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 | |
|---|---|---|---|
|
|
f0d76cf928 |
No files matched your search
@@ -1,15 +1,16 @@
|
||||
set $zts = 0
|
||||
|
||||
define ____executor_globals
|
||||
if basic_functions_module.zts
|
||||
set $tsrm_ls = ts_resource_ex(0, 0)
|
||||
set $eg = ((zend_executor_globals) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
if $zts
|
||||
set $eg = ((zend_executor_globals) (*((void ***) tsrm_ls))[executor_globals_id-1])
|
||||
else
|
||||
set $eg = executor_globals
|
||||
end
|
||||
end
|
||||
|
||||
document ____executor_globals
|
||||
portable way of accessing executor_globals, set $eg
|
||||
ZTS detection is automatically based on ext/standard module struct
|
||||
portable way of accessing executor_globals
|
||||
type "set $zts = 1" if you use --enable-maintainer-zts on your configure line
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -39,41 +40,59 @@ define printzv
|
||||
end
|
||||
|
||||
document printzv
|
||||
prints zval contents
|
||||
prints content of zval
|
||||
end
|
||||
|
||||
define ____printzv_contents
|
||||
____executor_globals
|
||||
set $zvalue = $arg0
|
||||
set $type = $zvalue->type
|
||||
|
||||
printf "(refcount=%d", $zvalue->refcount
|
||||
if $zvalue->is_ref
|
||||
printf ",is_ref"
|
||||
if $zvalue.type == 0
|
||||
set $typename = "NULL"
|
||||
end
|
||||
printf ") "
|
||||
if $type == 0
|
||||
printf "NULL"
|
||||
if $zvalue.type == 1
|
||||
set $typename = "long"
|
||||
end
|
||||
if $type == 1
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
if $zvalue.type == 2
|
||||
set $typename = "double"
|
||||
end
|
||||
if $type == 2
|
||||
printf "double: %lf", $zvalue->value.dval
|
||||
if $zvalue.type == 3
|
||||
set $typename = "string"
|
||||
end
|
||||
if $type == 3
|
||||
printf "bool: "
|
||||
if $zvalue->value.lval
|
||||
printf "true"
|
||||
else
|
||||
printf "false"
|
||||
end
|
||||
if $zvalue.type == 4
|
||||
set $typename = "array"
|
||||
end
|
||||
if $type == 4
|
||||
printf "array(%d): ", $zvalue->value.ht->nNumOfElements
|
||||
if $zvalue.type == 5
|
||||
set $typename = "object"
|
||||
end
|
||||
if $zvalue.type == 6
|
||||
set $typename = "bool"
|
||||
end
|
||||
if $zvalue.type == 7
|
||||
set $typename = "resource"
|
||||
end
|
||||
if $zvalue.type == 8
|
||||
set $typename = "constant"
|
||||
end
|
||||
if $zvalue.type == 9
|
||||
set $typename = "const_array"
|
||||
end
|
||||
|
||||
printf "(refcount=%d) %s: ", $zvalue.refcount, $typename
|
||||
if $zvalue.type == 1
|
||||
printf "%ld", $zvalue.value.lval
|
||||
end
|
||||
if $zvalue->type == 2
|
||||
printf "%lf", $zvalue.value.dval
|
||||
end
|
||||
if $zvalue.type == 3
|
||||
printf "\"%s\"(%d)", $zvalue.value.str.val, $zvalue.value.str.len
|
||||
end
|
||||
if $zvalue.type == 4
|
||||
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
|
||||
@@ -82,61 +101,34 @@ define ____printzv_contents
|
||||
end
|
||||
printf "}"
|
||||
end
|
||||
set $type = 0
|
||||
end
|
||||
if $type == 5
|
||||
printf "object"
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
if basic_functions_module.zts
|
||||
set $zobj = zend_objects_get_address($zvalue, $tsrm_ls)
|
||||
else
|
||||
set $zobj = zend_objects_get_address($zvalue)
|
||||
end
|
||||
if $handlers->get_class_entry == &zend_std_object_get_class
|
||||
set $cname = $zobj->ce.name
|
||||
else
|
||||
set $cname = "Unknown"
|
||||
end
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if $zvalue.type == 5
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
set $ht = $zobj->properties
|
||||
if $ht
|
||||
printf "(%d): ", $ht->nNumOfElements
|
||||
printf "{\n"
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
set $ind = $ind - 1
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
printf "}"
|
||||
else
|
||||
echo "no properties found"
|
||||
end
|
||||
printf "(prop examination disabled due to a gdb bug)"
|
||||
if $zvalue.value.obj.handlers->get_properties
|
||||
# set $ht = $zvalue->value.obj.handlers->get_properties($zvalue)
|
||||
# printf "{\n"
|
||||
# set $ind = $ind + 1
|
||||
# ____print_ht $ht
|
||||
# set $ind = $ind - 1
|
||||
# set $i = $ind
|
||||
# while $i > 0
|
||||
# printf " "
|
||||
# set $i = $i - 1
|
||||
# end
|
||||
# printf "}"
|
||||
end
|
||||
end
|
||||
set $type = 0
|
||||
end
|
||||
if $type == 6
|
||||
printf "string(%d): ", $zvalue->value.str.len
|
||||
____print_str $zvalue->value.str.val $zvalue->value.str.len
|
||||
if $zvalue.type == 6
|
||||
if $zvalue.value.lval
|
||||
printf "true"
|
||||
else
|
||||
printf "false"
|
||||
end
|
||||
end
|
||||
if $type == 7
|
||||
printf "resource: #%d", $zvalue->value.lval
|
||||
end
|
||||
if $type == 8
|
||||
printf "constant"
|
||||
end
|
||||
if $type == 9
|
||||
printf "const_array"
|
||||
end
|
||||
if $type > 9
|
||||
printf "unknown type %d", $type
|
||||
if $zvalue.type == 7
|
||||
printf "#%d", $zvalue.value.lval
|
||||
end
|
||||
printf "\n"
|
||||
end
|
||||
@@ -151,7 +143,7 @@ define ____printzv
|
||||
printf "*uninitialized* "
|
||||
end
|
||||
|
||||
set $zcontents = (zval*) $zvalue
|
||||
set $zcontents = *(struct _zval_struct *) $zvalue
|
||||
if $arg1
|
||||
____printzv_contents $zcontents $arg1
|
||||
else
|
||||
@@ -164,7 +156,7 @@ define ____print_const_table
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $const = (zend_constant *) $p->pData
|
||||
set $const = *(zend_constant *) $p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
@@ -172,14 +164,13 @@ define ____print_const_table
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", $p->arKey
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
____printzv_contents &$const->value 0
|
||||
____printzv_contents $const.value 0
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
@@ -192,34 +183,25 @@ define print_const_table
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $zval = *(struct _zval_struct **)$p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", $p->arKey
|
||||
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
|
||||
@@ -227,7 +209,7 @@ end
|
||||
define print_ht
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 1
|
||||
____print_ht $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
@@ -235,171 +217,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
|
||||
|
||||
while $p != 0
|
||||
set $func = (zend_function*)$p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
printf "\"%s\"\n", $func->common.function_name
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
|
||||
define print_ft
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ft $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_ft
|
||||
dumps a function table (HashTable)
|
||||
end
|
||||
|
||||
define ____print_inh_class
|
||||
set $ce = $arg0
|
||||
if $ce->ce_flags & 0x10 || $ce->ce_flags & 0x20
|
||||
printf "abstract "
|
||||
else
|
||||
if $ce->ce_flags & 0x40
|
||||
printf "final "
|
||||
end
|
||||
end
|
||||
printf "class %s", $ce->name
|
||||
if $ce->parent != 0
|
||||
printf " extends %s", $ce->parent->name
|
||||
end
|
||||
if $ce->num_interfaces != 0
|
||||
printf " implements"
|
||||
set $tmp = 0
|
||||
while $tmp < $ce->num_interfaces
|
||||
printf " %s", $ce->interfaces[$tmp]->name
|
||||
set $tmp = $tmp + 1
|
||||
if $tmp < $ce->num_interfaces
|
||||
printf ","
|
||||
end
|
||||
end
|
||||
end
|
||||
set $ce = $ce->parent
|
||||
end
|
||||
|
||||
define ____print_inh_iface
|
||||
set $ce = $arg0
|
||||
printf "interface %s", $ce->name
|
||||
if $ce->num_interfaces != 0
|
||||
set $ce = $ce->interfaces[0]
|
||||
printf " extends %s", $ce->name
|
||||
else
|
||||
set $ce = 0
|
||||
end
|
||||
end
|
||||
|
||||
define print_inh
|
||||
set $ce = $arg0
|
||||
set $depth = 0
|
||||
while $ce != 0
|
||||
set $tmp = $depth
|
||||
while $tmp != 0
|
||||
printf " "
|
||||
set $tmp = $tmp - 1
|
||||
end
|
||||
set $depth = $depth + 1
|
||||
if $ce->ce_flags & 0x80
|
||||
____print_inh_iface $ce
|
||||
else
|
||||
____print_inh_class $ce
|
||||
end
|
||||
printf " {\n"
|
||||
end
|
||||
while $depth != 0
|
||||
set $tmp = $depth
|
||||
while $tmp != 1
|
||||
printf " "
|
||||
set $tmp = $tmp - 1
|
||||
end
|
||||
printf "}\n"
|
||||
set $depth = $depth - 1
|
||||
end
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
printf "[0x%08x] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
else
|
||||
if $pi->flags & 0x200
|
||||
printf "ZEND_ACC_PROTECTED"
|
||||
else
|
||||
if $pi->flags & 0x400
|
||||
printf "ZEND_ACC_PRIVATE"
|
||||
else
|
||||
if $pi->flags & 0x800
|
||||
printf "ZEND_ACC_CHANGED"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
printf "\""
|
||||
while $tmp < $arg1
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
end
|
||||
set $tmp = $tmp + 1
|
||||
end
|
||||
printf "\""
|
||||
end
|
||||
|
||||
define printzn
|
||||
____executor_globals
|
||||
set $ind = 0
|
||||
|
||||
+1
-7
@@ -207,12 +207,6 @@ Syntax and indentation
|
||||
indent preprocessor directives you should put the # at the beginning
|
||||
of a line, followed by any number of whitespace.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
[1] Extensions should be well tested using *.phpt tests. Read about that
|
||||
in README.TESTING.
|
||||
|
||||
Documentation and Folding Hooks
|
||||
-------------------------------
|
||||
|
||||
@@ -256,7 +250,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.
|
||||
|
||||
+110
-102
@@ -68,6 +68,11 @@ PRIMARY MAINTAINER: Alex Leigh <aleigh@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: date
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: embed
|
||||
PRIMARY MAINTAINER: Edin Kadribasic <edink@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -127,14 +132,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
|
||||
@@ -169,53 +192,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: Unknown
|
||||
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>
|
||||
@@ -250,7 +234,7 @@ STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: simplexml
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
@@ -258,11 +242,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 +254,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 +272,7 @@ SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bcmath
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bz2
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
@@ -317,6 +291,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
|
||||
@@ -328,30 +307,33 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: date
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
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
|
||||
@@ -452,11 +464,6 @@ PRIMARY MAINTAINER: Kristian K
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: reflection
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -465,7 +472,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 +483,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 +494,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 - 2006 The PHP Group. All rights reserved.
|
||||
The PHP License, Version 3.0
|
||||
Copyright (c) 1999 - 2005 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -38,8 +38,8 @@ are met:
|
||||
|
||||
6. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment:
|
||||
"This product includes PHP software, freely available from
|
||||
<http://www.php.net/software/>".
|
||||
"This product includes PHP, freely available from
|
||||
<http://www.php.net/>".
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
|
||||
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
@@ -64,5 +64,5 @@ The PHP Group can be contacted via Email at group@php.net.
|
||||
For more information on the PHP Group and the PHP project,
|
||||
please see <http://www.php.net>.
|
||||
|
||||
PHP includes the Zend Engine, freely available at
|
||||
This product includes the Zend Engine, freely available at
|
||||
<http://www.zend.com>.
|
||||
+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
|
||||
+2
-8
@@ -29,7 +29,7 @@ php_lcov.info: lcov-test
|
||||
@rm -rf lcov_data/
|
||||
@$(mkinstalldirs) lcov_data/
|
||||
@echo
|
||||
-@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
|
||||
-@find . -name \*.gcda -o -name \*.gcno -o -name \*.da | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
dir=lcov_data/`dirname $$x`; \
|
||||
@@ -37,9 +37,6 @@ php_lcov.info: lcov-test
|
||||
if test -f "$(top_srcdir)/$$y.c"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
|
||||
fi; \
|
||||
if test -f "$(top_srcdir)/$$y.h"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
|
||||
fi; \
|
||||
if test -f "$(top_srcdir)/$$y.re"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
|
||||
fi; \
|
||||
@@ -49,9 +46,6 @@ php_lcov.info: lcov-test
|
||||
if test -f "$(top_srcdir)/$$y.l"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
|
||||
fi; \
|
||||
if test -f "$(top_srcdir)/$$y"; then \
|
||||
ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
|
||||
fi; \
|
||||
if test -f "$(top_builddir)/$$y.c"; then \
|
||||
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
|
||||
fi; \
|
||||
@@ -67,7 +61,7 @@ php_lcov.info: lcov-test
|
||||
|
||||
lcov-html: php_lcov.info
|
||||
@echo "Generating lcov HTML"
|
||||
@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
|
||||
@$(LTP_GENHTML) --legend --no-prefix --output-directory lcov_html/ --title "PHP Code Coverage" --show-details php_lcov.info
|
||||
|
||||
lcov-clean:
|
||||
rm -f php_lcov.info
|
||||
|
||||
+17
-62
@@ -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)
|
||||
|
||||
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_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_SUFFIX_NAME).$$i; then \
|
||||
$(LN_S) $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME); \
|
||||
break; \
|
||||
fi; \
|
||||
done; \
|
||||
@@ -44,13 +44,13 @@ install-modules: build-modules
|
||||
|
||||
install-headers:
|
||||
-@if test "$(INSTALL_HEADERS)"; then \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
for i in $(INSTALL_HEADERS); do \
|
||||
i=`$(top_srcdir)/build/shtool path -d $$i`; \
|
||||
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
|
||||
done; \
|
||||
$(mkinstalldirs) $$paths && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
for i in $(INSTALL_HEADERS); do \
|
||||
if test "$(PHP_PECL_EXTENSION)"; then \
|
||||
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
|
||||
else \
|
||||
@@ -66,78 +66,33 @@ 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 "$(PHP_MODULES)"; then \
|
||||
for i in $(PHP_MODULES); do \
|
||||
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
|
||||
done; \
|
||||
fi`
|
||||
|
||||
test: all
|
||||
test: all
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -U -d extension_dir=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 \
|
||||
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -U -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
utest: all
|
||||
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -u -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
ntest: all
|
||||
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -N -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
$(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 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
|
||||
|
||||
|
||||
+5
-15
@@ -29,20 +29,14 @@ Having said that, here are the organizational rules:
|
||||
5. If you don't know how to do something, ask first!
|
||||
|
||||
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:
|
||||
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 This branch is closed.
|
||||
PHP_5_1 Is used to release the PHP 5.1.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
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.
|
||||
on this branch.
|
||||
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
@@ -98,13 +92,9 @@ For string.c:
|
||||
|
||||
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:
|
||||
|
||||
|
||||
@@ -31,17 +31,14 @@ resources cannot be auto-converted.
|
||||
|
||||
Type specifiers
|
||||
---------------
|
||||
a - array
|
||||
b - boolean, stored in zend_bool
|
||||
d - double
|
||||
f - function or array containing php method call info (returned as
|
||||
zend_fcall_info* and zend_fcall_info_cache*)
|
||||
h - array (returned as HashTable*)
|
||||
l - long
|
||||
d - double
|
||||
s - string (with possible null bytes) and its length
|
||||
b - boolean, stored in zend_bool
|
||||
r - resource (stored in zval)
|
||||
a - array
|
||||
o - object (of any type)
|
||||
O - object (of specific type, specified by class entry)
|
||||
r - resource (stored in zval)
|
||||
s - string (with possible null bytes) and its length
|
||||
z - the actual zval
|
||||
|
||||
The following characters also have a meaning in the specifier string:
|
||||
@@ -51,8 +48,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
|
||||
--------
|
||||
|
||||
-1022
File diff suppressed because it is too large.
Load diff
+1
-4
@@ -10,10 +10,7 @@ The Input Filter support in PHP 5 is aimed at providing the framework
|
||||
through which a company-wide or site-wide security policy can be
|
||||
enforced. It is implemented as a SAPI hook and is called from the
|
||||
treat_data and post handler functions. To implement your own security
|
||||
policy you will need to write a standard PHP extension. There is also
|
||||
a powerful standard implementation in ext/filter that should suit most
|
||||
peoples' needs. However, if you want to implement your own security
|
||||
policy, read on.
|
||||
policy you will need to write a standard PHP extension.
|
||||
|
||||
A simple implementation might look like the following. This stores the
|
||||
original raw user data and adds a my_get_raw() function while the normal
|
||||
|
||||
@@ -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
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 1999-2006, Andi Gutmans, Sascha Schumann, Zeev Suraski.
|
||||
Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-47
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999, 2000, 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 |
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -480,52 +480,6 @@ void ts_free_thread(void)
|
||||
}
|
||||
|
||||
|
||||
/* frees all resources allocated for all threads except current */
|
||||
void ts_free_worker_threads(void)
|
||||
{
|
||||
tsrm_tls_entry *thread_resources;
|
||||
int i;
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
int hash_value;
|
||||
tsrm_tls_entry *last=NULL;
|
||||
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
|
||||
thread_resources = tsrm_tls_table[hash_value];
|
||||
|
||||
while (thread_resources) {
|
||||
if (thread_resources->thread_id != thread_id) {
|
||||
for (i=0; i<thread_resources->count; i++) {
|
||||
if (resource_types_table[i].dtor) {
|
||||
resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
|
||||
}
|
||||
}
|
||||
for (i=0; i<thread_resources->count; i++) {
|
||||
free(thread_resources->storage[i]);
|
||||
}
|
||||
free(thread_resources->storage);
|
||||
if (last) {
|
||||
last->next = thread_resources->next;
|
||||
} else {
|
||||
tsrm_tls_table[hash_value] = thread_resources->next;
|
||||
}
|
||||
free(thread_resources);
|
||||
if (last) {
|
||||
thread_resources = last->next;
|
||||
} else {
|
||||
thread_resources = tsrm_tls_table[hash_value];
|
||||
}
|
||||
} else {
|
||||
if (thread_resources->next) {
|
||||
last = thread_resources;
|
||||
}
|
||||
thread_resources = thread_resources->next;
|
||||
}
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}
|
||||
|
||||
|
||||
/* deallocates all occurrences of a given id */
|
||||
void ts_free_id(ts_rsrc_id id)
|
||||
{
|
||||
|
||||
+7
-15
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999, 2000, 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
|
||||
|
||||
@@ -111,9 +106,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
|
||||
/* frees all resources allocated for the current thread */
|
||||
TSRM_API void ts_free_thread(void);
|
||||
|
||||
/* frees all resources allocated for all threads except current */
|
||||
void ts_free_worker_threads(void);
|
||||
|
||||
/* deallocates all occurrences of a given id */
|
||||
TSRM_API void ts_free_id(ts_rsrc_id id);
|
||||
|
||||
|
||||
+5
-8
@@ -7,15 +7,11 @@
|
||||
* on Windows 95/NT.
|
||||
*/
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <direct.h>
|
||||
|
||||
|
||||
/* struct dirent - same as Unix */
|
||||
|
||||
@@ -29,10 +25,10 @@ struct dirent {
|
||||
|
||||
/* typedef DIR - not the same as Unix */
|
||||
typedef struct {
|
||||
HANDLE handle; /* _findfirst/_findnext handle */
|
||||
long handle; /* _findfirst/_findnext handle */
|
||||
short offset; /* offset into directory */
|
||||
short finished; /* 1 if there are not more files */
|
||||
WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
|
||||
struct _finddata_t fileinfo; /* from _findfirst/_findnext */
|
||||
char *dir; /* the dir we are reading */
|
||||
struct dirent dent; /* the dirent to return */
|
||||
} DIR;
|
||||
@@ -42,6 +38,7 @@ DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *, struct dirent *, struct dirent **);
|
||||
int closedir(DIR *);
|
||||
int rewinddir(DIR *);
|
||||
void rewinddir(DIR *);
|
||||
|
||||
|
||||
#endif /* READDIR_H */
|
||||
@@ -68,6 +68,7 @@ AC_DEFUN([TSRM_CHECK_ST],[
|
||||
])
|
||||
|
||||
sinclude(threads.m4)
|
||||
sinclude(TSRM/threads.m4)
|
||||
|
||||
AC_DEFUN([TSRM_CHECK_PTHREADS],[
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
|
||||
+220
-441
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -35,6 +35,11 @@
|
||||
#ifdef TSRM_WIN32
|
||||
#include <io.h>
|
||||
#include "tsrm_win32.h"
|
||||
# if HAVE_NEWAPIS_H
|
||||
# define WANT_GETLONGPATHNAME_WRAPPER
|
||||
# define COMPILE_NEWAPIS_STUBS
|
||||
# include <NewAPIs.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
@@ -135,93 +140,11 @@ static int php_check_dots(const char *element, int n)
|
||||
#define CWD_STATE_FREE(s) \
|
||||
free((s)->cwd);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
CWD_API int php_sys_stat(const char *path, struct stat *buf)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA data;
|
||||
__int64 t;
|
||||
|
||||
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
|
||||
return stat(path, buf);
|
||||
}
|
||||
|
||||
if (path[1] == ':') {
|
||||
if (path[0] >= 'A' && path[0] <= 'Z') {
|
||||
buf->st_dev = buf->st_rdev = path[0] - 'A';
|
||||
} else {
|
||||
buf->st_dev = buf->st_rdev = path[0] - 'a';
|
||||
}
|
||||
} else {
|
||||
char cur_path[MAXPATHLEN+1];
|
||||
DWORD len = sizeof(cur_path);
|
||||
char *tmp = cur_path;
|
||||
|
||||
while(1) {
|
||||
DWORD r = GetCurrentDirectory(len, tmp);
|
||||
if (r < len) {
|
||||
if (tmp[1] == ':') {
|
||||
if (path[0] >= 'A' && path[0] <= 'Z') {
|
||||
buf->st_dev = buf->st_rdev = path[0] - 'A';
|
||||
} else {
|
||||
buf->st_dev = buf->st_rdev = path[0] - 'a';
|
||||
}
|
||||
} else {
|
||||
buf->st_dev = buf->st_rdev = -1;
|
||||
}
|
||||
break;
|
||||
} else if (!r) {
|
||||
buf->st_dev = buf->st_rdev = -1;
|
||||
break;
|
||||
} else {
|
||||
len = r+1;
|
||||
tmp = (char*)malloc(len);
|
||||
}
|
||||
}
|
||||
if (tmp != cur_path) {
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
buf->st_uid = buf->st_gid = buf->st_ino = 0;
|
||||
buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
|
||||
buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
|
||||
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
||||
int len = strlen(path);
|
||||
|
||||
if (path[len-4] == '.') {
|
||||
if (_memicmp(path+len-3, "exe", 3) == 0 ||
|
||||
_memicmp(path+len-3, "com", 3) == 0 ||
|
||||
_memicmp(path+len-3, "bat", 3) == 0 ||
|
||||
_memicmp(path+len-3, "cmd", 3) == 0) {
|
||||
buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6));
|
||||
}
|
||||
}
|
||||
}
|
||||
buf->st_nlink = 1;
|
||||
t = data.nFileSizeHigh;
|
||||
t = t << 32;
|
||||
t |= data.nFileSizeLow;
|
||||
buf->st_size = t;
|
||||
t = data.ftLastAccessTime.dwHighDateTime;
|
||||
t = t << 32;
|
||||
t |= data.ftLastAccessTime.dwLowDateTime;
|
||||
buf->st_atime = (unsigned long)((t / 10000000) - 11644473600);
|
||||
t = data.ftCreationTime.dwHighDateTime;
|
||||
t = t << 32;
|
||||
t |= data.ftCreationTime.dwLowDateTime;
|
||||
buf->st_ctime = (unsigned long)((t / 10000000) - 11644473600);
|
||||
t = data.ftLastWriteTime.dwHighDateTime;
|
||||
t = t << 32;
|
||||
t |= data.ftLastWriteTime.dwLowDateTime;
|
||||
buf->st_mtime = (unsigned long)((t / 10000000) - 11644473600);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int php_is_dir_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
@@ -231,7 +154,7 @@ static int php_is_file_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
@@ -240,16 +163,31 @@ static int php_is_file_ok(const cwd_state *state)
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
|
||||
{
|
||||
CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state);
|
||||
#ifdef REALPATH_CACHE
|
||||
cwd_globals->realpath_cache_size = 0;
|
||||
cwd_globals->realpath_cache_size_limit = REALPATH_CACHE_SIZE;
|
||||
cwd_globals->realpath_cache_ttl = REALPATH_CACHE_TTL;
|
||||
memset(cwd_globals->realpath_cache, 0, sizeof(cwd_globals->realpath_cache));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
|
||||
{
|
||||
CWD_STATE_FREE(&cwd_globals->cwd);
|
||||
realpath_cache_clean(TSRMLS_C);
|
||||
#ifdef REALPATH_CACHE
|
||||
{
|
||||
int i;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static char *tsrm_strndup(const char *s, size_t length)
|
||||
@@ -370,53 +308,17 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC)
|
||||
return buf;
|
||||
}
|
||||
|
||||
#ifdef REALPATH_CACHE
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
const char *e = path + path_len;
|
||||
for (h = 2166136261U; path < e; ) {
|
||||
h *= 16777619;
|
||||
h ^= *path++;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC)
|
||||
@@ -437,7 +339,7 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,18 +352,19 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
while (*bucket != NULL) {
|
||||
if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) {
|
||||
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);
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
free(r);
|
||||
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
return *bucket;
|
||||
} else {
|
||||
bucket = &(*bucket)->next;
|
||||
*bucket = (*bucket)->next;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Resolve path relatively to state and put the real path into state */
|
||||
@@ -469,57 +372,48 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
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);
|
||||
char *ptr, *path_copy;
|
||||
char *tok = NULL;
|
||||
int ptr_length;
|
||||
cwd_state old_state;
|
||||
int ret = 0;
|
||||
int copy_amount = -1;
|
||||
char *free_path;
|
||||
unsigned char is_absolute = 0;
|
||||
#ifndef TSRM_WIN32
|
||||
char resolved_path[MAXPATHLEN];
|
||||
#else
|
||||
char *new_path;
|
||||
#endif
|
||||
#ifdef REALPATH_CACHE
|
||||
char orig_path[MAXPATHLEN];
|
||||
int orig_path_len;
|
||||
realpath_cache_bucket *bucket;
|
||||
time_t t = 0;
|
||||
int ret;
|
||||
int use_cache;
|
||||
int use_relative_path = 0;
|
||||
time_t t;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
use_cache = ((use_realpath != CWD_EXPAND) && CWDG(realpath_cache_size_limit));
|
||||
#endif
|
||||
|
||||
if (path_length == 0)
|
||||
return (1);
|
||||
return (0);
|
||||
if (path_length >= MAXPATHLEN)
|
||||
return (1);
|
||||
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
|
||||
#endif
|
||||
|
||||
/* 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;
|
||||
#ifdef REALPATH_CACHE
|
||||
if (use_realpath && CWDG(realpath_cache_size_limit)) {
|
||||
if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) {
|
||||
memcpy(orig_path, path, path_length+1);
|
||||
orig_path_len = path_length;
|
||||
} else {
|
||||
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;
|
||||
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;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_cache) {
|
||||
t = CWDG(realpath_cache_ttl)?time(0):0;
|
||||
if ((bucket = realpath_cache_find(path, path_length, t TSRMLS_CC)) != NULL) {
|
||||
t = CWDG(realpath_cache_ttl)?time(NULL):0;
|
||||
if ((bucket = realpath_cache_find(orig_path, orig_path_len, t TSRMLS_CC)) != NULL) {
|
||||
int len = bucket->realpath_len;
|
||||
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
@@ -536,72 +430,107 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (use_realpath != CWD_EXPAND) {
|
||||
#endif
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
char resolved_path[MAXPATHLEN];
|
||||
|
||||
if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
|
||||
if (use_realpath == CWD_REALPATH) {
|
||||
return 1;
|
||||
/* 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) || (state->cwd_length < 1)) {
|
||||
if (use_realpath) {
|
||||
if (realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
} else {
|
||||
/* disable for now
|
||||
return 1; */
|
||||
}
|
||||
goto no_realpath;
|
||||
}
|
||||
use_realpath = CWD_REALPATH;
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
} else { /* Concat current directory with relative path and then run realpath() on it */
|
||||
char *tmp;
|
||||
char *ptr;
|
||||
|
||||
state->cwd_length = strlen(resolved_path);
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1);
|
||||
memcpy(state->cwd, resolved_path, state->cwd_length+1);
|
||||
#else
|
||||
goto no_realpath;
|
||||
#endif
|
||||
} else {
|
||||
char *ptr, *path_copy, *free_path;
|
||||
char *tok;
|
||||
int ptr_length;
|
||||
#ifdef TSRM_WIN32
|
||||
int is_unc;
|
||||
#endif
|
||||
no_realpath:
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
if (memchr(path, '*', path_length) ||
|
||||
memchr(path, '?', path_length)) {
|
||||
ptr = tmp = (char *) malloc(state->cwd_length+path_length+sizeof("/"));
|
||||
if (!tmp) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
free_path = path_copy = tsrm_strndup(path, path_length);
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
ret = 0;
|
||||
is_unc = 0;
|
||||
if (path_length >= 2 && path[1] == ':') {
|
||||
state->cwd = (char *) realloc(state->cwd, 2 + 1);
|
||||
state->cwd[0] = toupper(path[0]);
|
||||
state->cwd[1] = ':';
|
||||
state->cwd[2] = '\0';
|
||||
state->cwd_length = 2;
|
||||
path_copy += 2;
|
||||
} else if (IS_UNC_PATH(path, path_length)) {
|
||||
state->cwd = (char *) realloc(state->cwd, 1 + 1);
|
||||
state->cwd[0] = DEFAULT_SLASH;
|
||||
state->cwd[1] = '\0';
|
||||
state->cwd_length = 1;
|
||||
path_copy += 2;
|
||||
is_unc = 2;
|
||||
} else {
|
||||
#endif
|
||||
state->cwd = (char *) realloc(state->cwd, 1);
|
||||
state->cwd[0] = '\0';
|
||||
state->cwd_length = 0;
|
||||
#ifdef TSRM_WIN32
|
||||
memcpy(ptr, state->cwd, state->cwd_length);
|
||||
ptr += state->cwd_length;
|
||||
*ptr++ = DEFAULT_SLASH;
|
||||
memcpy(ptr, path, path_length);
|
||||
ptr += path_length;
|
||||
*ptr = '\0';
|
||||
if (strlen(tmp) >= MAXPATHLEN) {
|
||||
free(tmp);
|
||||
return 1;
|
||||
}
|
||||
if (use_realpath) {
|
||||
if (realpath(tmp, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
} else {
|
||||
/* disable for now
|
||||
free(tmp);
|
||||
return 1; */
|
||||
}
|
||||
}
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
#if defined(TSRM_WIN32)
|
||||
{
|
||||
int new_path_length;
|
||||
|
||||
new_path_length = GetLongPathName(path, NULL, 0) + 1;
|
||||
if (new_path_length == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* GetLongPathName already counts the \0 */
|
||||
new_path = (char *) malloc(new_path_length);
|
||||
if (!new_path) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
tok = NULL;
|
||||
if (GetLongPathName(path, new_path, new_path_length) != 0) {
|
||||
path = new_path;
|
||||
path_length = new_path_length;
|
||||
} else {
|
||||
free(new_path);
|
||||
new_path = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
free_path = path_copy = tsrm_strndup(path, path_length);
|
||||
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
|
||||
#endif
|
||||
if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
|
||||
copy_amount = COPY_WHEN_ABSOLUTE(path_copy);
|
||||
is_absolute = 1;
|
||||
#ifdef TSRM_WIN32
|
||||
} else if (IS_SLASH(path_copy[0])) {
|
||||
copy_amount = 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (copy_amount != -1) {
|
||||
state->cwd = (char *) realloc(state->cwd, copy_amount + 1);
|
||||
if (copy_amount) {
|
||||
if (is_absolute) {
|
||||
memcpy(state->cwd, path_copy, copy_amount);
|
||||
path_copy += copy_amount;
|
||||
} else {
|
||||
memcpy(state->cwd, old_state.cwd, copy_amount);
|
||||
}
|
||||
}
|
||||
state->cwd[copy_amount] = '\0';
|
||||
state->cwd_length = copy_amount;
|
||||
}
|
||||
|
||||
|
||||
if (state->cwd_length > 0 || IS_ABSOLUTE_PATH(path, path_length)) {
|
||||
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
|
||||
while (ptr) {
|
||||
ptr_length = strlen(ptr);
|
||||
@@ -609,12 +538,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]
|
||||
@@ -634,88 +557,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[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) {
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
|
||||
if ((hFind = FindFirstFile(state->cwd, &data)) != INVALID_HANDLE_VALUE) {
|
||||
int length = strlen(data.cFileName);
|
||||
|
||||
if (length != ptr_length) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+length+1);
|
||||
}
|
||||
memcpy(&state->cwd[state->cwd_length], data.cFileName, length+1);
|
||||
ptr_length = length;
|
||||
FindClose(hFind);
|
||||
ret = 0;
|
||||
} else if (use_realpath == CWD_REALPATH) {
|
||||
if (is_unc) {
|
||||
/* skip share name */
|
||||
is_unc--;
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
state->cwd_length += ptr_length;
|
||||
}
|
||||
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
|
||||
}
|
||||
#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 ((use_realpath == CWD_REALPATH) && ret) {
|
||||
CWD_STATE_FREE(state);
|
||||
*state = old_state;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
|
||||
@@ -723,11 +595,24 @@ no_realpath:
|
||||
state->cwd[state->cwd_length+1] = '\0';
|
||||
state->cwd_length++;
|
||||
}
|
||||
} else {
|
||||
state->cwd = (char *) realloc(state->cwd, path_length+1);
|
||||
memcpy(state->cwd, path, path_length+1);
|
||||
state->cwd_length = path_length;
|
||||
}
|
||||
|
||||
if (use_cache && (use_realpath == CWD_REALPATH)) {
|
||||
realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC);
|
||||
#ifdef TSRM_WIN32
|
||||
if (new_path) {
|
||||
free(new_path);
|
||||
}
|
||||
#endif
|
||||
free(free_path);
|
||||
|
||||
#ifdef REALPATH_CACHE
|
||||
if (use_realpath && CWDG(realpath_cache_size_limit)) {
|
||||
realpath_cache_add(orig_path, orig_path_len, state->cwd, state->cwd_length, t TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (verify_path && verify_path(state)) {
|
||||
CWD_STATE_FREE(state);
|
||||
@@ -746,7 +631,7 @@ no_realpath:
|
||||
|
||||
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;
|
||||
return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, 1)?-1:0;
|
||||
}
|
||||
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC)
|
||||
@@ -785,25 +670,10 @@ 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) {
|
||||
if (virtual_file_ex(&new_state, path, NULL, 1)==0) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
|
||||
memcpy(real_path, new_state.cwd, len);
|
||||
@@ -824,7 +694,7 @@ CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_f
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH);
|
||||
retval = virtual_file_ex(&new_state, path, verify_path, 1);
|
||||
|
||||
*filepath = new_state.cwd;
|
||||
|
||||
@@ -847,10 +717,7 @@ 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;
|
||||
}
|
||||
virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
f = fopen(new_state.cwd, mode);
|
||||
|
||||
@@ -864,10 +731,7 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, pathname, NULL, 1);
|
||||
|
||||
#if defined(TSRM_WIN32)
|
||||
ret = tsrm_win32_access(new_state.cwd, mode);
|
||||
@@ -888,10 +752,7 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, filename, NULL, 0);
|
||||
|
||||
ret = utime(new_state.cwd, buf);
|
||||
|
||||
@@ -906,10 +767,7 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, filename, NULL, 1);
|
||||
|
||||
ret = chmod(new_state.cwd, mode);
|
||||
|
||||
@@ -918,26 +776,15 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
|
||||
}
|
||||
|
||||
#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 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;
|
||||
}
|
||||
virtual_file_ex(&new_state, filename, NULL, 0);
|
||||
|
||||
if (link) {
|
||||
#if HAVE_LCHOWN
|
||||
ret = lchown(new_state.cwd, owner, group);
|
||||
#else
|
||||
ret = -1;
|
||||
#endif
|
||||
} else {
|
||||
ret = chown(new_state.cwd, owner, group);
|
||||
}
|
||||
ret = chown(new_state.cwd, owner, group);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
@@ -950,10 +797,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
if (flags & O_CREAT) {
|
||||
mode_t mode;
|
||||
@@ -977,10 +821,7 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
f = creat(new_state.cwd, mode);
|
||||
|
||||
@@ -995,18 +836,11 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&old_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) {
|
||||
CWD_STATE_FREE(&old_state);
|
||||
return -1;
|
||||
}
|
||||
virtual_file_ex(&old_state, oldname, NULL, 0);
|
||||
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);
|
||||
return -1;
|
||||
}
|
||||
virtual_file_ex(&new_state, newname, NULL, 0);
|
||||
newname = new_state.cwd;
|
||||
|
||||
retval = rename(oldname, newname);
|
||||
@@ -1023,12 +857,11 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
|
||||
CWD_STATE_FREE(&new_state);
|
||||
if (virtual_file_ex(&new_state, path, NULL, 1)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = php_sys_stat(new_state.cwd, buf);
|
||||
retval = stat(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
@@ -1041,10 +874,7 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, path, NULL, 0);
|
||||
|
||||
retval = lstat(new_state.cwd, buf);
|
||||
|
||||
@@ -1059,10 +889,7 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, path, NULL, 0);
|
||||
|
||||
retval = unlink(new_state.cwd);
|
||||
|
||||
@@ -1076,10 +903,7 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, pathname, NULL, 1);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
retval = mkdir(new_state.cwd);
|
||||
@@ -1096,10 +920,7 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, pathname, NULL, 0);
|
||||
|
||||
retval = rmdir(new_state.cwd);
|
||||
|
||||
@@ -1117,10 +938,7 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC)
|
||||
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;
|
||||
}
|
||||
virtual_file_ex(&new_state, pathname, NULL, 1);
|
||||
|
||||
retval = opendir(new_state.cwd);
|
||||
|
||||
@@ -1228,45 +1046,6 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
|
||||
#endif
|
||||
|
||||
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)) &&
|
||||
VCWD_GETCWD(cwd, MAXPATHLEN)) {
|
||||
new_state.cwd = strdup(cwd);
|
||||
new_state.cwd_length = strlen(cwd);
|
||||
} else {
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
new_state.cwd[0] = '\0';
|
||||
new_state.cwd_length = 0;
|
||||
}
|
||||
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
|
||||
free(new_state.cwd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (real_path) {
|
||||
int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
|
||||
memcpy(real_path, new_state.cwd, copy_len);
|
||||
real_path[copy_len] = '\0';
|
||||
free(new_state.cwd);
|
||||
return real_path;
|
||||
} else {
|
||||
return new_state.cwd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+39
-37
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -37,14 +37,8 @@
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
#define VIRTUAL_DIR
|
||||
#endif
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
@@ -126,12 +120,6 @@ typedef unsigned short mode_t;
|
||||
#define CWD_API
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
CWD_API int php_sys_stat(const char *path, struct stat *buf);
|
||||
#else
|
||||
# define php_sys_stat stat
|
||||
#endif
|
||||
|
||||
typedef struct _cwd_state {
|
||||
char *cwd;
|
||||
int cwd_length;
|
||||
@@ -178,28 +166,40 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* On AIX & Tru64 when a file does not exist realpath() returns
|
||||
* NULL, and sets errno to ENOENT. Unlike in other libc implementations
|
||||
* the destination is not filled and remains undefined. Therefor, we
|
||||
* must populate it manually using strcpy as done on systems with no
|
||||
* realpath() function.
|
||||
*/
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
static char *php_realpath_hack(char *src, char *dest)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) {
|
||||
return strcpy(dest, src);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
|
||||
#endif
|
||||
CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
|
||||
#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 TSRMLS_DC);
|
||||
#endif
|
||||
|
||||
/* One of the following constants must be used as the last argument
|
||||
in virtual_file_ex() call. */
|
||||
|
||||
#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */
|
||||
#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
|
||||
#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
|
||||
|
||||
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath);
|
||||
|
||||
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
|
||||
|
||||
#define REALPATH_CACHE
|
||||
#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */
|
||||
#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
|
||||
|
||||
#ifdef REALPATH_CACHE
|
||||
typedef struct _realpath_cache_bucket {
|
||||
unsigned long key;
|
||||
char *path;
|
||||
@@ -209,13 +209,16 @@ typedef struct _realpath_cache_bucket {
|
||||
time_t expires;
|
||||
struct _realpath_cache_bucket *next;
|
||||
} realpath_cache_bucket;
|
||||
#endif
|
||||
|
||||
typedef struct _virtual_cwd_globals {
|
||||
cwd_state cwd;
|
||||
#ifdef REALPATH_CACHE
|
||||
long realpath_cache_size;
|
||||
long realpath_cache_size_limit;
|
||||
long realpath_cache_ttl;
|
||||
realpath_cache_bucket *realpath_cache[1024];
|
||||
#endif
|
||||
} virtual_cwd_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -226,9 +229,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
|
||||
@@ -262,10 +262,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
#endif
|
||||
#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC)
|
||||
#if HAVE_LCHOWN
|
||||
#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC)
|
||||
#endif
|
||||
#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group TSRMLS_CC)
|
||||
#endif
|
||||
|
||||
#else
|
||||
@@ -279,7 +276,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
#define VCWD_CHDIR(path) chdir(path)
|
||||
#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
|
||||
#define VCWD_GETWD(buf) getwd(buf)
|
||||
#define VCWD_STAT(path, buff) php_sys_stat(path, buff)
|
||||
#define VCWD_STAT(path, buff) stat(path, buff)
|
||||
#define VCWD_LSTAT(path, buff) lstat(path, buff)
|
||||
#define VCWD_UNLINK(path) unlink(path)
|
||||
#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode)
|
||||
@@ -292,7 +289,15 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
|
||||
#endif
|
||||
|
||||
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
|
||||
#ifdef HAVE_REALPATH
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
#define VCWD_REALPATH(path, real_path) php_realpath_hack(path, real_path)
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) realpath(path, real_path)
|
||||
#endif
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) strcpy(real_path, path)
|
||||
#endif
|
||||
|
||||
#if HAVE_UTIME
|
||||
#define VCWD_UTIME(path, time) utime(path, time)
|
||||
@@ -300,9 +305,6 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
#define VCWD_CHMOD(path, mode) chmod(path, mode)
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
|
||||
#if HAVE_LCHOWN
|
||||
#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+11
-20
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -86,19 +86,11 @@ TSRM_API void tsrm_win32_shutdown(void)
|
||||
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
{
|
||||
SHFILEINFO sfi;
|
||||
|
||||
if (mode == 1 /*X_OK*/) {
|
||||
#if 1
|
||||
/* This code is not supported by Windows 98,
|
||||
* but we don't support it anymore */
|
||||
DWORD type;
|
||||
|
||||
return GetBinaryType(pathname, &type)?0:-1;
|
||||
#else
|
||||
SHFILEINFO sfi;
|
||||
|
||||
return access(pathname, 0) == 0 &&
|
||||
SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1;
|
||||
#endif
|
||||
} else {
|
||||
return access(pathname, mode);
|
||||
}
|
||||
@@ -219,7 +211,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)) {
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, env, cwd, &startup, &process)) {
|
||||
return NULL;
|
||||
}
|
||||
free(cmd);
|
||||
@@ -228,10 +220,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);
|
||||
}
|
||||
|
||||
@@ -280,6 +272,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);
|
||||
@@ -288,10 +283,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);
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2007 The PHP Group |
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
|
||||
@@ -35,7 +35,7 @@ UPGRADE NOTES - PHP 5.1
|
||||
1a. Overview
|
||||
============
|
||||
|
||||
From the PHP script writer's point of view, the change most likely to impact
|
||||
>From the PHP script writer's point of view, the change most likely to impact
|
||||
legacy code is in the way that references are handled in all PHP versions
|
||||
post-dating the PHP 4.4.0 release.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The Zend Engine License, Version 2.00
|
||||
Copyright (c) 1999-2006 Zend Technologies Ltd. All rights reserved.
|
||||
Copyright (c) 1999-2005 Zend Technologies Ltd. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ libZend_la_SOURCES=\
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c \
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c zend_mm.c \
|
||||
zend_default_classes.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c \
|
||||
zend_strtod.c zend_multibyte.c
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
Zend Memory Manager
|
||||
===================
|
||||
|
||||
General:
|
||||
--------
|
||||
|
||||
The goal of the new memory manager (available since PHP 5.2) is to reduce memory
|
||||
allocation overhead and speedup memory management.
|
||||
|
||||
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.
|
||||
|
||||
Debugging:
|
||||
----------
|
||||
|
||||
Normal:
|
||||
|
||||
$ 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.
|
||||
@@ -195,6 +195,10 @@ SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_mm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_object_handlers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -367,6 +371,10 @@ SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_mm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+34
-109
@@ -129,6 +129,15 @@ AC_ARG_WITH(zend-vm,
|
||||
PHP_ZEND_VM=CALL
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(zend-memory-manager,
|
||||
[ --disable-zend-memory-manager
|
||||
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
|
||||
[
|
||||
ZEND_USE_ZEND_ALLOC=$enableval
|
||||
], [
|
||||
ZEND_USE_ZEND_ALLOC=yes
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(maintainer-zts,
|
||||
[ --enable-maintainer-zts Enable thread safety - for code maintainers only!!],[
|
||||
ZEND_MAINTAINER_ZTS=$enableval
|
||||
@@ -144,6 +153,13 @@ AC_ARG_ENABLE(inline-optimization,
|
||||
ZEND_INLINE_OPTIMIZATION=yes
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(memory-limit,
|
||||
[ --enable-memory-limit Compile with memory limit support], [
|
||||
ZEND_MEMORY_LIMIT=$enableval
|
||||
],[
|
||||
ZEND_MEMORY_LIMIT=no
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(zend-multibyte,
|
||||
[ --enable-zend-multibyte Compile with zend multibyte support], [
|
||||
ZEND_MULTIBYTE=$enableval
|
||||
@@ -154,12 +170,18 @@ AC_ARG_ENABLE(zend-multibyte,
|
||||
AC_MSG_CHECKING([virtual machine dispatch method])
|
||||
AC_MSG_RESULT($PHP_ZEND_VM)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable the Zend memory manager)
|
||||
AC_MSG_RESULT($ZEND_USE_ZEND_ALLOC)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable thread-safety)
|
||||
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable inline optimization for GCC)
|
||||
AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable a memory limit)
|
||||
AC_MSG_RESULT($ZEND_MEMORY_LIMIT)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable Zend debugging)
|
||||
AC_MSG_RESULT($ZEND_DEBUG)
|
||||
|
||||
@@ -194,12 +216,24 @@ fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
|
||||
AC_DEFINE(USE_ZEND_ALLOC,1,[Use Zend memory manager])
|
||||
else
|
||||
AC_DEFINE(USE_ZEND_ALLOC,0,[Use Zend memory manager])
|
||||
fi
|
||||
|
||||
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
CFLAGS="$CFLAGS -DZTS"
|
||||
LIBZEND_CPLUSPLUS_CHECKS
|
||||
fi
|
||||
|
||||
if test "$ZEND_MEMORY_LIMIT" = "yes"; then
|
||||
AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit])
|
||||
else
|
||||
AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit])
|
||||
fi
|
||||
|
||||
if test "$ZEND_MULTIBYTE" = "yes"; then
|
||||
AC_DEFINE(ZEND_MULTIBYTE, 1, [ ])
|
||||
fi
|
||||
@@ -272,108 +306,6 @@ int main()
|
||||
|
||||
AC_MSG_RESULT(done)
|
||||
|
||||
dnl test for memory allocation using mmap(MAP_ANON)
|
||||
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef MAP_ANON
|
||||
# ifdef MAP_ANONYMOUS
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MREMAP_MAYMOVE
|
||||
# define MREMAP_MAYMOVE 0
|
||||
#endif
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void*)-1)
|
||||
#endif
|
||||
|
||||
#define SEG_SIZE (256*1024)
|
||||
|
||||
int main()
|
||||
{
|
||||
void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
if (seg == MAP_FAILED) {
|
||||
return 1;
|
||||
}
|
||||
if (munmap(seg, SEG_SIZE) != 0) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [
|
||||
dnl cross-compile needs something here
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl test for memory allocation using mmap("/dev/zero")
|
||||
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef MAP_ANON
|
||||
# ifdef MAP_ANONYMOUS
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MREMAP_MAYMOVE
|
||||
# define MREMAP_MAYMOVE 0
|
||||
#endif
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void*)-1)
|
||||
#endif
|
||||
|
||||
#define SEG_SIZE (256*1024)
|
||||
|
||||
int main()
|
||||
{
|
||||
int fd;
|
||||
void *seg;
|
||||
|
||||
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0) {
|
||||
return 1;
|
||||
}
|
||||
seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||
if (seg == MAP_FAILED) {
|
||||
return 2;
|
||||
}
|
||||
if (munmap(seg, SEG_SIZE) != 0) {
|
||||
return 3;
|
||||
}
|
||||
if (close(fd) != 0) {
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [
|
||||
dnl cross-compile needs something here
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS(mremap)
|
||||
|
||||
])
|
||||
|
||||
|
||||
@@ -381,10 +313,3 @@ AC_DEFUN([LIBZEND_CPLUSPLUS_CHECKS],[
|
||||
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether /dev/urandom exists)
|
||||
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
||||
AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define if the target system has /dev/urandom device])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
+8
-1
@@ -169,7 +169,6 @@ SOURCE=.\zend_exceptions.c
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# ADD CPP /I "..\TSRM"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -229,6 +228,10 @@ SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_mm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_object_handlers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -405,6 +408,10 @@ SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_mm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2005 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"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+3
-4
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
function simple() {
|
||||
$a = 0;
|
||||
@@ -180,7 +179,7 @@ function fibo($n) {
|
||||
|
||||
/****/
|
||||
|
||||
function hash1($n) {
|
||||
function hash($n) {
|
||||
for ($i = 1; $i <= $n; $i++) {
|
||||
$X[dechex($i)] = $i;
|
||||
}
|
||||
@@ -402,8 +401,8 @@ ary3(2000);
|
||||
$t = end_test($t, "ary3(2000)");
|
||||
fibo(30);
|
||||
$t = end_test($t, "fibo(30)");
|
||||
hash1(50000);
|
||||
$t = end_test($t, "hash1(50000)");
|
||||
hash(50000);
|
||||
$t = end_test($t, "hash(50000)");
|
||||
hash2(500);
|
||||
$t = end_test($t, "hash2(500)");
|
||||
heapsort(20000);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2005 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,54 +0,0 @@
|
||||
--TEST--
|
||||
func_num_args() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
test1();
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_num_args());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(1)
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
Warning: func_num_args(): Called from the global scope - no function context in %s on line %d
|
||||
int(-1)
|
||||
Done
|
||||
@@ -1,108 +0,0 @@
|
||||
--TEST--
|
||||
func_get_arg() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_get_arg(-10));
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
var_dump(func_get_arg(2));
|
||||
}
|
||||
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_get_arg(1));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
int(10)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1,81 +0,0 @@
|
||||
--TEST--
|
||||
func_get_args() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_get_args());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(10)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Warning: func_get_args(): Called from the global scope - no function context in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
strncmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strncmp("", ""));
|
||||
var_dump(strncmp("", "", 100));
|
||||
var_dump(strncmp("aef", "dfsgbdf", -1));
|
||||
var_dump(strncmp("fghjkl", "qwer", 0));
|
||||
var_dump(strncmp("qwerty", "qwerty123", 6));
|
||||
var_dump(strncmp("qwerty", "qwerty123", 7));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strncmp() in %s on line %d
|
||||
NULL
|
||||
int(0)
|
||||
|
||||
Warning: Length must be greater than or equal to 0 in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(0)
|
||||
int(-1)
|
||||
Done
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
strcasecmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strcasecmp(""));
|
||||
var_dump(strcasecmp("", ""));
|
||||
var_dump(strcasecmp("aef", "dfsgbdf"));
|
||||
var_dump(strcasecmp("qwe", "qwer"));
|
||||
var_dump(strcasecmp("qwerty", "QweRty"));
|
||||
var_dump(strcasecmp("qwErtY", "qwerty"));
|
||||
var_dump(strcasecmp("q123", "Q123"));
|
||||
var_dump(strcasecmp("01", "01"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strcasecmp() in %s on line %d
|
||||
NULL
|
||||
int(0)
|
||||
int(-3)
|
||||
int(-1)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
Done
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
strncasecmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strncasecmp(""));
|
||||
var_dump(strncasecmp("", "", -1));
|
||||
var_dump(strncasecmp("aef", "dfsgbdf", 0));
|
||||
var_dump(strncasecmp("aef", "dfsgbdf", 10));
|
||||
var_dump(strncasecmp("qwe", "qwer", 3));
|
||||
var_dump(strncasecmp("qwerty", "QweRty", 6));
|
||||
var_dump(strncasecmp("qwErtY", "qwer", 7));
|
||||
var_dump(strncasecmp("q123", "Q123", 3));
|
||||
var_dump(strncasecmp("01", "01", 1000));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strncasecmp() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Length must be greater than or equal to 0 in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(-3)
|
||||
int(0)
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
int(0)
|
||||
Done
|
||||
@@ -1,63 +0,0 @@
|
||||
--TEST--
|
||||
each() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(each());
|
||||
$var = 1;
|
||||
var_dump(each($var));
|
||||
$var = "string";
|
||||
var_dump(each($var));
|
||||
$var = array(1,2,3);
|
||||
var_dump(each($var));
|
||||
$var = array("a"=>1,"b"=>2,"c"=>3);
|
||||
var_dump(each($var));
|
||||
|
||||
$a = array(1);
|
||||
$a [] =&$a[0];
|
||||
|
||||
var_dump(each($a));
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for each() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Variable passed to each() is not an array or object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Variable passed to each() is not an array or object in %s on line %d
|
||||
NULL
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
int(0)
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
["key"]=>
|
||||
string(1) "a"
|
||||
}
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
int(0)
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
Done
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
define() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(define());
|
||||
var_dump(define("TRUE"));
|
||||
var_dump(define("TRUE", 1));
|
||||
var_dump(define("TRUE", 1, array(1)));
|
||||
|
||||
var_dump(define(array(1,2,3,4,5), 1));
|
||||
var_dump(define(" ", 1));
|
||||
var_dump(define("[[[", 2));
|
||||
var_dump(define("test const", 3));
|
||||
var_dump(define("test const", 3));
|
||||
var_dump(define("test", array(1)));
|
||||
var_dump(define("test1", new stdclass));
|
||||
|
||||
var_dump(constant(" "));
|
||||
var_dump(constant("[[["));
|
||||
var_dump(constant("test const"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
|
||||
Notice: Constant true already defined in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Notice: Constant test const already defined in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
Done
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
get_class() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
function bar () {
|
||||
var_dump(get_class());
|
||||
}
|
||||
}
|
||||
|
||||
class foo2 extends foo {
|
||||
}
|
||||
|
||||
foo::bar();
|
||||
foo2::bar();
|
||||
|
||||
$f1 = new foo;
|
||||
$f2 = new foo2;
|
||||
|
||||
$f1->bar();
|
||||
$f2->bar();
|
||||
|
||||
var_dump(get_class());
|
||||
var_dump(get_class("qwerty"));
|
||||
|
||||
var_dump(get_class($f1));
|
||||
var_dump(get_class($f2));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
|
||||
string(3) "foo"
|
||||
|
||||
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
|
||||
Warning: get_class() called without object from outside a class in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
string(4) "foo2"
|
||||
Done
|
||||
@@ -1,59 +0,0 @@
|
||||
--TEST--
|
||||
get_parent_class() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface i {
|
||||
function test();
|
||||
}
|
||||
|
||||
class foo implements i {
|
||||
function test() {
|
||||
var_dump(get_parent_class());
|
||||
}
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
function test_bar() {
|
||||
var_dump(get_parent_class());
|
||||
}
|
||||
}
|
||||
|
||||
$bar = new bar;
|
||||
$foo = new foo;
|
||||
|
||||
$foo->test();
|
||||
$bar->test();
|
||||
$bar->test_bar();
|
||||
|
||||
var_dump(get_parent_class($bar));
|
||||
var_dump(get_parent_class($foo));
|
||||
var_dump(get_parent_class("bar"));
|
||||
var_dump(get_parent_class("foo"));
|
||||
var_dump(get_parent_class("i"));
|
||||
|
||||
var_dump(get_parent_class(""));
|
||||
var_dump(get_parent_class("[[[["));
|
||||
var_dump(get_parent_class(" "));
|
||||
var_dump(get_parent_class(new stdclass));
|
||||
var_dump(get_parent_class(array()));
|
||||
var_dump(get_parent_class(1));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1,89 +0,0 @@
|
||||
--TEST--
|
||||
property_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
public $pp1 = 1;
|
||||
private $pp2 = 2;
|
||||
protected $pp3 = 3;
|
||||
|
||||
function bar() {
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
}
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
function test() {
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(property_exists());
|
||||
var_dump(property_exists(""));
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
var_dump(property_exists("foo","nonexistent"));
|
||||
var_dump(property_exists("fo","nonexistent"));
|
||||
var_dump(property_exists("foo",""));
|
||||
var_dump(property_exists("","test"));
|
||||
var_dump(property_exists("",""));
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
var_dump(property_exists($foo,"pp1"));
|
||||
var_dump(property_exists($foo,"pp2"));
|
||||
var_dump(property_exists($foo,"pp3"));
|
||||
var_dump(property_exists($foo,"nonexistent"));
|
||||
var_dump(property_exists($foo,""));
|
||||
var_dump(property_exists(array(),"test"));
|
||||
var_dump(property_exists(1,"test"));
|
||||
var_dump(property_exists(true,"test"));
|
||||
|
||||
$foo->bar();
|
||||
|
||||
$bar = new bar;
|
||||
$bar->test();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for property_exists() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for property_exists() in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
Done
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
class_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
}
|
||||
|
||||
var_dump(class_exists());
|
||||
var_dump(class_exists("qwerty"));
|
||||
var_dump(class_exists(""));
|
||||
var_dump(class_exists(array()));
|
||||
var_dump(class_exists("test", false));
|
||||
var_dump(class_exists("foo", false));
|
||||
var_dump(class_exists("foo"));
|
||||
var_dump(class_exists("stdClass", false));
|
||||
var_dump(class_exists("stdClass"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
Done
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
interface_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface foo {
|
||||
}
|
||||
|
||||
var_dump(interface_exists());
|
||||
var_dump(interface_exists("qwerty"));
|
||||
var_dump(interface_exists(""));
|
||||
var_dump(interface_exists(array()));
|
||||
var_dump(interface_exists("test", false));
|
||||
var_dump(interface_exists("foo", false));
|
||||
var_dump(interface_exists("foo"));
|
||||
var_dump(interface_exists("stdClass", false));
|
||||
var_dump(interface_exists("stdClass"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
/* dummy file for 014.phpt */
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
--TEST--
|
||||
get_included_files() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(get_included_files());
|
||||
|
||||
include(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
var_dump(get_included_files(1,1));
|
||||
|
||||
include_once(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
var_dump(get_included_files(1));
|
||||
|
||||
include(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
|
||||
Warning: Wrong parameter count for get_included_files() in %s on line %d
|
||||
NULL
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
|
||||
Warning: Wrong parameter count for get_included_files() in %s on line %d
|
||||
NULL
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
Done
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
trigger_error() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(trigger_error());
|
||||
var_dump(trigger_error("error"));
|
||||
var_dump(trigger_error(array()));
|
||||
var_dump(trigger_error("error", -1));
|
||||
var_dump(trigger_error("error", 0));
|
||||
var_dump(trigger_error("error", E_USER_WARNING));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for trigger_error() in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: error in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
|
||||
Notice: Array in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Warning: Invalid error type specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Invalid error type specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: error in %s on line %d
|
||||
bool(true)
|
||||
Done
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
isset() with object properties when operating on non-object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = NULL;
|
||||
isset($foo->bar->bar);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,86 +0,0 @@
|
||||
--TEST--
|
||||
builtin functions tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(get_resource_type());
|
||||
var_dump(get_resource_type(""));
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump(get_resource_type($fp));
|
||||
fclose($fp);
|
||||
var_dump(get_resource_type($fp));
|
||||
|
||||
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");
|
||||
|
||||
var_dump(get_defined_constants(true, true));
|
||||
var_dump(gettype(get_defined_constants(true)));
|
||||
var_dump(gettype(get_defined_constants()));
|
||||
var_dump(count(get_defined_constants()));
|
||||
|
||||
function test () {
|
||||
}
|
||||
|
||||
var_dump(get_defined_functions(true));
|
||||
var_dump(gettype(get_defined_functions()));
|
||||
var_dump(count(get_defined_functions()));
|
||||
|
||||
var_dump(get_declared_interfaces(true));
|
||||
var_dump(gettype(get_declared_interfaces()));
|
||||
var_dump(count(get_declared_interfaces()));
|
||||
|
||||
var_dump(get_extension_funcs());
|
||||
var_dump(get_extension_funcs(true));
|
||||
var_dump(gettype(get_extension_funcs("standard")));
|
||||
var_dump(count(get_extension_funcs("standard")));
|
||||
var_dump(gettype(get_extension_funcs("zend")));
|
||||
var_dump(count(get_extension_funcs("zend")));
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for get_resource_type() in %s on line %d
|
||||
NULL
|
||||
|
||||
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(0)
|
||||
|
||||
Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in /home/johannes/src/php/PHP_5_2/Zend/tests/017.php on line 14
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for get_defined_constants() in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: Wrong parameter count for get_defined_functions() in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: Wrong parameter count for get_declared_interfaces() in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: Wrong parameter count for get_extension_funcs() in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
Done
|
||||
@@ -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
|
||||
-1332
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,14 +0,0 @@
|
||||
--TEST--
|
||||
Test for abstract static classes
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class TestClass
|
||||
{
|
||||
abstract static public function getName();
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Static function TestClass::getName() should not be abstract in %sabstract-static.php on line %d
|
||||
===DONE===
|
||||
@@ -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,17 +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)
|
||||
}
|
||||
@@ -12,4 +12,4 @@ foo(123);
|
||||
--EXPECTF--
|
||||
3
|
||||
|
||||
Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
@@ -1,17 +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--
|
||||
|
||||
@@ -23,6 +23,6 @@ $test = new Test();
|
||||
$test2 = $test->__copy();
|
||||
var_dump($test2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(Test)#%d (0) {
|
||||
--EXPECT--
|
||||
object(Test)#2 (0) {
|
||||
}
|
||||
+14
-21
@@ -2,7 +2,6 @@
|
||||
Bug #26166 (__toString() crash when no values returned)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo
|
||||
{
|
||||
function __toString()
|
||||
@@ -29,23 +28,6 @@ class Bar
|
||||
$o = new Bar;
|
||||
echo $o;
|
||||
|
||||
echo "===NONE===\n";
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class None
|
||||
{
|
||||
function __toString() {
|
||||
}
|
||||
}
|
||||
|
||||
$o = new None;
|
||||
echo $o;
|
||||
|
||||
echo "===THROW===\n";
|
||||
|
||||
class Error
|
||||
@@ -63,12 +45,23 @@ catch (Exception $e) {
|
||||
echo "Got the exception\n";
|
||||
}
|
||||
|
||||
echo "===NONE===\n";
|
||||
|
||||
class None
|
||||
{
|
||||
function __toString() {
|
||||
}
|
||||
}
|
||||
|
||||
$o = new None;
|
||||
echo $o;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Hello World!
|
||||
===NONE===
|
||||
string(52) "Method None::__toString() must return a string value"
|
||||
===THROW===
|
||||
Got the exception
|
||||
===NONE===
|
||||
|
||||
Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
|
||||
Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #27304 (Static functions don't function properly)
|
||||
Bug #27304
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $a = "Default for A";
|
||||
public $b = "Default for B";
|
||||
|
||||
function __construct($a, $b) {
|
||||
$this->a = $a;
|
||||
$this->b = $b;
|
||||
}
|
||||
function A() {
|
||||
$args = func_get_args();
|
||||
call_user_func_array(Array(&$this, '__construct'), $args);
|
||||
}
|
||||
}
|
||||
|
||||
$t = new A("New A", "New B");
|
||||
print_r($t);
|
||||
print_r(get_class_vars(get_class($t)));
|
||||
print_r(get_object_vars($t));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
|
||||
A Object
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => Default for A
|
||||
[b] => Default for B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
@@ -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) {
|
||||
|
||||
@@ -3,12 +3,6 @@ Bug #28444 (Cannot access undefined property for object with overloaded property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class Object
|
||||
{
|
||||
public $x;
|
||||
@@ -66,8 +60,7 @@ Overloaded::__set(y,3)
|
||||
int(3)
|
||||
Overloaded::__get(y)
|
||||
int(3)
|
||||
string(55) "Object of class Object could not be converted to string"
|
||||
Overloaded::__set(z,)
|
||||
Overloaded::__set(z,Object id #3)
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(4)
|
||||
|
||||
@@ -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 {
|
||||
@@ -92,7 +92,11 @@ $object->test();
|
||||
--EXPECTF--
|
||||
test_func1
|
||||
test_func2
|
||||
|
||||
Strict Standards: Non-static method test_class::test_func3() canot be called statically, assuming $this from compatible context test_class in %sbug29210.php on line %d
|
||||
test_func3
|
||||
|
||||
Strict Standards: Non-static method test_class::test_func4() canot be called statically, assuming $this from compatible context test_class in %sbug29210.php on line %d
|
||||
test_func4
|
||||
test_func1 isn't callable from outside
|
||||
test_func2 isn't callable from outside
|
||||
@@ -100,5 +104,9 @@ test_func3 isn't callable from outside
|
||||
test_func4 isn't callable from outside
|
||||
test_func1 isn't callable from child
|
||||
test_func2
|
||||
|
||||
Strict Standards: Non-static method test_class::test_func3() canot be called statically, assuming $this from compatible context foo in %sbug29210.php on line %d
|
||||
test_func3 isn't callable from child
|
||||
|
||||
Strict Standards: Non-static method test_class::test_func4() canot be called statically, assuming $this from compatible context foo in %sbug29210.php on line %d
|
||||
test_func4
|
||||
@@ -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,34 +1,22 @@
|
||||
--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
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class a
|
||||
{
|
||||
class a {
|
||||
public $a = 4;
|
||||
function __call($a,$b) {
|
||||
return "unknown method";
|
||||
}
|
||||
}
|
||||
|
||||
$b = new a;
|
||||
echo $b,"\n";
|
||||
$c = unserialize(serialize($b));
|
||||
echo $c,"\n";
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(50) "Object of class a could not be converted to string"
|
||||
|
||||
string(50) "Object of class a could not be converted to string"
|
||||
|
||||
Object id #1
|
||||
Object id #2
|
||||
object(a)#2 (1) {
|
||||
["a"]=>
|
||||
int(4)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #31177 (memory corruption because of incorrect refcounting)
|
||||
Bug #31177 (menory corruption because of incorrect refcounting)
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
|
||||
@@ -98,7 +98,7 @@ var_dump($x->doSomethingStatic(1));
|
||||
===A===
|
||||
TestB::doSomething(1)
|
||||
|
||||
Strict Standards: Non-static method TestA::doSomething() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
|
||||
Strict Standards: Non-static method TestA::doSomething() canot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
|
||||
TestA::doSomething(2)
|
||||
int(1)
|
||||
|
||||
@@ -110,7 +110,7 @@ int(1)
|
||||
===C===
|
||||
TestB::doSomethingParent(1)
|
||||
|
||||
Strict Standards: Non-static method TestA::doSomethingParent() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
|
||||
Strict Standards: Non-static method TestA::doSomethingParent() canot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
|
||||
TestA::doSomethingParent(2)
|
||||
int(1)
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -28,12 +28,9 @@ $b = "much longer";
|
||||
print_r($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20
|
||||
A Object
|
||||
(
|
||||
[q] => 3
|
||||
[q] => long
|
||||
)
|
||||
|
||||
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23
|
||||
|
||||
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
|
||||
@@ -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,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33282 (Re-assignment by reference does not clear the is_ref flag)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(1, 2, 3);
|
||||
$r = &$a[0];
|
||||
$r = &$a[1];
|
||||
$r = &$a[2];
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
&int(3)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ interface iB2 extends iA2 {
|
||||
class A2 implements iA2 {
|
||||
}
|
||||
|
||||
class B2 extends A2 implements iA2 {
|
||||
class B2 extends A2 implements iB2 {
|
||||
}
|
||||
|
||||
echo iA2::cA;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
|
||||
bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -14,7 +14,7 @@ function make_exception()
|
||||
|
||||
function make_exception_and_change_err_reporting()
|
||||
{
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
error_reporting(E_ALL);
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(8191)
|
||||
int(8191)
|
||||
int(6143)
|
||||
int(4095)
|
||||
int(4095)
|
||||
int(2047)
|
||||
Done
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
@@ -24,6 +24,6 @@ FooTest();
|
||||
FooTest(new Foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
|
||||
Hi!
|
||||
Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #34065 (throw in foreach causes memory leaks)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = file(__FILE__);
|
||||
try {
|
||||
foreach ($data as $line) {
|
||||
throw new Exception("error");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?>
|
||||
<?php if (!extension_loaded("xml")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Thing {}
|
||||
@@ -15,4 +15,4 @@ function boom()
|
||||
boom();
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
ok
|
||||
@@ -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,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #34873 (Segmentation Fault on foreach in object)
|
||||
bug #34873 (Segmentation Fault on foreach in object)
|
||||
--FILE--
|
||||
<?php
|
||||
class pwa {
|
||||
|
||||
Loaded 100 of 3723 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user