Skip to content

Commit f9c69bc

Browse files
committed
ext/phar: Reorganise some headers
1 parent d55074e commit f9c69bc

File tree

9 files changed

+25
-33
lines changed

9 files changed

+25
-33
lines changed

ext/phar/dirstream.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
2222
int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
2323

2424
#ifdef PHAR_DIRSTREAM
25+
#include "ext/standard/url.h"
26+
2527
php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
2628

2729
/* directory handlers */

ext/phar/func_interceptors.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818

1919
#include "phar_internal.h"
20+
#include "ext/standard/php_filestat.h"
21+
#include "ext/standard/file.h" /* For php_le_stream_context() */
2022

2123
PHP_FUNCTION(phar_opendir) /* {{{ */
2224
{

ext/phar/phar.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919

2020
#define PHAR_MAIN 1
2121
#include "phar_internal.h"
22+
#include "php_phar.h"
2223
#include "SAPI.h"
2324
#include "func_interceptors.h"
25+
#include "ext/standard/crc32.h"
2426
#include "ext/standard/php_var.h"
27+
#include "ext/standard/php_string.h" /* For php_stristr() */
28+
#include "ext/standard/info.h"
29+
#include "zend_smart_str.h"
2530

2631
static void destroy_phar_data(zval *zv);
2732

ext/phar/phar_internal.h

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,9 @@
2424
#include <time.h>
2525
#include "php.h"
2626
#include "tar.h"
27-
#include "php_ini.h"
28-
#include "zend_constants.h"
29-
#include "zend_execute.h"
30-
#include "zend_exceptions.h"
27+
#include "pharzip.h"
3128
#include "zend_hash.h"
32-
#include "zend_interfaces.h"
33-
#include "zend_operators.h"
34-
#include "zend_sort.h"
35-
#include "zend_vm.h"
36-
#include "zend_smart_str.h"
37-
#include "main/php_streams.h"
38-
#include "main/streams/php_stream_plain_wrapper.h"
39-
#include "main/SAPI.h"
40-
#include "main/php_main.h"
41-
#include "main/php_open_temporary_file.h"
42-
#include "ext/standard/info.h"
43-
#include "ext/standard/basic_functions.h"
44-
#include "ext/standard/file.h"
45-
#include "ext/standard/php_string.h"
46-
#include "ext/standard/url.h"
47-
#include "ext/standard/crc32.h"
48-
#include "ext/standard/md5.h"
49-
#include "ext/standard/sha1.h"
50-
#include "ext/standard/php_var.h"
51-
#include "ext/standard/php_versioning.h"
52-
#include "Zend/zend_virtual_cwd.h"
53-
#include "ext/spl/spl_array.h"
5429
#include "ext/spl/spl_directory.h"
55-
#include "ext/spl/spl_exceptions.h"
56-
#include "ext/spl/spl_iterators.h"
57-
#include "php_phar.h"
58-
#include "ext/hash/php_hash.h"
59-
#include "ext/hash/php_hash_sha.h"
6030

6131
/* PHP_ because this is public information via MINFO */
6232
#define PHP_PHAR_API_VERSION "1.1.1"
@@ -193,8 +163,6 @@ ZEND_EXTERN_MODULE_GLOBALS(phar)
193163
ZEND_TSRMLS_CACHE_EXTERN()
194164
#endif
195165

196-
#include "pharzip.h"
197-
198166
typedef union _phar_archive_object phar_archive_object;
199167
typedef union _phar_entry_object phar_entry_object;
200168

ext/phar/phar_object.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
#include "phar_internal.h"
2121
#include "func_interceptors.h"
2222
#include "phar_object_arginfo.h"
23+
#include "ext/spl/spl_array.h"
24+
#include "ext/spl/spl_exceptions.h"
25+
#include "ext/spl/spl_iterators.h"
26+
#include "ext/standard/php_var.h"
27+
#include "main/SAPI.h"
28+
#include "zend_exceptions.h"
29+
#include "zend_interfaces.h"
30+
#include "zend_exceptions.h"
2331

2432
static zend_class_entry *phar_ce_archive;
2533
static zend_class_entry *phar_ce_data;

ext/phar/stream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919

2020
BEGIN_EXTERN_C()
21+
#include "ext/standard/url.h"
2122

2223
php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
2324
void phar_entry_remove(phar_entry_data *idata, char **error);

ext/phar/tar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919

2020
#include "phar_internal.h"
21+
#include "ext/standard/php_string.h" /* For php_stristr() */
2122

2223
static uint32_t phar_tar_number(const char *buf, size_t len) /* {{{ */
2324
{

ext/phar/util.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
*/
2020

2121
#include "phar_internal.h"
22+
#include "php_phar.h"
23+
#include "ext/hash/php_hash.h" /* Needed for PHP_HASH_API in ext/hash/php_hash_sha.h */
2224
#include "ext/hash/php_hash_sha.h"
25+
#include "ext/standard/md5.h"
2326

2427
#ifdef PHAR_HAVE_OPENSSL
2528
/* OpenSSL includes */

ext/phar/zip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818

1919
#include "phar_internal.h"
20+
#include "ext/standard/crc32.h"
21+
#include "ext/standard/php_string.h" /* For php_stristr() */
2022

2123
#define PHAR_GET_16(var) ((uint16_t)((((uint16_t)var[0]) & 0xff) | \
2224
(((uint16_t)var[1]) & 0xff) << 8))

0 commit comments

Comments
 (0)