cvs: php4 /ext/odbc php_odbc.c /ext/standard basic_functions.c file.c file.h link.c php_link.h

From: Date: Sun, 02 Jul 2000 15:12:34 +0000
Subject: cvs: php4 /ext/odbc php_odbc.c /ext/standard basic_functions.c file.c file.h link.c php_link.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-586@lists.php.net to get a copy of this message
andi Sun Jul 2 08:12:34 2000 EDT Modified files: /php4/ext/odbc php_odbc.c /php4/ext/standard basic_functions.c file.c file.h link.c php_link.h Log: - Make PHP compile again under Windows. - Please be careful when you make such changes. Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.57 php4/ext/odbc/php_odbc.c:1.58 --- php4/ext/odbc/php_odbc.c:1.57 Fri Jun 30 12:22:52 2000 +++ php4/ext/odbc/php_odbc.c Sun Jul 2 08:12:34 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.57 2000/06/30 19:22:52 kalowsky Exp $ */ +/* $Id: php_odbc.c,v 1.58 2000/07/02 15:12:34 andi Exp $ */ #include "php.h" #include "php_globals.h" @@ -1227,7 +1227,7 @@ } /* }}} */ -#ifdef HAVE_SOLID || defined(HAVE_SOLID_35) +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) PHP_FUNCTION(solid_fetch_prev) { odbc_result *result; Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.226 php4/ext/standard/basic_functions.c:1.227 --- php4/ext/standard/basic_functions.c:1.226 Sun Jul 2 06:41:26 2000 +++ php4/ext/standard/basic_functions.c Sun Jul 2 08:12:34 2000 @@ -53,7 +53,6 @@ #include "php_globals.h" #include "SAPI.h" - #ifdef ZTS int basic_globals_id; #else Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.97 php4/ext/standard/file.c:1.98 --- php4/ext/standard/file.c:1.97 Thu Jun 29 06:34:55 2000 +++ php4/ext/standard/file.c Sun Jul 2 08:12:34 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.97 2000/06/29 13:34:55 stas Exp $ */ +/* $Id: file.c,v 1.98 2000/07/02 15:12:34 andi Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -27,6 +27,7 @@ #include "php_globals.h" #include "ext/standard/flock_compat.h" #include "ext/standard/exec.h" +#include "ext/standard/php_filestat.h" #include <stdio.h> #include <stdlib.h> @@ -1575,11 +1576,10 @@ zend_list_delete((*arg1)->value.lval); RETURN_LONG(size); } - /* }}} */ + /* {{{ proto int rename(string old_name, string new_name) Rename a file */ - PHP_FUNCTION(rename) { pval **old_arg, **new_arg; @@ -1609,8 +1609,38 @@ RETVAL_TRUE; } +/* }}} */ + +/* {{{ proto int unlink(string filename) + Delete a file */ +PHP_FUNCTION(unlink) +{ + pval **filename; + int ret; + PLS_FETCH(); + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { + WRONG_PARAM_COUNT; + } + convert_to_string_ex(filename); + + if (PG(safe_mode) && !php_checkuid((*filename)->value.str.val, NULL, 2)) { + RETURN_FALSE; + } + + ret = V_UNLINK((*filename)->value.str.val); + if (ret == -1) { + php_error(E_WARNING, "Unlink failed (%s)", strerror(errno)); + RETURN_FALSE; + } + /* Clear stat cache */ + PHP_FN(clearstatcache)(INTERNAL_FUNCTION_PARAM_PASSTHRU); + RETURN_TRUE; +} /* }}} */ + + /* {{{ proto int ftruncate (int fp, int size) Truncate file to 'size' length */ PHP_FUNCTION(ftruncate) Index: php4/ext/standard/file.h diff -u php4/ext/standard/file.h:1.22 php4/ext/standard/file.h:1.23 --- php4/ext/standard/file.h:1.22 Tue Jun 6 11:58:15 2000 +++ php4/ext/standard/file.h Sun Jul 2 08:12:34 2000 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.h,v 1.22 2000/06/06 18:58:15 ccollie Exp $ */ +/* $Id: file.h,v 1.23 2000/07/02 15:12:34 andi Exp $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ @@ -60,6 +60,7 @@ PHP_FUNCTION(readfile); PHP_FUNCTION(umask); PHP_FUNCTION(rename); +PHP_FUNCTION(unlink); PHP_FUNCTION(copy); PHP_FUNCTION(file); PHP_FUNCTION(set_socket_blocking); /* deprecated */ Index: php4/ext/standard/link.c diff -u php4/ext/standard/link.c:1.25 php4/ext/standard/link.c:1.26 --- php4/ext/standard/link.c:1.25 Sun Jun 25 10:02:45 2000 +++ php4/ext/standard/link.c Sun Jul 2 08:12:34 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: link.c,v 1.25 2000/06/25 17:02:45 zeev Exp $ */ +/* $Id: link.c,v 1.26 2000/07/02 15:12:34 andi Exp $ */ #include "php.h" #include "php_filestat.h" @@ -158,36 +158,8 @@ } /* }}} */ -/* {{{ proto int unlink(string filename) - Delete a file */ -PHP_FUNCTION(unlink) -{ - pval **filename; - int ret; - PLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - if (PG(safe_mode) && !php_checkuid((*filename)->value.str.val, NULL, 2)) { - RETURN_FALSE; - } - - ret = V_UNLINK((*filename)->value.str.val); - if (ret == -1) { - php_error(E_WARNING, "Unlink failed (%s)", strerror(errno)); - RETURN_FALSE; - } - /* Clear stat cache */ - PHP_FN(clearstatcache)(INTERNAL_FUNCTION_PARAM_PASSTHRU); - RETURN_TRUE; -} -/* }}} */ - #endif - /* * Local variables: Index: php4/ext/standard/php_link.h diff -u php4/ext/standard/php_link.h:1.2 php4/ext/standard/php_link.h:1.3 --- php4/ext/standard/php_link.h:1.2 Tue Jun 13 11:07:19 2000 +++ php4/ext/standard/php_link.h Sun Jul 2 08:12:34 2000 @@ -28,14 +28,13 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_link.h,v 1.2 2000/06/13 18:07:19 andrei Exp $ */ +/* $Id: php_link.h,v 1.3 2000/07/02 15:12:34 andi Exp $ */ #ifndef _PHP_LINK_H #define _PHP_LINK_H #ifdef HAVE_SYMLINK PHP_FUNCTION(link); -PHP_FUNCTION(unlink); PHP_FUNCTION(readlink); PHP_FUNCTION(linkinfo); PHP_FUNCTION(symlink);

« previous php.cvs (#586) next »