- Make PHP compile again under Windows.

- Please be careful when you make such changes.
This commit is contained in:
Andi Gutmans 2000-07-02 15:12:34 +00:00
parent 0249137148
commit b9037f7d69
6 changed files with 35 additions and 34 deletions

View File

@ -1227,7 +1227,7 @@ PHP_FUNCTION(odbc_fetch_into)
}
/* }}} */
#ifdef HAVE_SOLID || defined(HAVE_SOLID_35)
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35)
PHP_FUNCTION(solid_fetch_prev)
{
odbc_result *result;

View File

@ -53,7 +53,6 @@
#include "php_globals.h"
#include "SAPI.h"
#ifdef ZTS
int basic_globals_id;
#else

View File

@ -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 @@ PHP_FUNCTION(fpassthru)
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 @@ PHP_FUNCTION(rename)
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)

View File

@ -60,6 +60,7 @@ PHP_FUNCTION(fpassthru);
PHP_FUNCTION(readfile);
PHP_FUNCTION(umask);
PHP_FUNCTION(rename);
PHP_FUNCTION(unlink);
PHP_FUNCTION(copy);
PHP_FUNCTION(file);
PHP_FUNCTION(set_socket_blocking); /* deprecated */

View File

@ -158,37 +158,9 @@ PHP_FUNCTION(link)
}
/* }}} */
/* {{{ 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:
* tab-width: 4

View File

@ -35,7 +35,6 @@
#ifdef HAVE_SYMLINK
PHP_FUNCTION(link);
PHP_FUNCTION(unlink);
PHP_FUNCTION(readlink);
PHP_FUNCTION(linkinfo);
PHP_FUNCTION(symlink);