pajoye Mon, 30 Aug 2010 09:38:47 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=302883
Log:
- use TSRMLS_CC instead of TSRMLS_FETCH in virtual_file_ex
Changed paths:
U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c
U php/php-src/trunk/TSRM/tsrm_virtual_cwd.h
U php/php-src/trunk/UPGRADING
U php/php-src/trunk/ext/zip/php_zip.c
U php/php-src/trunk/main/fopen_wrappers.c
U php/php-src/trunk/main/php_open_temporary_file.c
Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c
===================================================================
--- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-30 09:38:47 UTC (rev 302883)
@@ -990,7 +990,7 @@
/* Resolve path relatively to state and put the real path into state */
/* returns 0 for ok, 1 for error */
-CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC) /* {{{ */
{
int path_length = strlen(path);
char resolved_path[MAXPATHLEN];
@@ -1000,7 +1000,6 @@
int ret;
int add_slash;
void *tmp;
- TSRMLS_FETCH();
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
#ifdef TSRM_WIN32
@@ -1196,7 +1195,7 @@
CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */
{
- return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0;
+ return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH TSRMLS_CC)?-1:0;
}
/* }}} */
@@ -1256,7 +1255,7 @@
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
@@ -1278,7 +1277,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH);
+ retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC);
*filepath = new_state.cwd;
@@ -1303,7 +1302,7 @@
}
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return NULL;
}
@@ -1321,7 +1320,7 @@
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1394,7 +1393,7 @@
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1417,7 +1416,7 @@
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1436,7 +1435,7 @@
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1463,7 +1462,7 @@
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1491,7 +1490,7 @@
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1510,14 +1509,14 @@
int retval;
CWD_STATE_COPY(&old_state, &CWDG(cwd));
- if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) {
+ if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&old_state);
return -1;
}
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND)) {
+ if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&old_state);
CWD_STATE_FREE(&new_state);
return -1;
@@ -1546,7 +1545,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1565,7 +1564,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1584,7 +1583,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1602,7 +1601,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1623,7 +1622,7 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -1645,7 +1644,7 @@
DIR *retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return NULL;
}
@@ -1777,7 +1776,7 @@
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
free(new_state.cwd);
return NULL;
}
Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.h
===================================================================
--- php/php-src/trunk/TSRM/tsrm_virtual_cwd.h 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.h 2010-08-30 09:38:47 UTC (rev 302883)
@@ -195,7 +195,7 @@
#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
-CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath);
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC);
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
Modified: php/php-src/trunk/UPGRADING
===================================================================
--- php/php-src/trunk/UPGRADING 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/UPGRADING 2010-08-30 09:38:47 UTC (rev 302883)
@@ -28,8 +28,8 @@
h. New methods
i. New class constants
j. New hash algorithms
+13. Internals API changes
-
========================================
1. Changes made to default configuration
========================================
@@ -258,3 +258,11 @@
- fnv132
- fnv164
- joaat
+
+========================
+13. Internal API changes
+========================
+
+virtual_file_ex takes now a TSRM context as last parameter:
+CWD_API int virtual_file_ex(cwd_state *state, const char *path,
+ verify_path_func verify_path, int use_realpath TSRLS_DC);
Modified: php/php-src/trunk/ext/zip/php_zip.c
===================================================================
--- php/php-src/trunk/ext/zip/php_zip.c 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/ext/zip/php_zip.c 2010-08-30 09:38:47 UTC (rev 302883)
@@ -160,7 +160,7 @@
/* Clean/normlize the path and then transform any path (absolute or relative)
to a path relative to cwd (../../mydir/foo.txt > mydir/foo.txt)
*/
- virtual_file_ex(&new_state, file, NULL, CWD_EXPAND);
+ virtual_file_ex(&new_state, file, NULL, CWD_EXPAND TSRMLS_CC);
path_cleaned = php_zip_make_relative_path(new_state.cwd, new_state.cwd_length);
path_cleaned_len = strlen(path_cleaned);
Modified: php/php-src/trunk/main/fopen_wrappers.c
===================================================================
--- php/php-src/trunk/main/fopen_wrappers.c 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/main/fopen_wrappers.c 2010-08-30 09:38:47 UTC (rev 302883)
@@ -759,7 +759,7 @@
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
- if (virtual_file_ex(&new_state, filepath, NULL, CWD_FILEPATH)) {
+ if (virtual_file_ex(&new_state, filepath, NULL, CWD_FILEPATH TSRMLS_CC)) {
free(new_state.cwd);
return NULL;
}
Modified: php/php-src/trunk/main/php_open_temporary_file.c
===================================================================
--- php/php-src/trunk/main/php_open_temporary_file.c 2010-08-30 09:20:48 UTC (rev 302882)
+++ php/php-src/trunk/main/php_open_temporary_file.c 2010-08-30 09:38:47 UTC (rev 302883)
@@ -127,7 +127,7 @@
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
free(new_state.cwd);
return -1;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php