mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21988e3cf8 |
No files matched your search
@@ -8,29 +8,10 @@ define ____executor_globals
|
||||
end
|
||||
|
||||
document ____executor_globals
|
||||
portable way of accessing executor_globals, set $eg
|
||||
portable way of accessing executor_globals
|
||||
ZTS detection is automatically based on ext/standard module struct
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
@@ -58,18 +39,14 @@ define printzv
|
||||
end
|
||||
|
||||
document printzv
|
||||
prints zval contents
|
||||
prints content of zval
|
||||
end
|
||||
|
||||
define ____printzv_contents
|
||||
set $zvalue = $arg0
|
||||
set $type = $zvalue->type
|
||||
|
||||
printf "(refcount=%d", $zvalue->refcount
|
||||
if $zvalue->is_ref
|
||||
printf ",is_ref"
|
||||
end
|
||||
printf ") "
|
||||
printf "(refcount=%d) ", $zvalue->refcount
|
||||
if $type == 0
|
||||
printf "NULL"
|
||||
end
|
||||
@@ -92,7 +69,7 @@ define ____printzv_contents
|
||||
if ! $arg1
|
||||
printf "{\n"
|
||||
set $ind = $ind + 1
|
||||
____print_ht $zvalue->value.ht 1
|
||||
____print_ht $zvalue->value.ht
|
||||
set $ind = $ind - 1
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
@@ -126,7 +103,7 @@ define ____printzv_contents
|
||||
printf "(%d): ", $ht->nNumOfElements
|
||||
printf "{\n"
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
____print_ht $ht
|
||||
set $ind = $ind - 1
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
@@ -211,10 +188,12 @@ define print_const_table
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $zval = *(zval **)$p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
@@ -227,18 +206,8 @@ define ____print_ht
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
if $arg1 == 0
|
||||
printf "%p\n", (void*)$p->pData
|
||||
end
|
||||
if $arg1 == 1
|
||||
set $zval = *(zval **)$p->pData
|
||||
____printzv $zval 1
|
||||
end
|
||||
if $arg1 == 2
|
||||
printf "%s\n", (char*)$p->pData
|
||||
end
|
||||
|
||||
____printzv $zval 1
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
@@ -246,7 +215,7 @@ end
|
||||
define print_ht
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 1
|
||||
____print_ht $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
@@ -254,28 +223,6 @@ document print_ht
|
||||
dumps elements of HashTable made of zval
|
||||
end
|
||||
|
||||
define print_htptr
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_htptr
|
||||
dumps elements of HashTable made of pointers
|
||||
end
|
||||
|
||||
define print_htstr
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 2
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_htstr
|
||||
dumps elements of HashTable made of strings
|
||||
end
|
||||
|
||||
define ____print_ft
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
+3
-3
@@ -58,8 +58,8 @@ Exceptions:
|
||||
calling.
|
||||
|
||||
[7] When commenting out code using a #if statement, do NOT use 0 only. Instead
|
||||
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
|
||||
svn user foo. This allows easier tracking of why code was commented out,
|
||||
use "<cvs username here>_0". For example, #if FOO_0, where FOO is your
|
||||
cvs user foo. This allows easier tracking of why code was commented out,
|
||||
especially in bundled libraries.
|
||||
|
||||
[8] Do not define functions that are not available. For instance, if a
|
||||
@@ -256,7 +256,7 @@ that the first implementation include a file labeled 'EXPERIMENTAL'
|
||||
in the function directory, and that the functions follow the
|
||||
standard prefixing conventions during their initial implementation.
|
||||
|
||||
The file labeled 'EXPERIMENTAL' should include the following
|
||||
The file labelled 'EXPERIMENTAL' should include the following
|
||||
information:
|
||||
Any authoring information (known bugs, future directions of the module).
|
||||
Ongoing status notes which may not be appropriate for CVS comments.
|
||||
|
||||
+105
-92
@@ -127,14 +127,32 @@ EXTENSION: dbase
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dbx
|
||||
PRIMARY MAINTAINER: Marc Boeren <M.Boeren@guidance.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.6
|
||||
COMMENT: DB abstraction for odbc, mysql, pgsql, mssql, fbsql and more, see documentation
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fbsql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ingres_ii
|
||||
PRIMARY MAINTAINER: David Hénot <henot@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu>, Jouni Ahto <jouni.ahto@exdec.fi>
|
||||
MAINTENANCE: Odd fixes
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: msql
|
||||
@@ -159,7 +177,7 @@ STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>, Antony Dovgal <tony2001@php.net>
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -169,53 +187,14 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
EXTENSION: oracle
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_firebird
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_mysql
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_odbc
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_pgsql
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_sqlite
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
EXTENSION: ovrimos
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
|
||||
@@ -258,11 +237,11 @@ SINCE: 5.0
|
||||
EXTENSION: soap
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Orphaned
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
@@ -270,21 +249,11 @@ PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlreader
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlrpc
|
||||
PRIMARY MAINTAINER: Dan Libby
|
||||
MAINTENANCE: Orphaned
|
||||
MAINTENANCE: UNKNOWN
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlwriter
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xsl
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -298,7 +267,7 @@ SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bcmath
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bz2
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
@@ -317,6 +286,11 @@ MAINTENANCE: Maintained
|
||||
STATUS: Windows
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cpdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ctype
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -339,19 +313,27 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filter
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>, Pierre-Alain Joye <pajoye@php.net>, Ilia Alshanetsky <iliaa@php.net>
|
||||
EXTENSION: fam
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.2
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filepro
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
PRIMARY MAINTAINER: Stefan Esser <sesser@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
PRIMARY MAINTAINER: Stefan Esser (sesser@php.net)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -360,11 +342,15 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gmp
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net>, Antony Dovgal <tony2001@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hwapi
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -375,14 +361,13 @@ PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>, Ilia Alshanetsky <iliaa@
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: json
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.2
|
||||
EXTENSION: ircg
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>, Douglas Goldstein <cardoe@php.net>
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -396,9 +381,14 @@ PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcve
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Unknown
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mime_magic
|
||||
@@ -412,26 +402,48 @@ PRIMARY MAINTAINER: Frank M. Kromann
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mnogosearch
|
||||
PRIMARY MAINTAINER: Sergey Kartashoff <gluke@mail.ru>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mono
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: msession
|
||||
PRIMARY MAINTAINER Mark L. Woodward <mlwmohawk@mohawksoft.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working/Experimental
|
||||
COMMENT: Tested on Linux, should work on other UNIX platforms. Backend server code can compile under Windows.
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ncurses
|
||||
PRIMARY MAINTAINER Ilia Alshanetsky <iliaa@php.net>, Wez Furlong <wez@php.net>, Hartmut Holzgraefe <hholzgra@php.net>, Georg Richter <georg@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcntl
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>, Nuno Lopes <nlopess@php.net>
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pfpro
|
||||
PRIMARY MAINTAINER: David Croft <david@infotrek.co.uk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -465,7 +477,7 @@ STATUS: Working
|
||||
EXTENSION: shmop
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
@@ -476,7 +488,7 @@ STATUS: Working
|
||||
EXTENSION: sockets
|
||||
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: spl
|
||||
@@ -487,30 +499,31 @@ SINCE: 5.0.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvmsg
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvsem
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvshm
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tidy
|
||||
PRIMARY MAINTAINER: John Coggeshall <john@php.net>, Ilia Alshanetsky <iliaa@php.net>, Nuno Lopes <nlopess@php.net>
|
||||
PRIMARY MAINTAINER: John Coggeshall <john@php.net>, Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tokenizer
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zip
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+9
-9
@@ -3,21 +3,21 @@
|
||||
# Zend
|
||||
#
|
||||
|
||||
$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
|
||||
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
|
||||
$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h
|
||||
$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h
|
||||
|
||||
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
$(builddir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
@$(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l
|
||||
|
||||
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
|
||||
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
$(builddir)/zend_language_parser.h: $(builddir)/zend_language_parser.c
|
||||
$(builddir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
|
||||
|
||||
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
|
||||
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
$(builddir)/zend_ini_parser.h: $(builddir)/zend_ini_parser.c
|
||||
$(builddir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
|
||||
|
||||
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
$(builddir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
@$(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l
|
||||
|
||||
$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
|
||||
$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(builddir)/zend_language_parser.h
|
||||
+18
-3
@@ -5,7 +5,24 @@
|
||||
|
||||
lcov: lcov-html
|
||||
|
||||
lcov-test: lcov-clean-data test
|
||||
lcov-test: all
|
||||
@echo "Running test suite"
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
php_lcov.info: lcov-test
|
||||
@echo "Generating data for $@"
|
||||
@@ -57,5 +74,3 @@ lcov-clean:
|
||||
rm -rf lcov_data/
|
||||
rm -rf lcov_html/
|
||||
|
||||
lcov-clean-data:
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
+21
-38
@@ -8,27 +8,27 @@ COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORK
|
||||
all: $(all_targets)
|
||||
@echo
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@echo "(It is safe to ignore warnings about tempnam and tmpnam)."
|
||||
@echo
|
||||
|
||||
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
|
||||
build-modules: $(PHP_MODULES)
|
||||
|
||||
libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
libphp5.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
|
||||
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
|
||||
-@$(LIBTOOL) --silent --mode=install cp libphp5.la $(phptempdir)/libphp5.la >/dev/null 2>&1
|
||||
|
||||
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
|
||||
libs/libphp5.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp5.so
|
||||
|
||||
install: $(all_targets) $(install_targets)
|
||||
|
||||
install-sapi: $(OVERALL_TARGET)
|
||||
@echo "Installing PHP SAPI module: $(PHP_SAPI)"
|
||||
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
|
||||
-@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
|
||||
-@if test ! -r $(phptempdir)/libphp5.$(SHLIB_DL_SUFFIX_NAME); then \
|
||||
for i in 0.0.0 0.0 0; do \
|
||||
if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
|
||||
$(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
|
||||
if test -r $(phptempdir)/libphp5.$(SHLIB_DL_SUFFIX_NAME).$$i; then \
|
||||
$(LN_S) $(phptempdir)/libphp5.$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp5.$(SHLIB_DL_SUFFIX_NAME); \
|
||||
break; \
|
||||
fi; \
|
||||
done; \
|
||||
@@ -66,52 +66,35 @@ install-headers:
|
||||
fi \
|
||||
done; \
|
||||
fi
|
||||
|
||||
install-su: install-pear
|
||||
|
||||
PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'
|
||||
PHP_TEST_SHARED_EXTENSIONS = ` \
|
||||
if test "x$(PHP_MODULES)" != "x"; then \
|
||||
for i in $(PHP_MODULES)""; do \
|
||||
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
|
||||
done; \
|
||||
fi; \
|
||||
if test "x$(PHP_ZEND_EX)" != "x"; then \
|
||||
for i in $(PHP_ZEND_EX)""; do \
|
||||
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
|
||||
done; \
|
||||
fi`
|
||||
|
||||
test: all
|
||||
test: all
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
|
||||
if test "$$INI_SCANNED_PATH"; then \
|
||||
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
|
||||
$(EGREP) -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
rm -f libphp5.la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module buildmk.stamp
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
find . -name Makefile | xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
.NOEXPORT:
|
||||
@@ -1,31 +1,24 @@
|
||||
====================
|
||||
SVN Commit Rules
|
||||
====================
|
||||
|
||||
This is the first file you should be reading after you get your SVN account.
|
||||
We'll assume you're basically familiar with SVN, but feel free to post
|
||||
your questions on the mailing list. Please have a look at
|
||||
http://svnbook.red-bean.com/ for more detailed information on SVN.
|
||||
This is the first file you should be reading after you get your CVS account.
|
||||
We'll assume you're basically familiar with CVS, but feel free to post
|
||||
your questions on the mailing list. Please have a look at
|
||||
http://cvsbook.red-bean.com/ for more detailed information on CVS.
|
||||
|
||||
PHP is developed through the efforts of a large number of people.
|
||||
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
|
||||
some basic rules with regards to SVN usage will::
|
||||
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
|
||||
some basic rules with regards to CVS usage will:
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
the SVN itself.
|
||||
|
||||
the CVS itself.
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
c. Prevent some of those 'Oops' moments.
|
||||
|
||||
d. Increase the general level of good will on planet Earth.
|
||||
|
||||
Having said that, here are the organizational rules::
|
||||
|
||||
Having said that, here are the organizational rules:
|
||||
|
||||
1. Respect other people working on the project.
|
||||
|
||||
2. Discuss any significant changes on the list before committing and get
|
||||
confirmation from the release manager for the given branch.
|
||||
2. Discuss any significant changes on the list before committing.
|
||||
|
||||
3. Look at EXTENSIONS file to see who is the primary maintainer of
|
||||
the code you want to contribute to.
|
||||
@@ -37,54 +30,47 @@ Having said that, here are the organizational rules::
|
||||
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
To do so use "make test".
|
||||
|
||||
|
||||
7. For development use the --enable-maintainer-zts switch to ensure your
|
||||
code handles TSRM correctly and doesn't break for thos who need that.
|
||||
|
||||
Currently we have the following branches in use::
|
||||
Currently we have the following branches in use:
|
||||
HEAD Will become PHP 6.0. This CVS branch is for active development.
|
||||
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_5_0 This branch is closed.
|
||||
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_4_3 This branch is closed.
|
||||
|
||||
trunk Will become PHP 6.0. This CVS branch is for active development.
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
|
||||
branches/PHP_5_1 This branch is closed.
|
||||
|
||||
branches/PHP_4_4 This branch is closed.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to trunk and then get merged from trunk
|
||||
(aka MFH'ed) to all other relevant branches.
|
||||
|
||||
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
|
||||
1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
|
||||
messages every day. Woe be to those who attempt to mess with it.
|
||||
|
||||
3. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file of the
|
||||
*first* to be released version with the given change. In other words
|
||||
any NEWS file change only needs to done in one branch.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file.
|
||||
|
||||
NB! Lines, starting with @ will go automagically into NEWS file, but
|
||||
this is NOT recommended, though. Please, add news entries directly to
|
||||
this is NOT recommended, though. Please, add news entries directly to
|
||||
NEWS file and don't forget to keep them adjusted and sorted.
|
||||
|
||||
4. Do not commit multiple file and dump all messages in one commit. If you
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
provide a nice commit message for each one. See example below.
|
||||
|
||||
5. Do write your commit message in such a way that it makes sense even
|
||||
4. Do write your commit message in such a way that it makes sense even
|
||||
without the corresponding diff. One should be able to look at it, and
|
||||
immediately know what was modified. Definitely include the function name
|
||||
in the message as shown below.
|
||||
|
||||
6. In your commit messages, keep each line shorter than 80 characters. And
|
||||
5. In your commit messages, keep each line shorter than 80 characters. And
|
||||
try to align your lines vertically, if they wrap. It looks bad otherwise.
|
||||
|
||||
7. If you modified a function that is callable from PHP, prepend PHP to
|
||||
6. If you modified a function that is callable from PHP, prepend PHP to
|
||||
the function name as shown below.
|
||||
|
||||
|
||||
@@ -96,7 +82,7 @@ If a line begins with #, it is taken to be a comment and will not appear
|
||||
in the ChangeLog. Everything else goes into the ChangeLog.
|
||||
|
||||
It is important to note that if your comment or news logline spans multiple
|
||||
lines, you have to put # at the beginning of **every** such line.
|
||||
lines, you have to put # at the beginning of _every_ such line.
|
||||
|
||||
Example. Say you modified two files, datetime.c and string.c. In datetime.c you
|
||||
added a new format option for the date() function, and in string.c you fixed a
|
||||
@@ -104,39 +90,30 @@ memory leak in php_trim(). Don't commit both of these at once. Commit them
|
||||
separately and try to make sure your commit messages look something like the
|
||||
following.
|
||||
|
||||
For datetime.c::
|
||||
For datetime.c:
|
||||
- Added new 'K' format modifier to date() for printing out number of days until
|
||||
New Year's Eve.
|
||||
|
||||
- Added new 'K' format modifier to date() for printing out number of days
|
||||
until New Year's Eve.
|
||||
|
||||
For string.c::
|
||||
|
||||
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
|
||||
#- Man, that thing was leaking all over the place!
|
||||
For string.c:
|
||||
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
|
||||
#- Man, that thing was leaking all over the place!
|
||||
|
||||
The # lines will be omitted from the ChangeLog automagically.
|
||||
|
||||
Use the [DOC] tag in your log message whenever you feel that your changes
|
||||
imply a documentation modification. The php-doc team will automatically
|
||||
get notified about your commit through the php-doc mailing list.
|
||||
|
||||
If you fix some bugs, you should note the bug ID numbers in your
|
||||
commit message. Bug ID should be prefixed by "#" for easier access to
|
||||
bug report when developers are browsing CVS via LXR or Bonsai.
|
||||
bug report when developers are browsing CVS via. LXR or Bonsai.
|
||||
|
||||
Example::
|
||||
Example:
|
||||
|
||||
Fixed bug #14016 (pgsql notice handler double free crash bug.)
|
||||
Fixed bug #14016 (pgsql notice handler double free crash bug.)
|
||||
|
||||
If you don't see your messages in ChangeLog right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later.
|
||||
|
||||
When you change the NEWS file for a bug fix, then please keep the bugs
|
||||
sorted in decreasing order under the fixed version.
|
||||
somewhat later.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP SVN repository in various ways.
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
To receive daily updates to ChangeLog and NEWS, send an empty message to
|
||||
php-cvs-daily-subscribe@lists.php.net.
|
||||
@@ -51,8 +51,8 @@ Type specifiers
|
||||
passed to it.
|
||||
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
|
||||
! - the parameter it follows can be of specified type or NULL (only applies
|
||||
to 's', 'a', 'o', 'O', 'r', 'h', 'C', 'z', and 'Z'). If NULL is passed,
|
||||
the results pointer is set to NULL as well.
|
||||
to 'a', 'o', 'O', 'r', and 'z'). If NULL is passed, the results
|
||||
pointer is set to NULL as well.
|
||||
|
||||
Examples
|
||||
--------
|
||||
@@ -70,7 +70,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
|
||||
/* Gets an object of class specified by my_ce, and an optional double. */
|
||||
zval *obj;
|
||||
double d = 0.5;
|
||||
zend_class_entry *my_ce;
|
||||
zend_class_entry my_ce;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
|
||||
&obj, my_ce, &d) == FAILURE) {
|
||||
return;
|
||||
|
||||
+30
-10
@@ -8,11 +8,11 @@ part is making it acceptable for inclusion into our repository. :-)
|
||||
|
||||
How to create patch?
|
||||
--------------------
|
||||
We use Subversion (SVN) for revision control. You need to get the
|
||||
source from SVN in order to create a patch. Read
|
||||
http://www.php.net/svn.php for help on using SVN. You can check out
|
||||
older branches, but make sure you get trunk as well and make your
|
||||
patch work there.
|
||||
We are working with CVS. You need to get CVS source to create a patch
|
||||
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
|
||||
source. You can check out older versions, but make sure you get
|
||||
the default branch (i.e. Do not use -r option when you check out the
|
||||
CVS source)
|
||||
|
||||
Read CODING_STANDARDS file before you start working.
|
||||
|
||||
@@ -21,7 +21,7 @@ add a new feature to PHP. After you finished editing, please test your
|
||||
patch. Read README.TESTING for testing.
|
||||
|
||||
After you finish testing your patch, take diff file using
|
||||
"svn diff > your.patch" command.
|
||||
"cvs diff > your.patch" command.
|
||||
|
||||
Read README.TESTING for submitting a test script for your patch. This is
|
||||
not strictly required, but it is preferred to submit a test script along
|
||||
@@ -41,8 +41,25 @@ maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
|
||||
you are patching PEAR. Official module maintainers can be found in
|
||||
EXTENSIONS file in PHP source.
|
||||
|
||||
If you are new to SVN (Subversion), visit
|
||||
http://svnbook.red-bean.com/ for details.
|
||||
If you are new to CVS (Concurrent Versions System), visit
|
||||
http://cvshome.org/ for details.
|
||||
|
||||
|
||||
Recommended CVS client settings for creating patch file
|
||||
------------------------------------------------------
|
||||
Recommended ~/.cvsrc file setting is:
|
||||
------
|
||||
cvs -z3
|
||||
update -d -P
|
||||
checkout -P
|
||||
diff -u
|
||||
|
||||
------
|
||||
diff -u means:
|
||||
-u Use the unified output format.
|
||||
|
||||
With this CVS setting, you don't have to worry about adding/deleting
|
||||
newlines and spaces.
|
||||
|
||||
|
||||
Check list for submitting patch
|
||||
@@ -53,7 +70,10 @@ Check list for submitting patch
|
||||
web server error logs when you test your patch?
|
||||
- Did you build PHP for multi-threaded web servers. (Optional)
|
||||
- Did you create test script for "make test"? (Recommended)
|
||||
- Did you update SVN source before you take final patch?
|
||||
- Did you check your patch is unified format and it does not
|
||||
contain white space changes? (If you are not using recommended
|
||||
cvs setting)
|
||||
- Did you update CVS source before you take final patch?
|
||||
- Did you read the patch again?
|
||||
|
||||
|
||||
@@ -98,7 +118,7 @@ these questions:
|
||||
|
||||
What happens when your patch is applied?
|
||||
----------------------------------------
|
||||
Your name will be included together with your email address in the SVN
|
||||
Your name will be included together with your email address in the CVS
|
||||
commit log. If your patch affects end-users, a brief description
|
||||
and your name might be added to the NEWS file.
|
||||
|
||||
|
||||
+4
-5
@@ -32,12 +32,11 @@ sapi/cli/php [-c /path/to/php.ini] run-tests.php [ext/foo/tests/GLOB]
|
||||
|
||||
[Which "php" executable "make test" look for]
|
||||
---------------------------------------------
|
||||
If you are running the run-tests.php script from the command line (as above)
|
||||
you must set the TEST_PHP_EXECUTABLE environment variable to explicitly
|
||||
select the PHP executable that is to be tested, that is, used to run the test scripts.
|
||||
You must use TEST_PHP_EXECUTABLE environment variable to explicitly
|
||||
select the php executable to be used to run the tests. That can either
|
||||
be the CLI or CGI executable.
|
||||
|
||||
If you run the tests using make test, the PHP CLI and CGI executables are
|
||||
automatically set for you. "make test" executes "run-tests.php" script with the CLI binary. Some
|
||||
"make test" executes "run-tests.php" script with "php" binary. Some
|
||||
test scripts such as session must be executed by CGI SAPI. Therefore,
|
||||
you must build PHP with CGI SAPI to perform all tests.
|
||||
|
||||
|
||||
+14
-14
@@ -1,11 +1,11 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
This is an addendum to README.TESTING with additional information
|
||||
specific to server-tests.php.
|
||||
specific to run-tests2.php.
|
||||
|
||||
server-tests.php is backward compatible with tests developed for
|
||||
the original run-tests.php script. server-tests is *not* used by
|
||||
'make test'. server-tests was developed to provide support for
|
||||
run-tests2.php is backward compatible with tests developed for
|
||||
the original run-tests.php script. run-tests2 is *not* used by
|
||||
'make test'. run-tests2 was developed to provide support for
|
||||
testing PHP under it's primary environment, HTTP, and can run the
|
||||
PHP tests under any of the SAPI modules that are direct executables,
|
||||
or are accessable via HTTP.
|
||||
@@ -13,12 +13,12 @@ or are accessable via HTTP.
|
||||
[New features]
|
||||
----------------
|
||||
* Command line interface:
|
||||
You can run 'php server-tests.php -h' to get all the possible options.
|
||||
You can run 'php run-tests2.php -h' to get all the possible options.
|
||||
* Configuration file:
|
||||
the -c argument will allow you to use a configuration file. This is
|
||||
handy if you are testing multiple environments and need various options
|
||||
depending on the environment.
|
||||
see server-tests-config.php for details.
|
||||
see run-tests-config.php for details.
|
||||
* CGI Emulation:
|
||||
Will emulate a CGI environment when testing with the cgi sapi executable.
|
||||
* HTTP testing:
|
||||
@@ -39,23 +39,23 @@ make testing work.
|
||||
Some (but not all!) examples of usage:
|
||||
|
||||
1. run tests from the php source directory
|
||||
php server-tests.php -p /path/to/php-cli
|
||||
php run-tests2.php -p /path/to/php-cli
|
||||
|
||||
2. run tests using cgi emulation
|
||||
php server-tests.php -p /path/to/php-cgi
|
||||
php run-tests2.php -p /path/to/php-cgi
|
||||
|
||||
3. run tests over http, copying test files into document root
|
||||
php server-tests.php -w -u http://localhost/test -m /path/to/htdocs/test
|
||||
php run-tests2.php -w -u http://localhost/test -m /path/to/htdocs/test
|
||||
|
||||
4. run tests over http, php sources have been aliased in web server
|
||||
php server-tests.php -w -u http://localhost/test
|
||||
php run-tests2.php -w -u http://localhost/test
|
||||
|
||||
5. run tests using configuration file
|
||||
php server-tests.php -c /path/to/server-tests-config.php
|
||||
php run-tests2.php -c /path/to/run-tests-config.php
|
||||
|
||||
6. run tests using configuration file, but overriding some settings:
|
||||
(config file must be first)
|
||||
php server-tests.php -c /path/to/server-tests-config.php -w -t 3 -d /path/to/testdir
|
||||
php run-tests2.php -c /path/to/run-tests-config.php -w -t 3 -d /path/to/testdir
|
||||
|
||||
NOTE: configuration as described in README.TESTING still works.
|
||||
|
||||
@@ -63,7 +63,7 @@ NOTE: configuration as described in README.TESTING still works.
|
||||
----------------
|
||||
In addition to the traditional test sections
|
||||
(see http://qa.php.net/write-test.php), several new sections are available
|
||||
under server-tests.
|
||||
under run-tests2.
|
||||
|
||||
--POST--
|
||||
This is not a new section, but not multipart posts are supported for testing
|
||||
@@ -97,7 +97,7 @@ include:
|
||||
$scriptname this is what will become SCRIPT_NAME unless you override it
|
||||
$docroot the equivelant of DOCUMENT_ROOT under Apache
|
||||
$cwd the directory that the test is being initiated from
|
||||
$this->conf all server-tests configuration vars
|
||||
$this->conf all run-tests2 configuration vars
|
||||
$this->env all environment variables that will get passed to the test
|
||||
|
||||
|
||||
|
||||
@@ -172,21 +172,6 @@ Items from the NEWS file explained
|
||||
from your error handler in order to populate $php_errormsg. This allows
|
||||
you to fine-grain the levels of the messages stored.
|
||||
|
||||
==============================
|
||||
Regressions introduced/fixed
|
||||
==============================
|
||||
|
||||
- In version 5.2.4 a security fix caused a regression for patterns of
|
||||
the form "/foo/*/bar/*". Since version 5.2.5 instead of raising a warning the
|
||||
glob() function will return false when openbase_dir restrictions are violated.
|
||||
|
||||
#See http://bugs.php.net/bug.php?id=41655
|
||||
|
||||
The warning that used to be raised looked like something as follows:
|
||||
Warning: glob() [function.glob]: Unable to access /foo/*/bar/* in /foo.php on line xxx
|
||||
#See http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dir.c?r1=1.169&r2=1.170
|
||||
|
||||
The patch can safely be applied to PHP 5.2.4 as well.
|
||||
|
||||
==============================
|
||||
Backwards incompatible changes
|
||||
@@ -891,13 +876,6 @@ In ext/xmlwriter
|
||||
- End current element - returns FALSE on error
|
||||
bool xmlwriter_write_raw(resource xmlwriter, string content)
|
||||
- Write text - returns FALSE on error
|
||||
As of 5.2.1 #See http://cvs.php.net/viewvc.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.20.2.12.2.8&r2=1.20.2.12.2.9
|
||||
bool xmlwriter_start_dtd_entity(resource xmlwriter, string name, bool isparam)
|
||||
- Create start DTD Entity - returns FALSE on error
|
||||
bool xmlwriter_end_dtd_entity(resource xmlwriter)
|
||||
- End current DTD Entity - returns FALSE on error
|
||||
bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content [, bool pe [, string pubid [, string sysid [, string ndataid]]]])
|
||||
- Write full DTD Entity tag - returns FALSE on error
|
||||
|
||||
|
||||
New optional parameters
|
||||
|
||||
@@ -96,6 +96,13 @@ ext/pcntl
|
||||
* Remove all zend_extension code
|
||||
* Add object callback support to pcntl_signal()
|
||||
|
||||
ext/pgsql
|
||||
---------
|
||||
For PHP 4.3.0:
|
||||
* Add pg_metadata() with metadata cache feature.
|
||||
* Add pg_convert() to check and convert array value for query.
|
||||
* Add pg_insert/pg_update/pg_delete/pg_select for simple query.
|
||||
|
||||
ext/session
|
||||
-----------
|
||||
For PHP 4.3.0:
|
||||
@@ -122,6 +129,7 @@ ext/standard
|
||||
ext/wddx
|
||||
--------
|
||||
* See if we can support the remaining data types:
|
||||
dateTime
|
||||
binary
|
||||
|
||||
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
|
||||
|
||||
@@ -48,6 +48,26 @@ Responsibility: Shane Caraveo & each sapi module owner
|
||||
Timeframe: ? (but shouldn't be much effort, most modules are probably ok)
|
||||
|
||||
|
||||
Component: Input Filtering
|
||||
- Implement a SAPI input filter hook that will get called
|
||||
just before registering a variable in the
|
||||
treat_data/post_handler hooks. (done)
|
||||
- Make sure this is also done in mbstring (done)
|
||||
- Provide access functions, or perhaps a new
|
||||
$_RAW_GET/POST/Cookie set of superglobals to get at the
|
||||
unfiltered data
|
||||
- Provide a .ini directive which allows people to set their
|
||||
input filter to one of the built-in strip_tags,
|
||||
htmlspecialchars or whatever other internal function might
|
||||
be useful here.
|
||||
- (The main benefit of this is to make it easier for people
|
||||
to solve the XSS problem once and for all without having
|
||||
to go through every line of their code and adding input
|
||||
validation/filtering everywhere)
|
||||
Responsibility: Rasmus
|
||||
Timeframe: Yesterday
|
||||
|
||||
|
||||
Component: RPC Abstraction Layer
|
||||
Porting java, com, dotnet, xmlrpc, corba, soap and python, srm
|
||||
(are there more ?) to work with the new oo api and preferably
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+7
-12
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -13,11 +13,14 @@
|
||||
#ifndef TSRM_H
|
||||
#define TSRM_H
|
||||
|
||||
#if !defined(__CYGWIN__) && defined(WIN32)
|
||||
/* #ifndef WIN32 */
|
||||
#ifndef WIN32
|
||||
# include <tsrm_config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# define TSRM_WIN32
|
||||
# include "tsrm_config.w32.h"
|
||||
#else
|
||||
# include <tsrm_config.h>
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
@@ -30,14 +33,6 @@
|
||||
# define TSRM_API
|
||||
#endif
|
||||
|
||||
#ifdef _WIN64
|
||||
typedef __int64 tsrm_intptr_t;
|
||||
typedef unsigned __int64 tsrm_uintptr_t;
|
||||
#else
|
||||
typedef long tsrm_intptr_t;
|
||||
typedef unsigned long tsrm_uintptr_t;
|
||||
#endif
|
||||
|
||||
/* Only compile multi-threading functions if we're in ZTS mode */
|
||||
#ifdef ZTS
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef TSRM_CONFIG_COMMON_H
|
||||
#define TSRM_CONFIG_COMMON_H
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
# if WINNT|WIN32
|
||||
# define TSRM_WIN32
|
||||
# endif
|
||||
#if WINNT|WIN32
|
||||
# define TSRM_WIN32
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+123
-287
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -136,7 +136,7 @@ static int php_check_dots(const char *element, int n)
|
||||
free((s)->cwd);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
|
||||
CWD_API int php_sys_stat(const char *path, struct stat *buf)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA data;
|
||||
__int64 t;
|
||||
@@ -215,10 +215,9 @@ CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
|
||||
buf->st_mtime = (unsigned long)((t / 10000000) - 11644473600);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
static int php_is_dir_ok(const cwd_state *state) /* {{{ */
|
||||
static int php_is_dir_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
@@ -227,9 +226,8 @@ static int php_is_dir_ok(const cwd_state *state) /* {{{ */
|
||||
|
||||
return (1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int php_is_file_ok(const cwd_state *state) /* {{{ */
|
||||
static int php_is_file_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
@@ -238,9 +236,8 @@ static int php_is_file_ok(const cwd_state *state) /* {{{ */
|
||||
|
||||
return (1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
|
||||
{
|
||||
CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state);
|
||||
cwd_globals->realpath_cache_size = 0;
|
||||
@@ -248,16 +245,25 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{
|
||||
cwd_globals->realpath_cache_ttl = REALPATH_CACHE_TTL;
|
||||
memset(cwd_globals->realpath_cache, 0, sizeof(cwd_globals->realpath_cache));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
|
||||
{
|
||||
CWD_STATE_FREE(&cwd_globals->cwd);
|
||||
realpath_cache_clean(TSRMLS_C);
|
||||
}
|
||||
/* }}} */
|
||||
{
|
||||
int i;
|
||||
|
||||
static char *tsrm_strndup(const char *s, size_t length) /* {{{ */
|
||||
for (i = 0; i < sizeof(cwd_globals->realpath_cache)/sizeof(cwd_globals->realpath_cache[0]); i++) {
|
||||
realpath_cache_bucket *p = cwd_globals->realpath_cache[i];
|
||||
while (p != NULL) {
|
||||
realpath_cache_bucket *r = p;
|
||||
p = p->next;
|
||||
free(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char *tsrm_strndup(const char *s, size_t length)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@@ -271,9 +277,8 @@ static char *tsrm_strndup(const char *s, size_t length) /* {{{ */
|
||||
p[length]=0;
|
||||
return p;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
CWD_API void virtual_cwd_startup(void)
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
@@ -308,9 +313,8 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
cwd_mutex = tsrm_mutex_alloc();
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_shutdown(void) /* {{{ */
|
||||
CWD_API void virtual_cwd_shutdown(void)
|
||||
{
|
||||
#ifndef ZTS
|
||||
cwd_globals_dtor(&cwd_globals TSRMLS_CC);
|
||||
@@ -321,9 +325,8 @@ CWD_API void virtual_cwd_shutdown(void) /* {{{ */
|
||||
|
||||
free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC)
|
||||
{
|
||||
cwd_state *state;
|
||||
|
||||
@@ -355,10 +358,10 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
*length = state->cwd_length;
|
||||
return strdup(state->cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* Same semantics as UNIX getcwd() */
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC)
|
||||
{
|
||||
size_t length;
|
||||
char *cwd;
|
||||
@@ -377,61 +380,20 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
|
||||
free(cwd);
|
||||
return buf;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len)
|
||||
{
|
||||
register unsigned long h;
|
||||
const char *e = path + path_len;
|
||||
register unsigned long h;
|
||||
|
||||
for (h = 2166136261U; path < e;) {
|
||||
h *= 16777619;
|
||||
h ^= *path++;
|
||||
}
|
||||
|
||||
return h;
|
||||
const char *e = path + path_len;
|
||||
for (h = 2166136261U; path < e; ) {
|
||||
h *= 16777619;
|
||||
h ^= *path++;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
|
||||
realpath_cache_bucket *p = CWDG(realpath_cache)[i];
|
||||
while (p != NULL) {
|
||||
realpath_cache_bucket *r = p;
|
||||
p = p->next;
|
||||
free(r);
|
||||
}
|
||||
CWDG(realpath_cache)[i] = NULL;
|
||||
}
|
||||
CWDG(realpath_cache_size) = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
|
||||
|
||||
while (*bucket != NULL) {
|
||||
if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
free(r);
|
||||
return;
|
||||
} else {
|
||||
bucket = &(*bucket)->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC) /* {{{ */
|
||||
static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC)
|
||||
{
|
||||
long size = sizeof(realpath_cache_bucket) + path_len + 1 + realpath_len + 1;
|
||||
if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
|
||||
@@ -449,12 +411,11 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
|
||||
n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
bucket->next = CWDG(realpath_cache)[n];
|
||||
CWDG(realpath_cache)[n] = bucket;
|
||||
CWDG(realpath_cache_size) += size;
|
||||
CWDG(realpath_cache_size) += size;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
|
||||
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC)
|
||||
{
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
@@ -475,11 +436,11 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* 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)
|
||||
{
|
||||
int path_length = strlen(path);
|
||||
cwd_state old_state;
|
||||
@@ -487,18 +448,10 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
realpath_cache_bucket *bucket;
|
||||
time_t t = 0;
|
||||
int ret;
|
||||
int use_cache;
|
||||
int use_relative_path = 0;
|
||||
#ifdef TSRM_WIN32
|
||||
int is_unc;
|
||||
int exists;
|
||||
#endif
|
||||
TSRMLS_FETCH();
|
||||
|
||||
use_cache = ((use_realpath != CWD_EXPAND) && CWDG(realpath_cache_size_limit));
|
||||
|
||||
if (path_length == 0)
|
||||
return (1);
|
||||
return (0);
|
||||
if (path_length >= MAXPATHLEN)
|
||||
return (1);
|
||||
|
||||
@@ -509,33 +462,28 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
/* cwd_length can be 0 when getcwd() fails.
|
||||
* This can happen under solaris when a dir does not have read permissions
|
||||
* but *does* have execute permissions */
|
||||
if (!IS_ABSOLUTE_PATH(path, path_length)) {
|
||||
if (state->cwd_length == 0) {
|
||||
use_cache = 0;
|
||||
use_relative_path = 1;
|
||||
} else {
|
||||
int orig_path_len;
|
||||
int state_cwd_length = state->cwd_length;
|
||||
if (!IS_ABSOLUTE_PATH(path, path_length) && (state->cwd_length > 0)) {
|
||||
int orig_path_len;
|
||||
int state_cwd_length = state->cwd_length;
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
if (IS_SLASH(path[0])) {
|
||||
state_cwd_length = 2;
|
||||
}
|
||||
#endif
|
||||
orig_path_len = path_length + state_cwd_length + 1;
|
||||
if (orig_path_len >= MAXPATHLEN) {
|
||||
return 1;
|
||||
}
|
||||
memcpy(orig_path, state->cwd, state_cwd_length);
|
||||
orig_path[state_cwd_length] = DEFAULT_SLASH;
|
||||
memcpy(orig_path + state_cwd_length + 1, path, path_length + 1);
|
||||
path = orig_path;
|
||||
path_length = orig_path_len;
|
||||
if (IS_SLASH(path[0])) {
|
||||
state_cwd_length = 2;
|
||||
}
|
||||
#endif
|
||||
orig_path_len = path_length + state_cwd_length + 1;
|
||||
if (orig_path_len >= MAXPATHLEN) {
|
||||
return 1;
|
||||
}
|
||||
memcpy(orig_path, state->cwd, state_cwd_length);
|
||||
orig_path[state_cwd_length] = DEFAULT_SLASH;
|
||||
memcpy(orig_path + state_cwd_length + 1, path, path_length + 1);
|
||||
path = orig_path;
|
||||
path_length = orig_path_len;
|
||||
}
|
||||
|
||||
if (use_cache) {
|
||||
t = CWDG(realpath_cache_ttl)?time(0):0;
|
||||
if (use_realpath && CWDG(realpath_cache_size_limit)) {
|
||||
t = CWDG(realpath_cache_ttl)?time(NULL):0;
|
||||
if ((bucket = realpath_cache_find(path, path_length, t TSRMLS_CC)) != NULL) {
|
||||
int len = bucket->realpath_len;
|
||||
|
||||
@@ -554,7 +502,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
}
|
||||
}
|
||||
|
||||
if (use_realpath != CWD_EXPAND) {
|
||||
if (use_realpath) {
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
char resolved_path[MAXPATHLEN];
|
||||
|
||||
@@ -564,7 +512,6 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
}
|
||||
goto no_realpath;
|
||||
}
|
||||
use_realpath = CWD_REALPATH;
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
|
||||
state->cwd_length = strlen(resolved_path);
|
||||
@@ -575,24 +522,15 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
#endif
|
||||
} else {
|
||||
char *ptr, *path_copy, *free_path;
|
||||
char *tok;
|
||||
char *tok = NULL;
|
||||
int ptr_length;
|
||||
no_realpath:
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
if (memchr(path, '*', path_length) ||
|
||||
memchr(path, '?', path_length)) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
no_realpath:
|
||||
|
||||
free_path = path_copy = tsrm_strndup(path, path_length);
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
exists = (use_realpath != CWD_EXPAND);
|
||||
ret = 0;
|
||||
is_unc = 0;
|
||||
#ifdef TSRM_WIN32
|
||||
if (path_length >= 2 && path[1] == ':') {
|
||||
state->cwd = (char *) realloc(state->cwd, 2 + 1);
|
||||
state->cwd[0] = toupper(path[0]);
|
||||
@@ -606,7 +544,6 @@ no_realpath:
|
||||
state->cwd[1] = '\0';
|
||||
state->cwd_length = 1;
|
||||
path_copy += 2;
|
||||
is_unc = 2;
|
||||
} else {
|
||||
#endif
|
||||
state->cwd = (char *) realloc(state->cwd, 1);
|
||||
@@ -616,7 +553,6 @@ no_realpath:
|
||||
}
|
||||
#endif
|
||||
|
||||
tok = NULL;
|
||||
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
|
||||
while (ptr) {
|
||||
ptr_length = strlen(ptr);
|
||||
@@ -624,12 +560,6 @@ no_realpath:
|
||||
if (IS_DIRECTORY_UP(ptr, ptr_length)) {
|
||||
char save;
|
||||
|
||||
if (use_relative_path) {
|
||||
CWD_STATE_FREE(state);
|
||||
*state = old_state;
|
||||
return 1;
|
||||
}
|
||||
|
||||
save = DEFAULT_SLASH;
|
||||
|
||||
#define PREVIOUS state->cwd[state->cwd_length - 1]
|
||||
@@ -649,42 +579,37 @@ no_realpath:
|
||||
state->cwd_length--;
|
||||
}
|
||||
} else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
|
||||
if (use_relative_path) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1);
|
||||
use_relative_path = 0;
|
||||
} else {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
|
||||
#ifdef TSRM_WIN32
|
||||
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
|
||||
if (state->cwd_length < 2 ||
|
||||
(state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
|
||||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
Below code keeps appending to state->cwd a File system seperator
|
||||
cases where this appending should not happen is given below,
|
||||
a) sys: should just be left as it is
|
||||
b) sys:system should just be left as it is,
|
||||
Colon is allowed only in the first token as volume names alone can have the : in their names.
|
||||
Files and Directories cannot have : in their names
|
||||
So the check goes like this,
|
||||
For second token and above simply append the DEFAULT_SLASH to the state->cwd.
|
||||
For first token check for the existence of :
|
||||
if it exists don't append the DEFAULT_SLASH to the state->cwd.
|
||||
*/
|
||||
if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#else
|
||||
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
|
||||
if (state->cwd_length < 2 ||
|
||||
(state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
|
||||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
#endif
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
Below code keeps appending to state->cwd a File system seperator
|
||||
cases where this appending should not happen is given below,
|
||||
a) sys: should just be left as it is
|
||||
b) sys:system should just be left as it is,
|
||||
Colon is allowed only in the first token as volume names alone can have the : in their names.
|
||||
Files and Directories cannot have : in their names
|
||||
So the check goes like this,
|
||||
For second token and above simply append the DEFAULT_SLASH to the state->cwd.
|
||||
For first token check for the existence of :
|
||||
if it exists don't append the DEFAULT_SLASH to the state->cwd.
|
||||
*/
|
||||
if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#else
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
#endif
|
||||
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
if (use_realpath != CWD_EXPAND) {
|
||||
if (use_realpath) {
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
|
||||
@@ -697,18 +622,6 @@ no_realpath:
|
||||
memcpy(&state->cwd[state->cwd_length], data.cFileName, length+1);
|
||||
ptr_length = length;
|
||||
FindClose(hFind);
|
||||
ret = 0;
|
||||
} else {
|
||||
if (is_unc) {
|
||||
/* skip share name */
|
||||
is_unc--;
|
||||
ret = 0;
|
||||
} else {
|
||||
exists = 0;
|
||||
if (use_realpath == CWD_REALPATH) {
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -717,25 +630,8 @@ no_realpath:
|
||||
}
|
||||
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
|
||||
}
|
||||
free(free_path);
|
||||
|
||||
if (use_realpath == CWD_REALPATH) {
|
||||
if (ret) {
|
||||
CWD_STATE_FREE(state);
|
||||
*state = old_state;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
#if defined(TSRM_WIN32) || defined(NETWARE)
|
||||
if (path[path_length-1] == '\\' || path[path_length-1] == '/') {
|
||||
#else
|
||||
if (path[path_length-1] == '/') {
|
||||
#endif
|
||||
state->cwd = (char*)realloc(state->cwd, state->cwd_length + 2);
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
state->cwd[state->cwd_length] = 0;
|
||||
}
|
||||
}
|
||||
free(free_path);
|
||||
|
||||
if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
|
||||
@@ -745,12 +641,7 @@ no_realpath:
|
||||
}
|
||||
}
|
||||
|
||||
/* Store existent file in realpath cache. */
|
||||
#ifdef TSRM_WIN32
|
||||
if (use_cache && !is_unc && exists) {
|
||||
#else
|
||||
if (use_cache && (use_realpath == CWD_REALPATH)) {
|
||||
#endif
|
||||
if (use_realpath && CWDG(realpath_cache_size_limit)) {
|
||||
realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC);
|
||||
}
|
||||
|
||||
@@ -768,15 +659,13 @@ no_realpath:
|
||||
#endif
|
||||
return (ret);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */
|
||||
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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC)
|
||||
{
|
||||
int length = strlen(path);
|
||||
char *temp;
|
||||
@@ -807,29 +696,13 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
|
||||
tsrm_free_alloca(temp);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
char *retval;
|
||||
char cwd[MAXPATHLEN];
|
||||
|
||||
/* realpath("") returns CWD */
|
||||
if (!*path) {
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
new_state.cwd[0] = '\0';
|
||||
new_state.cwd_length = 0;
|
||||
if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
|
||||
path = cwd;
|
||||
}
|
||||
} else if (!IS_ABSOLUTE_PATH(path, strlen(path))) {
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
} else {
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
new_state.cwd[0] = '\0';
|
||||
new_state.cwd_length = 0;
|
||||
}
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
@@ -845,9 +718,8 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
|
||||
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
@@ -860,15 +732,13 @@ CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_f
|
||||
return retval;
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC)
|
||||
{
|
||||
return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ */
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
FILE *f;
|
||||
@@ -879,7 +749,6 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -888,16 +757,14 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -911,17 +778,16 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -930,17 +796,15 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -949,17 +813,15 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -976,17 +838,15 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
|
||||
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int f;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1005,16 +865,14 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int f;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1023,25 +881,21 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
|
||||
{
|
||||
cwd_state old_state;
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&old_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&old_state);
|
||||
if (virtual_file_ex(&old_state, oldname, NULL, CWD_REALPATH)) {
|
||||
return -1;
|
||||
}
|
||||
oldname = old_state.cwd;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&old_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
if (virtual_file_ex(&new_state, newname, NULL, CWD_FILEPATH)) {
|
||||
return -1;
|
||||
}
|
||||
newname = new_state.cwd;
|
||||
@@ -1053,16 +907,14 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
|
||||
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1071,17 +923,15 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if !defined(TSRM_WIN32)
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1090,17 +940,15 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ *
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_unlink(const char *path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1109,16 +957,14 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1130,16 +976,14 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1148,20 +992,18 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
DIR *opendir(const char *name);
|
||||
#endif
|
||||
|
||||
CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
DIR *retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1170,19 +1012,20 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
{
|
||||
return popen_ex(command, type, CWDG(cwd).cwd, NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#elif defined(NETWARE)
|
||||
|
||||
/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
|
||||
a VCWD_CHDIR() and mutex it
|
||||
*/
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
{
|
||||
char prev_cwd[MAXPATHLEN];
|
||||
char *getcwd_result;
|
||||
@@ -1207,9 +1050,10 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
|
||||
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#else /* Unix */
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
{
|
||||
int command_length;
|
||||
int dir_length, extra = 0;
|
||||
@@ -1266,23 +1110,15 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
|
||||
free(command_line);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
|
||||
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
|
||||
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
char cwd[MAXPATHLEN];
|
||||
|
||||
/* realpath("") returns CWD */
|
||||
if (!*path) {
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
new_state.cwd[0] = '\0';
|
||||
new_state.cwd_length = 0;
|
||||
if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
|
||||
path = cwd;
|
||||
}
|
||||
} else if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
|
||||
if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
|
||||
VCWD_GETCWD(cwd, MAXPATHLEN)) {
|
||||
new_state.cwd = strdup(cwd);
|
||||
new_state.cwd_length = strlen(cwd);
|
||||
@@ -1307,7 +1143,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
|
||||
return new_state.cwd;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -226,9 +226,6 @@ extern virtual_cwd_globals cwd_globals;
|
||||
# define CWDG(v) (cwd_globals.v)
|
||||
#endif
|
||||
|
||||
CWD_API void realpath_cache_clean(TSRMLS_D);
|
||||
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
|
||||
+21
-42
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -88,7 +88,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
{
|
||||
if (mode == 1 /*X_OK*/) {
|
||||
#if 1
|
||||
/* This code is not supported by Windows 98,
|
||||
/* This code is not supported by Windows 98,
|
||||
* but we don't support it anymore */
|
||||
DWORD type;
|
||||
|
||||
@@ -96,7 +96,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
#else
|
||||
SHFILEINFO sfi;
|
||||
|
||||
return access(pathname, 0) == 0 &&
|
||||
return access(pathname, 0) == 0 &&
|
||||
SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1;
|
||||
#endif
|
||||
} else {
|
||||
@@ -109,22 +109,22 @@ static process_pair *process_get(FILE *stream TSRMLS_DC)
|
||||
{
|
||||
process_pair *ptr;
|
||||
process_pair *newptr;
|
||||
|
||||
|
||||
for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
|
||||
if (ptr->stream == stream) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ptr < (TWG(process) + TWG(process_size))) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair));
|
||||
if (newptr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
TWG(process) = newptr;
|
||||
ptr = newptr + TWG(process_size);
|
||||
TWG(process_size)++;
|
||||
@@ -136,7 +136,7 @@ static shm_pair *shm_get(int key, void *addr)
|
||||
shm_pair *ptr;
|
||||
shm_pair *newptr;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
|
||||
for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
|
||||
if (!ptr->descriptor) {
|
||||
continue;
|
||||
@@ -151,12 +151,12 @@ static shm_pair *shm_get(int key, void *addr)
|
||||
if (ptr < (TWG(shm) + TWG(shm_size))) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair));
|
||||
if (newptr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
TWG(shm) = newptr;
|
||||
ptr = newptr + TWG(shm_size);
|
||||
TWG(shm_size)++;
|
||||
@@ -179,42 +179,23 @@ TSRM_API FILE *popen(const char *command, const char *type)
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, type_len = strlen(type), read, mode;
|
||||
int fno, str_len = strlen(type), read, mode;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
process_pair *proc;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
process_pair *proc;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (!type) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*The following two checks can be removed once we drop XP support */
|
||||
type_len = strlen(type);
|
||||
if (type_len <1 || type_len > 2) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0; i < type_len; i++) {
|
||||
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
|
||||
return NULL;
|
||||
}
|
||||
ptype++;
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
memset(&startup, 0, sizeof(STARTUPINFO));
|
||||
memset(&process, 0, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
@@ -223,7 +204,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
read = (type[0] == 'r') ? TRUE : FALSE;
|
||||
mode = ((type_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
|
||||
|
||||
if (read) {
|
||||
@@ -238,8 +219,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c "));
|
||||
sprintf(cmd, "%s /c %s", TWG(comspec), command);
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) {
|
||||
free(cmd);
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, env, cwd, &startup, &process)) {
|
||||
return NULL;
|
||||
}
|
||||
free(cmd);
|
||||
@@ -248,10 +228,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
proc = process_get(NULL TSRMLS_CC);
|
||||
|
||||
if (read) {
|
||||
fno = _open_osfhandle((tsrm_intptr_t)in, _O_RDONLY | mode);
|
||||
fno = _open_osfhandle((long)in, _O_RDONLY | mode);
|
||||
CloseHandle(out);
|
||||
} else {
|
||||
fno = _open_osfhandle((tsrm_intptr_t)out, _O_WRONLY | mode);
|
||||
fno = _open_osfhandle((long)out, _O_WRONLY | mode);
|
||||
CloseHandle(in);
|
||||
}
|
||||
|
||||
@@ -300,6 +280,9 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
|
||||
if ((!shm_handle && !info_handle)) {
|
||||
if (flags & IPC_EXCL) {
|
||||
return -1;
|
||||
}
|
||||
if (flags & IPC_CREAT) {
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment);
|
||||
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info);
|
||||
@@ -308,10 +291,6 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
if ((!shm_handle || !info_handle)) {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
shm = shm_get(key, NULL);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -381,12 +381,12 @@ ext/pfpro not actively maintained
|
||||
ext/w32api pecl/ffi
|
||||
ext/yp not actively maintained
|
||||
sapi/activescript http://pecl4win.php.net/ext.php/php5activescript.dll (PECL package)
|
||||
or pecl/activescript (SVN)
|
||||
or pecl/activescript (CVS)
|
||||
|
||||
Modules in PECL that are not actively maintained (i.e. have not been supported
|
||||
for some time, have no active maintainer working on them currently, and do not
|
||||
have any PECL package releases), are still available in SVN at
|
||||
http://svn.php.net/pecl/. However, unreleased PHP modules are by their nature
|
||||
have any PECL package releases), are still available in CVS at
|
||||
http://cvs.php.net/pecl/. However, unreleased PHP modules are by their nature
|
||||
unsupported, and your mileage may vary when attempting to install or use them.
|
||||
|
||||
9b. Class constants in new PHP 5.1 extensions
|
||||
|
||||
+7
-28
@@ -1,34 +1,13 @@
|
||||
Zend Memory Manager
|
||||
===================
|
||||
The goal of the new memory manager (PHP 5.2 and later) is reducing memory allocation overhead and speedup memory management.
|
||||
|
||||
General:
|
||||
--------
|
||||
The new manager's "configure" has no "--disable-zend-memory-manager" option, but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG build and disabled by default in RELEASE built. It allows select malloc/emalloc at runtime. So you can use internal and external memory debuggers without recompilation.
|
||||
|
||||
The goal of the new memory manager (available since PHP 5.2) is to reduce memory
|
||||
allocation overhead and speedup memory management.
|
||||
$ sapi/cli/php -r 'leak();'
|
||||
|
||||
The new manager's "configure" has no "--disable-zend-memory-manager" option,
|
||||
but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG
|
||||
build and disabled by default in RELEASE build. when enabled it allows selecting
|
||||
between malloc and emalloc at runtime so you can use internal and external memory
|
||||
debuggers without recompilation.
|
||||
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();'
|
||||
|
||||
Debugging:
|
||||
----------
|
||||
The patch allows tweaking memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment variables. Default values are "malloc" and "256K". Dependent on target system you can also use "mmap_anon", "mmap_zero"
|
||||
and "win32" storage managers.
|
||||
|
||||
Normal:
|
||||
$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php
|
||||
|
||||
$ sapi/cli/php -r 'leak();'
|
||||
|
||||
Zend MM disabled:
|
||||
|
||||
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
|
||||
|
||||
Tweaking:
|
||||
---------
|
||||
|
||||
The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment
|
||||
variables. Default values are "malloc" and "256K". Dependent on target system you
|
||||
can also use "mmap_anon", "mmap_zero" and "win32" storage managers.
|
||||
|
||||
$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc.
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+6
-6
@@ -23,18 +23,18 @@ var_dump(constant("test const"));
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: define() expects at least 2 parameters, 0 given in %s on line %d
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: define() expects at least 2 parameters, 1 given in %s on line %d
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
|
||||
Warning: define() expects parameter 3 to be boolean, array given in %s on line %d
|
||||
NULL
|
||||
Notice: Constant true already defined in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: define() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
+5
-9
@@ -10,11 +10,9 @@ var_dump(get_resource_type($fp));
|
||||
fclose($fp);
|
||||
var_dump(get_resource_type($fp));
|
||||
|
||||
var_dump(get_loaded_extensions(true));
|
||||
var_dump(gettype(get_loaded_extensions()));
|
||||
var_dump(count(get_loaded_extensions()));
|
||||
var_dump(gettype(get_loaded_extensions(true)));
|
||||
var_dump(count(get_loaded_extensions(true)));
|
||||
var_dump(get_loaded_extensions(true, true));
|
||||
|
||||
define("USER_CONSTANT", "test");
|
||||
|
||||
@@ -52,15 +50,13 @@ Warning: Supplied argument is not a valid resource handle in %s on line %d
|
||||
bool(false)
|
||||
string(6) "stream"
|
||||
string(7) "Unknown"
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d
|
||||
Warning: Wrong parameter count for get_loaded_extensions() in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d
|
||||
Warning: Wrong parameter count for get_defined_constants() in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
string(5) "array"
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
constant() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(constant());
|
||||
var_dump(constant("", ""));
|
||||
var_dump(constant(""));
|
||||
|
||||
var_dump(constant(array()));
|
||||
|
||||
define("TEST_CONST", 1);
|
||||
var_dump(constant("TEST_CONST"));
|
||||
|
||||
define("TEST_CONST2", "test");
|
||||
var_dump(constant("TEST_CONST2"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for constant() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for constant() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: constant(): Couldn't find constant in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
|
||||
Warning: constant(): Couldn't find constant Array in %s on line %d
|
||||
NULL
|
||||
int(1)
|
||||
string(4) "test"
|
||||
Done
|
||||
-1333
File diff suppressed because it is too large.
Load diff
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
func_get_arg() invalid usage
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(func_get_arg(1,2,3));
|
||||
var_dump(func_get_arg(1));
|
||||
var_dump(func_get_arg());
|
||||
|
||||
function bar() {
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function foo() {
|
||||
bar(func_get_arg(1));
|
||||
}
|
||||
|
||||
foo(1,2);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
__call() for private/protected methods
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private $var1 = 'var1 value';
|
||||
protected $var2 = 'var2 value';
|
||||
|
||||
private function func1()
|
||||
{
|
||||
return "in func1";
|
||||
}
|
||||
protected function func2()
|
||||
{
|
||||
return "in func2";
|
||||
}
|
||||
public function __get($var)
|
||||
{
|
||||
return $this->$var;
|
||||
}
|
||||
public function __call($func, array $args = array())
|
||||
{
|
||||
return call_user_func_array(array($this, $func), $args);
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
echo $a->var1,"\n";
|
||||
echo $a->var2,"\n";
|
||||
echo $a->func1(),"\n";
|
||||
echo $a->func2(),"\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
var1 value
|
||||
var2 value
|
||||
in func1
|
||||
in func2
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Trigger __call() in lieu of non visible methods when called via a callback.
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
protected function prot() { }
|
||||
private function priv() { }
|
||||
public function __call($name, $args) {
|
||||
echo "In __call() for method $name()\n";
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
call_user_func(array($c, 'none'));
|
||||
call_user_func(array($c, 'prot'));
|
||||
call_user_func(array($c, 'priv'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
In __call() for method none()
|
||||
In __call() for method prot()
|
||||
In __call() for method priv()
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
adding arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = array(1,2,3);
|
||||
$b = array("str", "here");
|
||||
|
||||
$c = $a + $b;
|
||||
var_dump($c);
|
||||
|
||||
$a = array(1,2,3);
|
||||
$b = array(1,2,4);
|
||||
|
||||
$c = $a + $b;
|
||||
var_dump($c);
|
||||
|
||||
$a = array("a"=>"aaa",2,3);
|
||||
$b = array(1,2,"a"=>"bbbbbb");
|
||||
|
||||
$c = $a + $b;
|
||||
var_dump($c);
|
||||
|
||||
$a += $b;
|
||||
var_dump($c);
|
||||
|
||||
$a += $a;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(3) "aaa"
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(3) "aaa"
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(3) "aaa"
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
Done
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
adding objects to arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = array(1,2,3);
|
||||
|
||||
$o = new stdclass;
|
||||
$o->prop = "value";
|
||||
|
||||
$c = $a + $o;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
|
||||
Fatal error: Unsupported operand types in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
adding arrays to objects
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = array(1,2,3);
|
||||
|
||||
$o = new stdclass;
|
||||
$o->prop = "value";
|
||||
|
||||
$c = $o + $a;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
|
||||
Fatal error: Unsupported operand types in %s on line %d
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
adding numbers to arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = array(1,2,3);
|
||||
|
||||
$c = $a + 5;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Unsupported operand types in %s on line %d
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
adding integers to doubles
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = 75636;
|
||||
$d = 2834681123.123123;
|
||||
|
||||
$c = $i + $d;
|
||||
var_dump($c);
|
||||
|
||||
$c = $d + $i;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
float(2834756759.1231)
|
||||
float(2834756759.1231)
|
||||
Done
|
||||
@@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
adding numbers to strings
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = 75636;
|
||||
$s1 = "this is a string";
|
||||
$s2 = "876222numeric";
|
||||
$s3 = "48474874";
|
||||
$s4 = "25.68";
|
||||
|
||||
$c = $i + $s1;
|
||||
var_dump($c);
|
||||
|
||||
$c = $i + $s2;
|
||||
var_dump($c);
|
||||
|
||||
$c = $i + $s3;
|
||||
var_dump($c);
|
||||
|
||||
$c = $i + $s4;
|
||||
var_dump($c);
|
||||
|
||||
$c = $s1 + $i;
|
||||
var_dump($c);
|
||||
|
||||
$c = $s2 + $i;
|
||||
var_dump($c);
|
||||
|
||||
$c = $s3 + $i;
|
||||
var_dump($c);
|
||||
|
||||
$c = $s4 + $i;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(75636)
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
int(75636)
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
Done
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
adding strings to arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = array(1,2,3);
|
||||
|
||||
$s1 = "some string";
|
||||
|
||||
$c = $a + $s1;
|
||||
var_dump($c);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Unsupported operand types in %s on line %d
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
bitwise AND and strings
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$s = "123";
|
||||
$s1 = "234";
|
||||
|
||||
var_dump($s & $s1);
|
||||
|
||||
$s = "test";
|
||||
$s1 = "some";
|
||||
|
||||
var_dump($s & $s1);
|
||||
|
||||
$s = "test long";
|
||||
$s1 = "some";
|
||||
|
||||
var_dump($s & $s1);
|
||||
|
||||
$s = "test";
|
||||
$s1 = "some long";
|
||||
|
||||
var_dump($s & $s1);
|
||||
|
||||
$s = "test";
|
||||
$s &= "some long";
|
||||
|
||||
var_dump($s);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "020"
|
||||
string(4) "pead"
|
||||
string(4) "pead"
|
||||
string(4) "pead"
|
||||
string(4) "pead"
|
||||
Done
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Tests that array manipulation code is correctly dealing with copy on write and splitting on reference
|
||||
--FILE--
|
||||
<?php
|
||||
$a=array();
|
||||
$b=1;
|
||||
$c=&$b;
|
||||
$a[]=$b;
|
||||
$b=2;
|
||||
var_dump ($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Tests that array unshift code is correctly dealing with copy on write and splitting on reference
|
||||
--FILE--
|
||||
<?php
|
||||
$a=array();
|
||||
$b=1;
|
||||
$c=&$b;
|
||||
array_unshift ($a,$b);
|
||||
$b=2;
|
||||
var_dump ($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #22725 (A derived class can call a parent's protected method that calls a private method)
|
||||
bug #22725 (A derived class can call a parent's protected method that calls a private method)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #27304 (Static functions don't function properly)
|
||||
Bug #27304
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ array(1) {
|
||||
}
|
||||
Base::__construct
|
||||
array(3) {
|
||||
["Baz"]=>
|
||||
int(4)
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
["Bar"]=>
|
||||
int(2)
|
||||
["Baz"]=>
|
||||
int(3)
|
||||
}
|
||||
Child::__construct
|
||||
array(3) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #29104 (Function declaration in method doesn't work)
|
||||
Bug #29104 Function declaration in method doesn't work
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #29210 (Function is_callable does not support private and protected methods)
|
||||
Bug #29210 Function: is_callable - no support for private and protected classes
|
||||
--FILE--
|
||||
<?php
|
||||
class test_class {
|
||||
|
||||
@@ -33,7 +33,7 @@ $obj->printVars();
|
||||
===BASE===
|
||||
string(4) "Base"
|
||||
|
||||
Notice: Undefined property: BaseClass::$private_child in %sbug29674.php on line %d
|
||||
Notice: Undefined property: BaseClass::$private_child in %sbug29674.php on line %d
|
||||
NULL
|
||||
===CHILD===
|
||||
string(4) "Base"
|
||||
|
||||
@@ -52,7 +52,7 @@ $baz->printFoo();
|
||||
--EXPECTF--
|
||||
foo: foo foo2
|
||||
bar: bar
|
||||
Notice: Undefined property: bar::$foo2 in %s on line %d
|
||||
Notice: Undefined property: bar::$foo2 in %s on line %d
|
||||
|
||||
---baz--
|
||||
foo: foo foo2
|
||||
|
||||
@@ -41,14 +41,12 @@ $db = new hariCow;
|
||||
|
||||
var_dump($db);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: db in %sbug30162.php on line 35
|
||||
NULL
|
||||
object(hariCow)#%d (2) {
|
||||
object(hariCow)#1 (2) {
|
||||
["x"]=>
|
||||
string(1) "x"
|
||||
["y"]=>
|
||||
string(1) "y"
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #30519 (Interface not existing says Class not found)
|
||||
Bug #30519 Interface not existing says Class not found
|
||||
--FILE--
|
||||
<?php
|
||||
class test implements a {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #30702 (cannot initialize class variable from class constant)
|
||||
Bug #30702 cannot initialize class variable from class constant
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded)
|
||||
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #30889 (Conflict between __get/__set and ++ operator)
|
||||
Bug #30889 Conflict between __get/__set and ++ operator
|
||||
--FILE--
|
||||
<?php
|
||||
class overloaded
|
||||
|
||||
@@ -10,4 +10,4 @@ var_dump($a instanceOf A);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Interface RecurisiveFooFar cannot implement itself in %sbug30922.php on line %d
|
||||
Fatal error: Interface RecurisiveFooFar cannot not implement itself in %sbug30922.php on line %d
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32296 (get_class_methods output has changed between 5.0.2 and 5.0.3)
|
||||
Bug #32296 get_class_methods output has changed between 5.0.2 and 5.0.3
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class space{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32427 (Interfaces are not allowed 'static' access modifier)
|
||||
Bug #32427 Interfaces are not allowed 'static' access modifier
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32660 (Assignment by reference causes crash when field access is overloaded (__get))
|
||||
Bug #32660 Assignment by reference causes crash when field access is overloaded (__get)
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32674 (exception in iterator causes crash)
|
||||
Bug #32674 exception in iterator causes crash
|
||||
--FILE--
|
||||
<?php
|
||||
class collection implements Iterator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32833 (Invalid opcode with $a[] .= '')
|
||||
Bug #32833 Invalid opcode
|
||||
--FILE--
|
||||
<?php
|
||||
$test = array();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #33257 (array_splice() inconsistent when passed function instead of variable)
|
||||
Bug #33257 array_splice() inconsistent when passed function instead of variable
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #34712 (zend.ze1_compatibility_mode = on segfault)
|
||||
Bug #34712 zend.ze1_compatibility_mode = on segfault
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=1
|
||||
error_reporting=4095
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #35106 (nested foreach fails when array variable has a reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$a=array("1","2");
|
||||
$b=&$a;
|
||||
foreach($a as $i){
|
||||
echo $i;
|
||||
foreach($a as $p);
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
12
|
||||
@@ -12,16 +12,30 @@ var_dump($a);
|
||||
$a->x0->y1 = "ok\n";
|
||||
echo $a->x0;
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["x0"]=>
|
||||
&object(stdClass)#%d (3) {
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
ok
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #35437 (Segfault or Invalid Opcode 137/1/4)
|
||||
Bug #35437 Segfault or Invalid Opcode 137/1/4
|
||||
--FILE--
|
||||
<?php
|
||||
function err2exception($errno, $errstr)
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Bug #35634 (Erroneous "Class declarations may not be nested" error raised)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
if (defined("pass3")) {
|
||||
|
||||
class ErrorClass {
|
||||
}
|
||||
|
||||
} else if (defined("pass2")) {
|
||||
|
||||
class TestClass {
|
||||
function __construct() {
|
||||
}
|
||||
function TestClass() {
|
||||
$this->__construct();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
function errorHandler($errorNumber, $errorMessage, $fileName, $lineNumber) {
|
||||
define("pass3", 1);
|
||||
include(__FILE__);
|
||||
die("Error: $errorMessage ($fileName:$lineNumber)\n");
|
||||
}
|
||||
|
||||
set_error_handler('errorHandler');
|
||||
define("pass2", 1);
|
||||
include(__FILE__);
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -6,6 +6,8 @@ error_reporting=4095
|
||||
<?php
|
||||
$a = clone 0;
|
||||
$a[0]->b = 0;
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: __clone method called on non-object in %sbug36071.php on line 2
|
||||
Warning: __clone method called on non-object in %sbug36071.php on line 2
|
||||
ok
|
||||
@@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
Bug #36214 (__get method works properly only when conditional operator is used)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class context {
|
||||
public $stack = array();
|
||||
|
||||
public function __set($name,$var) {
|
||||
$this->stack[$name] = $var;return;
|
||||
}
|
||||
|
||||
public function &__get($name) {
|
||||
return $this->stack[$name];
|
||||
}
|
||||
}
|
||||
|
||||
$ctx = new context;
|
||||
$ctx->comment_preview = array();
|
||||
$ctx->comment_preview[0] = 1;
|
||||
$ctx->comment_preview[1] = 2;
|
||||
var_dump($ctx->comment_preview);
|
||||
|
||||
$comment_preview = array();
|
||||
$comment_preview[0] = 1;
|
||||
$comment_preview[1] = 2;
|
||||
$ctx->comment_preview = $comment_preview;
|
||||
var_dump($ctx->comment_preview);
|
||||
|
||||
$ctx->comment_preview = new ArrayObject();
|
||||
$ctx->comment_preview[0] = 1;
|
||||
$ctx->comment_preview[1] = 2;
|
||||
var_dump($ctx->comment_preview);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
object(ArrayObject)#2 (2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #37212 (Access to protected property of common base class)
|
||||
Bug #3721 (Access to protected property of common base class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #37715 (array pointers resetting on copy)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(
|
||||
'a' => array(
|
||||
'A', 'B', 'C', 'D',
|
||||
),
|
||||
'b' => array(
|
||||
'AA', 'BB', 'CC', 'DD',
|
||||
),
|
||||
);
|
||||
|
||||
// Set the pointer of $a to 'b' and the pointer of 'b' to 'CC'
|
||||
reset($a);
|
||||
next($a);
|
||||
next($a['b']);
|
||||
next($a['b']);
|
||||
next($a['b']);
|
||||
|
||||
var_dump(key($a['b']));
|
||||
foreach($a as $k => $d)
|
||||
{
|
||||
}
|
||||
// Alternatively $c = $a; and foreachloop removal will cause identical results.
|
||||
var_dump(key($a['b']));
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(3)
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #37811 (define not using toString on objects)
|
||||
Bug #37811 define not using toString on objects
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ foreach($f->bar as $key => $value) {
|
||||
print "$key => $value\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Notice: Indirect modification of overloaded property foo::$bar has no effect in %sbug38146.php on line 10
|
||||
foo => bar
|
||||
bar => foo
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #38220 (Crash on some object operations)
|
||||
Bug #38220 Crash on some object operations
|
||||
--FILE--
|
||||
<?php
|
||||
class drv {
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
Bug #38469 (Unexpected creation of cycle)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
$a[0] = $a;
|
||||
var_dump($a);
|
||||
$b = array(array());
|
||||
$b[0][0] = $b;
|
||||
var_dump($b);
|
||||
|
||||
function f() {
|
||||
$a = array();
|
||||
$a[0] = $a;
|
||||
var_dump($a);
|
||||
$b = array(array());
|
||||
$b[0][0] = $b;
|
||||
var_dump($b);
|
||||
}
|
||||
f();
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
--TEST--
|
||||
Bug #39018 (Error control operator '@' fails to suppress "Uninitialized string offset")
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$a = 'foo';
|
||||
$a[11111111111];
|
||||
|
||||
$a = '';
|
||||
|
||||
$a[0];
|
||||
|
||||
print $a[0]; // 12
|
||||
|
||||
$a[-11111111111111111111111];
|
||||
|
||||
print $a[-11111111111111111111111]; // 16
|
||||
|
||||
$a[-0];
|
||||
|
||||
$x = 'test';
|
||||
|
||||
@$x[4];
|
||||
|
||||
@$y = $x[4];
|
||||
|
||||
@('a' == $x[4]);
|
||||
|
||||
$x[4] == 'a'; // 28
|
||||
|
||||
@$x[4] == 'a';
|
||||
|
||||
(@$x[4]) == 'a';
|
||||
|
||||
($x[4]) == 'a'; // 34
|
||||
|
||||
(@($x[4])) == 'a';
|
||||
|
||||
(($x[4])) == 'a'; // 38
|
||||
|
||||
@($x[4]) == 'a';
|
||||
|
||||
($x[4]) == 'a'; // 42
|
||||
|
||||
@($x[4] == 'a');
|
||||
|
||||
($x[4] == 'a'); // 46
|
||||
|
||||
$y = 'foobar';
|
||||
|
||||
$y[12.2];
|
||||
|
||||
print $y[12.2]; // 52
|
||||
|
||||
$y[3.5];
|
||||
|
||||
print $y[3.5]; // 56
|
||||
|
||||
print "\nDone\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line 12
|
||||
|
||||
Notice: Uninitialized string offset: -%d in %s on line 16
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line 28
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line 34
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line 38
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line 42
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line 46
|
||||
|
||||
Notice: Uninitialized string offset: 12 in %s on line 52
|
||||
b
|
||||
Done
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #39018 [2] (Error control operator '@' fails to suppress "Uninitialized string offset")
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$foo = 'test';
|
||||
$x = @$foo[6];
|
||||
|
||||
print @($foo[100] + $foo[130]);
|
||||
|
||||
print "\nDone\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
Done
|
||||
@@ -6,6 +6,4 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
|
||||
list($a, $b) = $s[0];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
Fatal error: Cannot use string offset as an array in %sbug39304.php on line %d
|
||||
Fatal error: Cannot use string offset as an array in %sbug39304.php on line 3
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #39449 (Overloaded array properties do not work correctly)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
private $keys = array();
|
||||
public function & __get($val) {
|
||||
return $this->keys[$val];
|
||||
}
|
||||
public function __set($k, $v) {
|
||||
$this->keys[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$a =new A();
|
||||
$a->arr = array('a','b','c');
|
||||
|
||||
$b = &$a->arr;
|
||||
$b[]= 'd';
|
||||
|
||||
foreach ($a->arr as $k => $v) {
|
||||
echo "$k => $v\n";
|
||||
}
|
||||
|
||||
$a->arr[]='d';
|
||||
|
||||
foreach ($a->arr as $k => $v) {
|
||||
echo "$k => $v\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
0 => a
|
||||
1 => b
|
||||
2 => c
|
||||
3 => d
|
||||
0 => a
|
||||
1 => b
|
||||
2 => c
|
||||
3 => d
|
||||
4 => d
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0)
|
||||
--FILE--
|
||||
<?php
|
||||
$oldcwd = getcwd();
|
||||
chdir(dirname(__FILE__));
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
set_include_path(dirname(__FILE__).'/bug39542;.');
|
||||
} else {
|
||||
set_include_path(dirname(__FILE__).'/bug39542:.');
|
||||
}
|
||||
|
||||
function __autoload($class) {
|
||||
if (!require_once($class.'.php')) {
|
||||
error_log('Error: Autoload class: '.$class.' not found!');
|
||||
}
|
||||
}
|
||||
|
||||
new bug39542();
|
||||
|
||||
chdir($oldcwd);
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class bug39542 {
|
||||
function bug39542() {
|
||||
echo "ok\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -4,7 +4,6 @@ Bug #39602 (Invalid session.save_handler crashes PHP)
|
||||
<?php if (!extension_loaded("session")) die("skip"); ?>
|
||||
--INI--
|
||||
session.save_handler=qwerty
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("session.save_handler","files");
|
||||
@@ -13,3 +12,4 @@ echo "ok";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
Fatal error: Unknown: Cannot find save handler qwerty in Unknown on line 0
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #39990 (Cannot "foreach" over overloaded properties)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
public function __get($name) {
|
||||
return array('Hello', 'World');
|
||||
}
|
||||
}
|
||||
|
||||
$obj=new Foo();
|
||||
foreach($obj->arr as $value)
|
||||
echo "$value\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Hello
|
||||
World
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
function func1() { }
|
||||
function func2() { }
|
||||
function func3() { }
|
||||
function func4() { }
|
||||
function func5() { }
|
||||
function func6() { }
|
||||
function func7() { }
|
||||
print ("ok\n");
|
||||
?>
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40236 (php -a function allocation eats memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (php_sapi_name() != "cli") die("skip CLI only");
|
||||
if (extension_loaded("readline")) die("skip Test doesn't support readline");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$php = getenv('TEST_PHP_EXECUTABLE');
|
||||
$cmd = "\"$php\" -n -d memory_limit=4M -a \"".dirname(__FILE__)."\"/bug40236.inc";
|
||||
echo `$cmd`;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Interactive %s
|
||||
|
||||
ok
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40261 (Extremely slow data handling due to memory fragmentation)
|
||||
--INI--
|
||||
memory_limit=128M
|
||||
--FILE--
|
||||
<?php
|
||||
$num = 100000;
|
||||
|
||||
$a = Array();
|
||||
for ($i=0; $i<$num; $i++) {
|
||||
$a[$i] = Array(1);
|
||||
}
|
||||
|
||||
for ($i=0; $i<$num; $i++) {
|
||||
$b[$i] = $a[$i][0];
|
||||
}
|
||||
|
||||
unset($a);
|
||||
for ($i=0; $i<$num; $i++) {
|
||||
$b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40509 (key() function changed behaviour if global array is used within function)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo()
|
||||
{
|
||||
global $arr;
|
||||
|
||||
$c = $arr["v"];
|
||||
foreach ($c as $v) {}
|
||||
}
|
||||
|
||||
$arr["v"] = array("a");
|
||||
|
||||
var_dump(key($arr["v"]));
|
||||
foo();
|
||||
var_dump(key($arr["v"]));
|
||||
foreach ($arr["v"] as $k => $v) {
|
||||
var_dump($k);
|
||||
}
|
||||
var_dump(key($arr["v"]));
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
NULL
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40621 (Crash when constructor called inappropriately (statically))
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
private function __construct() { }
|
||||
function get() {
|
||||
self::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
Foo::get();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Non-static method Foo::get() should not be called statically in %s on line %d
|
||||
|
||||
Fatal error: Non-static method Foo::__construct() cannot be called statically in %s on line %d
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40705 (Iterating within function moves original array pointer)
|
||||
--FILE--
|
||||
<?php
|
||||
function doForeach($array)
|
||||
{
|
||||
foreach ($array as $k => $v) {
|
||||
// do stuff
|
||||
}
|
||||
}
|
||||
|
||||
$foo = array('foo', 'bar', 'baz');
|
||||
var_dump(key($foo));
|
||||
doForeach($foo);
|
||||
var_dump(key($foo));
|
||||
foreach ($foo as $k => $v) {
|
||||
var_dump($k);
|
||||
}
|
||||
var_dump(key($foo));
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(1)
|
||||
int(2)
|
||||
NULL
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40757 (get_object_vars() get nothing in child class)
|
||||
--FILE--
|
||||
<?php
|
||||
class Base {
|
||||
private $p1='sadf';
|
||||
|
||||
function getFields($obj){
|
||||
return get_object_vars($obj);
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Base { }
|
||||
|
||||
$base=new Base();
|
||||
print_r($base->getFields(new Base()));
|
||||
$child=new Child();
|
||||
print_r($child->getFields(new Base()));
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[p1] => sadf
|
||||
)
|
||||
Array
|
||||
(
|
||||
[p1] => sadf
|
||||
)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40770 (Apache child exits when PHP memory limit reached)
|
||||
--INI--
|
||||
memory_limit=8M
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('display_errors',true);
|
||||
$mb=148;
|
||||
$var = '';
|
||||
for ($i=0; $i<=$mb; $i++) {
|
||||
$var.= str_repeat('a',1*1024*1024);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Allowed memory size of 8388608 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40784 (Case sensivity in constructor's fallback)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function A () { echo "I'm A\n"; }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
parent::__constrUct();
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
I'm A
|
||||
I'm A
|
||||
Done
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40809 (Poor perfomance of ".=")
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
|
||||
$num_increments = 100;
|
||||
$num_repeats = 1000;
|
||||
$increment = 50;
|
||||
|
||||
/* Create some more holes to give the memory allocator something to
|
||||
* work with. */
|
||||
$num = 5000;
|
||||
$a = Array();
|
||||
for ($i=0; $i<$num; $i++) {
|
||||
$a[$i] = Array(1);
|
||||
}
|
||||
for ($i=0; $i<$num; $i++) {
|
||||
$b[$i] = $a[$i][0];
|
||||
}
|
||||
unset($a);
|
||||
|
||||
for ($i=0;$i<$num_repeats;$i++) {
|
||||
$evil = "";
|
||||
for ($j=0;$j<$num_increments;$j++) {
|
||||
$evil .= str_repeat("a", $increment);
|
||||
}
|
||||
unset($evil);
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40815 (using strings like "class::func" and static methods in set_exception_handler() might result in crash).
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ehandle{
|
||||
static public function exh ($ex) {
|
||||
echo 'foo';
|
||||
}
|
||||
}
|
||||
|
||||
set_exception_handler("ehandle::exh");
|
||||
|
||||
throw new Exception ("Whiii");
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
foo
|
||||
@@ -1,72 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40833 (Crash when using unset() on an ArrayAccess object retrieved via __get)
|
||||
--FILE--
|
||||
<?php
|
||||
class entity
|
||||
{
|
||||
private $data;
|
||||
private $modified;
|
||||
|
||||
function __get($name)
|
||||
{
|
||||
if ( isset($this->data[$name]) )
|
||||
return $this->data[$name];
|
||||
else
|
||||
return $this->data[$name] = new set($this);
|
||||
}
|
||||
|
||||
function __set($name, $value)
|
||||
{
|
||||
$this->modified[$name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
class set implements ArrayAccess
|
||||
{
|
||||
private $entity;
|
||||
|
||||
function __construct($entity)
|
||||
{
|
||||
$this->entity = $entity;
|
||||
$this->entity->whatever = $this;
|
||||
}
|
||||
|
||||
function clear() {
|
||||
$this->entity->whatever = null;
|
||||
}
|
||||
|
||||
function offsetUnset($offset)
|
||||
{
|
||||
$this->clear();
|
||||
// $this->entity->{$this->name} = null;
|
||||
}
|
||||
|
||||
function offsetSet($offset, $value)
|
||||
{
|
||||
}
|
||||
|
||||
function offsetGet($offset)
|
||||
{
|
||||
return 'Bogus ';
|
||||
}
|
||||
|
||||
function offsetExists($offset)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$entity = new entity();
|
||||
echo($entity->whatever[0]);
|
||||
|
||||
//This will crash
|
||||
// $entity->whatever->clear();
|
||||
unset($entity->whatever[0]);
|
||||
|
||||
//This will not crash (comment previous & uncomment this to test
|
||||
// $test = $entity->whatever; unset($test[0]);
|
||||
|
||||
echo($entity->whatever[0]);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Bogus Bogus ok
|
||||
Loaded 100 of 8220 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user