mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 09:47:30 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f66905dad7 | ||
|
|
79e6dba040 |
No files matched your search
@@ -1,51 +0,0 @@
|
||||
|
||||
version: "{branch}.build.{build}"
|
||||
|
||||
image: Visual Studio 2017
|
||||
|
||||
branches:
|
||||
except:
|
||||
- PHP-5.6
|
||||
- PHP-7.0
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
|
||||
environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.7beta1
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!"
|
||||
#PDO_MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_PASS: Password12!
|
||||
#PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!"
|
||||
#PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!"
|
||||
#build permutations
|
||||
matrix:
|
||||
- THREAD_SAFE: 0
|
||||
OPCACHE: 0
|
||||
- THREAD_SAFE: 1
|
||||
OPCACHE: 1
|
||||
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql96
|
||||
|
||||
platform:
|
||||
- x64
|
||||
# - x86
|
||||
|
||||
build_script:
|
||||
- appveyor\build.bat
|
||||
|
||||
test_script:
|
||||
- appveyor\test.bat
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,m4,sh}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
@@ -16,11 +16,9 @@ define ____executor_globals
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
set $eg_ptr = $eg
|
||||
else
|
||||
set $eg = executor_globals
|
||||
set $cg = compiler_globals
|
||||
set $eg_ptr = (zend_executor_globals*) &executor_globals
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,33 +29,22 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
set $cv_count = $cv_ex_ptr.func.op_array.last_var
|
||||
set $cv = $cv_ex_ptr.func.op_array.vars
|
||||
set $cv_idx = 0
|
||||
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
|
||||
|
||||
printf "Compiled variables count: %d\n\n", $cv_count
|
||||
while $cv_idx < $cv_count
|
||||
printf "[%d] '%s'\n", $cv_idx, $cv[$cv_idx].val
|
||||
set $zvalue = ((zval *) $cv_ex_ptr) + $callFrameSize + $cv_idx
|
||||
printzv $zvalue
|
||||
set $cv_idx = $cv_idx + 1
|
||||
end
|
||||
end
|
||||
|
||||
document print_cvs
|
||||
Prints the compiled variables and their values.
|
||||
If a zend_execute_data pointer is set this will print the compiled
|
||||
variables of that scope. If no parameter is used it will use
|
||||
current_execute_data for scope.
|
||||
|
||||
usage: print_cvs [zend_execute_data *]
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -114,7 +101,7 @@ define dump_bt
|
||||
____print_str $zvalue->value.str->val $zvalue->value.str->len
|
||||
end
|
||||
if $type == 7
|
||||
printf "array(%d)[%p]", $zvalue->value.arr->nNumOfElements, $zvalue
|
||||
printf "array(%d)[%p]", $zvalue->value.arr->ht->nNumOfElements, $zvalue
|
||||
end
|
||||
if $type == 8
|
||||
printf "object[%p]", $zvalue
|
||||
@@ -165,15 +152,15 @@ define ____printzv_contents
|
||||
set $type = $zvalue->u1.v.type
|
||||
|
||||
# 15 == IS_INDIRECT
|
||||
if $type > 5 && $type != 15
|
||||
printf "(refcount=%d) ", $zvalue->value.counted->gc.refcount
|
||||
if $type >= 5 && $type != 15
|
||||
printf "(refcount=%d) ", $zvalue->value.counted->refcount
|
||||
end
|
||||
|
||||
if $type == 0
|
||||
printf "UNDEF"
|
||||
end
|
||||
if $type == 1
|
||||
printf "NULL"
|
||||
printf "NULL"
|
||||
end
|
||||
if $type == 2
|
||||
printf "bool: false"
|
||||
@@ -181,20 +168,20 @@ define ____printzv_contents
|
||||
if $type == 3
|
||||
printf "bool: true"
|
||||
end
|
||||
if $type == 4
|
||||
if $type == 4
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 7
|
||||
printf "array: "
|
||||
if ! $arg1
|
||||
set $ind = $ind + 1
|
||||
____print_ht $zvalue->value.arr 1
|
||||
____print_ht $zvalue->value.arr
|
||||
set $ind = $ind - 1
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
@@ -209,17 +196,12 @@ define ____printzv_contents
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
set $ht = $zobj->properties
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -230,7 +212,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "not found"
|
||||
echo "no properties found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -247,31 +229,25 @@ define ____printzv_contents
|
||||
printf "const: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 12
|
||||
printf "CONSTANT_AST"
|
||||
printf "const_ast"
|
||||
end
|
||||
if $type == 13
|
||||
printf "_BOOL"
|
||||
printf "_IS_BOOL"
|
||||
end
|
||||
if $type == 14
|
||||
printf "CALLABLE"
|
||||
printf "IS_CALLABLE"
|
||||
end
|
||||
if $type == 15
|
||||
printf "indirect: "
|
||||
____printzv $zvalue->value.zv $arg1
|
||||
end
|
||||
if $type == 16
|
||||
printf "string_offset"
|
||||
end
|
||||
if $type == 17
|
||||
printf "pointer: %p", $zvalue->value.ptr
|
||||
end
|
||||
if $type == 18
|
||||
printf "ITERABLE"
|
||||
end
|
||||
if $type == 19
|
||||
printf "VOID"
|
||||
end
|
||||
if $type == 20
|
||||
printf "_ERROR"
|
||||
end
|
||||
if $type == 16 || $type > 20
|
||||
if $type > 17
|
||||
printf "unknown type %d", $type
|
||||
end
|
||||
printf "\n"
|
||||
@@ -291,28 +267,38 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define print_global_vars
|
||||
____executor_globals
|
||||
set $symtable = ((HashTable *)&($eg_ptr->symbol_table))
|
||||
print_ht $symtable
|
||||
end
|
||||
define ____print_const_table
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
document print_global_vars
|
||||
Prints the global variables
|
||||
while $p != 0
|
||||
set $const = (zend_constant *) $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
|
||||
|
||||
____printzv_contents &$const->value 0
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
____print_ht $arg0 4
|
||||
____print_const_table $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_const_table
|
||||
Dumps elements of Constants HashTable
|
||||
Example: print_const_table executor_globals.zend_constants
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $n = $ind
|
||||
@@ -359,10 +345,6 @@ define ____print_ht
|
||||
set $func = (zend_function*)$p->val.value.ptr
|
||||
printf "\"%s\"\n", $func->common.function_name->val
|
||||
end
|
||||
if $arg1 == 4
|
||||
set $const = (zend_constant *)$p->val.value.ptr
|
||||
____printzv $const 1
|
||||
end
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
@@ -473,13 +455,10 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
set $initial_offset = ((uint32_t)(zend_uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
|
||||
set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
|
||||
set $pi = $arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " offset = %p\n", $pi->offset
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = 0x%x (", $pi->flags
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
else
|
||||
@@ -490,40 +469,23 @@ define print_pi
|
||||
printf "ZEND_ACC_PRIVATE"
|
||||
else
|
||||
if $pi->flags & 0x800
|
||||
printf "ZEND_ACC_EARLY_BINDING"
|
||||
else
|
||||
if $pi->flags & 0x20000
|
||||
printf "ZEND_ACC_SHADOW"
|
||||
end
|
||||
printf "ZEND_ACC_CHANGED"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
print_zstr $pi->name
|
||||
printf " default value: "
|
||||
printzv $ptr_to_val
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_pi
|
||||
Takes a pointer to an object's property and prints the property information
|
||||
usage: print_pi <ptr>
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
if $argc > 2
|
||||
set $maxlen = $arg2
|
||||
else
|
||||
set $maxlen = 256
|
||||
end
|
||||
|
||||
printf "\""
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -592,23 +554,6 @@ document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define print_zstr
|
||||
set $zstr = (zend_string *)$arg0
|
||||
if $argc == 2
|
||||
set $maxlen = $arg1
|
||||
else
|
||||
set $maxlen = $zstr->len
|
||||
end
|
||||
printf "string(%d) ", $zstr->len
|
||||
____print_str $zstr->val $zstr->len $maxlen
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
document print_zstr
|
||||
print the length and contents of a zend string
|
||||
usage: print_zstr <ptr> [max length]
|
||||
end
|
||||
|
||||
define zbacktrace
|
||||
____executor_globals
|
||||
dump_bt $eg.current_execute_data
|
||||
@@ -621,6 +566,79 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
@@ -15,8 +15,11 @@ ext/dba/libflatfile/flatfile.c ident
|
||||
ext/dba/libcdb/cdb_make.c ident
|
||||
ext/dba/libcdb/cdb.c ident
|
||||
ext/filter/filter.c ident
|
||||
ext/zip/php_zip.c ident
|
||||
README.input_filter ident
|
||||
run-tests.php ident
|
||||
sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
@@ -29,6 +32,7 @@ UPGRADING.INTERNALS merge=NEWS
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
/ext/ereg/tests/eregi_basic_002.phpt -crlf
|
||||
/ext/iconv/tests/iconv004.phpt -crlf
|
||||
/ext/iconv/tests/iconv_basic.phpt -crlf
|
||||
/ext/iconv/tests/iconv_strpos.phpt -crlf
|
||||
|
||||
+90
-37
@@ -21,9 +21,6 @@
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
*.tar.gz.asc
|
||||
*.tar.bz2.asc
|
||||
*.tar.xz.asc
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
@@ -31,9 +28,17 @@
|
||||
phpt.*
|
||||
core
|
||||
dynlib.m4
|
||||
Debug
|
||||
Debug_TS
|
||||
Makefile
|
||||
Makefile.fragments
|
||||
Makefile.objects
|
||||
Release
|
||||
Release_TS
|
||||
Release_TSDbg
|
||||
Release_TS_inline
|
||||
Release_inline
|
||||
ZendEngine1
|
||||
_libs
|
||||
acconfig.h
|
||||
aclocal.m4
|
||||
@@ -48,6 +53,7 @@ config.cache
|
||||
config.h.in
|
||||
config.log
|
||||
config.nice
|
||||
config.nice.bat
|
||||
config.status
|
||||
config.sub
|
||||
config_vars.mk
|
||||
@@ -56,6 +62,8 @@ configuration-parser.h
|
||||
configuration-parser.output
|
||||
configuration-scanner.c
|
||||
configure
|
||||
configure.bat
|
||||
configure.js
|
||||
conftest
|
||||
conftest.c
|
||||
debug.log
|
||||
@@ -85,6 +93,7 @@ stamp-h
|
||||
test.php3
|
||||
tmp-php.ini
|
||||
want_dependencies
|
||||
x64
|
||||
stamp-h.in
|
||||
scan_makefile_in.awk
|
||||
TSRM/tsrm_config.h
|
||||
@@ -103,9 +112,64 @@ ext/phar/phar.php
|
||||
main/php_config.h
|
||||
main/php_config.h.in
|
||||
|
||||
# Test specific Ignores
|
||||
tests/*/*.diff
|
||||
tests/*/*.out
|
||||
tests/*/*.php
|
||||
tests/*/*.exp
|
||||
tests/*/*.log
|
||||
tests/*/*.sh
|
||||
tests/*/*/*.diff
|
||||
tests/*/*/*.out
|
||||
tests/*/*/*.php
|
||||
tests/*/*/*.exp
|
||||
tests/*/*/*.log
|
||||
tests/*/*/*.sh
|
||||
*/tests/*.diff
|
||||
*/tests/*.out
|
||||
*/tests/*.php
|
||||
*/tests/*.exp
|
||||
*/tests/*.log
|
||||
*/tests/*.sh
|
||||
*/tests/*/*.diff
|
||||
*/tests/*/*.out
|
||||
*/tests/*/*.php
|
||||
*/tests/*/*.exp
|
||||
*/tests/*/*.log
|
||||
*/tests/*/*.sh
|
||||
*/tests/*/*/*.diff
|
||||
*/tests/*/*/*.out
|
||||
*/tests/*/*/*.php
|
||||
*/tests/*/*/*.exp
|
||||
*/tests/*/*/*.log
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
*/*/tests/*.sh
|
||||
*/*/tests/*/*.diff
|
||||
*/*/tests/*/*.out
|
||||
*/*/tests/*/*.php
|
||||
*/*/tests/*/*.exp
|
||||
*/*/tests/*/*.log
|
||||
*/*/tests/*/*.sh
|
||||
*/*/tests/*/*/*.diff
|
||||
*/*/tests/*/*/*.out
|
||||
*/*/tests/*/*/*.php
|
||||
*/*/tests/*/*/*.exp
|
||||
*/*/tests/*/*/*.log
|
||||
*/*/tests/*/*/*.sh
|
||||
*/*/tests/*/*/*/*.diff
|
||||
*/*/tests/*/*/*/*.out
|
||||
*/*/tests/*/*/*/*.php
|
||||
*/*/tests/*/*/*/*.exp
|
||||
*/*/tests/*/*/*/*.log
|
||||
*/*/tests/*/*/*/*.sh
|
||||
|
||||
# Extension specifc ignores
|
||||
ext/*/configure.in
|
||||
ext/*/configure.ac
|
||||
ext/*/ltmain.sh
|
||||
ext/*/libs.mk
|
||||
ext/*/build
|
||||
@@ -146,28 +210,47 @@ ext/mssql/Makefile.global
|
||||
ext/mssql/acinclude.m4
|
||||
ext/mssql/config.sub
|
||||
ext/mssql/configure.in
|
||||
ext/mssql/configure.ac
|
||||
ext/mssql/ltmain.sh
|
||||
ext/mysql/weztest.sqlite
|
||||
ext/oci8/tests/*.tmp
|
||||
ext/oci8/tests/*.vglog
|
||||
ext/pdo/conftest*
|
||||
ext/pdo/tests/*.db
|
||||
ext/pdo/tests/*.tmp
|
||||
ext/pdo_firebird/conftest*
|
||||
ext/pdo_mysql/conftest*
|
||||
ext/pdo_mysql/tests/*.db
|
||||
ext/pdo_mysql/tests/*.tmp
|
||||
ext/pdo_oci/conftest*
|
||||
ext/pdo_odbc/tests/*.db
|
||||
ext/pdo_odbc/tests/*.tmp
|
||||
ext/pdo_odbc/tests/*.mdb
|
||||
ext/pdo_pgsql/conftest*
|
||||
ext/pdo_pgsql/tests/*.db
|
||||
ext/pdo_pgsql/tests/*.tmp
|
||||
ext/pdo_sqlite/conftest*
|
||||
ext/pdo_sqlite/sqlite3.h
|
||||
ext/pdo_sqlite/tests/*.db
|
||||
ext/pdo_sqlite/tests/*.tmp
|
||||
ext/phar/phar.phar
|
||||
ext/phar/phar.1
|
||||
ext/phar/phar.phar.1
|
||||
ext/pspell/tests/*.tmp
|
||||
ext/reflection/xml
|
||||
ext/reflection/html
|
||||
ext/reflection/spl.chm
|
||||
ext/simplexml/examples/security.new.xml
|
||||
ext/spl/examples/.htaccess
|
||||
ext/spl/examples/*.phps
|
||||
ext/sqlite/weztest.sqlite
|
||||
ext/sqlite/libsqlite/src/sqlite.h
|
||||
ext/sqlite/libsqlite/src/parse.out
|
||||
ext/sqlite/libsqlite/src/libsqlite.dsw
|
||||
ext/sqlite3/tests/phpsql*
|
||||
ext/sqlite3/tests/*.db
|
||||
ext/sqlite3/tests/*.tmp
|
||||
ext/standard/tests/misc/*.txt
|
||||
ext/standard/tests/strings/*.txt
|
||||
main/build-defs.h
|
||||
main/internal_functions_cli.c
|
||||
main/config.w32.h
|
||||
@@ -179,7 +262,9 @@ pear/phpize
|
||||
pear/run-tests
|
||||
pear/php-config
|
||||
pear/scripts
|
||||
sapi/apache/libphp7.module
|
||||
sapi/apache2handler/libphp7.module
|
||||
sapi/apache_hooks/libphp7.module
|
||||
sapi/cgi/php-cgi
|
||||
sapi/cgi/php-cgi.1
|
||||
sapi/cli/php.1
|
||||
@@ -200,35 +285,3 @@ win32/*.positions
|
||||
win32/ext
|
||||
win32/phpts.def
|
||||
win32/wsyslog.h
|
||||
|
||||
# ------------------------------------------------------------------------------ Windows
|
||||
# Generated by `/buildconf.bat`
|
||||
/configure.bat
|
||||
/configure.js
|
||||
|
||||
# Generated by `/configure.(bat|js)` (architecture dependend)
|
||||
/config.nice.bat
|
||||
/Debug/
|
||||
/Debug_TS/
|
||||
/Release/
|
||||
/Release_TS/
|
||||
/x64/
|
||||
|
||||
# ------------------------------------------------------------------------------ Tests
|
||||
# Generated by `/run-tests.php` upon failure.
|
||||
**/tests/**/*.diff
|
||||
**/tests/**/*.out*
|
||||
**/tests/**/*.php
|
||||
**/tests/**/*.exp
|
||||
**/tests/**/*.log
|
||||
**/tests/**/*.sh
|
||||
|
||||
# Used by some test cases.
|
||||
**/tests/**/*.db
|
||||
**/tests/**/*.txt
|
||||
**/tests/**/*.tmp
|
||||
|
||||
# special cases to invert previous ignore rules
|
||||
!ext/fileinfo/libmagic.patch
|
||||
!ext/mbstring/oniguruma.patch
|
||||
|
||||
+17
-33
@@ -1,37 +1,20 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- locales
|
||||
- language-pack-de
|
||||
- re2c
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
- libpspell-dev
|
||||
- librecode-dev
|
||||
- libsasl2-dev
|
||||
- libxpm-dev
|
||||
- libt1-dev
|
||||
|
||||
branches:
|
||||
except:
|
||||
- phpng
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_failure: change
|
||||
irc:
|
||||
template:
|
||||
- "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} - Change view : %{compare_url} - Build details : %{build_url}"
|
||||
channels:
|
||||
- "irc.efnet.org#php.pecl"
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
ccache: true
|
||||
cache:
|
||||
- apt
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -46,24 +29,25 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
- ccache --zero-stats
|
||||
- export USE_CCACHE=1
|
||||
# Enable IPv6
|
||||
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
# Setup Extensions
|
||||
# Setup Extensions
|
||||
- . ./travis/ext/mysql/setup.sh
|
||||
- . ./travis/ext/mysqli/setup.sh
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
- . ./travis/ext/imap/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
|
||||
|
||||
after_success:
|
||||
- ccache --show-stats
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 1 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
|
||||
+6
-6
@@ -93,12 +93,12 @@ User Functions/Methods Naming Conventions
|
||||
readability of the function name itself::
|
||||
|
||||
Good:
|
||||
'str_word_count'
|
||||
'array_key_exists'
|
||||
'mcrypt_enc_self_test'
|
||||
'mysql_list_fields'
|
||||
|
||||
Ok:
|
||||
'date_interval_create_from_date_string'
|
||||
(could be 'date_intvl_create_from_date_str'?)
|
||||
'mcrypt_module_get_algo_supported_key_sizes'
|
||||
(could be 'mcrypt_mod_get_algo_sup_key_sizes'?)
|
||||
'get_html_translation_table'
|
||||
(could be 'html_get_trans_table'?)
|
||||
|
||||
@@ -165,7 +165,7 @@ User Functions/Methods Naming Conventions
|
||||
'foobar'
|
||||
'foo_bar'
|
||||
|
||||
Internal Function Naming Conventions
|
||||
Internal Function Naming Convensions
|
||||
----------------------
|
||||
|
||||
1. Functions that are part of the external API should be named
|
||||
@@ -178,7 +178,7 @@ Internal Function Naming Conventions
|
||||
Unexposed module function should be static and should not be defined in
|
||||
'php_modulename.h'.
|
||||
|
||||
static int php_session_destroy()
|
||||
static int php_session_destroy(TSRMLS_D)
|
||||
|
||||
2. Main module source file must be named 'modulename.c'.
|
||||
|
||||
|
||||
+8
-13
@@ -11,20 +11,15 @@ co-ordination.
|
||||
PHP welcomes pull requests to [add tests](#writing-tests), fix bugs and to
|
||||
implement RFCs. Please be sure to include tests as appropriate!
|
||||
|
||||
If you are fixing a bug, then please submit your PR against the lowest actively
|
||||
supported branch of PHP that the bug affects (only green branches on
|
||||
[the supported version page](http://php.net/supported-versions.php) are supported).
|
||||
For example, at the time of writing in mid-2017, the lowest supported version is
|
||||
PHP 7.0, which corresponds to the `PHP-7.0` branch in Git. Please also make sure you
|
||||
add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/).
|
||||
If you are fixing a bug, then please submit your PR against the lowest branch
|
||||
of PHP that the bug affects, or the oldest fully supported version (the first
|
||||
green branch on
|
||||
[the supported version page](http://php.net/supported-versions.php). For
|
||||
example, at the time of writing in mid-2015, this is PHP 5.5, which corresponds
|
||||
to the `PHP-5.5` branch in Git. Please also make sure you add a link to the PR
|
||||
in the bug on [the bug tracker](https://bugs.php.net/).
|
||||
|
||||
Pull requests implementing RFCs should be submitted against `master`.
|
||||
|
||||
Pull requests should *never* be submitted against `PHP-x.y.z` branches, as
|
||||
these are only used for release management.
|
||||
|
||||
If your pull request exhibits conflicts with the base branch, please resolve them
|
||||
by using `git rebase` instead of `git merge`.
|
||||
Pull requests to implement RFCs should be submitted against `master`.
|
||||
|
||||
## Filing bugs
|
||||
|
||||
|
||||
+29
-36
@@ -37,7 +37,7 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cli
|
||||
MAINTENANCE: Marcus Börger <helly@php.net>, Edin Kadribasic <edink@php.net>
|
||||
MAINTENANCE: Marcus Boerger <helly@php.net>, Edin Kadribasic <edink@php.net>
|
||||
STATUS: Working
|
||||
SINCE: 4.3.0
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
@@ -68,7 +68,7 @@ STATUS: 5.6
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>,Christopher Jones <sixd@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>,Christopher Jones <sixd@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: DBM abstraction for db2, db3, db4, dbm, ndbm, gdbm, ini
|
||||
@@ -79,13 +79,13 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqli
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqlnd
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
@@ -99,7 +99,7 @@ EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Wez Furlong <wez@php.net>
|
||||
@@ -108,8 +108,8 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -120,7 +120,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_mysql
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Johannes Schlüter <johannes@php.net>, Andrey Hristov <andrey@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Johannes Schlüter <johannes@php.net>, Andrey Hristov <andrey@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
@@ -132,7 +132,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
@@ -150,7 +150,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug.
|
||||
@@ -168,13 +168,13 @@ COMMENT: Integrates SQLite 3 embeddable SQL database engine.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dom
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Börger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: simplexml
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
@@ -195,12 +195,12 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: libxml
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlreader
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -262,14 +262,8 @@ PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: enchant
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.2
|
||||
@@ -287,12 +281,12 @@ STATUS: Working
|
||||
SINCE: 5.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
PRIMARY MAINTAINER: Stefan Esser <sesser@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -335,7 +329,7 @@ STATUS: Working
|
||||
SINCE: 5.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>, Douglas Goldstein <cardoe@php.net>, Pierre-Alain Joye <pajoye@php.net>, Côme Bernigaud <mcmic@php.net>
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>, Douglas Goldstein <cardoe@php.net>, Pierre-Alain Joye <pajoye@php.net>, Côme Bernigaud <mcmic@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -344,6 +338,11 @@ PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -367,13 +366,13 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phar
|
||||
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net>, Marcus Börger <helly@php.net>, Steph Fox <sfox@php.net>
|
||||
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net>, Marcus Börger <helly@php.net>, Steph Fox <sfox@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -388,12 +387,12 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: reflection
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -419,14 +418,8 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sodium
|
||||
PRIMARY MAINTAINER: Frank Denis <jedisct1@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 7.2.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: spl
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Etienne Kneuss <colder@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>, Etienne Kneuss <colder@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0.0
|
||||
|
||||
@@ -5,6 +5,7 @@ Installing PHP
|
||||
|
||||
* General Installation Considerations
|
||||
* Installation on Unix systems
|
||||
+ Apache 1.3.x on Unix systems
|
||||
+ Apache 2.x on Unix systems
|
||||
+ Lighttpd 1.4 on Unix systems
|
||||
+ Sun, iPlanet and Netscape servers on Sun Solaris
|
||||
@@ -102,6 +103,7 @@ Installation on Unix systems
|
||||
|
||||
Table of Contents
|
||||
|
||||
* Apache 1.3.x on Unix systems
|
||||
* Apache 2.x on Unix systems
|
||||
* Lighttpd 1.4 on Unix systems
|
||||
* Sun, iPlanet and Netscape servers on Sun Solaris
|
||||
@@ -161,6 +163,208 @@ Table of Contents
|
||||
you can't figure out why, see the Problems section.
|
||||
__________________________________________________________________
|
||||
|
||||
Apache 1.3.x on Unix systems
|
||||
|
||||
This section contains notes and hints specific to Apache installs of
|
||||
PHP on Unix platforms. We also have instructions and notes for Apache 2
|
||||
on a separate page.
|
||||
|
||||
You can select arguments to add to the configure on line 10 below from
|
||||
the list of core configure options and from extension specific options
|
||||
described at the respective places in the manual. The version numbers
|
||||
have been omitted here, to ensure the instructions are not incorrect.
|
||||
You will need to replace the 'xxx' here with the correct values from
|
||||
your files.
|
||||
|
||||
Example #1 Installation Instructions (Apache Shared Module Version) for
|
||||
PHP
|
||||
1. gunzip apache_xxx.tar.gz
|
||||
2. tar -xvf apache_xxx.tar
|
||||
3. gunzip php-xxx.tar.gz
|
||||
4. tar -xvf php-xxx.tar
|
||||
5. cd apache_xxx
|
||||
6. ./configure --prefix=/www --enable-module=so
|
||||
7. make
|
||||
8. make install
|
||||
9. cd ../php-xxx
|
||||
|
||||
10. Now, configure your PHP. This is where you customize your PHP
|
||||
with various options, like which extensions will be enabled. Do a
|
||||
./configure --help for a list of available options. In our example
|
||||
we'll do a simple configure with Apache 1 and MySQL support. Your
|
||||
path to apxs may differ from our example.
|
||||
|
||||
./configure --with-mysql --with-apxs=/www/bin/apxs
|
||||
|
||||
11. make
|
||||
12. make install
|
||||
|
||||
If you decide to change your configure options after installation,
|
||||
you only need to repeat the last three steps. You only need to
|
||||
restart apache for the new module to take effect. A recompile of
|
||||
Apache is not needed.
|
||||
|
||||
Note that unless told otherwise, 'make install' will also install PEAR,
|
||||
various PHP tools such as phpize, install the PHP CLI, and more.
|
||||
|
||||
13. Setup your php.ini file:
|
||||
|
||||
cp php.ini-development /usr/local/lib/php.ini
|
||||
|
||||
You may edit your .ini file to set PHP options. If you prefer your
|
||||
php.ini in another location, use --with-config-file-path=/some/path in
|
||||
step 10.
|
||||
|
||||
If you instead choose php.ini-production, be certain to read the list
|
||||
of changes within, as they affect how PHP behaves.
|
||||
|
||||
14. Edit your httpd.conf to load the PHP module. The path on the right hand
|
||||
side of the LoadModule statement must point to the path of the PHP
|
||||
module on your system. The make install from above may have already
|
||||
added this for you, but be sure to check.
|
||||
|
||||
LoadModule php7_module libexec/libphp7.so
|
||||
|
||||
15. And in the AddModule section of httpd.conf, somewhere under the
|
||||
ClearModuleList, add this:
|
||||
|
||||
AddModule mod_php7.c
|
||||
|
||||
16. Tell Apache to parse certain extensions as PHP. For example,
|
||||
let's have Apache parse the .php extension as PHP. You could
|
||||
have any extension(s) parse as PHP by simply adding more, with
|
||||
each separated by a space. We'll add .phtml to demonstrate.
|
||||
|
||||
AddType application/x-httpd-php .php .phtml
|
||||
|
||||
It's also common to setup the .phps extension to show highlighted PHP
|
||||
source, this can be done with:
|
||||
|
||||
AddType application/x-httpd-php-source .phps
|
||||
|
||||
17. Use your normal procedure for starting the Apache server. (You must
|
||||
stop and restart the server, not just cause the server to reload by
|
||||
using a HUP or USR1 signal.)
|
||||
|
||||
Alternatively, to install PHP as a static object:
|
||||
|
||||
Example #2 Installation Instructions (Static Module Installation for
|
||||
Apache) for PHP
|
||||
1. gunzip -c apache_1.3.x.tar.gz | tar xf -
|
||||
2. cd apache_1.3.x
|
||||
3. ./configure
|
||||
4. cd ..
|
||||
|
||||
5. gunzip -c php-5.x.y.tar.gz | tar xf -
|
||||
6. cd php-5.x.y
|
||||
7. ./configure --with-mysql --with-apache=../apache_1.3.x
|
||||
8. make
|
||||
9. make install
|
||||
|
||||
10. cd ../apache_1.3.x
|
||||
|
||||
11. ./configure --prefix=/www --activate-module=src/modules/php7/libphp7.a
|
||||
(The above line is correct! Yes, we know libphp7.a does not exist at this
|
||||
stage. It isn't supposed to. It will be created.)
|
||||
|
||||
12. make
|
||||
(you should now have an httpd binary which you can copy to your Apache bin d
|
||||
ir if
|
||||
it is your first install then you need to "make install" as well)
|
||||
|
||||
13. cd ../php-5.x.y
|
||||
14. cp php.ini-development /usr/local/lib/php.ini
|
||||
|
||||
15. You can edit /usr/local/lib/php.ini file to set PHP options.
|
||||
Edit your httpd.conf or srm.conf file and add:
|
||||
AddType application/x-httpd-php .php
|
||||
|
||||
Depending on your Apache install and Unix variant, there are many
|
||||
possible ways to stop and restart the server. Below are some typical
|
||||
lines used in restarting the server, for different apache/unix
|
||||
installations. You should replace /path/to/ with the path to these
|
||||
applications on your systems.
|
||||
|
||||
Example #3 Example commands for restarting Apache
|
||||
1. Several Linux and SysV variants:
|
||||
/etc/rc.d/init.d/httpd restart
|
||||
|
||||
2. Using apachectl scripts:
|
||||
/path/to/apachectl stop
|
||||
/path/to/apachectl start
|
||||
|
||||
3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
|
||||
/path/to/httpsdctl stop
|
||||
/path/to/httpsdctl start
|
||||
|
||||
4. Using mod_ssl, or another SSL server, you may want to manually
|
||||
stop and start:
|
||||
/path/to/apachectl stop
|
||||
/path/to/apachectl startssl
|
||||
|
||||
The locations of the apachectl and http(s)dctl binaries often vary. If
|
||||
your system has locate or whereis or which commands, these can assist
|
||||
you in finding your server control programs.
|
||||
|
||||
Different examples of compiling PHP for apache are as follows:
|
||||
./configure --with-apxs --with-pgsql
|
||||
|
||||
This will create a libphp7.so shared library that is loaded into Apache
|
||||
using a LoadModule line in Apache's httpd.conf file. The PostgreSQL
|
||||
support is embedded into this library.
|
||||
|
||||
./configure --with-apxs --with-pgsql=shared
|
||||
|
||||
This will create a libphp7.so shared library for Apache, but it will
|
||||
also create a pgsql.so shared library that is loaded into PHP either by
|
||||
using the extension directive in php.ini file or by loading it
|
||||
explicitly in a script using the dl() function.
|
||||
|
||||
./configure --with-apache=/path/to/apache_source --with-pgsql
|
||||
|
||||
This will create a libmodphp7.a library, a mod_php7.c and some
|
||||
accompanying files and copy this into the src/modules/php7 directory in
|
||||
the Apache source tree. Then you compile Apache using
|
||||
--activate-module=src/modules/php7/libphp7.a and the Apache build
|
||||
system will create libphp7.a and link it statically into the httpd
|
||||
binary. The PostgreSQL support is included directly into this httpd
|
||||
binary, so the final result here is a single httpd binary that includes
|
||||
all of Apache and all of PHP.
|
||||
|
||||
./configure --with-apache=/path/to/apache_source --with-pgsql=shared
|
||||
|
||||
Same as before, except instead of including PostgreSQL support directly
|
||||
into the final httpd you will get a pgsql.so shared library that you
|
||||
can load into PHP from either the php.ini file or directly using dl().
|
||||
|
||||
When choosing to build PHP in different ways, you should consider the
|
||||
advantages and drawbacks of each method. Building as a shared object
|
||||
will mean that you can compile apache separately, and don't have to
|
||||
recompile everything as you add to, or change, PHP. Building PHP into
|
||||
apache (static method) means that PHP will load and run faster. For
|
||||
more information, see the Apache » web page on DSO support.
|
||||
|
||||
Note:
|
||||
|
||||
Apache's default httpd.conf currently ships with a section that
|
||||
looks like this:
|
||||
|
||||
User nobody
|
||||
Group "#-1"
|
||||
|
||||
Unless you change that to "Group nogroup" or something like that
|
||||
("Group daemon" is also very common) PHP will not be able to open
|
||||
files.
|
||||
|
||||
Note:
|
||||
|
||||
Make sure you specify the installed version of apxs when using
|
||||
--with-apxs=/path/to/apxs . You must NOT use the apxs version that
|
||||
is in the apache sources but the one that is actually installed on
|
||||
your system.
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
Apache 2.x on Unix systems
|
||||
|
||||
This section contains notes and hints specific to Apache 2.x installs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2018 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2015 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
|
||||
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
|
||||
|
||||
all: $(all_targets)
|
||||
all: $(all_targets)
|
||||
@echo
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@@ -112,13 +112,13 @@ test: all
|
||||
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 \*.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) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
@@ -135,7 +135,7 @@ prof-gen:
|
||||
|
||||
prof-clean:
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ PHP_FUNCTION(module_name_drawtext)
|
||||
zval *image = NULL;
|
||||
zval *font = NULL;
|
||||
|
||||
if (zend_parse_parameters(argc, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
|
||||
return;
|
||||
|
||||
if (image) {
|
||||
|
||||
+9
-14
@@ -12,7 +12,7 @@ Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
|
||||
some basic rules with regards to Git usage will::
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
PHP itself.
|
||||
Git itself.
|
||||
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
@@ -38,26 +38,21 @@ Having said that, here are the organizational rules::
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
To do so use "make test".
|
||||
|
||||
7. For development use the --enable-debug switch to avoid memory leaks
|
||||
and the --enable-maintainer-zts switch to ensure your code handles
|
||||
TSRM correctly and doesn't break for those who need that.
|
||||
7. For development use the --enable-maintainer-zts switch to ensure your
|
||||
code handles TSRM correctly and doesn't break for those who need that.
|
||||
|
||||
Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-7.1 Is used to release the PHP 7.1.x series. This is a prerelease
|
||||
version.
|
||||
|
||||
PHP-7.0 Is used to release the PHP 7.0.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 This branch is closed.
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 This branch is closed.
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
@@ -72,7 +67,7 @@ Currently we have the following branches in use::
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.6) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
@@ -84,7 +79,7 @@ The next few rules are more of a technical nature::
|
||||
should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
|
||||
not master, which is not a public released version yet.
|
||||
|
||||
3. Do not commit multiple files and dump all messages in one commit. If you
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
provide a nice commit message for each one. See example below.
|
||||
|
||||
|
||||
+38
-38
@@ -8,98 +8,98 @@ API adjustment to the old output control code:
|
||||
|
||||
Checking output control layers status:
|
||||
// Using OG()
|
||||
php_output_get_status();
|
||||
php_output_get_status(TSRMLS_C);
|
||||
|
||||
Starting the default output handler:
|
||||
// php_start_ob_buffer(NULL, 0, 1);
|
||||
php_output_start_default();
|
||||
// php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
|
||||
php_output_start_default(TSRMLS_C);
|
||||
|
||||
Starting an user handler by zval:
|
||||
// php_start_ob_buffer(zhandler, chunk_size, erase);
|
||||
php_output_start_user(zhandler, chunk_size, flags);
|
||||
// php_start_ob_buffer(zhandler, chunk_size, erase TSRMLS_CC);
|
||||
php_output_start_user(zhandler, chunk_size, flags TSRMLS_CC);
|
||||
|
||||
Starting an internal handler without context:
|
||||
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase);
|
||||
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags);
|
||||
Starting an internal handler whithout context:
|
||||
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase TSRMLS_CC);
|
||||
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags TSRMLS_CC);
|
||||
|
||||
Starting an internal handler with context:
|
||||
// not possible with old API
|
||||
php_output_handler *h;
|
||||
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags);
|
||||
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags TSRMLS_CC);
|
||||
php_output_handler_set_context(h, my_context, my_context_dtor);
|
||||
php_output_handler_start(h);
|
||||
php_output_handler_start(h TSRMLS_CC);
|
||||
|
||||
Testing whether a certain output handler has already been started:
|
||||
// php_ob_handler_used("output handler name");
|
||||
php_output_handler_started(handler_name, handler_name_len);
|
||||
// php_ob_handler_used("output handler name" TSRMLS_CC);
|
||||
php_output_handler_started(handler_name, handler_name_len TSRMLS_CC);
|
||||
|
||||
Flushing one output buffer:
|
||||
// php_end_ob_buffer(1, 1);
|
||||
php_output_flush();
|
||||
// php_end_ob_buffer(1, 1 TSRMLS_CC);
|
||||
php_output_flush(TSRMLS_C);
|
||||
|
||||
Flushing all output buffers:
|
||||
// not possible with old API
|
||||
php_output_flush_all();
|
||||
php_output_flush_all(TSRMLS_C);
|
||||
|
||||
Cleaning one output buffer:
|
||||
// php_ob_end_buffer(0, 1);
|
||||
php_output_clean();
|
||||
// php_ob_end_buffer(0, 1 TSRMLS_CC);
|
||||
php_output_clean(TSRMLS_C);
|
||||
|
||||
Cleaning all output buffers:
|
||||
// not possible with old API
|
||||
php_output_clean_all();
|
||||
php_output_clean_all(TSRMLS_C);
|
||||
|
||||
Discarding one output buffer:
|
||||
// php_ob_end_buffer(0, 0);
|
||||
php_output_discard();
|
||||
// php_ob_end_buffer(0, 0 TSRMLS_CC);
|
||||
php_output_discard(TSRMLS_C);
|
||||
|
||||
Discarding all output buffers:
|
||||
// php_ob_end_buffers(0);
|
||||
php_output_discard_all();
|
||||
// php_ob_end_buffers(0 TSRMLS_CC);
|
||||
php_output_discard_all(TSRMLS_C);
|
||||
|
||||
Stopping (and dropping) one output buffer:
|
||||
// php_ob_end_buffer(1, 0)
|
||||
php_output_end();
|
||||
// php_ob_end_buffer(1, 0 TSRMLS_CC)
|
||||
php_output_end(TSRMLS_C);
|
||||
|
||||
Stopping (and dropping) all output buffers:
|
||||
// php_ob_end_buffers(1, 0);
|
||||
php_output_end_all();
|
||||
// php_ob_end_buffers(1, 0 TSRMLS_CC);
|
||||
php_output_end_all(TSRMLS_C);
|
||||
|
||||
Retrieving output buffers contents:
|
||||
// php_ob_get_buffer(zstring);
|
||||
php_output_get_contents(zstring);
|
||||
// php_ob_get_buffer(zstring TSRMLS_CC);
|
||||
php_output_get_contents(zstring TSRMLS_CC);
|
||||
|
||||
Retrieving output buffers length:
|
||||
// php_ob_get_length(zlength);
|
||||
php_output_get_length(zlength);
|
||||
// php_ob_get_length(zlength TSRMLS_CC);
|
||||
php_output_get_length(zlength TSRMLS_CC);
|
||||
|
||||
Retrieving output buffering level:
|
||||
// OG(nesting_level);
|
||||
php_output_get_level();
|
||||
php_output_get_level(TSRMLS_C);
|
||||
|
||||
Issue a warning because of an output handler conflict:
|
||||
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name");
|
||||
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len);
|
||||
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name" TSRMLS_CC);
|
||||
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len TSRMLS_CC);
|
||||
|
||||
Registering a conflict checking function, which will be checked prior starting the handler:
|
||||
// not possible with old API, unless hardcoding into output.c
|
||||
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t);
|
||||
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
|
||||
|
||||
Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler:
|
||||
// not possible with old API
|
||||
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t);
|
||||
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
|
||||
|
||||
Facilitating a context from within an output handler callable with ob_start():
|
||||
// not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr);
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr TSRMLS_CC);
|
||||
|
||||
Disabling of the output handler by itself:
|
||||
//not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL);
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL TSRMLS_CC);
|
||||
|
||||
Marking an output handler immutable by itself because of irreversibility of its operation:
|
||||
// not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
|
||||
|
||||
Restarting the output handler because of a CLEAN operation:
|
||||
// not possible with old API
|
||||
|
||||
@@ -13,8 +13,8 @@ meaningful error messages.
|
||||
Prototypes
|
||||
----------
|
||||
/* Implemented. */
|
||||
int zend_parse_parameters(int num_args, char *type_spec, ...);
|
||||
int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
|
||||
int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
|
||||
int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
|
||||
|
||||
The zend_parse_parameters() function takes the number of parameters
|
||||
passed to the extension function, the type specifier string, and the
|
||||
@@ -30,7 +30,7 @@ resources cannot be auto-converted.
|
||||
|
||||
PHP 5.5 includes a new function:
|
||||
|
||||
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
|
||||
int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);
|
||||
|
||||
This function behaves like zend_parse_parameters_ex() except that instead of
|
||||
reading the arguments from the stack, it receives a single zval to convert
|
||||
@@ -63,10 +63,10 @@ Type specifiers
|
||||
o - object of any type (zval*)
|
||||
O - object of specific type given by class entry (zval*, zend_class_entry)
|
||||
p - valid path (string without null bytes in the middle) and its length (char*, size_t)
|
||||
P - valid path (string without null bytes in the middle) as zend_string (zend_string*)
|
||||
P - valid path (string without null bytes in the middle) as zend_string (zend_string)
|
||||
r - resource (zval*)
|
||||
s - string (with possible null bytes) and its length (char*, size_t)
|
||||
S - string (with possible null bytes) as zend_string (zend_string*)
|
||||
S - string (with possible null bytes) as zend_string (zend_string)
|
||||
z - the actual zval (zval*)
|
||||
* - variable arguments list (0 or more)
|
||||
+ - variable arguments list (1 or more)
|
||||
@@ -97,11 +97,11 @@ Both mistakes might cause memory corruptions and segfaults:
|
||||
1)
|
||||
char *str;
|
||||
long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */
|
||||
zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len)
|
||||
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
|
||||
|
||||
2)
|
||||
int num; /* XXX THIS IS WRONG!! Use zend_long instead. */
|
||||
zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num)
|
||||
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)
|
||||
|
||||
If you're in doubt, use check_parameters.php script to the parameters
|
||||
and their types (it can be found in ./scripts/dev/ directory of PHP sources):
|
||||
@@ -116,7 +116,7 @@ zend_long l;
|
||||
char *s;
|
||||
size_t s_len;
|
||||
zval *param;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
|
||||
&l, &s, &s_len, ¶m) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
|
||||
zval *obj;
|
||||
double d = 0.5;
|
||||
zend_class_entry *my_ce;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
|
||||
&obj, my_ce, &d) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
|
||||
If null is passed for object, obj will be set to NULL. */
|
||||
zval *obj;
|
||||
zval *arr;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a",
|
||||
&obj, &arr) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
|
||||
|
||||
/* Gets a separated array which can also be null. */
|
||||
zval *arr;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
|
||||
&arr) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -161,10 +161,10 @@ char *s;
|
||||
*/
|
||||
size_t length;
|
||||
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"lll", &l1, &l2, &l3) == SUCCESS) {
|
||||
/* manipulate longs */
|
||||
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
|
||||
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"s", &s, &length) == SUCCESS) {
|
||||
/* manipulate string */
|
||||
} else {
|
||||
@@ -180,7 +180,7 @@ int i, num_varargs;
|
||||
zval *varargs = NULL;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &varargs, &num_varargs) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ size_t str_len;
|
||||
int i, num_varargs;
|
||||
zval *varargs = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ zval *array;
|
||||
int i, num_varargs;
|
||||
zval *varargs = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+44
-19
@@ -5,16 +5,17 @@
|
||||
5. ext/standard crypt
|
||||
6. ext/standard crypt's blowfish implementation
|
||||
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
|
||||
8. ext/standard/rand
|
||||
9. ext/standard/scanf
|
||||
10. ext/standard/strnatcmp.c
|
||||
11. ext/standard/uuencode
|
||||
12. libxmlrpc ext/xmlrpc
|
||||
13. libzip ext/zip
|
||||
14. main/snprintf.c
|
||||
15. main/strlcat
|
||||
16. main/strlcpy
|
||||
17. libgd see ext/gd/libgd/COPYING
|
||||
8. ext/json/json_parser
|
||||
9. ext/standard/rand
|
||||
10. ext/standard/scanf
|
||||
11. ext/standard/strnatcmp.c
|
||||
12. ext/standard/uuencode
|
||||
13. libxmlrpc ext/xmlrpc
|
||||
14. libzip ext/zip
|
||||
15. main/snprintf.c
|
||||
16. main/strlcat
|
||||
17. main/strlcpy
|
||||
18. libgd see ext/gd/libgd/COPYING
|
||||
|
||||
5. ext/standard crypt
|
||||
|
||||
@@ -103,7 +104,31 @@ a legal notice, here is a blessing:
|
||||
May you share freely, never taking more than you give.
|
||||
|
||||
|
||||
8. ext/standard/rand
|
||||
8. ext/json/json_parser
|
||||
Copyright (c) 2005 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
9. ext/standard/rand
|
||||
The following php_mt_...() functions are based on a C++ class MTRand by
|
||||
Richard J. Wagner. For more information see the web page at
|
||||
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
|
||||
@@ -156,7 +181,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
9. ext/standard/scanf
|
||||
10. ext/standard/scanf
|
||||
scanf.c --
|
||||
|
||||
This file contains the base code which implements sscanf and by extension
|
||||
@@ -202,7 +227,7 @@ authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
|
||||
10. ext/standard/strnatcmp.c
|
||||
11. ext/standard/strnatcmp.c
|
||||
|
||||
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
|
||||
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
|
||||
@@ -223,7 +248,7 @@ freely, subject to the following restrictions:
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
11. ext/standard/uuencode
|
||||
12. ext/standard/uuencode
|
||||
Portions of this code are based on Berkeley's uuencode/uudecode
|
||||
implementation.
|
||||
|
||||
@@ -259,7 +284,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
|
||||
12. libxmlrpc ext/xmlrpc
|
||||
13. libxmlrpc ext/xmlrpc
|
||||
|
||||
Copyright 2000 Epinions, Inc.
|
||||
|
||||
@@ -283,7 +308,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
|
||||
NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
13. libzip ext/zip
|
||||
14. libzip ext/zip
|
||||
zip.h -- exported declarations.
|
||||
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
|
||||
|
||||
@@ -315,7 +340,7 @@ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
14. main/snprintf.c
|
||||
15. main/snprintf.c
|
||||
Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -388,8 +413,8 @@ This code is based on, and used with the permission of, the
|
||||
SIO stdio-replacement strx_* functions by Panos Tsirigotis
|
||||
<panos@alumni.cs.colorado.edu> for xinetd.
|
||||
|
||||
15. main/strlcat
|
||||
16. main/strlcpy
|
||||
16. main/strlcat
|
||||
17. main/strlcpy
|
||||
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
All rights reserved.
|
||||
|
||||
|
||||
+44
-79
@@ -17,7 +17,7 @@ It is recommended to do so a couple of days before the packaging day, to
|
||||
have enough time to investigate failures, communicate with the authors and
|
||||
commit the fixes.
|
||||
The RM for the branch is also responsible for keeping the CI green on
|
||||
ongoing basis between the releases. Check the CI status for your branch
|
||||
ongoing bases between the releases. Check the CI status for your branch
|
||||
periodically and resolve the failures ASAP. See more in:
|
||||
https://wiki.php.net/rfc/travis_ci
|
||||
|
||||
@@ -31,7 +31,7 @@ team (Bjori) on hand.
|
||||
|
||||
6. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
7. Moving extensions from/to PECL requires write access to the destination.
|
||||
7. Moving extensions from/to PECL requires write acces to the destination.
|
||||
Most developers should have this.
|
||||
|
||||
Moving extensions from php-src to PECL
|
||||
@@ -65,7 +65,7 @@ credits files in ext/standard.
|
||||
|
||||
4. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
|
||||
|
||||
5. Bump the version numbers in ``main/php_version.h``, ``configure.ac`` and possibly ``NEWS``.
|
||||
5. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta. Do not use dashes, you should
|
||||
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
|
||||
|
||||
@@ -79,7 +79,7 @@ Do not use abbreviations for alpha and beta. Do not use dashes, you should
|
||||
9. Tag the repository release branch with the version, e.g.:
|
||||
``git tag -u YOURKEYID php-5.4.2RC2``
|
||||
|
||||
10. Bump the version numbers in ``main/php_version.h``, ``configure.ac`` and ``NEWS``
|
||||
10. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and ``NEWS``
|
||||
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
|
||||
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
@@ -93,59 +93,26 @@ Commit the changes to the main branch.
|
||||
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
13. run ``scripts/dev/gen_verify_stub <version> [identity]``, this will sign the tarballs
|
||||
and output verification information to be included in announcement email
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick or Dan.
|
||||
|
||||
14. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
directory "public_html/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, create it.
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
15. Now the RC can be found on http://downloads.php.net/~yourname,
|
||||
f.e. http://downloads.php.net/~derick/
|
||||
|
||||
16. Once the release has been tagged, contact the release-managers@ distribution list
|
||||
so that Windows binaries can be created. Once those are made, they can be found at
|
||||
http://windows.php.net/download
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be placed into the same directory as the source snapshots.
|
||||
|
||||
Getting the non stable release (alpha/beta/RC) announced
|
||||
--------------------------------------------------------
|
||||
|
||||
1. Update ``qa.git/include/release-qa.php`` with the appropriate information.
|
||||
See the documentation within release-qa.php for more information, but all releases
|
||||
and RCs are configured here. Only $QA_RELEASES needs to be edited.
|
||||
1. Send an email (see example here: http://news.php.net/php.internals/19486)
|
||||
**To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists
|
||||
pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release".
|
||||
|
||||
Example: When rolling an RC, set the 'rc' with appropriate information for the
|
||||
given version.
|
||||
|
||||
Note: Remember to update the MD5 and sha256 checksum information.
|
||||
|
||||
2. Update ``web/php.git/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
3. Add a short notice to phpweb stating that there is a new release, and
|
||||
highlight the major important things (security fixes) and when it is important
|
||||
to upgrade.
|
||||
|
||||
a. Call php bin/createNewsEntry in your local phpweb checkout
|
||||
Use category "releases" for all stable releases.
|
||||
Use category "frontpage" for X.Y.0 non-stable releases only (news only).
|
||||
|
||||
b. Add the content for the news entry. Be sure to include the text:
|
||||
"THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!"
|
||||
|
||||
4. Commit and push changes to qa and web
|
||||
|
||||
*Wait for web and qa sites to update with new information before sending announce*
|
||||
|
||||
5. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
lists pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release". Include in this information the verification
|
||||
information output by ``gen_verify_stub``.
|
||||
|
||||
6. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
This email is to notify the selected projects about a new release so that they
|
||||
can make sure their projects keep working. Make sure that you have been setup
|
||||
@@ -156,14 +123,33 @@ Derick) run the following commands for you:
|
||||
|
||||
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
|
||||
|
||||
7. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
3. Update ``qa.git/include/release-qa.php`` with the appropriate information.
|
||||
See the documentation within release-qa.php for more information, but all releases
|
||||
and RCs are configured here. Only $QA_RELEASES needs to be edited.
|
||||
|
||||
Example: When rolling an RC, set the 'rc' with appropriate information for the
|
||||
given version.
|
||||
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
4. Update ``web/php.git/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
5. Commit and push those changes:
|
||||
|
||||
a. ``git commit -a && git push origin master``
|
||||
|
||||
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
1. Checkout your release branch, you should have created when releasing previous RC
|
||||
and bump the version numbers in ``main/php_version.h``, ``configure.ac`` and possibly ``NEWS``.
|
||||
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
|
||||
2. If a CVE commit needs to be merged to the release, then have it committed to
|
||||
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
|
||||
@@ -204,8 +190,8 @@ Check if the pear files are updated (phar).
|
||||
This is to fetch the last commit id from php-distributions.git and commit this
|
||||
last commit id to web/php.git, then, mirrors will now sync
|
||||
|
||||
12. Once the release has been tagged, contact release managers, windows builders, and package maintainers
|
||||
so that they can build releases. Do not send this announcement to any public lists.
|
||||
12. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
@@ -285,8 +271,8 @@ to upgrade.
|
||||
10. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
http://news.php.net/php.internals/17222.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
@@ -323,27 +309,6 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
New Release Manager Checklist
|
||||
-----------------------------
|
||||
|
||||
1. Email systems@ to get setup for access to downloads.php.net and to be added to the
|
||||
release-managers@ distribution list.
|
||||
|
||||
2. Create a GPG key for your @php.net address and publish it by editing `include/gpg-keys.inc`
|
||||
in the `web-php` repository, adding the output of `gpg --fingerprint "$USER@php.net"`. Let
|
||||
one or more of the previous RMs sign your key. Publish your public key to pgp.mit.edu with:
|
||||
`gpg --keyserver pgp.mit.edu --send-keys $KEYID`
|
||||
|
||||
3. Request karma to eding main/php_version.h. Possibly karma for other restricted parts of
|
||||
php-src might come in question.
|
||||
|
||||
4. Request karma for web/qa.git and web/php.git for publishing release announcements.
|
||||
|
||||
5. Request moderation access to announce@php.net and primary-qa-tester@lists.php.net lists, to
|
||||
be able to moderate your release announcements. All the announcements should be sent from
|
||||
the @php.net alias.
|
||||
|
||||
+3
-3
@@ -28,7 +28,7 @@ The main functions are:
|
||||
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
|
||||
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
|
||||
count);
|
||||
PHPAPI size_t php_stream_printf(php_stream * stream,
|
||||
PHPAPI size_t php_stream_printf(php_stream * stream TSRMLS_DC,
|
||||
const char * fmt, ...);
|
||||
PHPAPI int php_stream_eof(php_stream * stream);
|
||||
PHPAPI int php_stream_getc(php_stream * stream);
|
||||
@@ -47,7 +47,7 @@ Opening Streams
|
||||
In most cases, you should use this API:
|
||||
|
||||
PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode,
|
||||
int options, char **opened_path);
|
||||
int options, char **opened_path TSRMLS_DC);
|
||||
|
||||
Where:
|
||||
path is the file or resource to open.
|
||||
@@ -80,7 +80,7 @@ PHPAPI php_stream *php_stream_fopen_tmpfile(void);
|
||||
Open a FILE * with tmpfile() and convert into a stream.
|
||||
|
||||
PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir,
|
||||
const char *pfx, char **opened_path);
|
||||
const char *pfx, char **opened_path TSRMLS_DC);
|
||||
Generate a temporary file name and open it.
|
||||
|
||||
There are some network enabled relatives in php_network.h:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Win32 Build System.
|
||||
|
||||
See https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
|
||||
See http://wiki.php.net/internals/windows/stepbystepbuild
|
||||
|
||||
vim:tw=78:sw=1:ts=1:et
|
||||
|
||||
+2
-2
@@ -138,7 +138,7 @@ SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter)
|
||||
strcpy(raw_var, "RAW_");
|
||||
strlcat(raw_var,var,var_len+5);
|
||||
|
||||
php_register_variable_ex(raw_var, &new_var, array_ptr);
|
||||
php_register_variable_ex(raw_var, &new_var, array_ptr TSRMLS_DC);
|
||||
|
||||
php_strip_tags(*val, val_len, NULL, NULL, 0);
|
||||
|
||||
@@ -154,7 +154,7 @@ PHP_FUNCTION(my_get_raw)
|
||||
zval **tmp;
|
||||
zval *array_ptr = NULL;
|
||||
|
||||
if(zend_parse_parameters(2, "ls", &arg, &var, &var_len) == FAILURE) {
|
||||
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,12 @@ This is the github mirror of the official PHP repository located at
|
||||
http://git.php.net.
|
||||
|
||||
[](http://travis-ci.org/php/php-src)
|
||||
[](https://ci.appveyor.com/project/php/php-src)
|
||||
|
||||
Pull Requests
|
||||
=============
|
||||
PHP accepts pull requests via github. Discussions are done on github, but
|
||||
depending on the topic can also be relayed to the official PHP developer
|
||||
mailing list internals@lists.php.net.
|
||||
mailinglist internals@lists.php.net.
|
||||
|
||||
New features require an RFC and must be accepted by the developers.
|
||||
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
Design
|
||||
======
|
||||
|
||||
Main assumption of the model is that the problem that we are to solve is the
|
||||
problem of the very long class names in PHP libraries. We would not attempt
|
||||
to take autoloader's job or create packaging model - only make names
|
||||
manageable.
|
||||
|
||||
Namespaces are defined the following way:
|
||||
|
||||
Zend/DB/Connection.php:
|
||||
<?php
|
||||
namespace Zend\DB;
|
||||
|
||||
class Connection {
|
||||
}
|
||||
|
||||
function connect() {
|
||||
}
|
||||
?>
|
||||
|
||||
Namespace definition does the following:
|
||||
All class and function names inside are automatically prefixed with
|
||||
namespace name. Inside namespace, local name always takes precedence over
|
||||
global name. Several files may be using the same namespace.
|
||||
The namespace declaration statement must be the very first statement in
|
||||
the file. The only exception is "declare" statement that can be used before.
|
||||
|
||||
Every class and function in a namespace can be referred to by the full name
|
||||
- e.g. Zend\DB\Connection or Zend\DB\connect - at any time.
|
||||
|
||||
<?php
|
||||
require 'Zend/Db/Connection.php';
|
||||
$x = new Zend\DB\Connection;
|
||||
Zend\DB\connect();
|
||||
?>
|
||||
|
||||
Namespace or class name can be imported:
|
||||
|
||||
<?php
|
||||
require 'Zend/Db/Connection.php';
|
||||
use Zend\DB;
|
||||
use Zend\DB\Connection as DbConnection;
|
||||
|
||||
$x = new Zend\DB\Connection();
|
||||
$y = new DB\connection();
|
||||
$z = new DbConnection();
|
||||
DB\connect();
|
||||
?>
|
||||
|
||||
The use statement only defines name aliasing. It may create name alias for
|
||||
namespace or class. The simple form of statement "use A\B\C\D;" is
|
||||
equivalent to "use A\B\C\D as D;". The use statement can be used at any
|
||||
time in the global scope (not inside function/class) and takes effect from
|
||||
the point of definition down to the end of file. It is recommended however to
|
||||
place the use statements at the beginning of the file. The use statements have
|
||||
effect only on the file where they appear.
|
||||
|
||||
The special "empty" namespace (\ prefix) is useful as explicit global
|
||||
namespace qualification. All class and function names started from \
|
||||
interpreted as global.
|
||||
|
||||
<?php
|
||||
namespace A\B\C;
|
||||
|
||||
$con = \mysql_connect(...);
|
||||
?>
|
||||
|
||||
A special constant __NAMESPACE__ contains the name of the current namespace.
|
||||
It can be used to construct fully-qualified names to pass them as callbacks.
|
||||
|
||||
<?php
|
||||
namespace A\B\C;
|
||||
|
||||
function foo() {
|
||||
}
|
||||
|
||||
set_error_handler(__NAMESPACE__ . "\foo");
|
||||
?>
|
||||
|
||||
In global namespace __NAMESPACE__ constant has the value of empty string.
|
||||
|
||||
Names inside namespace are resolved according to the following rules:
|
||||
|
||||
1) all qualified names are translated during compilation according to
|
||||
current import rules. So if we have "use A\B\C" and then "C\D\e()"
|
||||
it is translated to "A\B\C\D\e()".
|
||||
2) unqualified class names translated during compilation according to
|
||||
current import rules. So if we have "use A\B\C" and then "new C()" it
|
||||
is translated to "new A\B\C()".
|
||||
3) inside namespace, calls to unqualified functions that are defined in
|
||||
current namespace (and are known at the time the call is parsed) are
|
||||
interpreted as calls to these namespace functions.
|
||||
4) inside namespace, calls to unqualified functions that are not defined
|
||||
in current namespace are resolved at run-time. The call to function foo()
|
||||
inside namespace (A\B) first tries to find and call function from current
|
||||
namespace A\B\foo() and if it doesn't exist PHP tries to call internal
|
||||
function foo(). Note that using foo() inside namespace you can call only
|
||||
internal PHP functions, however using \foo() you are able to call any
|
||||
function from the global namespace.
|
||||
5) unqualified class names are resolved at run-time. E.q. "new Exception()"
|
||||
first tries to use (and autoload) class from current namespace and in case
|
||||
of failure uses internal PHP class. Note that using "new A" in namespace
|
||||
you can only create class from this namespace or internal PHP class, however
|
||||
using "new \A" you are able to create any class from the global namespace.
|
||||
6) Calls to qualified functions are resolved at run-time. Call to
|
||||
A\B\foo() first tries to call function foo() from namespace A\B, then
|
||||
it tries to find class A\B (__autoload() it if necessary) and call its
|
||||
static method foo()
|
||||
7) qualified class names are interpreted as class from corresponding
|
||||
namespace. So "new A\B\C()" refers to class C from namespace A\B.
|
||||
|
||||
Examples
|
||||
--------
|
||||
<?php
|
||||
namespace A;
|
||||
foo(); // first tries to call "foo" defined in namespace "A"
|
||||
// then calls internal function "foo"
|
||||
\foo(); // calls function "foo" defined in global scope
|
||||
?>
|
||||
|
||||
<?php
|
||||
namespace A;
|
||||
new B(); // first tries to create object of class "B" defined in namespace "A"
|
||||
// then creates object of internal class "B"
|
||||
new \B(); // creates object of class "B" defined in global scope
|
||||
?>
|
||||
|
||||
<?php
|
||||
namespace A;
|
||||
new A(); // first tries to create object of class "A" from namespace "A" (A\A)
|
||||
// then creates object of internal class "A"
|
||||
?>
|
||||
|
||||
<?php
|
||||
namespace A;
|
||||
B\foo(); // first tries to call function "foo" from namespace "A\B"
|
||||
// then calls method "foo" of internal class "B"
|
||||
\B\foo(); // first tries to call function "foo" from namespace "B"
|
||||
// then calls method "foo" of class "B" from global scope
|
||||
?>
|
||||
|
||||
The worst case if class name conflicts with namespace name
|
||||
<?php
|
||||
namespace A;
|
||||
A\foo(); // first tries to call function "foo" from namespace "A\A"
|
||||
// then tries to call method "foo" of class "A" from namespace "A"
|
||||
// then tries to call function "foo" from namespace "A"
|
||||
// then calls method "foo" of internal class "A"
|
||||
\A\foo(); // first tries to call function "foo" from namespace "A"
|
||||
// then calls method "foo" of class "A" from global scope
|
||||
?>
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
* Support for namespace constants?
|
||||
|
||||
* performance problems
|
||||
- calls to internal functions in namespaces are slower, because PHP first
|
||||
looks for such function in current namespace
|
||||
- calls to static methods are slower, because PHP first tries to look
|
||||
for corresponding function in namespace
|
||||
|
||||
* Extend the Reflection API?
|
||||
* Add ReflectionNamespace class
|
||||
+ getName()
|
||||
+ getClasses()
|
||||
+ getFunctions()
|
||||
+ getFiles()
|
||||
* Add getNamespace() methods to ReflectionClass and ReflectionFunction
|
||||
|
||||
* Rename namespaces to packages?
|
||||
|
||||
+61
-92
@@ -55,9 +55,8 @@ static int resource_types_table_size;
|
||||
static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */
|
||||
|
||||
/* New thread handlers */
|
||||
static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler = NULL;
|
||||
static tsrm_thread_end_func_t tsrm_new_thread_end_handler = NULL;
|
||||
static tsrm_shutdown_func_t tsrm_shutdown_handler = NULL;
|
||||
static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler;
|
||||
static tsrm_thread_end_func_t tsrm_new_thread_end_handler;
|
||||
|
||||
/* Debug support */
|
||||
int tsrm_error(int level, const char *format, ...);
|
||||
@@ -94,12 +93,7 @@ static FILE *tsrm_error_file;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(GNUPTH)
|
||||
static pth_key_t tls_key;
|
||||
# define tsrm_tls_set(what) pth_key_setdata(tls_key, (void*)(what))
|
||||
# define tsrm_tls_get() pth_key_getdata(tls_key)
|
||||
|
||||
#elif defined(PTHREADS)
|
||||
#if defined(PTHREADS)
|
||||
/* Thread local storage */
|
||||
static pthread_key_t tls_key;
|
||||
# define tsrm_tls_set(what) pthread_setspecific(tls_key, (void*)(what))
|
||||
@@ -126,14 +120,11 @@ static int32 tls_key;
|
||||
# warning tsrm_set_interpreter_context is probably broken on this platform
|
||||
#endif
|
||||
|
||||
TSRM_TLS uint8_t in_main_thread = 0;
|
||||
|
||||
/* Startup TSRM (call once for the entire process) */
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
|
||||
{/*{{{*/
|
||||
{
|
||||
#if defined(GNUPTH)
|
||||
pth_init();
|
||||
pth_key_create(&tls_key, 0);
|
||||
#elif defined(PTHREADS)
|
||||
pthread_key_create( &tls_key, 0 );
|
||||
#elif defined(TSRM_ST)
|
||||
@@ -145,9 +136,6 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
|
||||
tls_key = tls_allocate();
|
||||
#endif
|
||||
|
||||
/* ensure singleton */
|
||||
in_main_thread = 1;
|
||||
|
||||
tsrm_error_file = stderr;
|
||||
tsrm_error_set(debug_level, debug_filename);
|
||||
tsrm_tls_table_size = expected_threads;
|
||||
@@ -170,21 +158,18 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
|
||||
|
||||
tsmm_mutex = tsrm_mutex_alloc();
|
||||
|
||||
tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL;
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources));
|
||||
return 1;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* Shutdown TSRM (call once for the entire process) */
|
||||
TSRM_API void tsrm_shutdown(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!in_main_thread) {
|
||||
/* ensure singleton */
|
||||
return;
|
||||
}
|
||||
|
||||
if (tsrm_tls_table) {
|
||||
for (i=0; i<tsrm_tls_table_size; i++) {
|
||||
tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
|
||||
@@ -227,18 +212,12 @@ TSRM_API void tsrm_shutdown(void)
|
||||
#elif defined(TSRM_WIN32)
|
||||
TlsFree(tls_key);
|
||||
#endif
|
||||
if (tsrm_shutdown_handler) {
|
||||
tsrm_shutdown_handler();
|
||||
}
|
||||
tsrm_new_thread_begin_handler = NULL;
|
||||
tsrm_new_thread_end_handler = NULL;
|
||||
tsrm_shutdown_handler = NULL;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* allocates a new thread-safe-resource id */
|
||||
TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)
|
||||
{/*{{{*/
|
||||
{
|
||||
int i;
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size));
|
||||
@@ -289,11 +268,11 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id));
|
||||
return *rsrc_id;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id)
|
||||
{/*{{{*/
|
||||
{
|
||||
int i;
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id));
|
||||
@@ -329,16 +308,25 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
}
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
{/*{{{*/
|
||||
{
|
||||
THREAD_T thread_id;
|
||||
int hash_value;
|
||||
tsrm_tls_entry *thread_resources;
|
||||
|
||||
#ifdef NETWARE
|
||||
/* The below if loop is added for NetWare to fix an abend while unloading PHP
|
||||
* when an Apache unload command is issued on the system console.
|
||||
* While exiting from PHP, at the end for some reason, this function is called
|
||||
* with tsrm_tls_table = NULL. When this happened, the server abends when
|
||||
* tsrm_tls_table is accessed since it is NULL.
|
||||
*/
|
||||
if(tsrm_tls_table) {
|
||||
#endif
|
||||
if (!th_id) {
|
||||
/* Fast path for looking up the resources for the current
|
||||
* thread. Its used by just about every call to
|
||||
@@ -392,12 +380,15 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
* changes to the structure as we read it.
|
||||
*/
|
||||
TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count);
|
||||
}/*}}}*/
|
||||
#ifdef NETWARE
|
||||
} /* if(tsrm_tls_table) */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* frees an interpreter context. You are responsible for making sure that
|
||||
* it is not linked into the TSRM hash, and not marked as the current interpreter */
|
||||
void tsrm_free_interpreter_context(void *context)
|
||||
{/*{{{*/
|
||||
{
|
||||
tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context;
|
||||
int i;
|
||||
|
||||
@@ -416,10 +407,10 @@ void tsrm_free_interpreter_context(void *context)
|
||||
free(thread_resources);
|
||||
thread_resources = next;
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
void *tsrm_set_interpreter_context(void *new_ctx)
|
||||
{/*{{{*/
|
||||
{
|
||||
tsrm_tls_entry *current;
|
||||
|
||||
current = tsrm_tls_get();
|
||||
@@ -432,12 +423,12 @@ void *tsrm_set_interpreter_context(void *new_ctx)
|
||||
|
||||
/* return old context, so caller can restore it when they're done */
|
||||
return current;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* allocates a new interpreter context */
|
||||
void *tsrm_new_interpreter_context(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
tsrm_tls_entry *new_ctx, *current;
|
||||
THREAD_T thread_id;
|
||||
|
||||
@@ -451,12 +442,12 @@ void *tsrm_new_interpreter_context(void)
|
||||
/* switch back to the context that was in use prior to our creation
|
||||
* of the new one */
|
||||
return tsrm_set_interpreter_context(current);
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* frees all resources allocated for the current thread */
|
||||
void ts_free_thread(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
tsrm_tls_entry *thread_resources;
|
||||
int i;
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
@@ -493,12 +484,12 @@ void ts_free_thread(void)
|
||||
thread_resources = thread_resources->next;
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* 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();
|
||||
@@ -539,12 +530,12 @@ void ts_free_worker_threads(void)
|
||||
}
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* deallocates all occurrences of a given id */
|
||||
void ts_free_id(ts_rsrc_id id)
|
||||
{/*{{{*/
|
||||
{
|
||||
int i;
|
||||
int j = TSRM_UNSHUFFLE_RSRC_ID(id);
|
||||
|
||||
@@ -573,7 +564,7 @@ void ts_free_id(ts_rsrc_id id)
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id));
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -584,7 +575,7 @@ void ts_free_id(ts_rsrc_id id)
|
||||
|
||||
/* Obtain the current thread id */
|
||||
TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
#ifdef TSRM_WIN32
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(GNUPTH)
|
||||
@@ -600,12 +591,12 @@ TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
#elif defined(BETHREADS)
|
||||
return find_thread(NULL);
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* Allocate a mutex */
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
MUTEX_T mutexp;
|
||||
#ifdef TSRM_WIN32
|
||||
mutexp = malloc(sizeof(CRITICAL_SECTION));
|
||||
@@ -631,12 +622,12 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
|
||||
printf("Mutex created thread: %d\n",mythreadid());
|
||||
#endif
|
||||
return( mutexp );
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/* Free a mutex */
|
||||
TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
{/*{{{*/
|
||||
{
|
||||
if (mutexp) {
|
||||
#ifdef TSRM_WIN32
|
||||
DeleteCriticalSection(mutexp);
|
||||
@@ -660,7 +651,7 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
#ifdef THR_DEBUG
|
||||
printf("Mutex freed thread: %d\n",mythreadid());
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -668,7 +659,7 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
A return value of 0 indicates success
|
||||
*/
|
||||
TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
{/*{{{*/
|
||||
{
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id()));
|
||||
#ifdef TSRM_WIN32
|
||||
EnterCriticalSection(mutexp);
|
||||
@@ -692,7 +683,7 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
return acquire_sem(mutexp->sem);
|
||||
return 0;
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -700,7 +691,7 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
A return value of 0 indicates success
|
||||
*/
|
||||
TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
|
||||
{/*{{{*/
|
||||
{
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id()));
|
||||
#ifdef TSRM_WIN32
|
||||
LeaveCriticalSection(mutexp);
|
||||
@@ -724,14 +715,14 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
|
||||
return release_sem(mutexp->sem);
|
||||
return 0;
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
/*
|
||||
Changes the signal mask of the calling thread
|
||||
*/
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset)
|
||||
{/*{{{*/
|
||||
{
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Changed sigmask in thread: %ld", tsrm_thread_id()));
|
||||
/* TODO: add support for other APIs */
|
||||
#ifdef PTHREADS
|
||||
@@ -739,36 +730,28 @@ TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset)
|
||||
#else
|
||||
return sigprocmask(how, set, oldset);
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler)
|
||||
{/*{{{*/
|
||||
{
|
||||
void *retval = (void *) tsrm_new_thread_begin_handler;
|
||||
|
||||
tsrm_new_thread_begin_handler = new_thread_begin_handler;
|
||||
return retval;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler)
|
||||
{/*{{{*/
|
||||
{
|
||||
void *retval = (void *) tsrm_new_thread_end_handler;
|
||||
|
||||
tsrm_new_thread_end_handler = new_thread_end_handler;
|
||||
return retval;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler)
|
||||
{/*{{{*/
|
||||
void *retval = (void *) tsrm_shutdown_handler;
|
||||
|
||||
tsrm_shutdown_handler = shutdown_handler;
|
||||
return retval;
|
||||
}/*}}}*/
|
||||
|
||||
|
||||
/*
|
||||
* Debug support
|
||||
@@ -776,7 +759,7 @@ TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler)
|
||||
|
||||
#if TSRM_DEBUG
|
||||
int tsrm_error(int level, const char *format, ...)
|
||||
{/*{{{*/
|
||||
{
|
||||
if (level<=tsrm_error_level) {
|
||||
va_list args;
|
||||
int size;
|
||||
@@ -791,12 +774,12 @@ int tsrm_error(int level, const char *format, ...)
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void tsrm_error_set(int level, char *debug_filename)
|
||||
{/*{{{*/
|
||||
{
|
||||
tsrm_error_level = level;
|
||||
|
||||
#if TSRM_DEBUG
|
||||
@@ -813,25 +796,11 @@ void tsrm_error_set(int level, char *debug_filename)
|
||||
tsrm_error_file = stderr;
|
||||
}
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API void *tsrm_get_ls_cache(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
return tsrm_tls_get();
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API uint8_t tsrm_is_main_thread(void)
|
||||
{/*{{{*/
|
||||
return in_main_thread;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
#endif /* ZTS */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+7
-29
@@ -128,7 +128,6 @@ TSRM_API void ts_free_id(ts_rsrc_id id);
|
||||
|
||||
typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id);
|
||||
typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id);
|
||||
typedef void (*tsrm_shutdown_func_t)(void);
|
||||
|
||||
|
||||
TSRM_API int tsrm_error(int level, const char *format, ...);
|
||||
@@ -146,7 +145,6 @@ TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset);
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler);
|
||||
TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler);
|
||||
TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler);
|
||||
|
||||
/* these 3 APIs should only be used by people that fully understand the threading model
|
||||
* used by PHP/Zend and the selected SAPI. */
|
||||
@@ -155,16 +153,11 @@ TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
|
||||
TSRM_API void tsrm_free_interpreter_context(void *context);
|
||||
|
||||
TSRM_API void *tsrm_get_ls_cache(void);
|
||||
TSRM_API uint8_t tsrm_is_main_thread(void);
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus > 199711L
|
||||
# define TSRM_TLS thread_local
|
||||
#ifdef TSRM_WIN32
|
||||
# define TSRM_TLS __declspec(thread)
|
||||
#else
|
||||
# ifdef TSRM_WIN32
|
||||
# define TSRM_TLS __declspec(thread)
|
||||
# else
|
||||
# define TSRM_TLS __thread
|
||||
# endif
|
||||
# define TSRM_TLS __thread
|
||||
#endif
|
||||
|
||||
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
|
||||
@@ -172,19 +165,15 @@ TSRM_API uint8_t tsrm_is_main_thread(void);
|
||||
|
||||
#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
|
||||
#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache()
|
||||
#define TSRMG(id, type, element) (TSRMG_BULK(id, type)->element)
|
||||
#define TSRMG_BULK(id, type) ((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])
|
||||
#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
|
||||
|
||||
#define TSRMG_STATIC(id, type, element) (TSRMG_BULK_STATIC(id, type)->element)
|
||||
#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])
|
||||
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE;
|
||||
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
|
||||
#define TSRMG_STATIC(id, type, element) (((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
|
||||
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE
|
||||
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL
|
||||
#if ZEND_DEBUG
|
||||
#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
|
||||
#define TSRMLS_CACHE_RESET()
|
||||
#else
|
||||
#define TSRMLS_CACHE_UPDATE() if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache()
|
||||
#define TSRMLS_CACHE_RESET() TSRMLS_CACHE = NULL
|
||||
#endif
|
||||
#define TSRMLS_CACHE _tsrm_ls_cache
|
||||
|
||||
@@ -211,8 +200,6 @@ TSRM_API uint8_t tsrm_is_main_thread(void);
|
||||
#define TSRMLS_CACHE_UPDATE()
|
||||
#define TSRMLS_CACHE
|
||||
|
||||
#define TSRM_TLS
|
||||
|
||||
/* BC only */
|
||||
#define TSRMLS_D void
|
||||
#define TSRMLS_DC
|
||||
@@ -222,12 +209,3 @@ TSRM_API uint8_t tsrm_is_main_thread(void);
|
||||
#endif /* ZTS */
|
||||
|
||||
#endif /* TSRM_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+3
-3
@@ -30,14 +30,14 @@ $(LT_TARGETS):
|
||||
$(makefile_in_files): $(makefile_am_files)
|
||||
automake -a -i $(AMFLAGS) $(makefile_files)
|
||||
|
||||
aclocal.m4: configure.ac acinclude.m4
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.ac
|
||||
$(config_h_in): configure.in
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
autoheader
|
||||
|
||||
configure: aclocal.m4 configure.ac
|
||||
configure: aclocal.m4 configure.in
|
||||
autoconf
|
||||
@@ -1,6 +1,6 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Minimalistic configure.ac for TSRM.
|
||||
dnl Minimalistic configure.in for TSRM.
|
||||
dnl
|
||||
|
||||
AC_INIT(TSRM.c)
|
||||
@@ -1,197 +0,0 @@
|
||||
# =================================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
|
||||
# =================================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_FUNC_WHICH_GETHOSTBYNAME_R
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Determines which historical variant of the gethostbyname_r() call
|
||||
# (taking three, five, or six arguments) is available on the system and
|
||||
# defines one of the following macros accordingly:
|
||||
#
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_6
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_5
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_3
|
||||
#
|
||||
# as well as
|
||||
#
|
||||
# HAVE_GETHOSTBYNAME_R
|
||||
#
|
||||
# If used in conjunction with gethostname.c, the API demonstrated in
|
||||
# test.c can be used regardless of which gethostbyname_r() is available.
|
||||
# These example files can be found at
|
||||
# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
|
||||
#
|
||||
# based on David Arnold's autoconf suggestion in the threads faq
|
||||
#
|
||||
# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for
|
||||
# Autoconf 2.5x, and updated for 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
|
||||
# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 7
|
||||
|
||||
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
|
||||
|
||||
AC_LANG_PUSH([C])
|
||||
AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
|
||||
|
||||
AC_CACHE_VAL([ac_cv_func_which_gethostbyname_r], [
|
||||
|
||||
################################################################
|
||||
|
||||
ac_cv_func_which_gethostbyname_r=unknown
|
||||
|
||||
#
|
||||
# ONE ARGUMENT (sanity check)
|
||||
#
|
||||
|
||||
# This should fail, as there is no variant of gethostbyname_r() that takes
|
||||
# a single argument. If it actually compiles, then we can assume that
|
||||
# netdb.h is not declaring the function, and the compiler is thereby
|
||||
# assuming an implicit prototype. In which case, we're out of luck.
|
||||
#
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
(void)gethostbyname_r(name) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=no])
|
||||
|
||||
#
|
||||
# SIX ARGUMENTS
|
||||
# (e.g. Linux)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret, *retp;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=six])
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# FIVE ARGUMENTS
|
||||
# (e.g. Solaris)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=five])
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# THREE ARGUMENTS
|
||||
# (e.g. AIX, HP-UX, Tru64)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
struct hostent_data data;
|
||||
(void)gethostbyname_r(name, &ret, &data) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=three])
|
||||
|
||||
fi
|
||||
|
||||
################################################################
|
||||
|
||||
]) dnl end AC_CACHE_VAL
|
||||
|
||||
case "$ac_cv_func_which_gethostbyname_r" in
|
||||
three|five|six)
|
||||
AC_DEFINE([HAVE_GETHOSTBYNAME_R], [1],
|
||||
[Define to 1 if you have some form of gethostbyname_r().])
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$ac_cv_func_which_gethostbyname_r" in
|
||||
three)
|
||||
AC_MSG_RESULT([three])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_3], [1],
|
||||
[Define to 1 if you have the three-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
five)
|
||||
AC_MSG_RESULT([five])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_5], [1],
|
||||
[Define to 1 if you have the five-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
six)
|
||||
AC_MSG_RESULT([six])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_6], [1],
|
||||
[Define to 1 if you have the six-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
no)
|
||||
AC_MSG_RESULT([cannot find function declaration in netdb.h])
|
||||
;;
|
||||
|
||||
unknown)
|
||||
AC_MSG_RESULT([can't tell])
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([internal error])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_LANG_POP
|
||||
|
||||
]) dnl end AC_DEFUN
|
||||
|
||||
+45
-3
@@ -1,3 +1,45 @@
|
||||
/* Keep this header for compatibility with external code, it's currently not
|
||||
used anywhere in the core and there are no implementations in TSRM. */
|
||||
#include "win32/readdir.h"
|
||||
#ifndef READDIR_H
|
||||
#define READDIR_H
|
||||
|
||||
|
||||
/*
|
||||
* Structures and types used to implement opendir/readdir/closedir
|
||||
* on Windows 95/NT.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <direct.h>
|
||||
|
||||
/* struct dirent - same as Unix */
|
||||
|
||||
struct dirent {
|
||||
long d_ino; /* inode (always 1 in WIN32) */
|
||||
off_t d_off; /* offset to this dirent */
|
||||
unsigned short d_reclen; /* length of d_name */
|
||||
char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
|
||||
};
|
||||
|
||||
|
||||
/* typedef DIR - not the same as Unix */
|
||||
typedef struct {
|
||||
HANDLE 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 */
|
||||
char *dir; /* the dir we are reading */
|
||||
struct dirent dent; /* the dirent to return */
|
||||
} DIR;
|
||||
|
||||
/* Function prototypes */
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *, struct dirent *, struct dirent **);
|
||||
int closedir(DIR *);
|
||||
int rewinddir(DIR *);
|
||||
|
||||
#endif /* READDIR_H */
|
||||
+30
-27
@@ -66,7 +66,7 @@ dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
|
||||
AC_LINK_IFELSE([ AC_LANG_SOURCE([
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -80,11 +80,18 @@ int main() {
|
||||
int data = 1;
|
||||
pthread_mutexattr_init(&mattr);
|
||||
return pthread_create(&thd, NULL, thread_routine, &data);
|
||||
} ]) ], [
|
||||
pthreads_checked=yes
|
||||
} ], [
|
||||
pthreads_working=yes
|
||||
], [
|
||||
pthreads_checked=no
|
||||
]
|
||||
pthreads_working=no
|
||||
], [
|
||||
dnl For cross compiling running this test is of no use. NetWare supports pthreads
|
||||
pthreads_working=no
|
||||
case $host_alias in
|
||||
*netware*)
|
||||
pthreads_working=yes
|
||||
esac
|
||||
]
|
||||
) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
@@ -122,34 +129,30 @@ else
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_cflags=$flag
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
|
||||
pthreads_working="yes"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
threads_result="POSIX-Threads found"
|
||||
|
||||
+1
-3
@@ -1,4 +1,3 @@
|
||||
m4_include([TSRM/m4/gethostbyname.m4])
|
||||
|
||||
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
||||
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
|
||||
@@ -33,8 +32,6 @@ AC_CHECK_HEADERS(stdarg.h)
|
||||
|
||||
AC_CHECK_FUNCS(sigprocmask)
|
||||
|
||||
AX_FUNC_WHICH_GETHOSTBYNAME_R()
|
||||
|
||||
])
|
||||
|
||||
|
||||
@@ -92,6 +89,7 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([TSRM_THREADS_CHECKS],[
|
||||
|
||||
dnl For the thread implementations, we always use --with-*
|
||||
|
||||
@@ -13,12 +13,3 @@
|
||||
#include <crtdbg.h>
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
@@ -25,7 +25,9 @@
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
# ifndef NETWARE
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -40,10 +42,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# if _WIN32
|
||||
# include "win32/ioutil.h"
|
||||
# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
|
||||
# elif PATH_MAX
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# elif defined(MAX_PATH)
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
@@ -69,12 +68,3 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#endif /* TSRM_CONFIG_COMMON_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.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. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Venkat Raghavan S <rvenkat@novell.com> |
|
||||
| Anantha Kesari H Y <hyanantha@novell.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "TSRM.h"
|
||||
|
||||
#ifdef NETWARE
|
||||
|
||||
#ifdef USE_MKFIFO
|
||||
#include <sys/stat.h>
|
||||
#elif !defined(USE_PIPE_OPEN) /* NXFifoOpen */
|
||||
#include <nks/fsio.h>
|
||||
#endif
|
||||
|
||||
#include <nks/vm.h>
|
||||
#include <nks/memory.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "mktemp.h"
|
||||
|
||||
/* strtok() call in LibC is abending when used in a different address space
|
||||
* -- hence using PHP's version itself for now
|
||||
*/
|
||||
#include "tsrm_strtok_r.h"
|
||||
#define tsrm_strtok_r(a,b,c) strtok((a),(b))
|
||||
|
||||
#define WHITESPACE " \t"
|
||||
#define MAX_ARGS 10
|
||||
|
||||
|
||||
TSRM_API FILE* popen(const char *commandline, const char *type)
|
||||
{
|
||||
char *command = NULL, *argv[MAX_ARGS] = {'\0'}, **env = NULL;
|
||||
char *tempName = "sys:/php/temp/phpXXXXXX.tmp";
|
||||
char *filePath = NULL;
|
||||
char *ptr = NULL;
|
||||
int ptrLen = 0, argc = 0, i = 0, envCount = 0, err = 0;
|
||||
FILE *stream = NULL;
|
||||
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
|
||||
int pipe_handle;
|
||||
int mode = O_RDONLY;
|
||||
#else
|
||||
NXHandle_t pipe_handle;
|
||||
NXMode_t mode = NX_O_RDONLY;
|
||||
#endif
|
||||
NXExecEnvSpec_t envSpec;
|
||||
NXNameSpec_t nameSpec;
|
||||
NXVmId_t newVM = 0;
|
||||
|
||||
/* Check for validity of input parameters */
|
||||
if (!commandline || !type)
|
||||
return NULL;
|
||||
|
||||
/* Get temporary file name */
|
||||
filePath = mktemp(tempName);
|
||||
if (!filePath)
|
||||
return NULL;
|
||||
|
||||
/* Set pipe mode according to type -- for now allow only "r" or "w" */
|
||||
if (strcmp(type, "r") == 0)
|
||||
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
|
||||
mode = O_RDONLY;
|
||||
#else
|
||||
mode = NX_O_RDONLY;
|
||||
#endif
|
||||
else if (strcmp(type, "w") == 0)
|
||||
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
|
||||
mode = O_WRONLY;
|
||||
#else
|
||||
mode = NX_O_WRONLY;
|
||||
#endif
|
||||
else
|
||||
return NULL;
|
||||
|
||||
#ifdef USE_PIPE_OPEN
|
||||
pipe_handle = pipe_open(filePath, mode);
|
||||
if (pipe_handle == -1)
|
||||
return NULL;
|
||||
#elif defined(USE_MKFIFO)
|
||||
pipe_handle = mkfifo(filePath, mode);
|
||||
if (pipe_handle == -1)
|
||||
return NULL;
|
||||
#else
|
||||
/* - NetWare doesn't require first parameter
|
||||
* - Allowing LibC to choose the buffer size for now
|
||||
*/
|
||||
err = NXFifoOpen(0, filePath, mode, 0, &pipe_handle);
|
||||
if (err)
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
/* Copy the environment variables in preparation for the spawn call */
|
||||
envCount = NXGetEnvCount() + 1; /* add one for NULL */
|
||||
env = (char **) NXMemAlloc(sizeof(char *) * envCount, 0);
|
||||
if (!env)
|
||||
return NULL;
|
||||
|
||||
err = NXCopyEnv(env, envCount);
|
||||
if (err) {
|
||||
NXMemFree (env);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Separate commandline string into words */
|
||||
ptr = tsrm_strtok_r((char*)commandline, WHITESPACE, NULL);
|
||||
ptrLen = strlen(ptr);
|
||||
|
||||
command = (char*)malloc(ptrLen + 1);
|
||||
if (!command) {
|
||||
NXMemFree (env);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
strcpy (command, ptr);
|
||||
|
||||
ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL);
|
||||
while (ptr && (argc < MAX_ARGS)) {
|
||||
ptrLen = strlen(ptr);
|
||||
|
||||
argv[argc] = (char*)malloc(ptrLen + 1);
|
||||
if (!argv[argc]) {
|
||||
NXMemFree (env);
|
||||
if (command)
|
||||
free (command);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (argv[i])
|
||||
free (argv[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
strcpy (argv[argc], ptr);
|
||||
argc++;
|
||||
ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL);
|
||||
}
|
||||
|
||||
/* Setup the execution environment and spawn new process */
|
||||
envSpec.esFlags = 0; /* Not used */
|
||||
envSpec.esArgc = argc;
|
||||
envSpec.esArgv = (void **) argv;
|
||||
envSpec.esEnv = (void **) env;
|
||||
|
||||
/* envSpec.esStdin.ssType = */
|
||||
envSpec.esStdout.ssType = NX_OBJ_FIFO;
|
||||
envSpec.esStderr.ssType = NX_OBJ_FILE;
|
||||
|
||||
/* 'ssHandle' is not a struct/union/class member */
|
||||
/*
|
||||
envSpec.esStdin.ssHandle =
|
||||
envSpec.esStdout.ssHandle =
|
||||
envSpec.esStderr.ssHandle = -1;
|
||||
*/
|
||||
envSpec.esStdin.ssPathCtx = NULL;
|
||||
envSpec.esStdout.ssPathCtx = NULL;
|
||||
envSpec.esStderr.ssPathCtx = NULL;
|
||||
|
||||
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
|
||||
if (mode == O_RDONLY) {
|
||||
#else
|
||||
if (mode == NX_O_RDONLY) {
|
||||
#endif
|
||||
envSpec.esStdin.ssPath = filePath;
|
||||
envSpec.esStdout.ssPath = stdout;
|
||||
} else { /* Write Only */
|
||||
envSpec.esStdin.ssPath = stdin;
|
||||
envSpec.esStdout.ssPath = filePath;
|
||||
}
|
||||
|
||||
envSpec.esStderr.ssPath = stdout;
|
||||
|
||||
nameSpec.ssType = NX_OBJ_FIFO;
|
||||
/* nameSpec.ssHandle = 0; */ /* 'ssHandle' is not a struct/union/class member */
|
||||
nameSpec.ssPathCtx = NULL; /* Not used */
|
||||
nameSpec.ssPath = argv[0];
|
||||
err = NXVmSpawn(&nameSpec, &envSpec, 0, &newVM);
|
||||
if (!err)
|
||||
/* Get file pointer corresponding to the pipe (file) opened */
|
||||
stream = fdopen(pipe_handle, type);
|
||||
|
||||
/* Clean-up */
|
||||
if (env)
|
||||
NXMemFree (env);
|
||||
|
||||
if (pipe_handle)
|
||||
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
|
||||
close(pipe_handle);
|
||||
#else
|
||||
NXClose(pipe_handle);
|
||||
#endif
|
||||
|
||||
if (command)
|
||||
free (command);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (argv[i])
|
||||
free (argv[i]);
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
TSRM_API int pclose(FILE* stream)
|
||||
{
|
||||
int err = 0;
|
||||
NXHandle_t fd = 0;
|
||||
|
||||
/* Get the process associated with this pipe (file) handle and terminate it */
|
||||
fd = fileno(stream);
|
||||
NXClose (fd);
|
||||
|
||||
err = fclose(stream);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif /* NETWARE */
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2018 The PHP Group |
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -12,22 +12,18 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Kalle Sommer Nielsen <kalle@php.net> |
|
||||
| Authors: Venkat Raghavan S <rvenkat@novell.com> |
|
||||
| Anantha Kesari H Y <hyanantha@novell.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef HAVE_NICE_H
|
||||
# define HAVE_NICE_H
|
||||
|
||||
PHPAPI int nice(zend_long);
|
||||
#ifndef TSRM_NW_H
|
||||
#define TSRM_NW_H
|
||||
|
||||
#include "TSRM.h"
|
||||
|
||||
TSRM_API FILE* popen(const char *command, const char *type);
|
||||
TSRM_API int pclose(FILE* stream);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+4
-13
@@ -4,7 +4,7 @@
|
||||
#include "tsrm_strtok_r.h"
|
||||
|
||||
static inline int in_character_class(char ch, const char *delim)
|
||||
{/*{{{*/
|
||||
{
|
||||
while (*delim) {
|
||||
if (*delim == ch) {
|
||||
return 1;
|
||||
@@ -12,10 +12,10 @@ static inline int in_character_class(char ch, const char *delim)
|
||||
delim++;
|
||||
}
|
||||
return 0;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last)
|
||||
{/*{{{*/
|
||||
{
|
||||
char *token;
|
||||
|
||||
if (s == NULL) {
|
||||
@@ -41,7 +41,7 @@ TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last)
|
||||
*last = s + 1;
|
||||
}
|
||||
return token;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -61,12 +61,3 @@ main()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+80
-173
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2018 The PHP Group |
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <Sddl.h>
|
||||
#include "tsrm_win32.h"
|
||||
#include "zend_virtual_cwd.h"
|
||||
#include "win32/ioutil.h"
|
||||
|
||||
#ifdef ZTS
|
||||
static ts_rsrc_id win32_globals_id;
|
||||
@@ -42,7 +41,7 @@ static tsrm_win32_globals win32_globals;
|
||||
#endif
|
||||
|
||||
static void tsrm_win32_ctor(tsrm_win32_globals *globals)
|
||||
{/*{{{*/
|
||||
{
|
||||
#ifdef ZTS
|
||||
TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
@@ -50,7 +49,7 @@ TSRMLS_CACHE_UPDATE();
|
||||
globals->shm = NULL;
|
||||
globals->process_size = 0;
|
||||
globals->shm_size = 0;
|
||||
globals->comspec = _strdup("cmd.exe");
|
||||
globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com");
|
||||
|
||||
/* Set it to INVALID_HANDLE_VALUE
|
||||
* It will be initialized correctly in tsrm_win32_access or set to
|
||||
@@ -61,10 +60,10 @@ TSRMLS_CACHE_UPDATE();
|
||||
*/
|
||||
globals->impersonation_token = INVALID_HANDLE_VALUE;
|
||||
globals->impersonation_token_sid = NULL;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
static void tsrm_win32_dtor(tsrm_win32_globals *globals)
|
||||
{/*{{{*/
|
||||
{
|
||||
shm_pair *ptr;
|
||||
|
||||
if (globals->process) {
|
||||
@@ -89,48 +88,51 @@ static void tsrm_win32_dtor(tsrm_win32_globals *globals)
|
||||
if (globals->impersonation_token_sid) {
|
||||
free(globals->impersonation_token_sid);
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor);
|
||||
#else
|
||||
tsrm_win32_ctor(&win32_globals);
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API void tsrm_win32_shutdown(void)
|
||||
{/*{{{*/
|
||||
{
|
||||
#ifndef ZTS
|
||||
tsrm_win32_dtor(&win32_globals);
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len)
|
||||
{/*{{{*/
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname)
|
||||
{
|
||||
PSID pSid = TWG(impersonation_token_sid);
|
||||
char *ptcSid = NULL;
|
||||
TCHAR *ptcSid = NULL;
|
||||
char *bucket_key = NULL;
|
||||
size_t ptc_sid_len;
|
||||
size_t ptc_sid_len, pathname_len;
|
||||
|
||||
pathname_len = strlen(pathname);
|
||||
|
||||
if (!pSid) {
|
||||
*key_len = pathname_len;
|
||||
return pathname;
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
|
||||
if (!bucket_key) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(bucket_key, pathname, pathname_len);
|
||||
return bucket_key;
|
||||
}
|
||||
|
||||
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
|
||||
*key_len = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ptc_sid_len = strlen(ptcSid);
|
||||
*key_len = pathname_len + ptc_sid_len;
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *key_len + 1);
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + ptc_sid_len + 1);
|
||||
if (!bucket_key) {
|
||||
LocalFree(ptcSid);
|
||||
*key_len = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -139,11 +141,11 @@ char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, si
|
||||
|
||||
LocalFree(ptcSid);
|
||||
return bucket_key;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
PSID tsrm_win32_get_token_sid(HANDLE hToken)
|
||||
{/*{{{*/
|
||||
{
|
||||
DWORD dwLength = 0;
|
||||
PTOKEN_USER pTokenUser = NULL;
|
||||
DWORD sid_len;
|
||||
@@ -190,10 +192,10 @@ Finished:
|
||||
HeapFree(GetProcessHeap(), 0, (LPVOID)pTokenUser);
|
||||
}
|
||||
return NULL;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
{/*{{{*/
|
||||
{
|
||||
time_t t;
|
||||
HANDLE thread_token = NULL;
|
||||
PSID token_sid;
|
||||
@@ -209,39 +211,25 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
|
||||
PHP_WIN32_IOUTIL_INIT_W(pathname)
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode == 1 /*X_OK*/) {
|
||||
DWORD type;
|
||||
int ret;
|
||||
|
||||
ret = GetBinaryTypeW(pathw, &type) ? 0 : -1;
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
return ret;
|
||||
return GetBinaryType(pathname, &type) ? 0 : -1;
|
||||
} else {
|
||||
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) == NULL) {
|
||||
goto Finished;
|
||||
}
|
||||
pathname = real_path;
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
|
||||
if(php_win32_ioutil_access(pathname, mode)) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(access(pathname, mode)) {
|
||||
free(real_path);
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* If only existence check is made, return now */
|
||||
if (mode == 0) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
free(real_path);
|
||||
return 0;
|
||||
}
|
||||
@@ -293,15 +281,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
|
||||
if (CWDG(realpath_cache_size_limit)) {
|
||||
t = time(0);
|
||||
bucket = realpath_cache_lookup(pathname, strlen(pathname), t);
|
||||
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
|
||||
if(bucket == NULL && real_path == NULL) {
|
||||
/* We used the pathname directly. Call tsrm_realpath */
|
||||
/* so that entry is created in realpath cache */
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) != NULL) {
|
||||
pathname = real_path;
|
||||
bucket = realpath_cache_lookup(pathname, strlen(pathname), t);
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,13 +325,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
|
||||
/* Get size of security buffer. Call is expected to fail */
|
||||
if(GetFileSecurityW(pathw, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
if(GetFileSecurity(pathname, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
psec_desc = (BYTE *)malloc(sec_desc_length);
|
||||
if(psec_desc == NULL ||
|
||||
!GetFileSecurityW(pathw, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
!GetFileSecurity(pathname, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
@@ -386,7 +373,6 @@ Finished:
|
||||
real_path = NULL;
|
||||
}
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(fAccess == FALSE) {
|
||||
errno = EACCES;
|
||||
return errno;
|
||||
@@ -394,11 +380,11 @@ Finished:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
static process_pair *process_get(FILE *stream)
|
||||
{/*{{{*/
|
||||
{
|
||||
process_pair *ptr;
|
||||
process_pair *newptr;
|
||||
|
||||
@@ -421,10 +407,10 @@ static process_pair *process_get(FILE *stream)
|
||||
ptr = newptr + TWG(process_size);
|
||||
TWG(process_size)++;
|
||||
return ptr;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
static shm_pair *shm_get(key_t key, void *addr)
|
||||
{/*{{{*/
|
||||
static shm_pair *shm_get(int key, void *addr)
|
||||
{
|
||||
shm_pair *ptr;
|
||||
shm_pair *newptr;
|
||||
|
||||
@@ -451,38 +437,35 @@ static shm_pair *shm_get(key_t key, void *addr)
|
||||
TWG(shm) = newptr;
|
||||
ptr = newptr + TWG(shm_size);
|
||||
TWG(shm_size)++;
|
||||
memset(ptr, 0, sizeof(*ptr));
|
||||
return ptr;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
static HANDLE dupHandle(HANDLE fh, BOOL inherit)
|
||||
{/*{{{*/
|
||||
static HANDLE dupHandle(HANDLE fh, BOOL inherit) {
|
||||
HANDLE copy, self = GetCurrentProcess();
|
||||
if (!DuplicateHandle(self, fh, self, ©, 0, inherit, DUPLICATE_SAME_ACCESS|DUPLICATE_CLOSE_SOURCE)) {
|
||||
return NULL;
|
||||
}
|
||||
return copy;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API FILE *popen(const char *command, const char *type)
|
||||
{/*{{{*/
|
||||
{
|
||||
|
||||
return popen_ex(command, type, NULL, NULL);
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
|
||||
{/*{{{*/
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, type_len, read, mode;
|
||||
STARTUPINFOW startup;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
BOOL res;
|
||||
process_pair *proc;
|
||||
char *cmd = NULL;
|
||||
wchar_t *cmdw = NULL, *cwdw = NULL, *envw = NULL;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
HANDLE thread_token = NULL;
|
||||
@@ -506,42 +489,18 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
ptype++;
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
cmdw = php_win32_cp_any_to_w(cmd);
|
||||
if (!cmdw) {
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cwd) {
|
||||
cwdw = php_win32_ioutil_any_to_w(cwd);
|
||||
if (!cwdw) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&startup, 0, sizeof(STARTUPINFOW));
|
||||
memset(&startup, 0, sizeof(STARTUPINFO));
|
||||
memset(&process, 0, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
startup.cb = sizeof(STARTUPINFOW);
|
||||
startup.cb = sizeof(STARTUPINFO);
|
||||
startup.dwFlags = STARTF_USESTDHANDLES;
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
@@ -573,28 +532,19 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
}
|
||||
}
|
||||
|
||||
envw = php_win32_cp_env_any_to_w(env);
|
||||
if (envw) {
|
||||
dwCreateFlags |= CREATE_UNICODE_ENVIRONMENT;
|
||||
} else {
|
||||
if (env) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
return NULL;
|
||||
}
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUserW(token_user, NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
CloseHandle(token_user);
|
||||
} else {
|
||||
res = CreateProcessW(NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
}
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(envw);
|
||||
|
||||
if (!res) {
|
||||
return NULL;
|
||||
@@ -615,10 +565,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
proc->prochnd = process.hProcess;
|
||||
proc->stream = stream;
|
||||
return stream;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int pclose(FILE *stream)
|
||||
{/*{{{*/
|
||||
{
|
||||
DWORD termstat = 0;
|
||||
process_pair *process;
|
||||
|
||||
@@ -635,61 +585,41 @@ TSRM_API int pclose(FILE *stream)
|
||||
CloseHandle(process->prochnd);
|
||||
|
||||
return termstat;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
{/*{{{*/
|
||||
TSRM_API int shmget(int key, int size, int flags)
|
||||
{
|
||||
shm_pair *shm;
|
||||
char shm_segment[26], shm_info[29];
|
||||
HANDLE shm_handle, info_handle;
|
||||
BOOL created = FALSE;
|
||||
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
if (size < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key);
|
||||
sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
|
||||
if (!shm_handle && !info_handle) {
|
||||
if (flags & IPC_CREAT) {
|
||||
#if SIZEOF_SIZE_T == 8
|
||||
DWORD high = size >> 32;
|
||||
DWORD low = (DWORD)size;
|
||||
#else
|
||||
DWORD high = 0;
|
||||
DWORD low = size;
|
||||
#endif
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, shm_segment);
|
||||
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);
|
||||
created = TRUE;
|
||||
}
|
||||
if (!shm_handle || !info_handle) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
shm = shm_get(key, NULL);
|
||||
if (!shm) {
|
||||
CloseHandle(shm_handle);
|
||||
CloseHandle(info_handle);
|
||||
return -1;
|
||||
}
|
||||
shm->segment = shm_handle;
|
||||
shm->info = info_handle;
|
||||
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
@@ -718,33 +648,27 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
}
|
||||
|
||||
return key;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{/*{{{*/
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->descriptor->shm_atime = time(NULL);
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
return shm->addr;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
{
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
|
||||
if (!shm->segment) {
|
||||
@@ -756,10 +680,9 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
{/*{{{*/
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) {
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
|
||||
if (!shm->segment) {
|
||||
@@ -787,16 +710,16 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer)
|
||||
{/*{{{*/
|
||||
{
|
||||
int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL);
|
||||
if(!ret || ret > _MAX_PATH) {
|
||||
return NULL;
|
||||
}
|
||||
return buffer;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
#if HAVE_UTIME
|
||||
static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
|
||||
@@ -814,17 +737,10 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
{
|
||||
FILETIME mtime, atime;
|
||||
HANDLE hFile;
|
||||
PHP_WIN32_IOUTIL_INIT_W(filename)
|
||||
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
hFile = CreateFileW(pathw, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
|
||||
the CreateFile operation succeeds */
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
@@ -854,12 +770,3 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
/* }}} */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+6
-16
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2018 The PHP Group |
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -26,10 +26,9 @@
|
||||
#if HAVE_UTIME
|
||||
# include <sys/utime.h>
|
||||
#endif
|
||||
#include "win32/ipc.h"
|
||||
|
||||
struct ipc_perm {
|
||||
key_t key;
|
||||
int key;
|
||||
unsigned short uid;
|
||||
unsigned short gid;
|
||||
unsigned short cuid;
|
||||
@@ -40,7 +39,7 @@ struct ipc_perm {
|
||||
|
||||
struct shmid_ds {
|
||||
struct ipc_perm shm_perm;
|
||||
size_t shm_segsz;
|
||||
int shm_segsz;
|
||||
time_t shm_atime;
|
||||
time_t shm_dtime;
|
||||
time_t shm_ctime;
|
||||
@@ -73,7 +72,7 @@ typedef struct {
|
||||
|
||||
#ifdef ZTS
|
||||
# define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v)
|
||||
TSRMLS_CACHE_EXTERN()
|
||||
TSRMLS_CACHE_EXTERN();
|
||||
#else
|
||||
# define TWG(v) (win32_globals.v)
|
||||
#endif
|
||||
@@ -95,7 +94,7 @@ TSRMLS_CACHE_EXTERN()
|
||||
#define SHM_RND FILE_MAP_WRITE
|
||||
#define SHM_REMAP FILE_MAP_COPY
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len);
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname );
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void);
|
||||
TSRM_API void tsrm_win32_shutdown(void);
|
||||
@@ -106,19 +105,10 @@ TSRM_API int pclose(FILE *stream);
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode);
|
||||
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
|
||||
|
||||
TSRM_API int shmget(key_t key, size_t size, int flags);
|
||||
TSRM_API int shmget(int key, int size, int flags);
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags);
|
||||
TSRM_API int shmdt(const void *shmaddr);
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+254
-46
@@ -1,52 +1,223 @@
|
||||
PHP 7.2 INTERNALS UPGRADE NOTES
|
||||
$Id$
|
||||
|
||||
PHP 7.0 INTERNALS UPGRADE NOTES
|
||||
|
||||
0. Wiki Examples
|
||||
1. Internal API changes
|
||||
a. Path related functions
|
||||
b. php_win32_get_random_bytes()
|
||||
c. nice() Windows implementation
|
||||
d. ZEND_ACC_CLONE removed
|
||||
e. IS_TYPE_IMMUTABLE removed
|
||||
f. zend_arg_info.class_name removed
|
||||
g. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX changed
|
||||
h. valid_symbol_table removed
|
||||
e. New data types
|
||||
f. zend_parse_parameters() specs
|
||||
g. sprintf() formats
|
||||
h. HashTable API
|
||||
i. New portable macros for large file support
|
||||
j. New portable macros for integers
|
||||
k. get_class_entry object handler info
|
||||
l. get_class_name object handler info
|
||||
m. Other portable macros info
|
||||
n. ZEND_ENGINE_2 removal
|
||||
o. Updated final class modifier
|
||||
p. TSRM changes
|
||||
q. gc_collect_cycles() is now hookable
|
||||
r. PDO uses size_t for lengths
|
||||
s. Resource API changes
|
||||
t. Optimized strings concatenation.
|
||||
u. Streams changes
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
b. Windows build system changes
|
||||
|
||||
|
||||
3. Module changes
|
||||
|
||||
================
|
||||
0. Wiki Examples
|
||||
================
|
||||
|
||||
The wiki contains multiple examples and further explanations of the internal
|
||||
changes. See: https://wiki.php.net/phpng-upgrading
|
||||
|
||||
|
||||
========================
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Path related functions
|
||||
- CWD_API void realpath_cache_del(const char *path, size_t path_len);
|
||||
- CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, size_t path_len, time_t t);
|
||||
- PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, size_t filename_len);
|
||||
- PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zval *return_value);
|
||||
e. New data types
|
||||
|
||||
b. php_win32_get_random_bytes()
|
||||
The internal randomness source on Windows switched to use CNG API.
|
||||
String
|
||||
|
||||
c. nice() now have a Windows alternative that is implemented in win32/nice.c, using
|
||||
SetPriorityClass(). See the implementation for more in-depth details. This also
|
||||
defines HAVE_NICE.
|
||||
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
|
||||
was introduced. It expects an argument of the type zend_string *. String lengths
|
||||
in it are bound to the size_t datatype.
|
||||
|
||||
d. ZEND_ACC_CLONE is removed, but was not used in previous versions
|
||||
Integer types
|
||||
|
||||
e. IS_TYPE_IMMUTABLE is removed, IS_TYPE_COPYABLE can be used instead
|
||||
Z_IMMUTABLE() check function is still available
|
||||
Integers do no more depend on the firm 'long' type. Instead a platform
|
||||
dependent integer type is used, it is called zend_long. That datatype is
|
||||
defined dynamically to guarantee the consistent 64 bit support. The zval
|
||||
field representing user land integer it bound to zend_long.
|
||||
|
||||
f. zend_arg_info class_name member is removed, use ZEND_TYPE_NAME instead
|
||||
Signed integer is defined as zend_long, unsigned integer as zend_ulong
|
||||
inside Zend.
|
||||
|
||||
g. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX classname option is removed
|
||||
use ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX for simple type
|
||||
use ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX for object
|
||||
Other datatypes
|
||||
|
||||
h. valid_symbol_table is removed from executor_globals.
|
||||
Use EG(active) instead of removed EG(valid_symbol_table)
|
||||
zend_off_t - portable off_t analogue
|
||||
zend_stat_t - portable 'struct stat' analogue
|
||||
|
||||
These datatypes are declared to be portable across platforms. Thus, direct
|
||||
usage of the functions like fseek, stat, etc. as well as direct usage of
|
||||
off_t and struct stat is strongly not recommended. Instead the portable
|
||||
macros should be used.
|
||||
|
||||
zend_fseek - portable fseek equivalent
|
||||
zend_ftell - portable ftell equivalent
|
||||
zend_lseek - portable lseek equivalent
|
||||
zend_fstat - portable fstat equivalent
|
||||
zend_stat - portable stat equivalent
|
||||
|
||||
f. zend_parse_parameters() specs
|
||||
|
||||
The new spec 'S' introduced, which expects an argument of type zend_string *.
|
||||
The 'l' spec expects a parameter of the type zend_long, not long anymore.
|
||||
The 's' spec expects parameters of the type char * and size_t, no int anymore.
|
||||
|
||||
g. sprintf() formats
|
||||
|
||||
New printf modifier 'p' was implemented to platform independently output zend_long,
|
||||
zend_ulong and php_size_t datatypes. That modifier can be used with 'd', 'u', 'x' and 'o'
|
||||
printf format specs with spprintf, snprintf and the wrapping printf implementations.
|
||||
%pu is sufficient for both zend_ulong and php_size_t. the code using %p spec to output
|
||||
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
|
||||
'u', 'x' or 'o'.
|
||||
|
||||
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
||||
they can use the implemenations available on the system, not the PHP one. With snprintf the
|
||||
macros ZEND_INT_FMT and ZEND_UINT_FMT should be used.
|
||||
|
||||
h. HashTable API
|
||||
|
||||
Datatype for array indexes was changed to zend_ulong, for string keys to zend_string *.
|
||||
|
||||
i. New portable macros for large file support
|
||||
|
||||
Function(s) Alias Comment
|
||||
stat, _stat64 zend_stat for use with zend_stat_t
|
||||
fstat, _fstat64 zend_fstat for use with zend_stat_t
|
||||
lseek, _lseeki64 zend_lseek for use with zend_off_t
|
||||
ftell, _ftelli64 zend_ftell for use with zend_off_t
|
||||
fseek, _fseeki64 zend_fseek for use with zend_off_t
|
||||
|
||||
j. New portable macros for integers
|
||||
|
||||
Function(s) Alias Comment
|
||||
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_LTOA for use with zend_long
|
||||
atol, atoll, _atoi64 ZEND_ATOL for use with zend_long
|
||||
strtol, strtoll, _strtoi64 ZEND_STRTOL for use with zend_long
|
||||
strtoul, strtoull, _strtoui64 ZEND_STRTOUL for use with zend_long
|
||||
abs, llabs, _abs64 ZEND_ABS for use with zend_long
|
||||
- ZEND_LONG_MAX replaces LONG_MAX where appropriate
|
||||
- ZEND_LONG_MIN replaces LONG_MIN where appropriate
|
||||
- ZEND_ULONG_MAX replaces ULONG_MAX where appropriate
|
||||
- SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype
|
||||
- ZEND_SIZE_MAX Max value of size_t
|
||||
- Z_L casts an integral constant to zend_long
|
||||
- Z_UL casts an integral constant to zend_ulong
|
||||
|
||||
The macro ZEND_ENABLE_ZVAL_LONG64 reveals whether zval operates on 64 or 32 bit integer.
|
||||
|
||||
k. The get_class_entry object handler is no longer available. Instead
|
||||
zend_object.ce is always used.
|
||||
|
||||
l. The get_class_name object handler is now only used for displaying class
|
||||
names in debugging functions like var_dump(). It is no longer used in
|
||||
get_class(), get_parent_class() or similar.
|
||||
|
||||
The handler is now obligatory, no longer accepts a `parent` argument and
|
||||
must return a non-NULL zend_string*, which will be released by the caller.
|
||||
|
||||
m. Other portable macros info
|
||||
|
||||
ZEND_SECURE_ZERO - zeroes chunk of memory
|
||||
ZEND_VALID_SOCKET - validates a php_socket_t variable
|
||||
|
||||
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
|
||||
ZEND_NORETURN is defined as __declspec(noreturn) on VS
|
||||
|
||||
n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.
|
||||
|
||||
o. Removed ZEND_ACC_FINAL_CLASS in favour of ZEND_ACC_FINAL, turning final class
|
||||
modifier now a different class entry flag. Update your extensions.
|
||||
|
||||
p. TSRM changes
|
||||
|
||||
The TSRM layer undergone significant changes. It is not necessary anymore to
|
||||
pass the tsrm_ls pointer explicitly. The TSRMLS_* macros should not be used
|
||||
in any new developments.
|
||||
|
||||
The recommended way accessing globals in TS builds is by implementing it
|
||||
to use a local thread unique pointer to the corresponding data pool. These
|
||||
are the new macros that serve to achieve this goal:
|
||||
|
||||
- ZEND_TSRMG - based on TSRMG and if static pointer for data pool access is
|
||||
implemented, will use it
|
||||
- ZEND_TSRMLS_CACHE_EXTERN - to be used in a header shared across multiple
|
||||
C/C++ files
|
||||
- ZEND_TSRMLS_CACHE_DEFINE - to be used in the main extension C/C++ file
|
||||
- ZEND_TSRMLS_CACHE_UPDATE - to be integrated at the top of the globals
|
||||
ctor or RINIT function
|
||||
- ZEND_ENABLE_STATIC_TSRMLS_CACHE - to be used in the config.[m4|w32] for
|
||||
enabling the globals access per thread unique pointer
|
||||
- TSRMLS_CACHE - expands to the variable name which links to the thread
|
||||
unique data pool
|
||||
|
||||
Note that usually it will work without implementing the globals access per
|
||||
a thread unique pointer, however it might cause a slowdown. The reason is
|
||||
that the access model to the extension/SAPI own globals as well as the
|
||||
access to the core globals is determined in the compilation phase depending
|
||||
on whether ZEND_ENABLE_STATIC_TSRMLS_CACHE macro is defined.
|
||||
|
||||
Due to the current compiler evolution state, the TSRMLS_CACHE pointer
|
||||
(when implemented) has to be present and updated in every binary unit which
|
||||
is not compiled statically into PHP. So any DLL, DSO, EXE, etc. has to take
|
||||
care about defining and updating it's TSRMLS cache. An update should happen
|
||||
before any globals was accessed.
|
||||
|
||||
Porting an extension or SAPI is usually as easy as removing all the TSRMLS_*
|
||||
occurrences and integrating the macros mentioned above. However if tsrm_ls
|
||||
is used explicitly, its usage can be considered obsolete in most cases.
|
||||
Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't
|
||||
be passed to that threads directly.
|
||||
|
||||
When working with CTOR/DTOR for the extension globals, only the data passed
|
||||
as parameters should be touched. For example, don't use code like
|
||||
free(MYEXT_G(vars)); inside globals destructor, as it possibly can destroy
|
||||
the data from a wrong thread. Instead use the pointer to the data delivered
|
||||
into the destructor. So the previous example could look like
|
||||
free(my_struct->vars); given the income was casted to (struct my_struct *).
|
||||
|
||||
q. gc_collect_cycles() is now a function pointer, and can be replaced in the
|
||||
same manner as zend_execute_ex() if needed (for example, to include the
|
||||
time spent in the garbage collector in a profiler). The default
|
||||
implementation has been renamed to zend_gc_collect_cycles(), and is
|
||||
exported with ZEND_API.
|
||||
|
||||
r. In accordance with general use of size_t as string length, all PDO API
|
||||
functions now use size_t for string length.
|
||||
|
||||
s. Removed ZEND_REGISTER/FETCH_RESOURCE, use zend_fetch_resource and
|
||||
and zend_register_resource instead, zend_fetch_resource accepts a zend_resource *
|
||||
as first argument, if you still need to fetch a resource from zval, use
|
||||
zend_fetch_resource_ex. More details can be found in Zend/zend_list.c.
|
||||
|
||||
t. Optimized strings concatenation.
|
||||
ZEND_ADD_STRING/VAR/CHAR are replaced with ZEND_ROPE_INIT, ZEND_ROPE_ADD,
|
||||
ZEND_ROPE_END.
|
||||
Instead of reallocation and copying string on each ZEND_ADD_STRING/VAR/CAHR,
|
||||
collect all the strings and then allocate and construct the resulting string once.
|
||||
|
||||
u. Streams changes
|
||||
- It is possible to do blocking reads on Windows pipes. It can be done either
|
||||
using context stream option PHP_STREAM_OPTION_PIPE_BLOCKING or
|
||||
adding STREAM_USE_BLOCKING_PIPE when opening the stream.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
@@ -56,28 +227,65 @@ PHP 7.2 INTERNALS UPGRADE NOTES
|
||||
|
||||
b. Windows build system changes
|
||||
|
||||
. Minimum supported Windows versions are Windows 7/Server 2008 R2.
|
||||
. --enable-one-shot configure option is removed, --with-mp is usable.
|
||||
. The new binary tools SDK is required for Windows builds, the
|
||||
documentation is available under https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
|
||||
. Visual Studio 2017 is utilized for the Windows builds
|
||||
. Clang build with ASAN is supported with clang 5+
|
||||
- Besides Visual Studio, building with Clang or Intel Composer is now
|
||||
possible. To enable an alternative toolset, add the option
|
||||
--with-toolset=[vs,clang,icc] to the configure line. The default
|
||||
toolset is vs. Still clang or icc need the correct environment
|
||||
which involves many tools from the vs toolset.
|
||||
|
||||
The toolset option is supported by phpize as well.
|
||||
|
||||
AWARENESS The only recommended and supported toolset to produce production
|
||||
ready binaries is Visual Studio. Still other compilers can be used now for
|
||||
testing and analyzing purposes.
|
||||
|
||||
- configure.js now produces response files which are passed to the linker
|
||||
and library manager. This solves the issues with the long command lines
|
||||
which can exceed the OS limit.
|
||||
|
||||
- with clang toolset, an option --with-uncritical-warn-choke is available,
|
||||
which suppresses the most frequent false positive warnings
|
||||
|
||||
- the --with-mp option will by default utilize all the available cores. It's
|
||||
enabled by default for release builds and can be disabled with the special
|
||||
"disable" keyword.
|
||||
|
||||
========================
|
||||
3. Module changes
|
||||
========================
|
||||
|
||||
- Pcre:
|
||||
. php_pcre_replace and php_pcre_replace_impl expect a zend_string instead of a zval and
|
||||
is_callable_replace options is removed:
|
||||
- PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str, int limit, int *replace_count);
|
||||
- PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str, int limit, int *replace_count);
|
||||
Session:
|
||||
|
||||
- Session:
|
||||
. php_session_start()/session_reset_id() return value is changed from void to int.
|
||||
It returns SUCCESS/FAILURE.
|
||||
. Session module manages session status correctly.
|
||||
- PS_MOD_UPDATE_TIMESTAMP() session save handler definition is added. New
|
||||
save handler should use PS_MOD_UPDATE_TIMESTAMP() definition. Save handler
|
||||
must not refer/change PS() variables directly from save handler. Use
|
||||
parameters.
|
||||
- PS_MOD()/PS_MOD_SID() macro exist only for transition. Beware these
|
||||
save handlers are less secure and slower than PS_MOD_UPDATE_TIMESTAMP().
|
||||
- PS(invalid_session_id) was removed. It was never worked as it supposed.
|
||||
To report invalid session ID, use PS_VALIDATE_SID() handler.
|
||||
- PS_VALIDATE_SID() defines session ID validation handler. This handler
|
||||
must validate if requested session ID exists in session data storage or not.
|
||||
Do not access PS(id) directly, but use this handler and it's parameter.
|
||||
- PS_UPDATE_TIMESTAMP() defines timestamp updating handler. This handler
|
||||
must update session data timestamp for GC if it is needed. e.g. Memcache
|
||||
updates timestamp on read, so it does not need to update timestamp. Return
|
||||
SUCCESS simply for this case.
|
||||
- PS_CREATE_SID() should check session ID collision. Return NULL for failure.
|
||||
- More documentation can be found in ext/session/mod_files.c as comments.
|
||||
mod_files.c may be used as reference implementation.
|
||||
|
||||
Openssl:
|
||||
- several ext/openssl functions require the inclusion of the applink shim
|
||||
as documented in the OpenSSL FAQ https://www.openssl.org/support/faq.html#PROG2
|
||||
to properly work on Windows. While this primarily affects the OpenSSL
|
||||
functionality, the shim needs to be included into the executable file
|
||||
which loads the extension DLL, not into the extension DLL itself. Alternatively
|
||||
it can be compiled and linked with the main program as a separate object file.
|
||||
More information and explanation in the linked OpenSSL FAQ.
|
||||
|
||||
- OpenSSL:
|
||||
. Windows builds ship with OpenSSL 1.1 by default, lower versions are still supported with custom deps.
|
||||
Thus, this primarily affects any WAMP or other redistributions bundling the
|
||||
official PHP release zipballs or building from sources. The applink shim is
|
||||
already integrated with all the PHP executables from the official distribution
|
||||
starting with 7.0.0beta1.
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
Revamped object model using object handles
|
||||
===========================================
|
||||
|
||||
Background
|
||||
----------
|
||||
|
||||
In the Zend Engine 1.0 (and its predecessor the PHP 3 scripting
|
||||
engine) the object model's design is that instantiated objects are
|
||||
language values. This means that when programmers are performing
|
||||
operations, such variable assignment and passing parameters to
|
||||
functions, objects are handled very similarly to the way other
|
||||
primitive types are handled such as integers and strings.
|
||||
Semantically this means that the whole object is being copied. The
|
||||
approach Java takes is different where one refers to objects by handle
|
||||
and not by value (one can think of a handle as an objects' ID).
|
||||
|
||||
Need
|
||||
----
|
||||
|
||||
Unfortunately, the approach taken up to now has severely limited the
|
||||
Zend Engine's object oriented model, both feature and simplicity
|
||||
wise. One of the main problems with the former approach is that object
|
||||
instantiation and duplication is very hard to control, a problem which
|
||||
can not only lead to inefficient development but also often to strange
|
||||
run-time behavior. Changing the object model to a handle oriented
|
||||
model will allow the addressing of many needs such as destructors,
|
||||
de-referencing method return values, tight control of object
|
||||
duplication and more.
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The proposed object model is very much influenced by the Java
|
||||
model. In general, when you create a new object you will be getting a
|
||||
handle to the object instead of the object itself. When this handle is
|
||||
sent to functions, assigned and copied it is only the handle which is
|
||||
copied/sent/assigned. The object itself is never copied nor
|
||||
duplicated. This results in all handles of this object to always point
|
||||
at the same object making it a very consistent solution and saving
|
||||
unnecessary duplication and confusing behavior.
|
||||
|
||||
Functionality
|
||||
-------------
|
||||
|
||||
After this change the basic use of objects will be almost identical to
|
||||
previous versions of the scripting engine. However, you won't bump
|
||||
into awkward and confusing copying & destructing of objects. In order
|
||||
to create and use a new object instance you will do the following:
|
||||
$object = new MyClass(); $object->method();
|
||||
|
||||
The previous code will assign $object the handle of a new instance of
|
||||
the class MyClass and call one of its methods.
|
||||
|
||||
|
||||
Consider the following code:
|
||||
|
||||
1 class MyClass
|
||||
2 {
|
||||
3 function setMember($value)
|
||||
4 {
|
||||
5 $this->member = $value;
|
||||
6 }
|
||||
7
|
||||
8 function getMember()
|
||||
9 {
|
||||
10 return $this->member;
|
||||
11 }
|
||||
12 }
|
||||
13
|
||||
14 function foo($obj)
|
||||
15 {
|
||||
16 $obj->setMember("foo");
|
||||
17 }
|
||||
18
|
||||
19 $object = new MyClass();
|
||||
20 $object->setMember("bar");
|
||||
21 foo($object);
|
||||
22 print $object->getMember();
|
||||
|
||||
Without the new Java-like handles, at line 20 the objects' data member
|
||||
member is set to the string value of "bar". Because of the internal
|
||||
representation of objects in the Zend Engine 1.0, the object is marked
|
||||
as a reference, and when it is sent by value to the function foo, it
|
||||
is duplicated (!). Therefore, the call to foo() on line 21 will
|
||||
result in the $obj->setMember("foo") call being called on a duplicate
|
||||
of $object. Line 22 will then result in "bar" being printed.
|
||||
|
||||
This is how the scripting engine has worked until today. Most
|
||||
developers are probably unaware of the fact that they aren't always
|
||||
talking to the same object but often duplicates; others may have
|
||||
realized this can usually be solved by always passing objects by
|
||||
reference (unless a replica is actually desired, which is uncommon).
|
||||
|
||||
The new object model will allow for a much more intuitive
|
||||
implementation of the code. On line 21, the object's handle (ID) is
|
||||
passed to foo() by value. Inside foo(), the object is fetched
|
||||
according to this handle and, therefore, the setMember() method is
|
||||
called on the originally instantiated object and not a copy. Line 22
|
||||
will therefore result in "foo" being printed. This approach gives
|
||||
developers tighter control of when objects are created and duplicated.
|
||||
An additional not-as-important benefit is that the object handle will
|
||||
be passed to foo() by value, which most probably will also save
|
||||
unnecessary duplication of the value containing the ID itself and thus
|
||||
additionally improving run-time performance.
|
||||
|
||||
This was just a simple description of why the new object model solves
|
||||
awkward behavior and makes object handling much easier, intuitive and
|
||||
efficient. The importance of this change goes far beyond what is
|
||||
mentioned in this section as you will see in further sections which
|
||||
describe new features with a majority of them being based on this
|
||||
change.
|
||||
|
||||
Compatibility Notes
|
||||
--------------------
|
||||
|
||||
Many PHP programmers aren't even aware of the copying quirks of the
|
||||
current object model and, therefore, there is a relatively good chance
|
||||
that the amount of PHP applications that will work out of the box or
|
||||
after a very small amount of modifications would be high.
|
||||
|
||||
To simplify migration, version 2.0 will support an optional
|
||||
'auto-clone' feature, which will perform a cloning of the object
|
||||
whenever it would have been copied in version 1.0. Optionally, it
|
||||
will also be possible to request that the engine will emit an E_NOTICE
|
||||
message whenever such an automatic clone occurs, in order to allow
|
||||
developers to gradually migrate to the version 2.0-style behavior
|
||||
(without automatic clones).
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
The new object model is not dependent on other features. Many of the
|
||||
other Zend Engine 2.0 features, such as the $foo->bar()->barbara()
|
||||
syntax, destructors and others completely rely on this new object
|
||||
model.
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
Title: Zend 2.0 Namespaces
|
||||
Version: $Id$
|
||||
Status: declined
|
||||
Maintainer: Stig S. Bakken <ssb@php.net>
|
||||
Created: 2001-09-08
|
||||
Modified: 2001-09-08
|
||||
|
||||
|
||||
1. Background/Need
|
||||
==================
|
||||
|
||||
PHP and Zend 1.0 have come to a point where a lot of reusable code is
|
||||
being written; from simple functions and classes to entire application
|
||||
frameworks. It is becoming increasingly difficult to avoid symbol
|
||||
name collisions with the current scoping methods.
|
||||
|
||||
The symbol scopes available in Zend 1.0 are the global scope, the
|
||||
class scope and the function scope. All scopes but classes may
|
||||
contain variables, only the class and global scopes may contain
|
||||
functions, while only the global scope may contain constants and
|
||||
classes. This means that all of Zend 1.0's scoping methods are
|
||||
inherently limited for solving symbol name collision problems.
|
||||
|
||||
|
||||
2. Overview
|
||||
===========
|
||||
|
||||
Namespaces in Zend 2.0 provide a way to manage the symbol collision
|
||||
problem by making it possible to define multiple symbol tables able to
|
||||
contain all types of symbols. Zend will get the notion of a current
|
||||
namespace, defaulting to the current global one. The current name
|
||||
space may be changed on a file-by-file basis. Symbols in other name
|
||||
spaces than the current one may be referenced using a new namespace
|
||||
operator. It will be possible to "import" symbols from one namespace
|
||||
into another.
|
||||
|
||||
|
||||
3. Functionality
|
||||
================
|
||||
|
||||
3.1. Namespace Syntax
|
||||
=====================
|
||||
|
||||
The namespace operator ":" is used to refer to symbols in other
|
||||
namespaces than the current one:
|
||||
|
||||
Class: Namespace:class
|
||||
Function: Namespace:function
|
||||
Static method: Namespace:class::method
|
||||
Variable: $Namespace:variable
|
||||
Constant: Namespace:CONSTANT
|
||||
Class variable: $Namespace:class::variable
|
||||
|
||||
To refer to symbols in the global namespace, symbols are prefixed with
|
||||
only the namespace operator:
|
||||
|
||||
Class: :class
|
||||
Function: :function
|
||||
Static method: :class::method
|
||||
Variable: $:variable
|
||||
Constant: :CONSTANT
|
||||
Class variable: $:class::variable
|
||||
|
||||
Note: $:variable will effectively be just another syntax for
|
||||
$GLOBALS['variable'].
|
||||
|
||||
A namespace may have a name containing a ":", it is always the last
|
||||
":" character in the symbol qualifier that is the actual namespace
|
||||
operator:
|
||||
|
||||
Class: Name:Space:class
|
||||
Function: Name:Space:function
|
||||
Static method: Name:Space:class::method
|
||||
Variable: $Name:Space:variable
|
||||
Constant: Name:Space:CONSTANT
|
||||
Class variable: $Name:Space:class::variable
|
||||
|
||||
(Here, the ":" between "Name" and "Space" is part of the name, it is
|
||||
the one after "Space" that is the namespace operator.)
|
||||
|
||||
|
||||
3.2. Defining Namespaces
|
||||
========================
|
||||
|
||||
Individual files may define a namespace that will apply to the entire
|
||||
file. If no "namespace" operator occurs in the file, it will be in
|
||||
the global namespace:
|
||||
|
||||
1 namespace HTML;
|
||||
2
|
||||
3 class Form {
|
||||
4 function Form() {
|
||||
5 // constructor
|
||||
6 }
|
||||
7 // ...
|
||||
8 }
|
||||
|
||||
Or with the "nested" name syntax:
|
||||
|
||||
1 namespace HTML:Form;
|
||||
2
|
||||
3 class Image {
|
||||
4 var $src;
|
||||
5 function Image($src) {
|
||||
6 $this->src = $src;
|
||||
7 }
|
||||
8 // ...
|
||||
9 }
|
||||
|
||||
Code executed within the "HTML" namespace may refer to the Form class
|
||||
as just "Form". Code executed from within other namespaces has to
|
||||
refer to it as "HTML:Form". The "namespace" statement must occur
|
||||
before any other statements in the file.
|
||||
|
||||
# [ssb 2001-09-08]:
|
||||
# Should it be possible to "add" symbols to a namespace by including a
|
||||
# second file with the same namespace statement?
|
||||
|
||||
|
||||
3.3. Importing Symbols
|
||||
======================
|
||||
|
||||
It is possible to import symbols from another namespace into the
|
||||
current one with the "import" statement:
|
||||
|
||||
import * from HTML; // all symbols
|
||||
|
||||
import Form from HTML; // single symbols
|
||||
|
||||
import Form,Table from HTML; // multiple symbols
|
||||
|
||||
There is a potential for name clashes between symols of different
|
||||
types that have the same qualifier syntax. These are resolved in this
|
||||
order: class, function, constant.
|
||||
|
||||
Optionally, the symbol type may be explicitly given to import (as
|
||||
"class", "function", "variable" or "constant"):
|
||||
|
||||
import class Form from HTML;
|
||||
|
||||
And finally, you may import all symbols of a given type:
|
||||
|
||||
import constant * from HTML:Table;
|
||||
|
||||
The namespace with its symbols must already be defined before using
|
||||
"import".
|
||||
|
||||
|
||||
4. Compatibility Notes
|
||||
======================
|
||||
|
||||
Old code that does not take advantage of namespaces will run without
|
||||
modifications.
|
||||
|
||||
|
||||
5. Dependencies
|
||||
===============
|
||||
|
||||
The class variable syntax depends on this class variables being
|
||||
implemented in the new ZE2 object model.
|
||||
|
||||
|
||||
6. Acknowledgements
|
||||
===================
|
||||
|
||||
Andi Gutmans <andi@zend.com> and Zeev Suraski <zeev@zend.com> for
|
||||
initial ZE2 namespaces proposal
|
||||
|
||||
Dean Hall <php@apt7.com> for the initial symbol qualification syntax
|
||||
@@ -0,0 +1,72 @@
|
||||
Title: Loose type requirements for functions
|
||||
Version: $Id$
|
||||
Status: draft
|
||||
Maintainer: Brian Moon <brianm@dealnews.com>
|
||||
Created: 2001-09-17
|
||||
Modified: 2001-09-17
|
||||
|
||||
|
||||
1. Background/Need
|
||||
==================
|
||||
|
||||
Many internal functions of PHP will reject parameters because of their
|
||||
type (the array and variable function come to mind). For userland
|
||||
this is not an easy task as there is no uniform way to do it. An
|
||||
addition to the engine for requiring loose types would allow
|
||||
developers to know that the data passed to their functions are of the
|
||||
correct type and reduce the need for duplicating the same code in
|
||||
every function to check for the type of data.
|
||||
|
||||
|
||||
2. Overview
|
||||
===========
|
||||
|
||||
Loose typing mostly means evaluating the contents of the variable and
|
||||
not the type of the variable itself. The requirements for this would
|
||||
and should work much like several of the is_* functions do now.
|
||||
|
||||
The typing of parameters would be optional and those not typed would
|
||||
simply continue to be treated as they are now.
|
||||
|
||||
3. Functionality
|
||||
================
|
||||
|
||||
3.1. Allowed Types
|
||||
==================
|
||||
|
||||
Only loose types should be needed to ensure the data is usable by the
|
||||
function. Duplicating the functionallity of is_scalar, is_resource,
|
||||
is_array and is_object should give developers all the information they
|
||||
need to use a variable correctly.
|
||||
|
||||
3.2. Syntax
|
||||
===========
|
||||
|
||||
The current function syntax should be expanded to allow typing of
|
||||
variables inline in a C style.
|
||||
|
||||
function foo ($var){
|
||||
}
|
||||
|
||||
could be changed to require an array such as:
|
||||
|
||||
function foo (array $var){
|
||||
}
|
||||
|
||||
3.3. Errors
|
||||
===========
|
||||
|
||||
Mis-matches in type should be reported as fatal errors and should halt
|
||||
the execution of a script as that function cannot be run and code
|
||||
following could not reliably run.
|
||||
|
||||
|
||||
4. Compatibility Notes
|
||||
======================
|
||||
|
||||
Old code that does not take advantage of this will run without
|
||||
modifications.
|
||||
|
||||
|
||||
|
||||
|
||||
+1166
File diff suppressed because it is too large.
Load diff
+4
-144
@@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
@@ -370,10 +370,10 @@ AC_CHECK_FUNCS(mremap)
|
||||
|
||||
|
||||
AC_ARG_ENABLE(zend-signals,
|
||||
[ --disable-zend-signals whether to enable zend signal handling],[
|
||||
[ --enable-zend-signals Use zend signal handling],[
|
||||
ZEND_SIGNALS=$enableval
|
||||
],[
|
||||
ZEND_SIGNALS=yes
|
||||
ZEND_SIGNALS=no
|
||||
])
|
||||
|
||||
AC_CHECK_FUNC(sigaction, [
|
||||
@@ -421,6 +421,7 @@ AC_ARG_ENABLE(gcc-global-regs,
|
||||
AC_MSG_CHECKING(for global register variables support)
|
||||
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
|
||||
AC_TRY_COMPILE([
|
||||
],[
|
||||
#if defined(__GNUC__)
|
||||
# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#else
|
||||
@@ -435,9 +436,6 @@ if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
|
||||
#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__powerpc64__)
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r28"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r29"
|
||||
#elif defined(__IBMC__) && ZEND_GCC_VERSION >= 4002 && defined(__powerpc64__)
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r28"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r29"
|
||||
#else
|
||||
# error "global register variables are not supported"
|
||||
#endif
|
||||
@@ -453,7 +451,6 @@ int emu(const opcode_handler_t *ip, void *fp) {
|
||||
FP = orig_fp;
|
||||
IP = orig_ip;
|
||||
}
|
||||
], [
|
||||
], [
|
||||
ZEND_GCC_GLOBAL_REGS=yes
|
||||
], [
|
||||
@@ -466,140 +463,3 @@ else
|
||||
HAVE_GCC_GLOBAL_REGS=no
|
||||
fi
|
||||
AC_MSG_RESULT($ZEND_GCC_GLOBAL_REGS)
|
||||
|
||||
dnl
|
||||
dnl Check if atof() accepts NAN
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
|
||||
AC_TRY_RUN([
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isnan(atof("NAN")) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
ac_cv_atof_accept_nan=yes
|
||||
],[
|
||||
ac_cv_atof_accept_nan=no
|
||||
],[
|
||||
ac_cv_atof_accept_nan=no
|
||||
])])
|
||||
if test "$ac_cv_atof_accept_nan" = "yes"; then
|
||||
AC_DEFINE([HAVE_ATOF_ACCEPTS_NAN], 1, [whether atof() accepts NAN])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if atof() accepts INF
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
|
||||
AC_TRY_RUN([
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
ac_cv_atof_accept_inf=yes
|
||||
],[
|
||||
ac_cv_atof_accept_inf=no
|
||||
],[
|
||||
ac_cv_atof_accept_inf=no
|
||||
])])
|
||||
if test "$ac_cv_atof_accept_inf" = "yes"; then
|
||||
AC_DEFINE([HAVE_ATOF_ACCEPTS_INF], 1, [whether atof() accepts INF])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if HUGE_VAL == INF
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
|
||||
AC_TRY_RUN([
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isinf(HUGE_VAL) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
ac_cv_huge_val_inf=yes
|
||||
],[
|
||||
ac_cv_huge_val_inf=no
|
||||
],[
|
||||
ac_cv_huge_val_inf=yes
|
||||
])])
|
||||
dnl This is the most probable fallback so we assume yes in case of cross compile.
|
||||
if test "$ac_cv_huge_val_inf" = "yes"; then
|
||||
AC_DEFINE([HAVE_HUGE_VAL_INF], 1, [whether HUGE_VAL == INF])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if HUGE_VAL + -HUGEVAL == NAN
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
|
||||
AC_TRY_RUN([
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
#if defined(__sparc__) && !(__GNUC__ >= 3)
|
||||
/* prevent bug #27830 */
|
||||
return 1;
|
||||
#else
|
||||
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
|
||||
#endif
|
||||
}
|
||||
],[
|
||||
ac_cv_huge_val_nan=yes
|
||||
],[
|
||||
ac_cv_huge_val_nan=no
|
||||
],[
|
||||
ac_cv_huge_val_nan=yes
|
||||
])])
|
||||
dnl This is the most probable fallback so we assume yes in case of cross compile.
|
||||
if test "$ac_cv_huge_val_nan" = "yes"; then
|
||||
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
|
||||
fi
|
||||
+1
-1
@@ -107,7 +107,7 @@ int main(void)
|
||||
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
])
|
||||
if test $ac_cv_c_bigendian_php = yes; then
|
||||
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
|
||||
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
+3
-3
@@ -30,14 +30,14 @@ $(LT_TARGETS):
|
||||
$(makefile_in_files): $(makefile_am_files)
|
||||
automake -a -i $(AMFLAGS) $(makefile_files)
|
||||
|
||||
aclocal.m4: configure.ac acinclude.m4
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.ac
|
||||
$(config_h_in): configure.in
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
autoheader
|
||||
|
||||
configure: aclocal.m4 configure.ac
|
||||
configure: aclocal.m4 configure.in
|
||||
autoconf
|
||||
@@ -24,6 +24,9 @@ AH_TOP([
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
])
|
||||
|
||||
AH_BOTTOM([
|
||||
@@ -59,28 +62,35 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
@@ -92,6 +102,12 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||
|
||||
#ifdef NETWARE
|
||||
#ifdef USE_WINSOCK
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
+8
-13
@@ -17,20 +17,11 @@ function test3($a, $b) {
|
||||
|
||||
test1();
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -47,10 +38,14 @@ echo "Done\n";
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(1)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s001.php on line 27 and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
|
||||
+19
-12
@@ -23,19 +23,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -70,7 +62,14 @@ int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
|
||||
|
||||
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)
|
||||
|
||||
@@ -85,7 +84,15 @@ bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s002.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
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)
|
||||
|
||||
|
||||
+12
-12
@@ -18,19 +18,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -55,7 +47,10 @@ array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
|
||||
|
||||
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)
|
||||
@@ -64,7 +59,12 @@ array(2) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
@@ -25,8 +25,6 @@ echo "Done\n";
|
||||
Warning: each() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
|
||||
|
||||
Warning: Variable passed to each() is not an array or object in %s on line %d
|
||||
NULL
|
||||
|
||||
|
||||
@@ -7,10 +7,6 @@ class foo {
|
||||
function bar () {
|
||||
var_dump(get_class());
|
||||
}
|
||||
function testNull ()
|
||||
{
|
||||
var_dump(get_class(null));
|
||||
}
|
||||
}
|
||||
|
||||
class foo2 extends foo {
|
||||
@@ -31,8 +27,6 @@ var_dump(get_class("qwerty"));
|
||||
var_dump(get_class($f1));
|
||||
var_dump(get_class($f2));
|
||||
|
||||
$f1->testNull();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
@@ -51,7 +45,4 @@ Warning: get_class() expects parameter 1 to be object, string given in %s on lin
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
string(4) "foo2"
|
||||
|
||||
Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -26,6 +26,7 @@ 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()));
|
||||
|
||||
@@ -64,6 +65,9 @@ NULL
|
||||
string(5) "array"
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: get_defined_functions() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
|
||||
+4
-4
@@ -37,15 +37,15 @@ NULL
|
||||
Notice: Undefined variable: b in %s on line %d
|
||||
int(1)
|
||||
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: c in %s on line %d
|
||||
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
|
||||
Notice: Trying to get property '' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
NULL
|
||||
+1
-1
@@ -18,7 +18,7 @@ print "ok\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Trying to get property 'a' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
ok
|
||||
|
||||
Warning: Creating default object from empty value in %s on line %d
|
||||
|
||||
+37
-1
@@ -31,4 +31,40 @@ $test->bar();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot re-assign $this in %s030.php on line 11
|
||||
object(Exception)#%d (7) {
|
||||
["message":protected]=>
|
||||
string(3) "foo"
|
||||
["string":"Exception":private]=>
|
||||
string(0) ""
|
||||
["code":protected]=>
|
||||
int(0)
|
||||
["file":protected]=>
|
||||
string(%d) "%s030.php"
|
||||
["line":protected]=>
|
||||
int(%d)
|
||||
["trace":"Exception":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s030.php"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(3) "bar"
|
||||
["class"]=>
|
||||
string(3) "foo"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
["previous":"Exception":private]=>
|
||||
NULL
|
||||
}
|
||||
'test' => '0'
|
||||
'test_2' => '1'
|
||||
'test_3' => '2'
|
||||
ok
|
||||
+1
-1
@@ -24,7 +24,7 @@ Notice: Undefined variable: arr in %s on line %d
|
||||
|
||||
Notice: Undefined variable: arr in %s on line %d
|
||||
|
||||
Notice: Trying to get property 'foo' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
|
||||
Warning: Creating default object from empty value in %s on line %d
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Using indirect append on ArrayAccess object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class AA implements ArrayAccess {
|
||||
private $data = [];
|
||||
public function &offsetGet($name) {
|
||||
if (null === $name) {
|
||||
return $this->data[];
|
||||
} else {
|
||||
return $this->data[$name];
|
||||
}
|
||||
}
|
||||
public function offsetSet($name, $value) {
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
public function offsetUnset($name) {}
|
||||
public function offsetExists($name) {}
|
||||
}
|
||||
|
||||
$aa = new AA;
|
||||
$aa[3] = 1;
|
||||
$aa[][][0] = 2;
|
||||
var_dump($aa);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(AA)#1 (1) {
|
||||
["data":"AA":private]=>
|
||||
array(2) {
|
||||
[3]=>
|
||||
int(1)
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Allow abstract function override
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class A { abstract function bar($x); }
|
||||
abstract class B extends A { abstract function bar($x); }
|
||||
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Allow abstract function override
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class A { abstract function bar($x); }
|
||||
abstract class B extends A { abstract function bar($x, $y = 0); }
|
||||
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Allow abstract function override
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class A { abstract function bar($x, $y = 0); }
|
||||
abstract class B extends A { abstract function bar($x); }
|
||||
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of B::bar($x) must be compatible with A::bar($x, $y = 0) in %s
|
||||
@@ -38,19 +38,11 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
@@ -19,13 +19,8 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Exception: Unsupported operand types
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Ensure proper inheritance with get_class(anon class instance) used via class_alias (see also bug #70106)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class_alias(get_class(new class { protected $foo = 1; }), "AnonBase");
|
||||
var_dump((new class extends AnonBase {
|
||||
function getFoo() {
|
||||
return $this->foo;
|
||||
}
|
||||
})->getFoo());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Ensure correct unmangling of private property names for anonymous class instances
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(new class { private $foo; });
|
||||
?>
|
||||
--EXPECT--
|
||||
object(class@anonymous)#1 (1) {
|
||||
["foo":"class@anonymous":private]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
closure binding to anonymous class
|
||||
--FILE--
|
||||
<?php
|
||||
$class = new class {};
|
||||
$foo = function() {
|
||||
return $this;
|
||||
};
|
||||
|
||||
$closure = Closure::bind($foo, $class, $class);
|
||||
var_dump($closure());
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
anonymous class trait binding
|
||||
--FILE--
|
||||
<?php
|
||||
trait TaskTrait {
|
||||
function run() {
|
||||
return 'Running...';
|
||||
}
|
||||
}
|
||||
$class = new class() {
|
||||
use TaskTrait;
|
||||
};
|
||||
var_dump($class->run());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "Running..."
|
||||
@@ -12,43 +12,24 @@ for ($i = 0; $i < 10; $i++) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(1)
|
||||
int(1)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(2)
|
||||
int(2)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(3)
|
||||
int(3)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(4)
|
||||
int(4)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(5)
|
||||
int(5)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(6)
|
||||
int(6)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(7)
|
||||
int(7)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(8)
|
||||
int(8)
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(9)
|
||||
int(9)
|
||||
@@ -11,9 +11,6 @@ var_dump($arr[$test(1)]);
|
||||
var_dump($arr[$test(0)]() == $arr);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
--EXPECT--
|
||||
int(2)
|
||||
bool(true)
|
||||
@@ -11,6 +11,5 @@ try {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Array must be separated if unpacking by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function inc(&... $args) {
|
||||
foreach ($args as &$arg) {
|
||||
$arg++;
|
||||
}
|
||||
}
|
||||
|
||||
$arr = [1, 2];
|
||||
$arr[] = 3;
|
||||
$arr2 = $arr;
|
||||
inc(...$arr);
|
||||
var_dump($arr);
|
||||
var_dump($arr2);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Array addition is not commutative -- do not swap operands
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [1, 2, 3];
|
||||
$array = [4, 5, 6] + $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(6)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Next free element may overflow in array literals
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = PHP_INT_MAX;
|
||||
$array = [$i => 42, new stdClass];
|
||||
var_dump($array);
|
||||
|
||||
const FOO = [PHP_INT_MAX => 42, "foo"];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Array type declaration
|
||||
Array type hint
|
||||
--FILE--
|
||||
<?php
|
||||
function foo(array $a) {
|
||||
@@ -12,8 +12,8 @@ foo(123);
|
||||
--EXPECTF--
|
||||
3
|
||||
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, integer given, called in %s on line 7 and defined in %s:2
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php:2
|
||||
Stack trace:
|
||||
#0 %s(%d): foo(123)
|
||||
#1 {main}
|
||||
thrown in %s on line 2
|
||||
thrown in %sarray_type_hint_001.php on line 2
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70208 (scope information must be preserved with assert())
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function non_class_scope() {
|
||||
return true;
|
||||
}
|
||||
|
||||
class test {
|
||||
protected $prop = 1;
|
||||
|
||||
public function __construct() {
|
||||
assert('non_class_scope();');
|
||||
var_dump($this->prop);
|
||||
}
|
||||
}
|
||||
|
||||
new test;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
|
||||
int(1)
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70528 (assert() with instanceof adds apostrophes around class name)
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
assert.exception=0
|
||||
assert.warning=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
class Bar {}
|
||||
|
||||
$bar = "Bar";
|
||||
assert(new \stdClass instanceof $bar);
|
||||
assert(new \stdClass instanceof Bar);
|
||||
assert(new \stdClass instanceof \Foo\Bar);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(new \stdClass() instanceof $bar) failed in %sbug70528.php on line %d
|
||||
|
||||
Warning: assert(): assert(new \stdClass() instanceof Bar) failed in %sbug70528.php on line %d
|
||||
|
||||
Warning: assert(): assert(new \stdClass() instanceof \Foo\Bar) failed in %sbug70528.php on line %d
|
||||
@@ -20,7 +20,7 @@ assert(0 && ($a = function () {
|
||||
yield from $x;
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = "aaa";
|
||||
@@ -154,14 +154,14 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
$x = $a ? $b : $c;
|
||||
$x = $a ?: $c;
|
||||
$x = $a ?? $b;
|
||||
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
|
||||
list($a, $b, $c) = [1, 2 => 'x', 'z' => 'c'];
|
||||
@foo();
|
||||
$y = clone $x;
|
||||
yield 1 => 2;
|
||||
yield from $x;
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = 'aaa';
|
||||
|
||||
@@ -18,7 +18,7 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_016.php on line 6
|
||||
bool(false)
|
||||
NULL
|
||||
bool(true)
|
||||
|
||||
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %sexpect_016.php on line 8
|
||||
@@ -25,9 +25,9 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 10
|
||||
bool(false)
|
||||
NULL
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 12
|
||||
bool(false)
|
||||
NULL
|
||||
bool(true)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Empty statement in assert() shouldn't segfault
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert((function () { return true;; })());
|
||||
echo "ok";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Misoptimization when variable is modified by assert()
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$i = 0;
|
||||
assert('$i = new stdClass');
|
||||
$i += 1;
|
||||
var_dump($i);
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
|
||||
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
int(2)
|
||||
@@ -1,56 +0,0 @@
|
||||
--TEST--
|
||||
Various null return conditions of dim/obj assignments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$array = [PHP_INT_MAX => 42];
|
||||
$true = true;
|
||||
|
||||
var_dump($array[] = 123);
|
||||
var_dump($array[[]] = 123);
|
||||
var_dump($array[new stdClass] = 123);
|
||||
var_dump($true[123] = 456);
|
||||
|
||||
var_dump($array[] += 123);
|
||||
var_dump($array[[]] += 123);
|
||||
var_dump($array[new stdClass] += 123);
|
||||
var_dump($true[123] += 456);
|
||||
|
||||
var_dump($true->foo = 123);
|
||||
var_dump($true->foo += 123);
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property 'foo' of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property 'foo' of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Assign to $this leaks when $this not defined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$this->a = new stdClass;
|
||||
} catch (Error $e) { echo $e->getMessage(), "\n"; }
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Using $this when not in object context
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
ZEND_POW_ASSIGN
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && ($a **= 2));
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Serialization of backtick literal is incorrect
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && `echo -n ""`);
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
'break' error (non positive numbers)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
break 0;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: 'break' operator accepts only positive numbers in %sbreak_error_001.php on line 3
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
'break' error (operator with non-constant operand)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
break $x;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: 'break' operator with non-constant operand is no longer supported in %sbreak_error_002.php on line 3
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
'break' error (not in the loop context)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
break;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: 'break' not in the 'loop' or 'switch' context in %sbreak_error_003.php on line 3
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
'break' error (wrong level)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
while (1) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot 'break' 2 levels in %sbreak_error_004.php on line 4
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #19859 (__call() does not catch call_user_func_array() calls)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class test
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #20240 (order of destructor calls)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed');
|
||||
if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
--TEST--
|
||||
Bug #21888 (protected property and protected method of the same name)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class mom {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
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--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #22836 (returning references to NULL)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function &f()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #24436 (isset()/empty() produce errors with non-existent variables in classes)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--INI--
|
||||
error_reporting=2047
|
||||
--FILE--
|
||||
|
||||
Loaded 100 of 6589 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user