Skip to content

Commit 0f06df3

Browse files
committed
Turn "php_stream_wrapper"s into constants
Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
1 parent 83e495e commit 0f06df3

19 files changed

+30
-30
lines changed

ext/bz2/bz2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static const php_stream_wrapper_ops bzip2_stream_wops = {
331331
NULL
332332
};
333333

334-
static php_stream_wrapper php_stream_bzip2_wrapper = {
334+
static const php_stream_wrapper php_stream_bzip2_wrapper = {
335335
&bzip2_stream_wops,
336336
NULL,
337337
0 /* is_url */

ext/phar/phar_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ int phar_zip_flush(phar_archive_data *archive, char *user_stub, zend_long len, i
576576

577577
#ifdef PHAR_MAIN
578578
static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error);
579-
extern php_stream_wrapper php_stream_phar_wrapper;
579+
extern const php_stream_wrapper php_stream_phar_wrapper;
580580
#else
581581
extern HashTable cached_phars;
582582
extern HashTable cached_alias;

ext/phar/stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const php_stream_wrapper_ops phar_stream_wops = {
4848
NULL
4949
};
5050

51-
php_stream_wrapper php_stream_phar_wrapper = {
51+
const php_stream_wrapper php_stream_phar_wrapper = {
5252
&phar_stream_wops,
5353
NULL,
5454
0 /* is_url */

ext/standard/ftp_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ static const php_stream_wrapper_ops ftp_stream_wops = {
11841184
NULL
11851185
};
11861186

1187-
PHPAPI php_stream_wrapper php_stream_ftp_wrapper = {
1187+
PHPAPI const php_stream_wrapper php_stream_ftp_wrapper = {
11881188
&ftp_stream_wops,
11891189
NULL,
11901190
1 /* is_url */

ext/standard/http_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ static const php_stream_wrapper_ops http_stream_wops = {
10171017
NULL
10181018
};
10191019

1020-
PHPAPI php_stream_wrapper php_stream_http_wrapper = {
1020+
PHPAPI const php_stream_wrapper php_stream_http_wrapper = {
10211021
&http_stream_wops,
10221022
NULL,
10231023
1 /* is_url */

ext/standard/php_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static const php_stream_wrapper_ops php_stdio_wops = {
437437
NULL
438438
};
439439

440-
PHPAPI php_stream_wrapper php_stream_php_wrapper = {
440+
PHPAPI const php_stream_wrapper php_stream_php_wrapper = {
441441
&php_stdio_wops,
442442
NULL,
443443
0, /* is_url */

ext/standard/php_fopen_wrappers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
2727
php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
28-
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
29-
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
30-
extern PHPAPI php_stream_wrapper php_stream_php_wrapper;
31-
extern PHPAPI php_stream_wrapper php_plain_files_wrapper;
28+
extern PHPAPI const php_stream_wrapper php_stream_http_wrapper;
29+
extern PHPAPI const php_stream_wrapper php_stream_ftp_wrapper;
30+
extern PHPAPI const php_stream_wrapper php_stream_php_wrapper;
31+
extern PHPAPI const php_stream_wrapper php_plain_files_wrapper;
3232

3333
#endif

ext/zip/php_zip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static inline ze_zip_object *php_zip_fetch_object(zend_object *obj) {
7777
php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
7878
php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC);
7979

80-
extern php_stream_wrapper php_stream_zip_wrapper;
80+
extern const php_stream_wrapper php_stream_zip_wrapper;
8181

8282
#endif /* PHP_ZIP_H */
8383

ext/zip/zip_stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static const php_stream_wrapper_ops zip_stream_wops = {
362362
NULL /* metadata */
363363
};
364364

365-
php_stream_wrapper php_stream_zip_wrapper = {
365+
const php_stream_wrapper php_stream_zip_wrapper = {
366366
&zip_stream_wops,
367367
NULL,
368368
0 /* is_url */

ext/zlib/php_zlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ZEND_END_MODULE_GLOBALS(zlib);
6868

6969
php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
7070
extern const php_stream_ops php_stream_gzio_ops;
71-
extern php_stream_wrapper php_stream_gzip_wrapper;
71+
extern const php_stream_wrapper php_stream_gzip_wrapper;
7272
extern const php_stream_filter_factory php_zlib_filter_factory;
7373
extern zend_module_entry php_zlib_module_entry;
7474
#define zlib_module_ptr &php_zlib_module_entry

0 commit comments

Comments
 (0)