File tree Expand file tree Collapse file tree 6 files changed +34
-33
lines changed Expand file tree Collapse file tree 6 files changed +34
-33
lines changed Original file line number Diff line number Diff line change @@ -1227,7 +1227,7 @@ PHP_FUNCTION(odbc_fetch_into)
1227
1227
}
1228
1228
/* }}} */
1229
1229
1230
- #ifdef HAVE_SOLID || defined (HAVE_SOLID_35 )
1230
+ #if defined( HAVE_SOLID ) || defined(HAVE_SOLID_35 )
1231
1231
PHP_FUNCTION (solid_fetch_prev )
1232
1232
{
1233
1233
odbc_result * result ;
Original file line number Diff line number Diff line change 53
53
#include "php_globals.h"
54
54
#include "SAPI.h"
55
55
56
-
57
56
#ifdef ZTS
58
57
int basic_globals_id ;
59
58
#else
Original file line number Diff line number Diff line change 27
27
#include "php_globals.h"
28
28
#include "ext/standard/flock_compat.h"
29
29
#include "ext/standard/exec.h"
30
+ #include "ext/standard/php_filestat.h"
30
31
31
32
#include <stdio.h>
32
33
#include <stdlib.h>
@@ -1575,11 +1576,10 @@ PHP_FUNCTION(fpassthru)
1575
1576
zend_list_delete ((* arg1 )-> value .lval );
1576
1577
RETURN_LONG (size );
1577
1578
}
1578
-
1579
1579
/* }}} */
1580
+
1580
1581
/* {{{ proto int rename(string old_name, string new_name)
1581
1582
Rename a file */
1582
-
1583
1583
PHP_FUNCTION (rename )
1584
1584
{
1585
1585
pval * * old_arg , * * new_arg ;
@@ -1609,8 +1609,38 @@ PHP_FUNCTION(rename)
1609
1609
1610
1610
RETVAL_TRUE ;
1611
1611
}
1612
+ /* }}} */
1613
+
1612
1614
1615
+ /* {{{ proto int unlink(string filename)
1616
+ Delete a file */
1617
+ PHP_FUNCTION (unlink )
1618
+ {
1619
+ pval * * filename ;
1620
+ int ret ;
1621
+ PLS_FETCH ();
1622
+
1623
+ if (ZEND_NUM_ARGS () != 1 || zend_get_parameters_ex (1 , & filename ) == FAILURE ) {
1624
+ WRONG_PARAM_COUNT ;
1625
+ }
1626
+ convert_to_string_ex (filename );
1627
+
1628
+ if (PG (safe_mode ) && !php_checkuid ((* filename )-> value .str .val , NULL , 2 )) {
1629
+ RETURN_FALSE ;
1630
+ }
1631
+
1632
+ ret = V_UNLINK ((* filename )-> value .str .val );
1633
+ if (ret == -1 ) {
1634
+ php_error (E_WARNING , "Unlink failed (%s)" , strerror (errno ));
1635
+ RETURN_FALSE ;
1636
+ }
1637
+ /* Clear stat cache */
1638
+ PHP_FN (clearstatcache )(INTERNAL_FUNCTION_PARAM_PASSTHRU );
1639
+ RETURN_TRUE ;
1640
+ }
1613
1641
/* }}} */
1642
+
1643
+
1614
1644
/* {{{ proto int ftruncate (int fp, int size)
1615
1645
Truncate file to 'size' length */
1616
1646
PHP_FUNCTION (ftruncate )
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ PHP_FUNCTION(fpassthru);
60
60
PHP_FUNCTION (readfile );
61
61
PHP_FUNCTION (umask );
62
62
PHP_FUNCTION (rename );
63
+ PHP_FUNCTION (unlink );
63
64
PHP_FUNCTION (copy );
64
65
PHP_FUNCTION (file );
65
66
PHP_FUNCTION (set_socket_blocking ); /* deprecated */
Original file line number Diff line number Diff line change @@ -158,37 +158,9 @@ PHP_FUNCTION(link)
158
158
}
159
159
/* }}} */
160
160
161
- /* {{{ proto int unlink(string filename)
162
- Delete a file */
163
- PHP_FUNCTION (unlink )
164
- {
165
- pval * * filename ;
166
- int ret ;
167
- PLS_FETCH ();
168
-
169
- if (ZEND_NUM_ARGS () != 1 || zend_get_parameters_ex (1 , & filename ) == FAILURE ) {
170
- WRONG_PARAM_COUNT ;
171
- }
172
- convert_to_string_ex (filename );
173
-
174
- if (PG (safe_mode ) && !php_checkuid ((* filename )-> value .str .val , NULL , 2 )) {
175
- RETURN_FALSE ;
176
- }
177
-
178
- ret = V_UNLINK ((* filename )-> value .str .val );
179
- if (ret == -1 ) {
180
- php_error (E_WARNING , "Unlink failed (%s)" , strerror (errno ));
181
- RETURN_FALSE ;
182
- }
183
- /* Clear stat cache */
184
- PHP_FN (clearstatcache )(INTERNAL_FUNCTION_PARAM_PASSTHRU );
185
- RETURN_TRUE ;
186
- }
187
- /* }}} */
188
161
189
162
#endif
190
163
191
-
192
164
/*
193
165
* Local variables:
194
166
* tab-width: 4
Original file line number Diff line number Diff line change 35
35
#ifdef HAVE_SYMLINK
36
36
37
37
PHP_FUNCTION (link );
38
- PHP_FUNCTION (unlink );
39
38
PHP_FUNCTION (readlink );
40
39
PHP_FUNCTION (linkinfo );
41
40
PHP_FUNCTION (symlink );
You can’t perform that action at this time.
0 commit comments