if (PG(allow_url_fopen)) {
- if (FAILURE == php_register_url_stream_wrapper("http", &php_stream_http_wrapper))
+ if (FAILURE == php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC))
return FAILURE;
- if (FAILURE == php_register_url_stream_wrapper("php", &php_stream_php_wrapper))
+ if (FAILURE == php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC))
return FAILURE;
- if (FAILURE == php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper))
+ if (FAILURE == php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC))
return FAILURE;
# if HAVE_OPENSSL_EXT
- if (FAILURE == php_register_url_stream_wrapper("https", &php_stream_http_wrapper))
+ if (FAILURE == php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC))
return FAILURE;
# endif
}
#endif
if (PG(allow_url_fopen)) {
- php_unregister_url_stream_wrapper("http");
- php_unregister_url_stream_wrapper("ftp");
- php_unregister_url_stream_wrapper("php");
+ php_unregister_url_stream_wrapper("http" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("php" TSRMLS_CC);
# if HAVE_OPENSSL_EXT
- php_unregister_url_stream_wrapper("https");
+ php_unregister_url_stream_wrapper("https" TSRMLS_CC);
# endif
}
return;
}
+ php_stream_open_wrapper(filename, "rb", 0, NULL);
+
md.stream = php_stream_open_wrapper(filename, "rb",
use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
+
+
if (!md.stream) {
RETURN_FALSE;
}
stream = php_stream_open_wrapper(filename, "rb",
use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
if (!stream) {
RETURN_FALSE;
}
stream = php_stream_open_wrapper(filename, "rb",
use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
if (!stream) {
RETURN_FALSE;
}
stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2),
use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
if (stream == NULL) {
RETURN_FALSE;
}
stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb",
use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
if (stream) {
size = php_passthru_stream(stream TSRMLS_CC);
php_stream_close(stream);
srcstream = php_stream_open_wrapper(src, "rb",
ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
deststream = php_stream_open_wrapper(dest, "wb",
ENFORCE_SAFE_MODE | REPORT_ERRORS,
- NULL TSRMLS_CC);
+ NULL);
if (srcstream && deststream)
ret = php_stream_copy_to_stream(srcstream, deststream, PHP_STREAM_COPY_ALL) == 0 ? FAILURE : SUCCESS;
le_zp = zend_register_list_destructors_ex(phpi_destructor_gzclose, NULL, "zlib", module_number);
if(PG(allow_url_fopen)) {
- php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper);
+ php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper TSRMLS_CC);
}
REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
{
FILE *retval = NULL;
php_stream *stream;
+ TSRMLS_FETCH();
stream = php_stream_open_wrapper((char *)filename, "rb", USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, opened_path);
if (stream) {
/* initialize stream wrappers registry
* (this uses configuration parameters from php.ini)
*/
- if (php_init_stream_wrappers() == FAILURE) {
+ if (php_init_stream_wrappers(TSRMLS_C) == FAILURE) {
php_printf("PHP: Unable to initialize stream url wrappers.\n");
return FAILURE;
}
zend_shutdown(TSRMLS_C);
- php_shutdown_stream_wrappers();
+ php_shutdown_stream_wrappers(TSRMLS_C);
php_shutdown_info_logos();
UNREGISTER_INI_ENTRIES();
# define IGNORE_URL_WIN 0
#endif
-int php_init_stream_wrappers(void);
-int php_shutdown_stream_wrappers(void);
-PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper);
-PHPAPI int php_unregister_url_stream_wrapper(char *protocol);
+int php_init_stream_wrappers(TSRMLS_D);
+int php_shutdown_stream_wrappers(TSRMLS_D);
+PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC);
+PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC);
PHPAPI php_stream *_php_stream_open_wrapper(char *path, char *mode, int options, char **opened_path STREAMS_DC);
#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper((path), (mode), (options), (opened) STREAMS_CC)
} /* }}} */
-int php_init_stream_wrappers(void)
+int php_init_stream_wrappers(TSRMLS_D)
{
- if (PG(allow_url_fopen))
+ if (PG(allow_url_fopen)) {
return zend_hash_init(&url_stream_wrappers_hash, 0, NULL, NULL, 1);
+ }
return SUCCESS;
}
-int php_shutdown_stream_wrappers(void)
+int php_shutdown_stream_wrappers(TSRMLS_D)
{
- if (PG(allow_url_fopen))
+ if (PG(allow_url_fopen)) {
zend_hash_destroy(&url_stream_wrappers_hash);
+ }
return SUCCESS;
}
-PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper)
+PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC)
{
- if (PG(allow_url_fopen))
+ if (PG(allow_url_fopen)) {
return zend_hash_add(&url_stream_wrappers_hash, protocol, strlen(protocol), wrapper, sizeof(*wrapper), NULL);
+ }
return FAILURE;
}
-PHPAPI int php_unregister_url_stream_wrapper(char *protocol)
+
+PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC)
{
- if (PG(allow_url_fopen))
+ if (PG(allow_url_fopen)) {
return zend_hash_del(&url_stream_wrappers_hash, protocol, strlen(protocol));
+ }
return SUCCESS;
}
PHPAPI php_stream *_php_stream_open_wrapper(char *path, char *mode, int options, char **opened_path STREAMS_DC)
{
php_stream *stream = NULL;
- TSRMLS_FETCH();
if (opened_path)
*opened_path = NULL;