mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73915a2bd6 | ||
|
|
61ba5f8477 | ||
|
|
498aa0ec97 | ||
|
|
2c74a57118 | ||
|
|
77072a0946 | ||
|
|
91826a311d | ||
|
|
ec664bd26d | ||
|
|
a938133d89 | ||
|
|
53b7c63c5e | ||
|
|
0180921255 | ||
|
|
88c521d659 | ||
|
|
7378e7bdc8 | ||
|
|
d9b0835dfd | ||
|
|
ef9d35cdc9 | ||
|
|
2c567eae28 | ||
|
|
3d7b2117e0 |
No files matched your search
+5
-6
@@ -1,7 +1,7 @@
|
||||
|
||||
version: "{branch}.build.{build}"
|
||||
|
||||
image: Visual Studio 2017
|
||||
image: Visual Studio 2015
|
||||
|
||||
branches:
|
||||
except:
|
||||
@@ -16,16 +16,15 @@ skip_commits:
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
#cache:
|
||||
# - c:\build-cache
|
||||
# - c:\build-cache\sdk -> .appveyor.yml
|
||||
cache:
|
||||
- c:\build-cache
|
||||
- c:\build-cache\sdk -> .appveyor.yml
|
||||
|
||||
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.0.12beta3
|
||||
PHP_BUILD_CRT: vc15
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.5
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
+6
-25
@@ -1,35 +1,16 @@
|
||||
# http://editorconfig.org/
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
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
|
||||
[*.yml]
|
||||
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
|
||||
@@ -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
|
||||
|
||||
+87
-34
@@ -31,9 +31,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 +56,7 @@ config.cache
|
||||
config.h.in
|
||||
config.log
|
||||
config.nice
|
||||
config.nice.bat
|
||||
config.status
|
||||
config.sub
|
||||
config_vars.mk
|
||||
@@ -56,6 +65,8 @@ configuration-parser.h
|
||||
configuration-parser.output
|
||||
configuration-scanner.c
|
||||
configure
|
||||
configure.bat
|
||||
configure.js
|
||||
conftest
|
||||
conftest.c
|
||||
debug.log
|
||||
@@ -85,6 +96,7 @@ stamp-h
|
||||
test.php3
|
||||
tmp-php.ini
|
||||
want_dependencies
|
||||
x64
|
||||
stamp-h.in
|
||||
scan_makefile_in.awk
|
||||
TSRM/tsrm_config.h
|
||||
@@ -103,9 +115,65 @@ 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/*.out.png
|
||||
*/*/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,21 +214,32 @@ 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
|
||||
@@ -168,6 +247,10 @@ ext/simplexml/examples/security.new.xml
|
||||
ext/spl/examples/.htaccess
|
||||
ext/spl/examples/*.phps
|
||||
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
|
||||
|
||||
+5
-11
@@ -8,6 +8,7 @@ addons:
|
||||
- re2c
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libmcrypt-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
@@ -28,9 +29,8 @@ notifications:
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
ccache: true
|
||||
cache:
|
||||
- apt
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -46,12 +46,9 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
- ccache --zero-stats
|
||||
- export USE_CCACHE=1
|
||||
# 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
|
||||
@@ -60,7 +57,4 @@ before_script:
|
||||
|
||||
# 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 == 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 --set-timeout 120
|
||||
+4
-4
@@ -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'?)
|
||||
|
||||
|
||||
+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
|
||||
|
||||
|
||||
+24
-31
@@ -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
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -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,7 +281,7 @@ STATUS: Working
|
||||
SINCE: 5.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
PRIMARY MAINTAINER: Stefan Esser <sesser@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
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
|
||||
|
||||
+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/*
|
||||
|
||||
|
||||
+6
-11
@@ -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 an old
|
||||
stable version and is open for security fixes only.
|
||||
|
||||
PHP-5.4 This branch is closed.
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is an old
|
||||
stable version and is open for security fixes only.
|
||||
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ API adjustment to the old output control code:
|
||||
// php_start_ob_buffer(zhandler, chunk_size, erase);
|
||||
php_output_start_user(zhandler, chunk_size, flags);
|
||||
|
||||
Starting an internal handler without context:
|
||||
Starting an internal handler whithout 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);
|
||||
|
||||
|
||||
+32
-64
@@ -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.
|
||||
@@ -97,55 +97,25 @@ and build three tarballs (gz, bz2 and xz).
|
||||
and output verification information to be included in announcement email
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
15. 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
|
||||
16. 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.
|
||||
|
||||
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``
|
||||
1. 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 +126,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,
|
||||
@@ -326,24 +315,3 @@ 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@
|
||||
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.
|
||||
|
||||
@@ -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?
|
||||
|
||||
+60
-85
@@ -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, ...);
|
||||
@@ -121,11 +120,9 @@ 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();
|
||||
#elif defined(PTHREADS)
|
||||
@@ -139,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;
|
||||
@@ -164,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;
|
||||
@@ -221,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));
|
||||
@@ -283,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));
|
||||
@@ -323,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
|
||||
@@ -386,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;
|
||||
|
||||
@@ -410,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();
|
||||
@@ -426,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;
|
||||
|
||||
@@ -445,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();
|
||||
@@ -487,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();
|
||||
@@ -533,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);
|
||||
|
||||
@@ -567,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));
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -578,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)
|
||||
@@ -594,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));
|
||||
@@ -625,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);
|
||||
@@ -654,7 +651,7 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
#ifdef THR_DEBUG
|
||||
printf("Mutex freed thread: %d\n",mythreadid());
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -662,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);
|
||||
@@ -686,7 +683,7 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
return acquire_sem(mutexp->sem);
|
||||
return 0;
|
||||
#endif
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -694,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);
|
||||
@@ -718,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
|
||||
@@ -733,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
|
||||
@@ -770,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;
|
||||
@@ -785,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
|
||||
@@ -807,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
|
||||
*/
|
||||
-12
@@ -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,7 +153,6 @@ 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);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
# define TSRM_TLS __declspec(thread)
|
||||
@@ -216,12 +213,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)
|
||||
+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 */
|
||||
@@ -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
|
||||
@@ -69,12 +71,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-2017 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 */
|
||||
@@ -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
|
||||
*/
|
||||
+57
-69
@@ -42,7 +42,7 @@ static tsrm_win32_globals win32_globals;
|
||||
#endif
|
||||
|
||||
static void tsrm_win32_ctor(tsrm_win32_globals *globals)
|
||||
{/*{{{*/
|
||||
{
|
||||
#ifdef ZTS
|
||||
TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
@@ -61,10 +61,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 +89,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 +142,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 +193,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;
|
||||
@@ -205,7 +208,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
|
||||
BYTE * psec_desc = NULL;
|
||||
BOOL fAccess = FALSE;
|
||||
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
|
||||
@@ -293,14 +295,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);
|
||||
if(tsrm_realpath(pathname, real_path) != NULL) {
|
||||
pathname = real_path;
|
||||
bucket = realpath_cache_lookup(pathname, strlen(pathname), t);
|
||||
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
}
|
||||
@@ -394,11 +396,11 @@ Finished:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
|
||||
static process_pair *process_get(FILE *stream)
|
||||
{/*{{{*/
|
||||
{
|
||||
process_pair *ptr;
|
||||
process_pair *newptr;
|
||||
|
||||
@@ -421,10 +423,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;
|
||||
|
||||
@@ -453,25 +455,24 @@ static shm_pair *shm_get(key_t key, void *addr)
|
||||
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;
|
||||
@@ -615,10 +616,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,15 +636,19 @@ 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;
|
||||
|
||||
if (size < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
@@ -652,14 +657,7 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -718,10 +716,10 @@ 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) {
|
||||
@@ -741,10 +739,10 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
return shm->addr;
|
||||
}/*}}}*/
|
||||
}
|
||||
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
{
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
|
||||
if (!shm->segment) {
|
||||
@@ -756,10 +754,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 +784,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) /* {{{ */
|
||||
@@ -854,12 +851,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
|
||||
*/
|
||||
+4
-14
@@ -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;
|
||||
@@ -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
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
PHP 7.2 UPGRADE NOTES
|
||||
PHP 7.1 UPGRADE NOTES
|
||||
|
||||
1. Backward Incompatible Changes
|
||||
2. New Features
|
||||
@@ -20,253 +20,262 @@ PHP 7.2 UPGRADE NOTES
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
. gettype() will now return "resource (closed)" instead of "unknown type" for
|
||||
closed resources.
|
||||
. is_object() will now return true for objects of class
|
||||
__PHP_Incomplete_Class.
|
||||
. Support for Netware operating systems has been removed.
|
||||
. Casting arrays to objects (with (object) or settype()) will now convert
|
||||
integer keys to string property names. This fixes the behaviour of previous
|
||||
versions, where integer keys would become inaccessible properties with
|
||||
integer names.
|
||||
. Casting objects to arrays (with (array) or settype()), and retrieving
|
||||
object properties in an array with get_object_vars(), will now convert
|
||||
numeric string property names (that is, property names of the format
|
||||
/^(0|(-?[1-9][0-9]*))$/ where PHP_INT_MIN <= n <= PHP_INT_MAX) to integer
|
||||
keys. This fixes the behaviour of previous versions, where numeric string
|
||||
property names would become inaccessible string keys.
|
||||
. Unqualified references to undefined constants now generate a Warning instead
|
||||
of a notice. They will generate an Error in a future version of PHP.
|
||||
(https://wiki.php.net/rfc/deprecate-bareword-strings)
|
||||
. Minimum supported Windows versions are Windows 7/Server 2008 R2.
|
||||
. Initial trait property value compatibility check will no longer perform
|
||||
any casts. (Bug #74269)
|
||||
. "object" (in any case) can no longer be used as a class name.
|
||||
. 'void' can no longer be used as the name of a class, interface, or trait.
|
||||
This applies to declarations, class_alias() and use statements.
|
||||
. 'iterable' can no longer be used as the name of a class, interface, or
|
||||
trait. This applies to declarations, class_alias() and use statements.
|
||||
(RFC: https://wiki.php.net/rfc/iterable)
|
||||
. (int), intval() where $base is 10 or unspecified, settype(), decbin(),
|
||||
decoct(), dechex(), integer operators and other conversions now always
|
||||
respect scientific notation in numeric strings.
|
||||
(RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
|
||||
. The ASCII 0x7F Delete control character is no longer permitted in unquoted
|
||||
identifiers in source code.
|
||||
. The following functions may no longer be called dynamically using $func(),
|
||||
call_user_func(), array_map() or similar:
|
||||
. extract()
|
||||
. compact()
|
||||
. get_defined_vars()
|
||||
. func_get_args()
|
||||
. func_get_arg()
|
||||
. func_num_args()
|
||||
. parse_str() with one argument
|
||||
. mb_parse_str() with one argument
|
||||
. assert() with a string argument
|
||||
(RFC: https://wiki.php.net/rfc/forbid_dynamic_scope_introspection)
|
||||
. If the error_log is set to syslog, the PHP error levels are mapped to the
|
||||
syslog error levels. This brings finer differentiation in the error logs
|
||||
in contrary to the previous approach where all the errors are loggged with
|
||||
the notice level only.
|
||||
. Don't call destructors of incompletely constructed objects, even if they
|
||||
are kept referenced. See bug #29368 and Zend/tests/bug29368_1.phpt.
|
||||
. call_user_func() will now consistently throw a warning if a function with
|
||||
reference arguments is called. However, call_user_func() will no longer
|
||||
abort the call in this case.
|
||||
. rand() and srand() are now aliases of mt_rand() and mt_srand().
|
||||
Consequently the output of the following functions has changed:
|
||||
. rand()
|
||||
. shuffle()
|
||||
. str_shuffle()
|
||||
. array_rand()
|
||||
. Fixes to random number generators mean that mt_rand() now produces a
|
||||
different sequence of outputs to previous versions. If you relied on
|
||||
mt_srand() to produce a deterministic sequence, it can be called using
|
||||
mt_srand($seed, MT_RAND_PHP) to produce the old sequences.
|
||||
. URL rewriter has been improved.
|
||||
. Use dedicated buffer for Session module rewrite and User rewrite.
|
||||
. Full path URL rewrite is supported. Allowed domain can be specified.
|
||||
$_SERVER['HTTP_HOST'] is allowed by default when host whitelist is empty.
|
||||
. Use session.trans_sid_tags and session.trans_sid_hosts to control
|
||||
session rewrite.
|
||||
. Use url_rewriter.tags and url_rewriter.hosts to control user rewrite.
|
||||
. <form>'s "action" attribute is used to check if URL rewrite is allowed
|
||||
and listed under hosts whitelist.
|
||||
. <fieldset> is no longer considered as a special tag. <form> is the
|
||||
only tag considered special.
|
||||
. Calling a function with less arguments than mandatory declared ones in
|
||||
signature now issues a Fatal Error (Error Exception) instead of a Warning.
|
||||
(RFC https://wiki.php.net/rfc/too_few_args).
|
||||
. The error message for E_RECOVERABLE errors has been changed from "Catchable
|
||||
fatal error" to "Recoverable fatal error".
|
||||
. The empty index operator (e.g. $str[] = $x) is not supported for strings
|
||||
anymore, and throws a fatal error instead of silently converting to array.
|
||||
. Array elements or object properties that are automatically created during
|
||||
by-reference assignments will now result in a different order. For example
|
||||
|
||||
$array = [];
|
||||
$array["a"] =& $array["b"];
|
||||
$array["b"] = 1;
|
||||
var_dump($array);
|
||||
|
||||
now results in the array ["b" => 1, "a" => 1], while for PHP 7.0 the result
|
||||
was ["a" => 1, "b" => 1].
|
||||
. The allowed_classes element of the $options parameter of unserialize() is
|
||||
now strictly typed, i.e. if anything other than an array or a boolean is
|
||||
given, unserialize() returns FALSE and issues an E_WARNING.
|
||||
. $this, autoglobals, and variables with the same name as a parameter can no
|
||||
longer be bound to a closure via the use construct.
|
||||
|
||||
- BCMath:
|
||||
. The bcmod() function no longer truncates fractional numbers to integers. As
|
||||
such, its behavior now follows fmod() rather than the `%` operator. For
|
||||
example `bcmod('4', '3.5')` now returns '0.5' instead of '1'.
|
||||
- JSON:
|
||||
. The serialize_precision is used instead of precision when encoding double
|
||||
values.
|
||||
. An empty key is decoded as an empty property name instead of using _empty_
|
||||
property name when decoding object to stdClass.
|
||||
. When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and
|
||||
U+2029 are escaped.
|
||||
|
||||
- Hash:
|
||||
. The hash_hmac(), hash_hmac_file(), hash_pbkdf2() and hash_init() (with
|
||||
HASH_HMAC) functions no longer accept non-cryptographic hashes.
|
||||
- mbstring:
|
||||
. mb_ereg() and mb_eregi() will now set the $regs argument to an empty array,
|
||||
if nothing matched. Formerly, $regs was not modified in that case.
|
||||
|
||||
- JSON
|
||||
. The json_decode() option JSON_OBJECT_AS_ARRAY is used if the second
|
||||
parameter (assoc) is null. Previously JSON_OBJECT_AS_ARRAY was always
|
||||
ignored.
|
||||
- OpenSSL:
|
||||
. Dropped sslv2 stream.
|
||||
|
||||
- Session:
|
||||
. Removed register_globals related code and "!" can be used as $_SESSION key name.
|
||||
. Session is made to manage session status correctly and prevents invalid operations.
|
||||
Only inappropriate codes are affected by this change. If you have problems with this,
|
||||
it means you have problem in your code.
|
||||
. Functions are made to set or return correct session status.
|
||||
session_start(), session_status(), session_regenerate_id()
|
||||
. Functions are made to return bool from null. These functions have void parameter
|
||||
and void parameter is checked.
|
||||
session_unset(), session_write_close()/session_commit(), session_abort(),
|
||||
session_reset()
|
||||
. Functions prohibit invalid operations with regard to session status and
|
||||
HTTP header status, returns correct bool return value.
|
||||
session_start(), session_set_cookie_params(), session_name(), session_module_name(),
|
||||
session_set_save_handler(), session_regenerate_id(), session_cache_limiter(),
|
||||
session_cache_expire(), session_unset(), session_destroy(),
|
||||
session_write_close()/session_commit(), session_reset()
|
||||
. INI value change by ini_set() returns update status correctly. Invalid INI modifications
|
||||
are checked and made to fail.
|
||||
session.name, session.save_path, session.cookie_lifetime, session.cookie_path,
|
||||
session.cookie_domain, session.cookie_httponly, session.cookie_secure,
|
||||
session.use_cookies, session.use_only_cookies, session.use_strict_mode,
|
||||
session.referer_check, session.cache_limiter, session.cache_expire,
|
||||
session.lazy_write, session.save_handler, session.serialize_handler,
|
||||
session.gc_probability, session.gc_divior, session.gc_maxlifetime,
|
||||
. Some E_ERRORs are changed to E_WARNING since session status is managed correctly.
|
||||
session_start()
|
||||
. Session no longer initialize $_SESSION for invalid and useless session.
|
||||
session_start()
|
||||
. When headers are already sent and try to set new INI values, session_name(),
|
||||
session_module_name(), session_save_path(), session_cache_limiter() and
|
||||
session_cache_expire() are no longer works. Older PHPs accepts new values even
|
||||
if new values will not be effective.
|
||||
This new corrected behavior may affect command line mode CLI scripts that manage
|
||||
sessions. Use output buffer just like web applications to resolve problems on
|
||||
CLI scripts.
|
||||
. Session ID is generated from CSPRNG directly. As a result, Session ID length
|
||||
could be any length between 22 and 256. Note: Max size of session ID depends
|
||||
on save handler you are using.
|
||||
. Following INIs are removed
|
||||
. session.hash_function
|
||||
. session.hash_bits_per_character
|
||||
. session.entropy_file
|
||||
. session.entropy_length
|
||||
. New INIs and defaults
|
||||
. session.sid_length (Number of session ID characters - 22 to 256.
|
||||
php.ini-* default: 26 Compiled default: 32)
|
||||
. session.sid_bits_per_character (Bits used per character - 4 to 6.
|
||||
php.ini-* default: 5 Compiled default: 4)
|
||||
. Length of old session ID string is determined as follows
|
||||
. Used hash function's bits.
|
||||
. session.hash_function=0 - MD5 128 bits (This was default)
|
||||
. session.hash_function=1 - SHA1 160 bits
|
||||
. Bits per character. (4, 5 or 6 bits per character)
|
||||
. Examples
|
||||
MD5 and 4 bits = 32 chars, ceil(128/4)=32
|
||||
MD5 and 5 bits = 26 chars, ceil(128/5)=26
|
||||
MD5 and 6 bits = 22 chars, ceil(128/6)=22
|
||||
SHA1 and 4 bits = 40 chars, ceil(160/4)=40
|
||||
SHA1 and 5 bits = 32 chars, ceil(160/5)=32
|
||||
SHA1 and 6 bits = 27 chars, ceil(160/6)=27
|
||||
and so on.
|
||||
. session_start() returns FALSE and no longer initializes $_SESSION when
|
||||
it failed to start session.
|
||||
|
||||
- Standard:
|
||||
. Sequences generated by mt_rand() and rand() for a specific seed may differ
|
||||
from PHP 7.1 on 64-bit machines. This change was necessary to resolve a
|
||||
modulo bias bug in the implementation.
|
||||
- Reflection:
|
||||
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
|
||||
aligned, which causes slightly different behavior than before for some
|
||||
pathological cases.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
. It is now possible to remove argument type annotations when overriding an
|
||||
inherited method. This complies with contravariance of method argument types
|
||||
under the Liskov Substitution Principle.
|
||||
(https://wiki.php.net/rfc/parameter-no-type-variance)
|
||||
. It is now allowed to override an abstract method with another abstract
|
||||
method in a child class.
|
||||
(https://wiki.php.net/rfc/allow-abstract-function-override)
|
||||
. A trailing comma in group use statements is now allowed.
|
||||
(https://wiki.php.net/rfc/list-syntax-trailing-commas)
|
||||
. The "object" type annotation is now supported.
|
||||
(https://wiki.php.net/rfc/object-typehint)
|
||||
|
||||
- DBA:
|
||||
. Implemented support for the LMDB backend.
|
||||
|
||||
- JSON:
|
||||
. Added JSON_INVALID_UTF8_IGNORE and JSON_INVALID_UTF8_SUBSTITUTE options for
|
||||
json_encode() and json_decode() to ignore and replace invalid UTF-8 byte
|
||||
sequences, respectively.
|
||||
|
||||
- OCI8:
|
||||
. Added Oracle Database Transparent Application Failover (TAF) callback support.
|
||||
|
||||
- PCRE:
|
||||
. Added `J` modifier for setting PCRE_DUPNAMES.
|
||||
. Added `PREG_UNMATCHED_AS_NULL` flag to allow distinguish between unmatched
|
||||
subpatterns and empty matches by reporting NULL and "" (empty string),
|
||||
respectively.
|
||||
|
||||
- Sodium
|
||||
. New cryptographic extension
|
||||
|
||||
- SQLite3:
|
||||
. Implemented writing to BLOBs.
|
||||
|
||||
- Standard:
|
||||
. Simplified password hashing API updated to support Argon2i hashes when PHP is compiled with libargon2
|
||||
(https://wiki.php.net/rfc/argon2_password_hash).
|
||||
. proc_nice() is now supported on Windows platforms.
|
||||
|
||||
- Zip:
|
||||
. read/write encrypted archive, relying on libzip 1.2.0,
|
||||
using new methods:
|
||||
ZipArchive::setEncryptionName($name, $method [, $password]);
|
||||
ZipArchive::setEncryptionIndex($index, $method [, $password]);
|
||||
and new constants:
|
||||
ZipArchive::EM_NONE
|
||||
ZipArchive::EM_AES_128
|
||||
ZipArchive::EM_AES_192
|
||||
ZipArchive::EM_AES_256
|
||||
. accept 'password' from zip stream context
|
||||
. ZipArchive implements countable, added ZipArchive::count() method.
|
||||
|
||||
- Core
|
||||
. Added void return type, which requires that a function not return a value.
|
||||
(RFC: https://wiki.php.net/rfc/void_return_type)
|
||||
. Added iterable pseudo-type accepting any array or object implementing
|
||||
Traversable.
|
||||
(RFC: https://wiki.php.net/rfc/iterable)
|
||||
. String offset access now supports negative references, which will be
|
||||
counted from the end of the string.
|
||||
(RFC: https://wiki.php.net/rfc/negative-string-offsets)
|
||||
. Added a form of the list() construct where keys can be specified.
|
||||
(RFC: https://wiki.php.net/rfc/list_keys)
|
||||
. Added [] = as alternative construct to list() =.
|
||||
(RFC: https://wiki.php.net/rfc/short_list_syntax)
|
||||
. Number operators taking numeric strings now emit "A non well formed numeric
|
||||
value encountered" E_NOTICEs for leading-numeric strings, and "A
|
||||
non-numeric value encountered" E_WARNINGs for non-numeric strings.
|
||||
This always applies to the +, -, *, /, **, %, << and >> operators, and
|
||||
their assignment counterparts +=, -=, *=, /=, **=, %=, <<= and >>=.
|
||||
For the bitwise operators |, & and ^, and their assignment counterparts
|
||||
|=, &= and ^=, this only applies where only one operand is a string.
|
||||
Note that this never applies to the bitwise NOT operator, ~, which does not
|
||||
handle numeric strings, nor to the increment and decrement operators
|
||||
++ and --, which have a unique approach to handling numeric strings.
|
||||
(RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
|
||||
. Closure::fromCallable (RFC: https://wiki.php.net/rfc/closurefromcallable)
|
||||
. Added support for class constant visibility modifiers.
|
||||
(RFC: https://wiki.php.net/rfc/class_const_visibility)
|
||||
. TypeError messages for arg_info type checks will now say "must be ...
|
||||
or null", or "must ... or be null" where the parameter or return type
|
||||
accepts null. arg_info type checks are used by all userland functions with
|
||||
type declarations, and some internal functions. Both nullable type
|
||||
declarations (?int) and parameters with default values of null
|
||||
(int $foo = NULL) are considered to "accept null" for this purpose.
|
||||
. The simple syntax for variable parsing inside of string literals now
|
||||
supports negative offsets.
|
||||
|
||||
========================================
|
||||
3. Changes in SAPI modules
|
||||
========================================
|
||||
- apache2handler:
|
||||
. Implemented per module logging.
|
||||
. Implemented error level mapping between PHP and Apache for the error logs.
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
========================================
|
||||
|
||||
All the deprecated functionality listed in the following will be removed in
|
||||
PHP 8.0.
|
||||
|
||||
- Core:
|
||||
. The track_errors ini directive has been deprecated.
|
||||
. The __autoload() mechanism has been deprecated, use spl_autoload_register()
|
||||
instead.
|
||||
. The (unset) cast has been deprecated. This does not affect the unset($var)
|
||||
language construct.
|
||||
. The create_function() function has been deprecated, use anonymous functions
|
||||
instead.
|
||||
. The each() function has been deprecated, use a foreach loop instead.
|
||||
. The $errcontext error handler argument has been deprecated. However, using
|
||||
it does not trigger a deprecation warning for technical reasons.
|
||||
|
||||
- EXIF:
|
||||
. The read_exif_data() alias has been deprecated, use exif_read_data() instead.
|
||||
|
||||
- GD:
|
||||
. png2wbmp() and jpeg2wbmp() have been deprecated.
|
||||
|
||||
- GMP:
|
||||
. The gmp_random() function has been deprecated, use gmp_random_bits() or
|
||||
gmp_random_range() instead.
|
||||
|
||||
- Intl:
|
||||
. INTL_IDNA_VARIANT_2003 has been deprecated; use INTL_IDNA_VARIANT_UTS46
|
||||
instead.
|
||||
|
||||
- Mbstring:
|
||||
. The mbstring.func_overload ini directive has been deprecated.
|
||||
|
||||
- Standard:
|
||||
. Calling parse_str() without the result argument has been deprecated.
|
||||
. Calling assert() with a string argument has been deprecated, use an ordinary
|
||||
expression instead.
|
||||
|
||||
See also: https://wiki.php.net/rfc/deprecations_php_7_2
|
||||
- 'e' option of mb_ereg_replace() and mb_eregi_replace().
|
||||
- ext/mcrypt is now fully deprecated.
|
||||
|
||||
========================================
|
||||
5. Changed Functions
|
||||
========================================
|
||||
- get_headers() has an extra parameter which allows passing a custom stream
|
||||
context.
|
||||
- The first $varname argument for getenv() is no longer mandatory, the
|
||||
current environment variables will be returned as an associative array
|
||||
when omitted.
|
||||
- json_encode() accepts new option JSON_UNESCAPED_LINE_TERMINATORS that
|
||||
disables escaping of U+2028 and U+2029 characters when
|
||||
JSON_UNESCAPED_UNICODE is supplied.
|
||||
- long2ip() accepts integer as parameter now
|
||||
- openssl_encrypt and openssl_decrypt have extra parameters for handling
|
||||
authenticated encryption (tag, aad, tag_length) and decryption (tag, aad).
|
||||
- pg_last_notice() accepts optional long parameter to specify operation.
|
||||
PGSQL_NOTICE_LAST - Get last notice (Default)
|
||||
PGSQL_NOTICE_ALL - Get all stored notices
|
||||
PGSQL_NOTICE_CLEAR - Remove all stored notices
|
||||
It returns empty string or array on successful PGSQL_NOTICE_LAST/ALL calls.
|
||||
It returned FALSE for empty notice previously.
|
||||
- pg_fetch_all() accepts 2nd optional result type parameter like
|
||||
pg_fetch_row().
|
||||
- pg_select() accepts 4th optional result type parameter like pg_fetch_row().
|
||||
- parse_url() is more restrictive now and supports RFC3986.
|
||||
- unpack() accepts an additional optional $offset argument. '@' format code
|
||||
(that specifes an absolute position) is applyed to input data after
|
||||
the $offset argument.
|
||||
- strpos(), stripos(), substr_count(), grapheme_strpos(), grapheme_stripos(),
|
||||
grapheme_extract(), iconv_strpos(), mb_strimwidth(), mb_ereg_search_setpos(),
|
||||
mb_strpos() and mb_stripos() now accept negative string offsets.
|
||||
- substr_count() and mb_strimwidth() additionally also accept negative length.
|
||||
- file_get_contents() accepts a negative seek offset if the stream is seekable.
|
||||
- tempnam() throws a notice when failing back to the system temp dir.
|
||||
- getopt() has an extra by-ref parameter : optind
|
||||
- mb_ereg() and mb_ereg_replace() reject illegal byte sequences.
|
||||
- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation
|
||||
according to RFC 6531.
|
||||
- output_reset_rewrite_vars() no longer reset session URL rewrite vars.
|
||||
- the lasinsertid() in pdo_pgsql extension triggers an error, when no nextval()
|
||||
were called in in the current session.
|
||||
- fopen()
|
||||
Since 7.1.2, mode 'e' was added, which sets the close-on-exec flag
|
||||
on the opened file descriptor. This mode is only available in PHP compiled on
|
||||
POSIX.1-2008 conform systems.
|
||||
|
||||
- Standard:
|
||||
. password_hash() can generate Argon2i hashes when the algorithm is set to PASSWORD_ARGON2I.
|
||||
When using PASSWORD_ARGON2I, the following cost factors may be set: 'memory_cost', 'time_cost',
|
||||
and 'threads'. These cost factors will default to 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST',
|
||||
'PASSWORD_ARGON2_DEFAULT_TIME_COST', and 'PASSWORD_ARGON2_DEFAULT_THREADS' respectively if not set.
|
||||
. password_verify() can verify Argon2i hashes.
|
||||
. password_get_info() and password_needs_rehash() can accept Argon2i hashes.
|
||||
. mail()/mb_send_mail() accept array $extra_header. Array parameter is checked against RFC 2822.
|
||||
Array format is
|
||||
$extra_headers = [
|
||||
'Header-Name' => 'Header value',
|
||||
'Multiple' => ['One header', 'Another header'],
|
||||
'Multiline' = "FirstLine\r\n SecondLine",
|
||||
];
|
||||
. count() now raises a warning when an invalid parameter is passed.
|
||||
Only arrays and objects implementing the Countable interface should be passed.
|
||||
. pack() and unpack() now support float and double in both little and big endian.
|
||||
. number_format() ensures zero values never contain a negative sign.
|
||||
|
||||
- XML:
|
||||
. utf8_encode() and utf8_decode() have been moved to the Standard extension
|
||||
as string functions.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
. Added stream_isatty().
|
||||
. Added sapi_windows_vt100_support().
|
||||
. Added sapi_windows_cp_set(), sapi_windows_cp_get(), sapi_windows_cp_is_utf8(),
|
||||
sapi_windows_cp_conv() for codepage handling.
|
||||
|
||||
- DOM:
|
||||
. DomNodeList implements Countable, added DomNodeList::count().
|
||||
. DOMNamedNodeMap implements Countable, added DOMNamedNodeMap::count().
|
||||
|
||||
- FTP:
|
||||
. Added ftp_append().
|
||||
|
||||
- GD:
|
||||
. Added imagesetclip() and imagegetclip().
|
||||
. Added imageopenpolygon().
|
||||
. Added imageresolution().
|
||||
. Added imagecreatefrombmp() and imagebmp().
|
||||
- cURL:
|
||||
. Added curl_multi_errno() and curl_share_errno() to return the last error
|
||||
number of curl_multi and curl_share resources.
|
||||
. Added curl_share_strerror() to convert error code to error message text
|
||||
describing the error.
|
||||
|
||||
- Hash:
|
||||
. Added hash_hmac_algos().
|
||||
. In PHP 7.1.2: Added hash_hkdf() function, which implements the HMAC-based
|
||||
Key Derivation Function (HKDF) algorithm according to RFC 5869. The
|
||||
implementation combines the Extract and Expand steps.
|
||||
|
||||
- Mbstring:
|
||||
. Added mb_chr() and mb_ord().
|
||||
. Added mb_scrub() that scrubs broken multibyte strings.
|
||||
- pcntl:
|
||||
. Added pcntl_signal_get_handler() that returns the current signal handler
|
||||
for a particular signal.
|
||||
|
||||
- OCI8:
|
||||
. Added oci_register_taf_callback() and oci_disable_taf_callback() for
|
||||
Oracle Database TAF callback support.
|
||||
- Session:
|
||||
. Added session_gc() that performs session data garbage collection.
|
||||
https://wiki.php.net/rfc/session-gc
|
||||
. Added session_create_id() for creating custom session ID.
|
||||
https://wiki.php.net/rfc/session-create-id
|
||||
|
||||
- Sockets:
|
||||
. Added socket_addrinfo_lookup(), socket_addrinfo_connect(),
|
||||
socket_addrinfo_bind() and socket_addrinfo_explain().
|
||||
- Standard:
|
||||
. Added is_iterable() that determines if a value will be accepted by the new
|
||||
iterable pseudo-type.
|
||||
|
||||
========================================
|
||||
7. New Classes and Interfaces
|
||||
@@ -276,79 +285,151 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
|
||||
8. Removed Extensions and SAPIs
|
||||
========================================
|
||||
|
||||
- Mcrypt:
|
||||
. The deprecated mcrypt extension has been moved to PECL.
|
||||
. libmcrypt has not been maintained since 2007 and the continued use of this
|
||||
extension is strongly discouraged.
|
||||
. Users are advised to use alternatives such as OpenSSL or libsodium.
|
||||
|
||||
========================================
|
||||
9. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
- EXIF:
|
||||
. Added extended exif tag support for the following formats:
|
||||
Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon,
|
||||
AGFA, Kyocera, Ricoh & Epson.
|
||||
. exif_read_data() and exif_thumbnail() now supports a passed streams as their
|
||||
first parameter.
|
||||
- Date:
|
||||
. Invalid serialization data for a DateTime or DatePeriod object will now
|
||||
throw an instance of Error from __wakeup() or __set_state() instead of
|
||||
resulting in a fatal error.
|
||||
. Timezone initialization failure from serialized data will now throw an
|
||||
instance of Error from __wakeup() or __set_state() instead of resulting in
|
||||
a fatal error.
|
||||
. DateTime and DateTimeImmutable now properly incorporate microseconds when
|
||||
constructed from the current time, either explicitly or with a relative
|
||||
string (e.g. "first day of next month"). This means that naive comparisons
|
||||
of two newly created instances will now more likely return FALSE instead of
|
||||
TRUE:
|
||||
new DateTime() == new DateTime();
|
||||
|
||||
- DBA:
|
||||
. Data modification functions (e.g.: dba_insert()) now throw an instance of
|
||||
Error instead of triggering a catchable fatal error if the key does not
|
||||
contain exactly two elements.
|
||||
|
||||
- DOM:
|
||||
. Invalid schema or RelaxNG validation contexts will throw an instance of
|
||||
Error instead of resulting in a fatal error.
|
||||
. Attempting to register a node class that does not extend the appropriate
|
||||
base class will now throw an instance of Error instead of resulting in a
|
||||
fatal error.
|
||||
. Attempting to read an invalid or write to a readonly property will throw
|
||||
an instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- GD:
|
||||
. Removed --enable-gd-native-ttf configuration option which was unused as
|
||||
of PHP 5.5.0 anyway.
|
||||
. imagegd() stores truecolor images as real truecolor images. Formerly, they
|
||||
have been converted to palette.
|
||||
. imageantialias() is now also available if compiled with a system libgd.
|
||||
. Changed the default of the ini setting gd.jpeg_ignore_warning to 1.
|
||||
|
||||
- Mbstring
|
||||
. mb_check_encoding() accepts array parameter. Both key and value
|
||||
encodings are checked recursively.
|
||||
. mb_convert_encoding() accepts array parameter. Only value encodings
|
||||
are converted recursively.
|
||||
- IMAP:
|
||||
. An email address longer than 16385 bytes will throw an instance of Error
|
||||
instead of resulting in a fatal error.
|
||||
|
||||
- Intl:
|
||||
. Failure to call the parent constructor in a class extending Collator
|
||||
before invoking the parent methods will throw an instance of Error
|
||||
instead of resulting in a recoverable fatal error.
|
||||
. Cloning a Transliterator object may will now throw an instance of Error
|
||||
instead of resulting in a fatal error if cloning the internal
|
||||
transliterator fails.
|
||||
|
||||
- PDO_OCI:
|
||||
. The '--with-pdo-oci' configure syntax no longer needs the vesion number of the
|
||||
Oracle Instant Client.
|
||||
- LDAP:
|
||||
. Providing an unknown modification type to ldap_batch_modify() will now
|
||||
throw an instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- pdo_sqlite
|
||||
. Use sqlite3_prepare_v2() and sqlite3_close_v2() functions instead of their
|
||||
legacy counterparts.
|
||||
- Mbstring:
|
||||
. mb_ereg() and mb_eregi() will now throw an instance of ParseError if an
|
||||
invalid PHP expression is provided and the 'e' option is used.
|
||||
|
||||
- Mcrypt:
|
||||
. mcrypt_encrypt() and mcrypt_decrypt() will throw an instance of Error
|
||||
instead of resulting in a fatal error if mcrypt cannot be initialized.
|
||||
|
||||
- Mysqli:
|
||||
. Attempting to read an invalid or write to a readonly property will throw
|
||||
an instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- PDO_Firebird
|
||||
As of PHP 7.1.2, the fetched data for integer fields is aware of the Firebird
|
||||
datatypes. Previously all integers was fetched as strings, starting with
|
||||
aforementioned PHP version integer fields are translated to the PHP integer
|
||||
datatype. The 64-bit integers are still fetched as strings in 32-bit PHP
|
||||
builds.
|
||||
|
||||
- Reflection:
|
||||
. Failure to retrieve a reflection object or retrieve an object property
|
||||
will now throw an instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- Session:
|
||||
. Custom session handlers that do not return strings for session IDs will
|
||||
now throw an instance of Error instead of resulting in a fatal error
|
||||
when a function is called that must generate a session ID.
|
||||
. Only CSPRNG is used to generate session ID.
|
||||
|
||||
- SimpleXML:
|
||||
. Creating an unnamed or duplicate attribute will throw an instance of Error
|
||||
instead of resulting in a fatal error.
|
||||
|
||||
- SPL:
|
||||
. Attempting to clone an SplDirectory object will throw an instance of Error
|
||||
instead of resulting in a fatal error.
|
||||
. Calling ArrayIterator::append() when iterating over an object will throw an
|
||||
instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- SQLite3:
|
||||
. Upgraded bundled SQLite lib to 3.13.0
|
||||
|
||||
- Standard:
|
||||
. assert() will throw a ParseError when evaluating a string given as the first
|
||||
argument if the PHP code is invalid instead of resulting in a catchable
|
||||
fatal error.
|
||||
. Calling forward_static_call() outside of a class scope will now throw an
|
||||
instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- Tidy:
|
||||
. Creating a tidyNode manually will now throw an instance of Error instead of
|
||||
resulting in a fatal error.
|
||||
|
||||
- WDDX:
|
||||
. A circular reference when serializing will now throw an instance of Error
|
||||
instead of resulting in a fatal error.
|
||||
|
||||
- XML-RPC:
|
||||
. A circular reference when serializing will now throw an instance of Error
|
||||
instead of resulting in a fatal error.
|
||||
|
||||
- Zip:
|
||||
. ZipArchive::addGlob() will throw an instance of Error instead of resulting
|
||||
in a fatal error if glob support is not available.
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
. PHP_FLOAT_DIG number of decimal digits, that can be rounded into a
|
||||
float and back without precision loss
|
||||
. PHP_FLOAT_EPSILON smallest representable positive number x, so then
|
||||
x + 1.0 != 1.0
|
||||
. PHP_FLOAT_MIN min representable float number
|
||||
. PHP_FLOAT_MAX max representable float number
|
||||
. PHP_OS_FAMILY current operating system family
|
||||
. PHP_FD_SETSIZE
|
||||
|
||||
- Fileinfo:
|
||||
. FILEINFO_EXTENSION include list of possible file extensions
|
||||
- JSON:
|
||||
. JSON_UNESCAPED_LINE_TERMINATORS
|
||||
|
||||
- GD:
|
||||
. IMG_EFFECT_MULTIPLY
|
||||
. IMG_BMP
|
||||
|
||||
- PCRE
|
||||
. PREG_UNMATCHED_AS_NULL
|
||||
- Pgsql:
|
||||
PGSQL_NOTICE_LAST
|
||||
PGSQL_NOTICE_ALL
|
||||
PGSQL_NOTICE_CLEAR
|
||||
|
||||
- Standard:
|
||||
. PASSWORD_ARGON2_DEFAULT_MEMORY_COST
|
||||
. PASSWORD_ARGON2_DEFAULT_TIME_COST
|
||||
. PASSWORD_ARGON2_DEFAULT_THREADS
|
||||
. PASSWORD_ARGON2I
|
||||
. IMAGETYPE_WEBP
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
|
||||
- sql.safe_mode
|
||||
. This INI directive has been removed.
|
||||
- serialize_precision
|
||||
. If the value is set to -1, then the dtoa mode 0 is used. The value -1
|
||||
is now used by default.
|
||||
|
||||
- precision
|
||||
. If the value is set to -1, then the dtoa mode 0 is used. No changes
|
||||
in default value which is still 14.
|
||||
|
||||
- realpath_cache_size
|
||||
. Set to 4096k by default
|
||||
@@ -357,17 +438,89 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
|
||||
12. Windows Support
|
||||
========================================
|
||||
|
||||
- Support for VT100 console mode
|
||||
- Core:
|
||||
. Support for long and UTF-8 path;
|
||||
|
||||
On systems starting with 10.0.10586, cmd.exe supports ANSI escape sequences.
|
||||
The corresponding console mode is enabled by default on CLI on suitable
|
||||
systems. As well, the function sapi_windows_vt100_support() is provided,
|
||||
to control and query the corresponding information in the scripts.
|
||||
If a web application is UTF-8 conform, no further action is required. For
|
||||
applications depending on paths in non UTF-8 encodings for I/O, an explicit
|
||||
INI directive has to be set. The encoding INI settings check relies on the
|
||||
order in the core:
|
||||
- internal_encoding
|
||||
- default_charset
|
||||
- zend.multibyte
|
||||
|
||||
Several functions for codepage handling were itroduced:
|
||||
- sapi_windows_cp_set() to set the default codepage
|
||||
- sapi_windows_cp_get() to retrieve the current codepage
|
||||
- sapi_windows_cp_is_utf8()
|
||||
- sapi_windows_cp_conv() to convert between codepages, using iconv()
|
||||
compatible signature
|
||||
These functions are thread safe.
|
||||
|
||||
The console output codepage is adjusted depending on the encoding used in
|
||||
PHP. Depending on the concrete system OEM codepage, the visible output
|
||||
might or might be not correct. For example, in the default cmd.exe and on
|
||||
a system with the OEM codepage 437, outputs in codepages 1251, 1252, 1253
|
||||
and some others can be shown correctly when using UTF-8. On the same system,
|
||||
chars in codepage like 20932 probably won't be shown correctly. This refers
|
||||
to the particular system rules for codepage, font compatibility and the
|
||||
particular console program used. PHP automatically sets the console codepage
|
||||
according to the encoding rules from php.ini. Using alternative consoles
|
||||
instead of cmd.exe directly might bring better experience in some cases.
|
||||
|
||||
Nevertheless be aware, runtime codepage switch after the request start
|
||||
might bring unexpected side effects on CLI. The preferrable way is php.ini,
|
||||
When PHP CLI is used in a console emulator, that doesn't support Unicode,
|
||||
it might possibly be required, to avoid changing the console codepage. The
|
||||
best way to achieve it is by setting the default or internal encoding to
|
||||
correspond the ANSI codepage. Another method is to set the INI directives
|
||||
output_encoding and input_encoding to the required codepage, in which case
|
||||
however the difference between internal and I/O codepage is likely to cause
|
||||
mojibake. In rare cases, if PHP happens to crash gracefully, the original
|
||||
console codepage might be not restored. In this case, the chcp command
|
||||
can be used, to restore it manually.
|
||||
|
||||
Special awareness for the DBCS systems - the codepage switch on runtime
|
||||
using ini_set() is likely to cause display issues. The difference to the
|
||||
non DBCS systems is, that the extended characters require two console cells
|
||||
to be displayed. In certain case, only the mapping of the characters into
|
||||
the glyph set of the font could happen, no actual font change. This is the
|
||||
nature of DBCS systems, the most simple way to prevent display issues is
|
||||
to avoid usage of ini_set() for the codepage change.
|
||||
|
||||
As a result of UTF-8 support in the streams, PHP scripts are not limited
|
||||
to ASCII or ANSI filenames anymore. This is supported out of the box on
|
||||
CLI. For other SAPI, the documentation for the corresponding server
|
||||
is useful.
|
||||
|
||||
Long paths support is transparent. Paths longer than 260 bytes get
|
||||
automatically prefixed with \\?\. The max path length is limited to
|
||||
2048 bytes. Be aware, that the path segment limit (basename length) still
|
||||
persists.
|
||||
|
||||
For the best portability, it is strongely recommended to handle filenames,
|
||||
I/O and other related topics UTF-8. Additionally, for the console applications,
|
||||
the usage of a TrueType font is preferrable and the usage of ini_set() for
|
||||
the codepage change is discouraged.
|
||||
|
||||
. Support for ftok()
|
||||
|
||||
- FCGI
|
||||
. PHP_FCGI_CHILDREN is respected. If this environment variable is defined,
|
||||
the first php-fcgi.exe process will exec the specified number of children.
|
||||
Those will share the same TCP socket.
|
||||
|
||||
- readline:
|
||||
. The readline extension is supported through the WinEditLine library
|
||||
(http://mingweditline.sourceforge.net/). Thereby, the interactive CLI
|
||||
shell is supported as well (php.exe -a).
|
||||
|
||||
It is well known, but nevertheless is worth mentioning again, that
|
||||
the readline extension is not thread safe and will never be. Thus,
|
||||
the usage of it with any true thread safe SAPI (like Apache mod_winnt) is
|
||||
strongely discouraged.
|
||||
|
||||
========================================
|
||||
13. Other Changes
|
||||
========================================
|
||||
|
||||
- Build system
|
||||
|
||||
Autoconf minimal version is now 2.64.
|
||||
+58
-50
@@ -1,52 +1,79 @@
|
||||
PHP 7.2 INTERNALS UPGRADE NOTES
|
||||
PHP 7.1 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. Codepage handling on Windows
|
||||
f. Path handling on Windows
|
||||
g. SAPI logging
|
||||
|
||||
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. Codepage handling on Windows
|
||||
|
||||
A set of new APIs was introduced, which allows to handle codepage
|
||||
conversions. The corresponding prototypes and macros are contained
|
||||
in win32/codepage.h.
|
||||
|
||||
b. php_win32_get_random_bytes()
|
||||
The internal randomness source on Windows switched to use CNG API.
|
||||
Functions with php_win32_cp_* signatures provide handling for various
|
||||
codepage aspects. Primarily they are in use at various places in the
|
||||
I/O utils code and directly in the core where necessary, providing
|
||||
conversions to/from UTF-16. Arbitrary conversions between codepages
|
||||
are possible as well, whereby UTF-16 will be always an intermediate
|
||||
state in this case.
|
||||
|
||||
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.
|
||||
For input length arguments, the macro PHP_WIN32_CP_IGNORE_LEN can be
|
||||
passed, then the API will calculate the length. For output length
|
||||
arguments, the macro PHP_WIN32_CP_IGNORE_LEN_P can be passed, then
|
||||
the API won't set the output length.
|
||||
|
||||
d. ZEND_ACC_CLONE is removed, but was not used in previous versions
|
||||
The mapping between encodings and codepages is provided by the predefined
|
||||
array of data contained in win32/cp_enc_map.c. To change the data,
|
||||
a generator win32/cp_enc_map_gen.c needs to be edited and run.
|
||||
|
||||
e. IS_TYPE_IMMUTABLE is removed, IS_TYPE_COPYABLE can be used instead
|
||||
Z_IMMUTABLE() check function is still available
|
||||
f. Path handling on Windows
|
||||
|
||||
f. zend_arg_info class_name member is removed, use ZEND_TYPE_NAME instead
|
||||
A set of new APIs was introduced, which allows to handle UTF-8 paths. The
|
||||
corresponding prototypes and macros are contained in win32/ioutil.h.
|
||||
|
||||
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
|
||||
Functions with php_win32_ioutil_* signatures provide POSIX I/O analogues.
|
||||
These functions are integrated in various places across the code base to
|
||||
support Unicode filenames. While accepting char * arguments, internally
|
||||
the conversion to wchar_t * happens. Internally almost no ANSI APIs are
|
||||
used, but directly their wide equivalents. The string conversion rules
|
||||
correspond to those already present in the core and depend on the current
|
||||
encoding settings. Doing so allows to move away from the ANSI Windows API
|
||||
with its dependency on the system OEM/ANSI codepage.
|
||||
|
||||
Thanks to the wide API usage, the long paths are now supported as well. The
|
||||
PHP_WIN32_IOUTIL_MAXPATHLEN macro is defined to 2048 bytes and will override
|
||||
the MAXPATHLEN in files where the header is included.
|
||||
|
||||
The most optimal use case for scripts is utilizing UTF-8 for any I/O
|
||||
related functions. UTF-8 filenames are supported on any system disregarding
|
||||
the system OEM/ANSI codepage.
|
||||
|
||||
g. SAPI logging
|
||||
The log_message callback in the SAPI struct was extended with the severity
|
||||
argument. This allows SAPI modules to implement mapping between PHP and
|
||||
corresponding server error levels. A reference mapping implementation
|
||||
can be found in apache2handler.
|
||||
|
||||
h. valid_symbol_table is removed from executor_globals.
|
||||
Use EG(active) instead of removed EG(valid_symbol_table)
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
@@ -55,29 +82,10 @@ PHP 7.2 INTERNALS UPGRADE NOTES
|
||||
a. Unix build system changes
|
||||
|
||||
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+
|
||||
Static analysis with clang and Cppcheck is supported by passing "clang" or
|
||||
"cppcheck" keyword to the --with-analyzer configure option.
|
||||
|
||||
========================
|
||||
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:
|
||||
. php_session_start()/session_reset_id() return value is changed from void to int.
|
||||
It returns SUCCESS/FAILURE.
|
||||
. Session module manages session status correctly.
|
||||
|
||||
- OpenSSL:
|
||||
. Windows builds ship with OpenSSL 1.1 by default, lower versions are still supported with custom deps.
|
||||
|
||||
@@ -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
-137
@@ -466,140 +466,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,6 +62,13 @@ 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_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#define zend_isnan(a) isnan(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.
|
||||
@@ -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
|
||||
+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
|
||||
|
||||
+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
|
||||
|
||||
|
||||
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
|
||||
@@ -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)
|
||||
@@ -19,6 +19,5 @@ class test {
|
||||
new test;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -15,7 +15,5 @@ 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)
|
||||
@@ -49,8 +49,8 @@ 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
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property 'foo' of non-object in %s on line %d
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -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--
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #24635 (crash on dtor calling other functions)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class SiteClass {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #24699 (Memory Leak with per-class constants)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class TEST { const FOO = SEEK_CUR; };
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #24884 (calling $this->__clone(); crashes php)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
--TEST--
|
||||
Bug #26697 (calling class_exists on a nonexistent class in __autoload results in segfault)
|
||||
--SKIPIF--
|
||||
<?php if (function_exists('__autoload')) die('skip __autoload() declared in auto_prepend_file');?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function ($name) {
|
||||
function __autoload($name)
|
||||
{
|
||||
echo __METHOD__ . "($name)\n";
|
||||
var_dump(class_exists('NotExistingClass'));
|
||||
echo __METHOD__ . "($name), done\n";
|
||||
});
|
||||
}
|
||||
|
||||
var_dump(class_exists('NotExistingClass'));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
{closure}(NotExistingClass)
|
||||
__autoload(NotExistingClass)
|
||||
bool(false)
|
||||
{closure}(NotExistingClass), done
|
||||
__autoload(NotExistingClass), done
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -5,7 +5,7 @@ Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter cras
|
||||
|
||||
ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
|
||||
|
||||
class ObjectOne
|
||||
class Object
|
||||
{
|
||||
function getNone()
|
||||
{
|
||||
@@ -23,7 +23,7 @@ class Proxy
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new ObjectOne();
|
||||
$res = new Object();
|
||||
$this->three($res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
@@ -36,7 +36,7 @@ class Proxy
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new ObjectOne();
|
||||
$res = new Object();
|
||||
$this->three(1, $res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
@@ -49,7 +49,7 @@ class Proxy
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new ObjectOne();
|
||||
$res = new Object();
|
||||
$this->three(1, 2, $res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
|
||||
@@ -9,7 +9,7 @@ function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class ObjectOne
|
||||
class Object
|
||||
{
|
||||
public $x;
|
||||
|
||||
@@ -26,7 +26,7 @@ class Overloaded
|
||||
|
||||
function __construct($x)
|
||||
{
|
||||
$this->x = new ObjectOne($x);
|
||||
$this->x = new Object($x);
|
||||
}
|
||||
|
||||
function __get($prop)
|
||||
@@ -47,7 +47,7 @@ var_dump($y->x->x);
|
||||
var_dump($y->x->x = 3);
|
||||
var_dump($y->y = 3);
|
||||
var_dump($y->y);
|
||||
var_dump($y->z = new ObjectOne(4));
|
||||
var_dump($y->z = new Object(4));
|
||||
var_dump($y->z->x);
|
||||
$t = $y->z;
|
||||
var_dump($t->x = 5);
|
||||
@@ -56,7 +56,7 @@ var_dump($y->z->x = 6);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(ObjectOne)#%d (1) {
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -66,9 +66,9 @@ Overloaded::__set(y,3)
|
||||
int(3)
|
||||
Overloaded::__get(y)
|
||||
int(3)
|
||||
string(58) "Object of class ObjectOne could not be converted to string"
|
||||
string(55) "Object of class Object could not be converted to string"
|
||||
Overloaded::__set(z,)
|
||||
object(ObjectOne)#%d (1) {
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(4)
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ ok
|
||||
ok
|
||||
ok
|
||||
|
||||
Notice: Trying to get property 'wrong' of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
@@ -52,4 +52,4 @@ ok
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
ok
|
||||
ok
|
||||
@@ -5,7 +5,8 @@ Bug #31102 (Exception not handled when thrown inside __autoload())
|
||||
|
||||
$test = 0;
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
function __autoload($class)
|
||||
{
|
||||
global $test;
|
||||
|
||||
echo __METHOD__ . "($class,$test)\n";
|
||||
@@ -21,7 +22,7 @@ spl_autoload_register(function ($class) {
|
||||
case 3:
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
while($test++ < 5)
|
||||
{
|
||||
@@ -38,11 +39,11 @@ while($test++ < 5)
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
{closure}(Test1,1)
|
||||
__autoload(Test1,1)
|
||||
Caught: Test1::__construct
|
||||
{closure}(Test2,2)
|
||||
Caught: {closure}
|
||||
{closure}(Test3,3)
|
||||
__autoload(Test2,2)
|
||||
Caught: __autoload
|
||||
__autoload(Test3,3)
|
||||
|
||||
Fatal error: Uncaught Error: Class 'Test3' not found in %sbug31102.php(%d) : eval()'d code:1
|
||||
Stack trace:
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
Bug #33116 (crash when assigning class name to global variable in __autoload)
|
||||
--FILE--
|
||||
<?php
|
||||
spl_autoload_register(function ($class) {
|
||||
function __autoload($class)
|
||||
{
|
||||
$GLOBALS['include'][] = $class;
|
||||
eval("class DefClass{}");
|
||||
});
|
||||
}
|
||||
|
||||
$a = new DefClass;
|
||||
print_r($a);
|
||||
|
||||
@@ -5,7 +5,7 @@ Bug #35470 (Assigning global using variable name from array doesn't function)
|
||||
$x = array("test", "55");
|
||||
global ${$x[0]};
|
||||
${$x[0]} = $x[1];
|
||||
echo "Test: $test\n";
|
||||
echo "Test: $test\n";;
|
||||
?>
|
||||
--EXPECT--
|
||||
Test: 55
|
||||
@@ -8,7 +8,7 @@ foreach($x->a->b as &$v) {
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property 'a' of non-object in %sbug36303.php on line 3
|
||||
Warning: Attempt to modify property of non-object in %sbug36303.php on line 3
|
||||
|
||||
Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3
|
||||
ok
|
||||
@@ -2,7 +2,7 @@
|
||||
Bug #37138 (__autoload tries to load callback'ed self and parent)
|
||||
--FILE--
|
||||
<?php
|
||||
spl_autoload_register(function ($CN) { var_dump ($CN); });
|
||||
function __autoload ($CN) {var_dump ($CN);}
|
||||
class st {
|
||||
public static function e () {echo ("EHLO\n");}
|
||||
public static function e2 () {call_user_func (array ('self', 'e'));}
|
||||
|
||||
@@ -23,6 +23,6 @@ string(3) "Foo"
|
||||
|
||||
Warning: Constants may only evaluate to scalar values or arrays in %sbug37811.php on line %d
|
||||
|
||||
Warning: Use of undefined constant Baz - assumed 'Baz' (this will throw an Error in a future version of PHP) in %sbug37811.php on line %d
|
||||
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
|
||||
string(3) "Baz"
|
||||
===DONE===
|
||||
@@ -10,9 +10,10 @@ class ClassName
|
||||
|
||||
function test (OtherClassName $object) { }
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
function __autoload($class)
|
||||
{
|
||||
var_dump("__autload($class)");
|
||||
});
|
||||
}
|
||||
|
||||
$obj = new ClassName;
|
||||
test($obj);
|
||||
|
||||
@@ -4,9 +4,9 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
|
||||
<?php
|
||||
$s = "";
|
||||
list($a, $b) = $s[0];
|
||||
var_dump($a,$b);
|
||||
echo "I am alive";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304.php on line %d
|
||||
NULL
|
||||
NULL
|
||||
I am alive
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #39304 (Segmentation fault with list unpacking of string offset)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = "";
|
||||
list($a, $b) = $s[0];
|
||||
var_dump($a,$b);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line %d
|
||||
NULL
|
||||
NULL
|
||||
@@ -10,11 +10,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
set_include_path(dirname(__FILE__).'/bug39542:.');
|
||||
}
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
function __autoload($class) {
|
||||
if (!require_once($class.'.php')) {
|
||||
error_log('Error: Autoload class: '.$class.' not found!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
new bug39542();
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
Bug #42798 (_autoload() not triggered for classes used in method signature)
|
||||
--FILE--
|
||||
<?php
|
||||
spl_autoload_register(function ($className) {
|
||||
function __autoload($className) {
|
||||
print "$className\n";
|
||||
exit();
|
||||
});
|
||||
}
|
||||
|
||||
function foo($c = ok::constant) {
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@ echo f2()."\n";
|
||||
echo f3()."\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 13
|
||||
Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 13
|
||||
bar
|
||||
|
||||
Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 3
|
||||
Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 3
|
||||
bar
|
||||
|
||||
Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 6
|
||||
Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 6
|
||||
bar
|
||||
|
||||
Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 9
|
||||
Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 9
|
||||
bar
|
||||
@@ -28,22 +28,22 @@ var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
--> read access:
|
||||
Notice: Trying to get property 'p' of non-object in %sbug44660.php on line 6
|
||||
Notice: Trying to get property of non-object in %sbug44660.php on line 6
|
||||
|
||||
--> direct assignment:
|
||||
Warning: Attempt to assign property 'p' of non-object in %sbug44660.php on line 9
|
||||
Warning: Attempt to assign property of non-object in %sbug44660.php on line 9
|
||||
|
||||
--> increment:
|
||||
Warning: Attempt to increment/decrement property 'p' of non-object in %sbug44660.php on line 12
|
||||
Warning: Attempt to increment/decrement property of non-object in %sbug44660.php on line 12
|
||||
|
||||
--> reference assignment:
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 15
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 15
|
||||
|
||||
--> reference assignment:
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 18
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 18
|
||||
|
||||
--> indexed assignment:
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 21
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 21
|
||||
|
||||
--> Confirm assignments have had no impact:
|
||||
bool(true)
|
||||
@@ -3,13 +3,12 @@ Bug #46665 (Triggering autoload with a variable classname causes truncated autol
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
var_dump($class);
|
||||
require __DIR__ .'/bug46665_autoload.inc';
|
||||
});
|
||||
|
||||
$baz = '\\Foo\\Bar\\Baz';
|
||||
new $baz();
|
||||
function __autoload($class) {
|
||||
var_dump($class);
|
||||
require __DIR__ .'/bug46665_autoload.inc';
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
@@ -9,5 +9,5 @@ var_dump(ini_get("arg_separator.output"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
string(1) "&"
|
||||
%unicode|string%(1) "&"
|
||||
|
||||
@@ -7,5 +7,5 @@ $a->{"a"."b"};
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: a in %sbug47109.php on line 2
|
||||
|
||||
Notice: Trying to get property 'ab' of non-object in %sbug47109.php on line 2
|
||||
Notice: Trying to get property of non-object in %sbug47109.php on line 2
|
||||
|
||||
@@ -14,4 +14,4 @@ $foo = new Foo();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant FOO - assumed 'FOO' (this will throw an Error in a future version of PHP) in %s on line %d
|
||||
Notice: Use of undefined constant FOO - assumed 'FOO' in %s on line %d
|
||||
@@ -10,7 +10,11 @@ function au($class) {
|
||||
}');
|
||||
}
|
||||
|
||||
spl_autoload_register('au');
|
||||
function __autoload($class) {
|
||||
au($class);
|
||||
}
|
||||
|
||||
//spl_autoload_register('au');
|
||||
|
||||
set_exception_handler(function($exception) {
|
||||
$h = new handler();
|
||||
|
||||
@@ -31,11 +31,11 @@ $x::c();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(9) "__call::a"
|
||||
%unicode|string%(9) "__call::a"
|
||||
int(2)
|
||||
string(9) "__call::c"
|
||||
string(15) "__callStatic::a"
|
||||
%unicode|string%(9) "__call::c"
|
||||
%unicode|string%(15) "__callStatic::a"
|
||||
|
||||
Deprecated: Non-static method foo::b() should not be called statically in %s on line %d
|
||||
int(2)
|
||||
string(15) "__callStatic::c"
|
||||
%unicode|string%(15) "__callStatic::c"
|
||||
@@ -31,22 +31,15 @@ var_dump(
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
ParseError: syntax error, unexpected '}', expecting end of file in %sbug48693.php(4) : runtime-created function:1
|
||||
Stack trace:
|
||||
#0 %sbug48693.php(4): create_function('', 'return 1; }')
|
||||
#1 {main}
|
||||
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
ParseError: syntax error, unexpected end of file in %sbug48693.php(14) : runtime-created function:1
|
||||
Stack trace:
|
||||
#0 %sbug48693.php(14): create_function('', '{')
|
||||
#1 {main}
|
||||
|
||||
|
||||
Deprecated: Function create_function() is deprecated in %s on line %d
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -50,4 +50,4 @@ $c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(26) "A::func: This should work!"
|
||||
%unicode|string%(26) "A::func: This should work!"
|
||||
@@ -46,8 +46,8 @@ $c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(27) "A::func2: This should work!"
|
||||
string(27) "A::func3: This should work!"
|
||||
%unicode|string%(27) "A::func2: This should work!"
|
||||
%unicode|string%(27) "A::func3: This should work!"
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ $c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(27) "B::func2: This should work!"
|
||||
string(27) "B::func3: This should work!"
|
||||
%unicode|string%(27) "B::func2: This should work!"
|
||||
%unicode|string%(27) "B::func3: This should work!"
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in %s on line %d
|
||||
@@ -20,7 +20,7 @@ class B {
|
||||
try {
|
||||
$b = new B();
|
||||
} catch(Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
echo $e->getMessage() . "\n";;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #49908 (throwing exception in __autoload crashes when interface is not defin
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function ($className) {
|
||||
function __autoload($className) {
|
||||
var_dump($className);
|
||||
|
||||
if ($className == 'Foo') {
|
||||
@@ -11,20 +11,18 @@ spl_autoload_register(function ($className) {
|
||||
} else {
|
||||
throw new Exception($className);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
new Foo;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "Foo"
|
||||
string(3) "Bar"
|
||||
%unicode|string%(3) "Foo"
|
||||
%unicode|string%(3) "Bar"
|
||||
|
||||
Fatal error: Uncaught Exception: Bar in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}('Bar')
|
||||
#1 %s(%d): spl_autoload_call('Bar')
|
||||
#2 [internal function]: {closure}('Foo')
|
||||
#3 %s(%d): spl_autoload_call('Foo')
|
||||
#4 {main}
|
||||
#0 %s(7): __autoload('Bar')
|
||||
#1 %s(13): __autoload('Foo')
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -8,5 +8,5 @@ var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: Attempt to modify property 'info' of non-object in %sbug52237.php on line 3
|
||||
Warning: Attempt to modify property of non-object in %sbug52237.php on line 3
|
||||
string(4) "test"
|
||||
@@ -11,7 +11,7 @@ echo "ok\n";
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
|
||||
Warning: Attempt to modify property 'a' of non-object in %sbug54262.php on line 4
|
||||
Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
|
||||
ok
|
||||
@@ -5,13 +5,11 @@ track_errors=On
|
||||
--FILE--
|
||||
<?php
|
||||
function testing($source) {
|
||||
unset($source[$cos]);
|
||||
unset($source[$cos]);
|
||||
}
|
||||
testing($_GET);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||
|
||||
Notice: Undefined variable: cos in %sbug54585.php on line 3
|
||||
ok
|
||||
@@ -3,10 +3,10 @@ Bug #55007 (compiler fail after previous fail)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function ($classname) {
|
||||
function __autoload($classname) {
|
||||
if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[]; } }');
|
||||
if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }');
|
||||
});
|
||||
}
|
||||
|
||||
function shutdown() {
|
||||
new MyErrorHandler();
|
||||
|
||||
+71
-71
@@ -1,71 +1,71 @@
|
||||
--TEST--
|
||||
Bug #55509 (segfault on x86_64 using more than 2G memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die('skip Not for 32-bits OS');
|
||||
}
|
||||
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
// check the available memory
|
||||
if (PHP_OS == 'Linux') {
|
||||
$lines = file('/proc/meminfo');
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = (int)ltrim($tmp[1], " ")*1024;
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
elseif (PHP_OS == 'FreeBSD') {
|
||||
$lines = explode("\n",`sysctl -a`);
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
if(!$line){
|
||||
continue;
|
||||
}
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = trim($tmp[1], " ");
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=2100M
|
||||
--FILE--
|
||||
<?php
|
||||
$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "1\n";
|
||||
$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "2\n";
|
||||
$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "3\n";
|
||||
$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "4\n";
|
||||
$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "5\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
|
||||
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
|
||||
--TEST--
|
||||
Bug #55509 (segfault on x86_64 using more than 2G memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die('skip Not for 32-bits OS');
|
||||
}
|
||||
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
// check the available memory
|
||||
if (PHP_OS == 'Linux') {
|
||||
$lines = file('/proc/meminfo');
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = (int)ltrim($tmp[1], " ")*1024;
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
elseif (PHP_OS == 'FreeBSD') {
|
||||
$lines = explode("\n",`sysctl -a`);
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
if(!$line){
|
||||
continue;
|
||||
}
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = trim($tmp[1], " ");
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=2100M
|
||||
--FILE--
|
||||
<?php
|
||||
$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "1\n";
|
||||
$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "2\n";
|
||||
$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "3\n";
|
||||
$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "4\n";
|
||||
$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "5\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
|
||||
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
|
||||
@@ -6,7 +6,7 @@ define('OBJECT_COUNT', 10000);
|
||||
|
||||
$containers = array();
|
||||
|
||||
class ObjectOne {
|
||||
class Object {
|
||||
protected $_guid = 0;
|
||||
public function __construct() {
|
||||
global $containers;
|
||||
@@ -20,7 +20,7 @@ class ObjectOne {
|
||||
}
|
||||
|
||||
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
|
||||
new ObjectOne();
|
||||
new Object();
|
||||
}
|
||||
|
||||
// You probably won't see this because of the "zend_mm_heap corrupted"
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
Bug #61011 (Crash when an exception is thrown by __autoload accessing a static property)
|
||||
--FILE--
|
||||
<?php
|
||||
spl_autoload_register(function ($name) {
|
||||
function __autoload($name) {
|
||||
throw new Exception($name);
|
||||
});
|
||||
|
||||
}
|
||||
try {
|
||||
echo AAA::$a; //zend_fetch_var_address_helper
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61970 (Restraining __construct() access level in subclass gives a fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public function __construct(){}
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
protected function __construct(){}
|
||||
}
|
||||
|
||||
echo 'DONE';
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61970 (Restraining __construct() access level in subclass gives a fatal error - stays when implementing abstract)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class Foo {
|
||||
abstract public function __construct();
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
protected function __construct(){}
|
||||
}
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Bar::__construct() must be public (as in class Foo) in %s
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61970 (Restraining __construct() access level in subclass gives a fatal error - stays when inheriting implemented abstract)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class Foo {
|
||||
abstract public function __construct();
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
public function __construct(){}
|
||||
}
|
||||
|
||||
class Baz extends Bar {
|
||||
protected function __construct(){}
|
||||
}
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Baz::__construct() must be public (as in class Bar) in %s
|
||||
Loaded 100 of 3167 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user