pajoye Fri Jan 13 04:06:00 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/standard file.c file.h
/php-src NEWS
Log:
- add php_mkdir_ex, works like php_mkdir but allows to silent any error
when no options are used
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.409.2.3&r2=1.409.2.4&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.3
php-src/ext/standard/file.c:1.409.2.4
--- php-src/ext/standard/file.c:1.409.2.3 Sun Jan 1 12:50:14 2006
+++ php-src/ext/standard/file.c Fri Jan 13 04:05:59 2006
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.409.2.3 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: file.c,v 1.409.2.4 2006/01/13 04:05:59 pajoye Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1355,10 +1355,10 @@
/* {{{ proto int mkdir(char *dir int mode)
*/
-PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
+PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
{
int ret;
-
+
if (PG(safe_mode) && (!php_checkuid(dir, NULL,
CHECKUID_CHECK_FILE_AND_DIR))) {
return -1;
}
@@ -1367,11 +1367,16 @@
return -1;
}
- if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0) {
+ if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options &
REPORT_ERRORS)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",
strerror(errno));
}
- return ret;
+ return ret;
+}
+
+PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
+{
+ return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
}
/* }}} */
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.h?r1=1.94.2.1&r2=1.94.2.2&diff_format=u
Index: php-src/ext/standard/file.h
diff -u php-src/ext/standard/file.h:1.94.2.1
php-src/ext/standard/file.h:1.94.2.2
--- php-src/ext/standard/file.h:1.94.2.1 Sun Jan 1 12:50:14 2006
+++ php-src/ext/standard/file.h Fri Jan 13 04:05:59 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.h,v 1.94.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: file.h,v 1.94.2.2 2006/01/13 04:05:59 pajoye Exp $ */
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
@@ -72,6 +72,7 @@
PHPAPI int php_le_stream_context(void);
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
+PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
#define META_DEF_BUFSIZE 8192
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.345&r2=1.2027.2.346&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.345 php-src/NEWS:1.2027.2.346
--- php-src/NEWS:1.2027.2.345 Thu Jan 12 15:24:09 2006
+++ php-src/NEWS Fri Jan 13 04:06:00 2006
@@ -1,7 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2006, PHP 5.1.3
-
+- Added intern function php_mkdir_ex, works like php_mkdir but supports
+ the streams options (only REPORT_ERRORS is used) (Pierre)
12 Jan 2006, PHP 5.1.2
- Updated libsqlite in ext/sqlite to 2.8.17. (Ilia)
- Updated libsqlite in ext/pdo_sqlite to 3.2.8. (Ilia)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php