return NULL;
}
- if (php_check_open_basedir(filename)) {
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
return NULL;
}
RETURN_FALSE;
}
- if (php_check_open_basedir(dbf_name->value.str.val)) {
+ if (php_check_open_basedir(dbf_name->value.str.val TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (php_check_open_basedir(Z_STRVAL_P(filename))) {
+ if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (php_check_open_basedir(workbuf)) {
+ if (php_check_open_basedir(workbuf TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (php_check_open_basedir(workbuf)) {
+ if (php_check_open_basedir(workbuf TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (php_check_open_basedir(workbuf)) {
+ if (php_check_open_basedir(workbuf TSRMLS_CC)) {
RETURN_FALSE;
}
#ifdef PHP_WIN32
fp = VCWD_FOPEN(Z_STRVAL_PP(file), "rb");
#else
- fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC);
#endif
if (fp == NULL) {
php_error(E_WARNING, "ImageFontLoad: unable to open file");
#ifdef PHP_WIN32
fp = VCWD_FOPEN(fn, "rb");
#else
- fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC);
#endif
if (!fp && !socketd) {
php_strip_url_passwd(fn);
}
if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn)) {
+ if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn);
RETURN_FALSE;
}
}
/* Check origin file */
- if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org)) {
+ if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) {
php_error (E_WARNING, "%s: invalid origin filename '%s'", get_active_function_name(TSRMLS_C), fn_org);
RETURN_FALSE;
}
/* Check destination file */
- if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest)) {
+ if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) {
php_error (E_WARNING, "%s: invalid destination filename '%s'", get_active_function_name(TSRMLS_C), fn_dest);
RETURN_FALSE;
}
}
if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn)) {
+ if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn);
RETURN_FALSE;
}
/* {{{ proto hwdoc hw_new_document(string objrec, string data, int size)
Create a new document */
-PHP_FUNCTION(hw_new_document) {
+PHP_FUNCTION(hw_new_document)
+{
pval *arg1, *arg2, *arg3;
char *ptr;
hw_document *doc;
#define BUFSIZE 8192
/* {{{ proto hwdoc hw_new_document_from_file(string objrec, string filename)
Create a new document from a file */
-PHP_FUNCTION(hw_new_document_from_file) {
+PHP_FUNCTION(hw_new_document_from_file)
+{
pval **arg1, **arg2;
int len, type;
char *ptr;
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
- fp = php_fopen_wrapper((*arg2)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper((*arg2)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd){
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
convert_to_string_ex(arg);
- if (php_check_open_basedir((*arg)->value.str.val)) {
+ if (php_check_open_basedir((*arg)->value.str.val TSRMLS_CC)) {
RETURN_FALSE;
}
}
if (filename && *filename) {
- if (php_check_open_basedir(filename)) {
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
goto bail;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, z_pgsql_link, id, "PostgreSQL link", le_link, le_plink);
convert_to_string_ex(z_filename);
- fp = php_fopen_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp) {
php_error(E_WARNING, "Unable to open %s for logging", Z_STRVAL_PP(z_filename));
headers=Z_STRVAL_PP(emailhead);
}
- if (_php_error_log(opt_err,message,opt,headers)==FAILURE) {
+ if (_php_error_log(opt_err, message, opt, headers TSRMLS_CC)==FAILURE) {
RETURN_FALSE;
}
}
/* }}} */
-PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers)
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC)
{
FILE *logfile;
int issock=0, socketd=0;;
return FAILURE;
break;
case 3: /*save to a file*/
- logfile=php_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL);
+ logfile=php_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL TSRMLS_CC);
if(!logfile) {
php_error(E_WARNING,"error_log: Unable to write to %s",opt);
return FAILURE;
typedef int php_stat_len;
#endif
-PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers);
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC);
#if SIZEOF_INT == 4
/* Most 32-bit and 64-bit systems have 32-bit ints */
}
convert_to_string_ex(filename);
- md.fp = php_fopen_wrapper((*filename)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &md.issock, &md.socketd, NULL);
+ md.fp = php_fopen_wrapper((*filename)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &md.issock, &md.socketd, NULL TSRMLS_CC);
if (!md.fp && !md.socketd) {
if (md.issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
}
convert_to_string_ex(filename);
- fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
* We need a better way of returning error messages from
* php_fopen_wrapper().
*/
- fp = php_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
* We need a better way of returning error messages from
* php_fopen_wrapper().
*/
- fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd){
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
/* {{{ php_fopen_url_wrap_ftp
*/
-FILE *php_fopen_url_wrap_ftp(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+FILE *php_fopen_url_wrap_ftp(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
FILE *fp=NULL;
php_url *resource=NULL;
/* {{{ php_fopen_url_wrap_http
*/
-FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
FILE *fp=NULL;
php_url *resource=NULL;
zval *response_header;
char *http_header_line;
int http_header_line_length, http_header_line_size;
- TSRMLS_FETCH();
resource = php_url_parse((char *) path);
if (resource == NULL) {
if (location[0] != '\0') {
zval **response_header_new, *entry, **entryp;
- fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path);
+ fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path TSRMLS_CC);
if (zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &response_header_new) == SUCCESS) {
entryp = &entry;
MAKE_STD_ZVAL(entry);
break;
}
- fp = php_fopen_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
+ fp = php_fopen_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd) {
if (issock != BAD_URL) {
/* {{{ php_fopen_url_wrap_php
*/
-FILE *php_fopen_url_wrap_php(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+FILE *php_fopen_url_wrap_php(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
const char *res = path + 6;
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
-extern FILE *php_fopen_url_wrap_http(char *, char *, int, int *, int *, char **);
-extern FILE *php_fopen_url_wrap_ftp(char *, char *, int, int *, int *, char **);
-extern FILE *php_fopen_url_wrap_php(char *, char *, int, int *, int *, char **);
+FILE *php_fopen_url_wrap_http(char *, char *, int, int *, int *, char ** TSRMLS_DC);
+FILE *php_fopen_url_wrap_ftp(char *, char *, int, int *, int *, char ** TSRMLS_DC);
+FILE *php_fopen_url_wrap_php(char *, char *, int, int *, int *, char ** TSRMLS_DC);
#endif
PHP_MINIT_FUNCTION(url_scanner)
{
url_adapt_state_ex_t *ctx;
- //TSRMLS_FETCH();
ctx = &BG(url_adapt_state_ex);
-
- ctx->tags = NULL;
-
+ ctx->tags = NULL;
REGISTER_INI_ENTRIES();
return SUCCESS;
}
PHP_FUNCTION(gzencode);
PHP_FUNCTION(ob_gzhandler);
-FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path);
+FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC);
int php_enable_output_compression(int buffer_size);
#if HAVE_FOPENCOOKIE
if(PG(allow_url_fopen)) {
- php_register_url_wrapper("zlib",zlib_fopen_wrapper TSRMLS_CC);
+ php_register_url_wrapper("zlib", zlib_fopen_wrapper TSRMLS_CC);
}
#endif
/* {{{ php_gzopen_wrapper
*/
-static gzFile php_gzopen_wrapper(char *path, char *mode, int options)
+static gzFile php_gzopen_wrapper(char *path, char *mode, int options TSRMLS_DC)
{
FILE *f;
int issock=0, socketd=0;
- f = php_fopen_wrapper(path, mode, options, &issock, &socketd, NULL);
+ f = php_fopen_wrapper(path, mode, options, &issock, &socketd, NULL TSRMLS_CC);
if (!f) {
return NULL;
}
convert_to_string_ex(filename);
- zp = php_gzopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE);
+ zp = php_gzopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
if (!zp) {
php_error(E_WARNING,"gzFile(\"%s\") - %s",(*filename)->value.str.val,strerror(errno));
RETURN_FALSE;
* We need a better way of returning error messages from
* php_gzopen_wrapper().
*/
- zp = php_gzopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE);
+ zp = php_gzopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
if (!zp) {
php_error(E_WARNING,"gzopen(\"%s\",\"%s\") - %s",
(*arg1)->value.str.val, p, strerror(errno));
* We need a better way of returning error messages from
* php_gzopen_wrapper().
*/
- zp = php_gzopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE);
+ zp = php_gzopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
if (!zp){
php_error(E_WARNING,"ReadGzFile(\"%s\") - %s",(*arg1)->value.str.val,strerror(errno));
RETURN_FALSE;
, gz_closer
};
-FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
struct gz_cookie *gc = NULL;
FILE *fp;
path++;
- fp = php_fopen_wrapper(path, mode, options|IGNORE_URL, &fissock, &fsocketd, NULL);
+ fp = php_fopen_wrapper(path, mode, options|IGNORE_URL, &fissock, &fsocketd, NULL TSRMLS_CC);
if (!fp) {
free(gc);
#endif
/* }}} */
-typedef FILE * (*php_fopen_url_wrapper_t) (const char *, char *, int, int *, int *, char **) ;
-
-static FILE *php_fopen_url_wrapper(const char *, char *, int, int *, int *, char **);
-
-HashTable fopen_url_wrappers_hash;
+static FILE *php_fopen_url_wrapper(const char *, char *, int, int *, int *, char ** TSRMLS_DC);
+static HashTable fopen_url_wrappers_hash;
/* {{{ php_register_url_wrapper
*/
-PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC)
+PHPAPI int php_register_url_wrapper(char *protocol, php_fopen_url_wrapper_t wrapper TSRMLS_DC)
{
if(PG(allow_url_fopen)) {
return zend_hash_add(&fopen_url_wrappers_hash, protocol, strlen(protocol), &wrapper, sizeof(wrapper), NULL);
/* {{{ php_fopen_and_set_opened_path
*/
-static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path)
+static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC)
{
FILE *fp;
- TSRMLS_FETCH();
if (php_check_open_basedir((char *)path TSRMLS_CC)) {
return NULL;
/* {{{ php_fopen_wrapper
*/
-PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
- TSRMLS_FETCH();
-
- if(!path) return NULL;
- if(!*path) return NULL;
-
if (opened_path) {
*opened_path = NULL;
}
+ if(!path || !*path) {
+ return NULL;
+ }
+
+
if(PG(allow_url_fopen)) {
if (!(options & IGNORE_URL)) {
- return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path);
+ return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path TSRMLS_CC);
}
}
if (options & USE_PATH && PG(include_path) != NULL) {
- return php_fopen_with_path(path, mode, PG(include_path), opened_path);
+ return php_fopen_with_path(path, mode, PG(include_path), opened_path TSRMLS_CC);
} else {
if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) {
return NULL;
}
- return php_fopen_and_set_opened_path(path, mode, opened_path);
+ return php_fopen_and_set_opened_path(path, mode, opened_path TSRMLS_CC);
}
}
/* }}} */
/* {{{ php_fopen_primary_script
*/
-PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
+PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
{
FILE *fp;
struct stat st;
char *path_info, *filename;
int length;
- TSRMLS_FETCH();
filename = SG(request_info).path_translated;
path_info = SG(request_info).request_uri;
* Tries to open a file with a PATH-style list of directories.
* If the filename starts with "." or "/", the path is ignored.
*/
-PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path)
+PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC)
{
char *pathbuf, *ptr, *end;
char *exec_fname;
int filename_length;
int safe_mode_include_dir_length;
int exec_fname_length;
- TSRMLS_FETCH();
if (opened_path) {
*opened_path = NULL;
if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
return NULL;
}
- return php_fopen_and_set_opened_path(filename, mode, opened_path);
+ return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
}
/*
#endif
{
/* absolute path matches safe_mode_include_dir */
- fp = php_fopen_and_set_opened_path(trypath, mode, opened_path);
+ fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC);
if (fp) {
return fp;
}
if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
return NULL;
}
- return php_fopen_and_set_opened_path(filename, mode, opened_path);
+ return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
}
if (!path || (path && !*path)) {
if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
return NULL;
}
- return php_fopen_and_set_opened_path(filename, mode, opened_path);
+ return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
}
/* check in provided path */
#endif
{
/* trypath is in safe_mode_include_dir */
- fp = php_fopen_and_set_opened_path(trydir, mode, opened_path);
+ fp = php_fopen_and_set_opened_path(trydir, mode, opened_path TSRMLS_CC);
if (fp) {
efree(pathbuf);
return fp;
return NULL;
}
}
- fp = php_fopen_and_set_opened_path(trypath, mode, opened_path);
+ fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC);
if (fp) {
efree(pathbuf);
return fp;
/* {{{ php_fopen_url_wrapper
*/
-static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
+static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC)
{
FILE *fp = NULL;
const char *p;
const char *protocol=NULL;
int n=0;
-
for (p=path; isalnum((int)*p); p++) {
n++;
}
protocol=NULL;
}
if (wrapper) {
- return (*wrapper)(path, mode, options, issock, socketd, opened_path);
+ return (*wrapper)(path, mode, options, issock, socketd, opened_path TSRMLS_CC);
}
}
if (!protocol || !strncasecmp(protocol, "file",n)){
- TSRMLS_FETCH();
-
*issock = 0;
if(protocol) {
}
if (options & USE_PATH) {
- fp = php_fopen_with_path((char *) path, mode, PG(include_path), opened_path);
+ fp = php_fopen_with_path((char *) path, mode, PG(include_path), opened_path TSRMLS_CC);
} else {
if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) {
fp = NULL;
} else {
- fp = php_fopen_and_set_opened_path(path, mode, opened_path);
+ fp = php_fopen_and_set_opened_path(path, mode, opened_path TSRMLS_CC);
}
}
return (fp);
#define IS_SOCKET 1
#define BAD_URL 2
-PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path);
+typedef FILE *(*php_fopen_url_wrapper_t)(const char *, char *, int, int *, int *, char ** TSRMLS_DC);
-PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle);
+PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC);
+
+PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC);
PHPAPI char *expand_filepath(const char *filepath, char *real_path);
PHPAPI int php_check_open_basedir(char *path TSRMLS_DC);
PHPAPI int php_check_specific_open_basedir(char *basedir, char *path TSRMLS_DC);
-PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path);
+PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC);
PHPAPI int php_is_url(char *path);
PHPAPI char *php_strip_url_passwd(char *path);
int php_init_fopen_wrappers(TSRMLS_D);
int php_shutdown_fopen_wrappers(TSRMLS_D);
-PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC);
+PHPAPI int php_register_url_wrapper(char *protocol, php_fopen_url_wrapper_t wrapper TSRMLS_DC);
PHPAPI int php_unregister_url_wrapper(char *protocol TSRMLS_DC);
#endif
int issock=0, socketd=0;
int old_chunk_size;
FILE *retval;
+ TSRMLS_FETCH();
old_chunk_size = php_sock_set_def_chunk_size(1);
- retval=php_fopen_wrapper((char *) filename, "rb", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path);
+ retval=php_fopen_wrapper((char *) filename, "rb", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path TSRMLS_CC);
php_sock_set_def_chunk_size(old_chunk_size);
if (issock) {
PG(safe_mode) = 0;
PG(open_basedir) = NULL;
- fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path);
+ fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
if (free_ini_search_path) {
efree(php_ini_search_path);
}
}
}
if (cgi || SG(request_info).path_translated) {
- retval = php_fopen_primary_script(&file_handle);
+ retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
}
if (cgi && (retval == FAILURE)) {
*/
SETSTRING( SG(request_info).path_translated, pathTranslated );
#ifdef VIRTUAL_DIR
- retval = php_fopen_primary_script(&file_handle);
+ retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
#else
/*
* The java runtime doesn't like the working directory to be
* in the hopes that Java doesn't notice.
*/
getcwd(cwd,MAXPATHLEN);
- retval = php_fopen_primary_script(&file_handle);
+ retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
chdir(cwd);
#endif