mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cb7036515 |
No files matched your search
@@ -15,25 +15,6 @@ document ____executor_globals
|
||||
ZTS detection is automatically based on ext/standard module struct
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>php-5.3</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
+3
-3
@@ -59,8 +59,8 @@ Exceptions:
|
||||
you're calling.
|
||||
|
||||
7. When commenting out code using a #if statement, do NOT use 0 only. Instead
|
||||
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
|
||||
svn user foo. This allows easier tracking of why code was commented out,
|
||||
use "<cvs username here>_0". For example, #if FOO_0, where FOO is your
|
||||
cvs user foo. This allows easier tracking of why code was commented out,
|
||||
especially in bundled libraries.
|
||||
|
||||
8. Do not define functions that are not available. For instance, if a
|
||||
@@ -259,7 +259,7 @@ The file labelled 'EXPERIMENTAL' should include the following
|
||||
information::
|
||||
|
||||
Any authoring information (known bugs, future directions of the module).
|
||||
Ongoing status notes which may not be appropriate for SVN comments.
|
||||
Ongoing status notes which may not be appropriate for CVS comments.
|
||||
|
||||
Aliases & Legacy Documentation
|
||||
-----------------------------------
|
||||
|
||||
@@ -391,7 +391,7 @@ Apache 2.0 on Unix systems
|
||||
http://snaps.php.net/php5-latest.tar.gz or download binaries for
|
||||
Windows http://snaps.php.net/win32/php5-win32-latest.zip.
|
||||
* a prerelease version downloadable from http://qa.php.net/.
|
||||
* you have always the option to obtain PHP through SVN.
|
||||
* you have always the option to obtain PHP through anonymous CVS.
|
||||
|
||||
These versions of PHP are compatible to Apache 2.0.40 and later.
|
||||
|
||||
@@ -1308,8 +1308,8 @@ Introduction to PECL Installations
|
||||
|
||||
When building PHP modules, it's important to have known-good versions
|
||||
of the required tools (autoconf, automake, libtool, etc.) See the
|
||||
SVN Instructions for details on the required tools, and required
|
||||
versions.
|
||||
Anonymous CVS Instructions for details on the required tools, and
|
||||
required versions.
|
||||
__________________________________________________________________
|
||||
|
||||
Downloading PECL extensions
|
||||
@@ -1325,11 +1325,14 @@ Downloading PECL extensions
|
||||
PECL extensions that have releases listed on the PECL web site are
|
||||
available for download and installation using the pecl command.
|
||||
Specific revisions may also be specified.
|
||||
* SVN
|
||||
All PECL files reside in SVN. A web-based view may be seen at
|
||||
http://svn.php.net/pecl/. To download straight from SVN, use:
|
||||
* CVS
|
||||
Most PECL extensions also reside in CVS. A web-based view may be
|
||||
seen at http://cvs.php.net/pecl/. To download straight from CVS,
|
||||
the following sequence of commands may be used. Note that phpfi is
|
||||
the password for user cvsread:
|
||||
|
||||
$ svn co http://svn.php.net/repository/pecl/<extname>/trunk <extname>
|
||||
$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
|
||||
$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
|
||||
|
||||
* Windows downloads
|
||||
Windows users may find compiled PECL binaries by downloading the
|
||||
@@ -1377,7 +1380,7 @@ Compiling shared PECL extensions with phpize
|
||||
Sometimes, using the pecl installer is not an option. This could be
|
||||
because you're behind a firewall, or it could be because the extension
|
||||
you want to install is not available as a PECL compatible package, such
|
||||
as unreleased extensions from SVN. If you need to build such an
|
||||
as unreleased extensions from CVS. If you need to build such an
|
||||
extension, you can use the lower-level build tools to perform the build
|
||||
manually.
|
||||
|
||||
@@ -1524,7 +1527,7 @@ The configuration file
|
||||
directives are documented in the manual though. For a complete list of
|
||||
directives available in your PHP version, please read your well
|
||||
commented php.ini file. Alternatively, you may find the the latest
|
||||
php.ini from SVN helpful too.
|
||||
php.ini from CVS helpful too.
|
||||
|
||||
Example 6-1. php.ini example
|
||||
; any text on a line after an unquoted semicolon (;) is ignored
|
||||
|
||||
+19
-14
@@ -79,25 +79,29 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
|
||||
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
|
||||
done; \
|
||||
fi`
|
||||
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(define_syslog_variables|register_(globals|long_arrays)?|safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
|
||||
|
||||
test: all
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
|
||||
if test "$$INI_SCANNED_PATH"; then \
|
||||
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
|
||||
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
$(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
INI_SCANNED_PATH=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
|
||||
if test "$$INI_SCANNED_PATH"; then \
|
||||
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
|
||||
$(EGREP) -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
@@ -111,8 +115,9 @@ clean:
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
find . -name Makefile | xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
.NOEXPORT:
|
||||
@@ -1,399 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
22 Dec 2009, PHP 5.3.2 RC 1
|
||||
- Upgraded bundled sqlite to version 3.6.21. (Ilia)
|
||||
- Upgraded bundled PCRE to version 8.00. (Scott)
|
||||
|
||||
- Changed gmp_strval() to use full range from 2 to 62, and -2 to -36. FR #50283
|
||||
(David Soria Parra)
|
||||
- Changed "post_max_size" php.ini directive to allow unlimited post size by
|
||||
setting it to 0. (Rasmus)
|
||||
|
||||
- Added INTERNALDATE support to imap_append. (nick at mailtrust dot com)
|
||||
- Added support for SHA-256 and SHA-512 to php's crypt. (Pierre)
|
||||
- Added realpath_cache_size() and realpath_cache_get() functions. (Stas)
|
||||
- Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. (Ilia)
|
||||
- Added protection for $_SESSION from interrupt corruption and improved
|
||||
"session.save_path" check. (Stas)
|
||||
- Added LIBXML_PARSEHUGE constant to override the maximum text size of a
|
||||
single text node when using libxml2.7.3+. (Kalle)
|
||||
- Added ReflectionMethod::setAccessible() for invoking non-public methods
|
||||
through the Reflection API. (Sebastian)
|
||||
- Added Collator::getSortKey for intl extension. (Stas)
|
||||
- Added support for CURLOPT_POSTREDIR. FR #49571. (Sriram Natarajan)
|
||||
- Added support for CURLOPT_CERTINFO. FR #49253.
|
||||
(Linus Nielsen Feltzing <linus@haxx.se>)
|
||||
- Added client-side server name indication support in openssl. (Arnaud)
|
||||
|
||||
- Improved fix for bug #50006 (Segfault caused by uksort()). (Stas)
|
||||
|
||||
- Fixed mysqlnd hang when queries exactly 16777214 bytes long are sent. (Andrey)
|
||||
- Fixed incorrect decoding of 5-byte BIT sequences in mysqlnd. (Andrey)
|
||||
- Fixed error_log() to be binary safe when using message_type 3. (Jani)
|
||||
- Fixed unnecessary invocation of setitimer when timeouts have been disabled.
|
||||
(Arvind Srinivasan)
|
||||
- Fixed memory leak in extension loading when an error occurs on Windows.
|
||||
(Pierre)
|
||||
|
||||
- Fixed bug #50540 (Crash while running ldap_next_reference test cases).
|
||||
(Sriram)
|
||||
- Fixed bug #50508 (compile failure: Conflicting HEADER type declarations).
|
||||
(Jani)
|
||||
- Fixed bug #50496 (Use of <stdbool.h> is valid only in a c99 compilation
|
||||
environment. (Sriram)
|
||||
- Fixed bug #50464 (declare encoding doesn't work within an included file).
|
||||
(Felipe)
|
||||
- Fixed bug #50458 (PDO::FETCH_FUNC fails with Closures). (Felipe, Pierrick)
|
||||
- Fixed bug #50445 (PDO-ODBC stored procedure call from Solaris 64-bit causes
|
||||
seg fault). (davbrown4 at yahoo dot com, Felipe)
|
||||
- Fixed bug #50394 (Reference argument converted to value in __call). (Stas)
|
||||
- Fixed bug #50351 (performance regression handling objects, ten times slower
|
||||
in 5.3 than in 5.2). (Dmitry)
|
||||
- Fixed bug #50392 (date_create_from_format() enforces 6 digits for 'u'
|
||||
format character). (Ilia)
|
||||
- Fixed bug #50345 (nanosleep not detected properly on some solaris versions).
|
||||
(Jani)
|
||||
- Fixed bug #50340 (php.ini parser does not allow spaces in ini keys). (Jani)
|
||||
- Fixed bug #50334 (crypt ignores sha512 prefix). (Pierre)
|
||||
- Fixed bug #50323 (Allow use of ; in values via ;; in PDO DSN).
|
||||
(Ilia, Pierrick)
|
||||
- Fixed bug #50285 (xmlrpc does not preserve keys in encoded indexed arrays).
|
||||
(Felipe)
|
||||
- Fixed bug #50282 (xmlrpc_encode_request() changes object into array in
|
||||
calling function). (Felipe)
|
||||
- Fixed bug #50267 (get_browser(null) does not use HTTP_USER_AGENT). (Jani)
|
||||
- Fixed bug #50266 (conflicting types for llabs). (Jani)
|
||||
- Fixed bug #50261 (Crash When Calling Parent Constructor with
|
||||
call_user_func()). (Dmitry)
|
||||
- Fixed bug #50255 (isset() and empty() silently casts array to object).
|
||||
(Felipe)
|
||||
- Fixed bug #50240 (pdo_mysql.default_socket in php.ini shouldn't used
|
||||
if it is empty). (foutrelis at gmail dot com, Ilia)
|
||||
- Fixed bug #50231 (Socket path passed using --with-mysql-sock is ignored when
|
||||
mysqlnd is enabled). (Jani)
|
||||
- Fixed bug #50219 (soap call Segmentation fault on a redirected url).
|
||||
(Pierrick)
|
||||
- Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT).
|
||||
(Ilia, shigeru_kitazaki at cybozu dot co dot jp)
|
||||
- Fixed bug #50209 (Compiling with libedit cannot find readline.h).
|
||||
(tcallawa at redhat dot com)
|
||||
- Fixed bug #50207 (segmentation fault when concatenating very large strings on
|
||||
64bit linux). (Ilia)
|
||||
- Fixed bug #50196 (stream_copy_to_stream() produces warning when source is
|
||||
not file). (Stas)
|
||||
- Fixed bug #50195 (pg_copy_to() fails when table name contains schema. (Ilia)
|
||||
- Fixed bug #50185 (ldap_get_entries() return false instead of an empty array
|
||||
when there is no error). (Jani)
|
||||
- Fixed bug #50174 (Incorrectly matched docComment). (Felipe)
|
||||
- Fixed bug #50168 (FastCGI fails with wrong error on HEAD request to
|
||||
non-existant file). (Dmitry)
|
||||
- Fixed bug #50162 (Memory leak when fetching timestamp column from Oracle
|
||||
database). (Felipe)
|
||||
- Fixed bug #50159 (wrong working directory in symlinked files). (Dmitry)
|
||||
- Fixed bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses
|
||||
containing = or ?). (Pierrick)
|
||||
- Fixed bug #50152 (ReflectionClass::hasProperty behaves like isset() not
|
||||
property_exists). (Felipe)
|
||||
- Fixed bug #50146 (property_exists: Closure object cannot have properties).
|
||||
(Felipe)
|
||||
- Fixed bug #50145 (crash while running bug35634.phpt). (Felipe)
|
||||
- Fixed bug #50140 (With default compilation option, php symbols are unresolved
|
||||
for nsapi). (Uwe Schindler)
|
||||
- Fixed bug #50087 (NSAPI performance improvements). (Uwe Schindler)
|
||||
- Fixed bug #50073 (parse_url() incorrect when ? in fragment). (Ilia)
|
||||
- Fixed bug #50023 (pdo_mysql doesn't use PHP_MYSQL_UNIX_SOCK_ADDR). (Ilia)
|
||||
- Fixed bug #50005 (Throwing through Reflection modified Exception object
|
||||
makes segmentation fault). (Felipe)
|
||||
- Fixed bug #49990 (SNMP3 warning message about security level printed twice).
|
||||
(Jani)
|
||||
- Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted
|
||||
transaction). (ben dot pineau at gmail dot com, Ilia, Matteo)
|
||||
- Fixed bug #49938 (Phar::isBuffering() returns inverted value). (Greg)
|
||||
- Fixed bug #49936 (crash with ftp stream in php_stream_context_get_option()).
|
||||
(Pierrick)
|
||||
- Fixed bug #49921 (Curl post upload functions changed). (Ilia)
|
||||
- Fixed bug #49866 (Making reference on string offsets crashes PHP). (Dmitry)
|
||||
- Fixed bug #49855 (import_request_variables() always returns NULL). (Ilia,
|
||||
sjoerd at php dot net)
|
||||
- Fixed bug #49851, #50451 (http wrapper breaks on 1024 char long headers).
|
||||
(Ilia)
|
||||
- Fixed bug #49800 (SimpleXML allow (un)serialize() calls without warning).
|
||||
(Ilia, wmeler at wp-sa dot pl)
|
||||
- Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private
|
||||
property in base class). (Felipe)
|
||||
- Fixed bug #49677 (ini parser crashes with apache2 and using ${something}
|
||||
ini variables). (Jani)
|
||||
- Fixed bug #49660 (libxml 2.7.3+ limits text nodes to 10MB). (Felipe)
|
||||
- Fixed bug #49647 (DOMUserData does not exist). (Rob)
|
||||
- Fixed bug #49521 (PDO fetchObject sets values before calling constructor).
|
||||
(Pierrick)
|
||||
- Fixed bug #49472 (Constants defined in Interfaces can be overridden).
|
||||
(Felipe)
|
||||
- Fixed bug #49244 (Floating point NaN cause garbage characters). (Sjoerd)
|
||||
- Fixed bug #49224 (Compile error due to old DNS functions on AIX systems).
|
||||
(Scott)
|
||||
- Fixed bug #49174 (crash when extending PDOStatement and trying to set
|
||||
queryString property). (Felipe)
|
||||
- Fixed bug #47848 (importNode doesn't preserve attribute namespaces). (Rob)
|
||||
- Fixed bug #46478 (htmlentities() uses obsolete mapping table for character
|
||||
entity references). (Moriyoshi)
|
||||
- Fixed bug #45599 (strip_tags() truncates rest of string with invalid
|
||||
attribute). (Ilia, hradtke)
|
||||
- Fixed bug #45120 (PDOStatement->execute() returns true then false for same
|
||||
statement). (Pierrick)
|
||||
- Fixed bug #34852 (Failure in odbc_exec() using oracle-supplied odbc
|
||||
driver). (tim dot tassonis at trivadis dot com)
|
||||
|
||||
19 Nov 2009, PHP 5.3.1
|
||||
- Upgraded bundled sqlite to version 3.6.19. (Scott)
|
||||
- Updated timezone database to version 2009.17 (2009q). (Derick)
|
||||
|
||||
- Changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case
|
||||
insensitive. (garretts)
|
||||
|
||||
- Restored shebang line check to CGI sapi (not checked by scanner anymore).
|
||||
(Jani)
|
||||
|
||||
- Added "max_file_uploads" INI directive, which can be set to limit the
|
||||
number of file uploads per-request to 20 by default, to prevent possible
|
||||
DOS via temporary file exhaustion. (Ilia)
|
||||
- Added missing sanity checks around exif processing. (Ilia)
|
||||
- Added error constant when json_encode() detects an invalid UTF-8 sequence.
|
||||
(Scott)
|
||||
- Added support for ACL on Windows for thread safe SAPI (Apache2 for example)
|
||||
and fix its support on NTS. (Pierre)
|
||||
|
||||
- Improved symbolic, mounted volume and junctions support for realpath on
|
||||
Windows. (Pierre)
|
||||
- Improved readlink on Windows, suppress \??\ and use the drive syntax only.
|
||||
(Pierre)
|
||||
- Improved dns_get_record() AAAA support on windows. Always available when
|
||||
IPv6 is support is installed, format is now the same than on unix. (Pierre)
|
||||
- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API
|
||||
where available on other platforms. (Scott)
|
||||
- Improved shared extension loading on OSX to use the standard Unix dlopen()
|
||||
API. (Scott)
|
||||
|
||||
- Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)
|
||||
- Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak.
|
||||
(Rasmus)
|
||||
- Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz
|
||||
Stachowiak. (Rasmus)
|
||||
- Fixed certificate validation inside php_openssl_apply_verification_policy
|
||||
(Ryan Sleevi, Ilia)
|
||||
- Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery()
|
||||
when calling using Reflection. (Felipe)
|
||||
- Fixed crash when instantiating PDORow and PDOStatement through Reflection.
|
||||
(Felipe)
|
||||
- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
|
||||
- Fixed scandir/readdir when used mounted points on Windows. (Pierre)
|
||||
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
|
||||
- Fixed leak on error in popen/exec (and related functions) on Windows.
|
||||
(Pierre)
|
||||
- Fixed possible bad caching of symlinked directories in the realpath cache
|
||||
on Windows. (Pierre)
|
||||
- Fixed atime and mtime in stat related functions on Windows. (Pierre)
|
||||
- Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and
|
||||
Functors. (Christian Seiler)
|
||||
- Fixed open_basedir circumvention for "mail.log" ini directive.
|
||||
(Maksymilian Arciemowicz, Stas)
|
||||
- Fixed signature generation/validation for zip archives in ext/phar. (Greg)
|
||||
- Fixed memory leak in stream_is_local(). (Felipe, Tony)
|
||||
- Fixed BC break in mime_content_type(), removes the content encoding. (Scott)
|
||||
|
||||
- Fixed PECL bug #16842 (oci_error return false when NO_DATA_FOUND is raised).
|
||||
(Chris Jones)
|
||||
|
||||
- Fixed bug #50063 (safe_mode_include_dir fails). (Johannes, christian at
|
||||
elmerot dot se)
|
||||
- Fixed bug #50052 (Different Hashes on Windows and Linux on wrong Salt size).
|
||||
(Pierre)
|
||||
- Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre)
|
||||
- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar
|
||||
tar support). (Greg)
|
||||
- Fixed bug #49908 (throwing exception in __autoload crashes when interface
|
||||
is not defined). (Felipe)
|
||||
- Fixed bug #49847 (exec() fails to return data inside 2nd parameter, given
|
||||
output lines >4095 bytes). (Ilia)
|
||||
- Fixed bug #49809 (time_sleep_until() is not available on OpenSolaris). (Jani)
|
||||
- Fixed bug #49757 (long2ip() can return wrong value in a multi-threaded
|
||||
applications). (Ilia, Florian Anderiasch)
|
||||
- Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #49732 (crashes when using fileinfo when timestamp conversion
|
||||
fails). (Pierre)
|
||||
- Fixed bug #49698 (Unexpected change in strnatcasecmp()). (Rasmus)
|
||||
- Fixed bug #49630 (imap_listscan function missing). (Felipe)
|
||||
- Fixed bug #49572 (use of C++ style comments causes build failure).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE
|
||||
cannot be set"). (Felipe)
|
||||
- Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after
|
||||
fclose). (Ilia)
|
||||
- Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters).
|
||||
(Ilia)
|
||||
- Fixed bug #49447 (php engine need to correctly check for socket API
|
||||
return status on windows). (Sriram Natarajan)
|
||||
- Fixed bug #49391 (ldap.c utilizing deprecated ldap_modify_s). (Ilia)
|
||||
- Fixed bug #49372 (segfault in php_curl_option_curl). (Pierre)
|
||||
- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
|
||||
(Ilia, code-it at mail dot ru)
|
||||
- Fixed bug #49306 (inside pdo_mysql default socket settings are ignored).
|
||||
(Ilia)
|
||||
- Fixed bug #49289 (bcmath module doesn't compile with phpize configure).
|
||||
(Jani)
|
||||
- Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani)
|
||||
- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside
|
||||
foreach declaration). (Etienne, Dmitry)
|
||||
- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
|
||||
- Fixed bug #49223 (Inconsistency using get_defined_constants). (Garrett)
|
||||
- Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies
|
||||
wrong type in declaration). (Ilia)
|
||||
- Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre)
|
||||
- Fixed bug #49144 (Import of schema from different host transmits original
|
||||
authentication details). (Dmitry)
|
||||
- Fixed bug #49142 (crash when exception thrown from __tostring()).
|
||||
(David Soria Parra)
|
||||
- Fixed bug #49132 (posix_times returns false without error).
|
||||
(phpbugs at gunnu dot us)
|
||||
- Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu)
|
||||
- Fixed bug #49122 (undefined reference to mysqlnd_stmt_next_result on compile
|
||||
with --with-mysqli and MySQL 6.0). (Jani)
|
||||
- Fixed bug #49108 (2nd scan_dir produces segfault). (Felipe)
|
||||
- Fixed bug #49098 (mysqli segfault on error). (Rasmus)
|
||||
- Fixed bug #49095 (proc_get_status['exitcode'] fails on win32). (Felipe)
|
||||
- Fixed bug #49092 (ReflectionFunction fails to work with functions in fully
|
||||
qualified namespaces). (Kalle, Jani)
|
||||
- Fixed bug #49074 (private class static fields can be modified by using
|
||||
reflection). (Jani)
|
||||
- Fixed bug #49072 (feof never returns true for damaged file in zip). (Pierre)
|
||||
- Fixed bug #49065 ("disable_functions" php.ini option does not work on
|
||||
Zend extensions). (Stas)
|
||||
- Fixed bug #49064 (--enable-session=shared does not work: undefined symbol:
|
||||
php_url_scanner_reset_vars). (Jani)
|
||||
- Fixed bug #49056 (parse_ini_file() regression in 5.3.0 when using non-ASCII
|
||||
strings as option keys). (Jani)
|
||||
- Fixed bug #49052 (context option headers freed too early when using
|
||||
--with-curlwrappers). (Jani)
|
||||
- Fixed bug #49047 (The function touch() fails on directories on Windows).
|
||||
(Pierre)
|
||||
- Fixed bug #49032 (SplFileObject::fscanf() variables passed by reference).
|
||||
(Jani)
|
||||
- Fixed bug #49027 (mysqli_options() doesn't work when using mysqlnd). (Andrey)
|
||||
- Fixed bug #49026 (proc_open() can bypass safe_mode_protected_env_vars
|
||||
restrictions). (Ilia)
|
||||
- Fixed bug #49020 (phar misinterprets ustar long filename standard).
|
||||
(Greg)
|
||||
- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed).
|
||||
(Greg)
|
||||
- Fixed bug #49014 (dechunked filter broken when serving more than 8192 bytes
|
||||
in a chunk). (andreas dot streichardt at globalpark dot com, Ilia)
|
||||
- Fixed bug #49012 (phar tar signature algorithm reports as Unknown (0) in
|
||||
getSignature() call). (Greg)
|
||||
- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes
|
||||
when including files from function). (Stas)
|
||||
- Fixed bug #48994 (zlib.output_compression does not output HTTP headers when
|
||||
set to a string value). (Jani)
|
||||
- Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe)
|
||||
- Fixed bug #48962 (cURL does not upload files with specified filename).
|
||||
(Ilia)
|
||||
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
|
||||
option is an array). (David Zülke)
|
||||
- Fixed bug #48913 (Too long error code strings in pdo_odbc driver).
|
||||
(naf at altlinux dot ru, Felipe)
|
||||
- Fixed bug #48912 (Namespace causes unexpected strict behaviour with
|
||||
extract()). (Dmitry)
|
||||
- Fixed bug #48909 (Segmentation fault in mysqli_stmt_execute()). (Andrey)
|
||||
- Fixed bug #48899 (is_callable returns true even if method does not exist in
|
||||
parent class). (Felipe)
|
||||
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)
|
||||
- Fixed bug #48880 (Random Appearing open_basedir problem). (Rasmus, Gwynne)
|
||||
- Fixed bug #48872 (string.c: errors: duplicate case values). (Kalle)
|
||||
- Fixed bug #48854 (array_merge_recursive modifies arrays after first one).
|
||||
(Felipe)
|
||||
- Fixed bug #48805 (IPv6 socket transport is not working). (Ilia)
|
||||
- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani)
|
||||
- Fixed bug #48791 (open office files always reported as corrupted). (Greg)
|
||||
- Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked
|
||||
directories). (Ilia)
|
||||
- Fixed bug #48783 (make install will fail saying phar file exists). (Greg)
|
||||
- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #48771 (rename() between volumes fails and reports no error on
|
||||
Windows). (Pierre)
|
||||
- Fixed bug #48768 (parse_ini_*() crash with INI_SCANNER_RAW). (Jani)
|
||||
- Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at
|
||||
gmail dot com, Pierre)
|
||||
- Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
|
||||
- Fixed bug #48757 (ReflectionFunction::invoke() parameter issues). (Kalle)
|
||||
- Fixed bug #48754 (mysql_close() crash php when no handle specified).
|
||||
(Johannes, Andrey)
|
||||
- Fixed bug #48752 (Crash during date parsing with invalid date). (Pierre)
|
||||
- Fixed bug #48746 (Unable to browse directories within Junction Points).
|
||||
(Pierre, Kanwaljeet Singla)
|
||||
- Fixed bug #48745 (mysqlnd: mysql_num_fields returns wrong column count for
|
||||
mysql_list_fields). (Andrey)
|
||||
- Fixed bug #48740 (PHAR install fails when INSTALL_ROOT is not the final
|
||||
install location). (james dot cohen at digitalwindow dot com, Greg)
|
||||
- Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns on
|
||||
files that have been opened with r+). (Ilia)
|
||||
- Fixed bug #48719 (parse_ini_*(): scanner_mode parameter is not checked for
|
||||
sanity). (Jani)
|
||||
- Fixed bug #48718 (FILTER_VALIDATE_EMAIL does not allow numbers in domain
|
||||
components). (Ilia)
|
||||
- Fixed bug #48681 (openssl signature verification for tar archives broken).
|
||||
(Greg)
|
||||
- Fixed bug #48660 (parse_ini_*(): dollar sign as last character of value
|
||||
fails). (Jani)
|
||||
- Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal
|
||||
html-entities). (Moriyoshi)
|
||||
- Fixed bug #48637 ("file" fopen wrapper is overwritten when using
|
||||
--with-curlwrappers). (Jani)
|
||||
- Fixed bug #48608 (Invalid libreadline version not detected during configure).
|
||||
(Jani)
|
||||
- Fixed bug #48400 (imap crashes when closing stream opened with
|
||||
OP_PROTOTYPE flag). (Jani)
|
||||
- Fixed bug #48377 (error message unclear on converting phar with existing
|
||||
file). (Greg)
|
||||
- Fixed bug #48247 (Infinite loop and possible crash during startup with
|
||||
errors when errors are logged). (Jani)
|
||||
- Fixed bug #48198 error: 'MYSQLND_LLU_SPEC' undeclared. Cause for #48780 and
|
||||
#46952 - both fixed too. (Andrey)
|
||||
- Fixed bug #48189 (ibase_execute error in return param). (Kalle)
|
||||
- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre,
|
||||
Al dot Smith at aeschi dot ch dot eu dot org)
|
||||
- Fixed bug #48057 (Only the date fields of the first row are fetched, others
|
||||
are empty). (info at programmiernutte dot net)
|
||||
- Fixed bug #47481 (natcasesort() does not sort extended ASCII characters
|
||||
correctly). (Herman Radtke)
|
||||
- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
|
||||
- Fixed bug #47273 (Encoding bug in SoapServer->fault). (Dmitry)
|
||||
- Fixed bug #46682 (touch() afield returns different values on windows).
|
||||
(Pierre)
|
||||
- Fixed bug #46614 (Extended MySQLi class gives incorrect empty() result).
|
||||
(Andrey)
|
||||
- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX).
|
||||
(Uwe Schindler)
|
||||
- Fixed bug #45905 (imagefilledrectangle() clipping error).
|
||||
(markril at hotmail dot com, Pierre)
|
||||
- Fixed bug #45554 (Inconsistent behavior of the u format char). (Derick)
|
||||
- Fixed bug #45141 (setcookie will output expires years of >4 digits). (Ilia)
|
||||
- Fixed bug #44683 (popen crashes when an invalid mode is passed). (Pierre)
|
||||
- Fixed bug #43510 (stream_get_meta_data() does not return same mode as used
|
||||
in fopen). (Jani)
|
||||
- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot
|
||||
com, Kalle)
|
||||
- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter
|
||||
Knauf)
|
||||
- Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo).
|
||||
(Kalle, Rick Yorgason)
|
||||
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
|
||||
- Fixed bug #27051 (Impersonation with FastCGI does not exec process as
|
||||
impersonated user). (Pierre)
|
||||
|
||||
|
||||
30 Jun 2009, PHP 5.3.0
|
||||
- Upgraded bundled PCRE to version 7.9. (Nuno)
|
||||
- Upgraded bundled sqlite to version 3.6.15. (Scott)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
====================
|
||||
SVN Commit Rules
|
||||
CVS Commit Rules
|
||||
====================
|
||||
|
||||
This is the first file you should be reading after you get your SVN account.
|
||||
We'll assume you're basically familiar with SVN, but feel free to post
|
||||
This is the first file you should be reading after you get your CVS account.
|
||||
We'll assume you're basically familiar with CVS, but feel free to post
|
||||
your questions on the mailing list. Please have a look at
|
||||
http://svnbook.red-bean.com/ for more detailed information on SVN.
|
||||
http://cvsbook.red-bean.com/ for more detailed information on CVS.
|
||||
|
||||
PHP is developed through the efforts of a large number of people.
|
||||
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
|
||||
some basic rules with regards to SVN usage will::
|
||||
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
|
||||
some basic rules with regards to CVS usage will::
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
the SVN itself.
|
||||
the CVS itself.
|
||||
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
@@ -43,21 +43,21 @@ Having said that, here are the organizational rules::
|
||||
|
||||
Currently we have the following branches in use::
|
||||
|
||||
trunk Will become PHP 6.0. This CVS branch is for active development.
|
||||
HEAD Will become PHP 6.0. This CVS branch is for active development.
|
||||
|
||||
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
larger enhancements.
|
||||
PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
|
||||
branches/PHP_5_1 This branch is closed.
|
||||
PHP_5_1 This branch is closed.
|
||||
|
||||
branches/PHP_4_4 This branch is closed.
|
||||
PHP_4_4 This branch is closed.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to trunk and then get merged from trunk
|
||||
1. All changes should first go to HEAD and then get merged from HEAD
|
||||
(aka MFH'ed) to all other relevant branches.
|
||||
|
||||
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
|
||||
@@ -132,11 +132,11 @@ If you don't see your messages in ChangeLog right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later.
|
||||
|
||||
When you change the NEWS file for a bug fix, then please keep the bugs
|
||||
When you change the NEWS file for a bug fix, then please keep the bugs
|
||||
sorted in decreasing order under the fixed version.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP SVN repository in various ways.
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
To receive daily updates to ChangeLog and NEWS, send an empty message to
|
||||
php-cvs-daily-subscribe@lists.php.net.
|
||||
@@ -210,10 +210,6 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
|
||||
|
||||
III. ``s/Fixed bug #\([0-9]\+\)/<?php bugfix(\1); ?>/``
|
||||
|
||||
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
|
||||
|
||||
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
|
||||
|
||||
4. ``cp releases/4_4_0.php releases/4_4_1.php``
|
||||
|
||||
5. ``cvs add releases/4_4_1.php``
|
||||
@@ -252,8 +248,9 @@ number, and remove the RC from there.
|
||||
|
||||
II. For PHP5: Set $CURRENT_QA_RELEASE_5 to false
|
||||
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
------------------------------------
|
||||
|
||||
1. Commit the new binaries to ``phpweb/distributions/``
|
||||
|
||||
@@ -284,3 +281,4 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
|
||||
+96
-106
@@ -1,136 +1,126 @@
|
||||
Submitting Patches to PHP
|
||||
=========================
|
||||
Submitting Patch for PHP
|
||||
========================
|
||||
|
||||
This document describes how to submit a patch for PHP. Creating a
|
||||
patch for PHP is easy!
|
||||
This document describes how to submit a patch for PHP. Since you are
|
||||
reading this document, you are willing to submit a patch for PHP.
|
||||
Please keep reading! Submitting a patch for PHP is easy. The hard
|
||||
part is making it acceptable for inclusion into our repository. :-)
|
||||
|
||||
You don't need any login accounts or special access to download,
|
||||
build, debug and begin submitting PHP code, tests or documentation for
|
||||
inclusion in PHP. Once you've followed this README and had several
|
||||
patches accepted, PHP commit privileges are often quickly granted.
|
||||
How to create patch?
|
||||
--------------------
|
||||
We are working with CVS. You need to get CVS source to create a patch
|
||||
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
|
||||
source. You can check out older versions, but make sure you get
|
||||
the default branch (i.e. Do not use -r option when you check out the
|
||||
CVS source)
|
||||
|
||||
An excellent article to read first is:
|
||||
http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
|
||||
Read CODING_STANDARDS file before you start working.
|
||||
|
||||
Now you are ready to create a patch. Modify source to fix a bug in PHP or
|
||||
add a new feature to PHP. After you finished editing, please test your
|
||||
patch. Read README.TESTING for testing.
|
||||
|
||||
After you finish testing your patch, take diff file using
|
||||
"cvs diff > your.patch" command.
|
||||
|
||||
Read README.TESTING for submitting a test script for your patch. This is
|
||||
not strictly required, but it is preferred to submit a test script along
|
||||
with your patch. Making new test script is very easy. It also helps us
|
||||
to understand what you have been fixed or added to PHP.
|
||||
|
||||
|
||||
Prework
|
||||
-------
|
||||
If you are fixing broken functionality then create a bug or identify
|
||||
an existing bug at http://bugs.php.net/. This can be used to track
|
||||
the patch progress and prevent your changes getting lost in the PHP
|
||||
mail archives.
|
||||
Tips for creating patch
|
||||
-----------------------
|
||||
If you would like to fix multiple bugs. It is easier for us if you
|
||||
could create 1 patch for 1 bug, but this is not strictly required.
|
||||
Note though that you might get little response, if your patch is
|
||||
too hard to review.
|
||||
|
||||
If your code change is large then first discuss it with the extension
|
||||
maintainer and/or a development mail list. Extension maintainers can
|
||||
be found in the EXTENSIONS file in the PHP source. Use the
|
||||
internals@lists.php.net mail list to discuss changes to the base PHP
|
||||
code. Use pecl-dev@lists.php.net for changes to code that is only
|
||||
available from PECL (http://pecl.php.net/). Use pear-dev@lists.php.net
|
||||
for PEAR modules (http://pear.php.net/). Mail list subscription is
|
||||
explained on http://www.php.net/mailing-lists.php.
|
||||
If you would like change/add many lines, it is better to ask module
|
||||
maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
|
||||
you are patching PEAR. Official module maintainers can be found in
|
||||
EXTENSIONS file in PHP source.
|
||||
|
||||
If a PHP or PECL patch affects user-functionality or makes significant
|
||||
internal changes then create a simple RFC on http://wiki.php.net/rfc
|
||||
before starting discussion. This RFC can be used for initial
|
||||
discussion and later for documentation. Wiki accounts can be requested
|
||||
on http://wiki.php.net/start?do=register
|
||||
|
||||
There are several IRC channels where PHP developers are often
|
||||
available to discuss questions. They include #php.pecl on the EFNet
|
||||
network and #php-dev-win on FreeNode.
|
||||
If you are new to CVS (Concurrent Versions System), visit
|
||||
http://cvshome.org/ for details.
|
||||
|
||||
|
||||
How to create your patch
|
||||
------------------------
|
||||
PHP uses Subversion (SVN) for revision control. Read
|
||||
http://www.php.net/svn.php for help on using SVN to get and build PHP
|
||||
source code. We recommend using a Sparse Directory checkout described
|
||||
in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
|
||||
http://svnbook.red-bean.com.
|
||||
Recommended CVS client settings for creating patch file
|
||||
------------------------------------------------------
|
||||
Recommended ~/.cvsrc file setting is:
|
||||
------
|
||||
cvs -z3
|
||||
update -d -P
|
||||
checkout -P
|
||||
diff -u
|
||||
|
||||
Generally we ask that patches work on the current stable PHP
|
||||
development branch and on "trunk".
|
||||
------
|
||||
diff -u means:
|
||||
-u Use the unified output format.
|
||||
|
||||
Read CODING_STANDARDS before you start working.
|
||||
|
||||
After modifying the source see README.TESTING and
|
||||
http://qa.php.net/write-test.php for how to test. Submitting test
|
||||
scripts helps us to understand what functionality has changed. It is
|
||||
important for the stability and maintainability of PHP that tests are
|
||||
comprehensive.
|
||||
|
||||
After testing is finished, create a patch file using the command:
|
||||
|
||||
svn diff > your_patch.txt
|
||||
|
||||
For ease of review and later troubleshooting, submit individual
|
||||
patches for each bug or feature.
|
||||
With this CVS setting, you don't have to worry about adding/deleting
|
||||
newlines and spaces.
|
||||
|
||||
|
||||
Checklist for submitting your patch
|
||||
-----------------------------------
|
||||
- Update SVN source just before running your final 'diff' and
|
||||
before testing.
|
||||
- Run "make test" to check your patch doesn't break other features.
|
||||
- Rebuild PHP with --enable-debug (which will show some kinds of
|
||||
memory errors) and check the PHP and web server error logs after
|
||||
running the PHP tests.
|
||||
- Rebuild PHP with --enable-maintainer-zts to check your patch compiles
|
||||
on multi-threaded web servers.
|
||||
- Create test scripts for use with "make test".
|
||||
- Add in-line comments and/or have external documentation ready.
|
||||
- Review the patch once more just before submitting it.
|
||||
Check list for submitting patch
|
||||
-------------------------------
|
||||
- Did you run "make test" to check if your patch didn't break
|
||||
other features?
|
||||
- Did you compile PHP with --enable-debug and check the PHP and
|
||||
web server error logs when you test your patch?
|
||||
- Did you build PHP for multi-threaded web servers. (Optional)
|
||||
- Did you create test script for "make test"? (Recommended)
|
||||
- Did you check your patch is unified format and it does not
|
||||
contain white space changes? (If you are not using recommended
|
||||
cvs setting)
|
||||
- Did you update CVS source before you take final patch?
|
||||
- Did you read the patch again?
|
||||
|
||||
|
||||
Where to send your patch
|
||||
------------------------
|
||||
If you are patching PHP C source then email the patch to
|
||||
internals@lists.php.net
|
||||
Where to send your patch?
|
||||
-------------------------
|
||||
If you are patching C source, send the patch to internals@lists.php.net.
|
||||
If you are patching a module, you should also send the patch to the
|
||||
maintainer. Official module maintainers are listed in EXTENSION file
|
||||
in source.
|
||||
|
||||
If you patching a PECL extension then send the patch to
|
||||
pecl-dev@lists.php.net
|
||||
If you are patching PEAR, send the patch to pear-dev@lists.php.net.
|
||||
|
||||
If you are patching PEAR then send the patch to
|
||||
pear-dev@lists.php.net
|
||||
Please add the prefix "[PATCH]" to your email subject and make sure
|
||||
to include the patch as a MIME attachment even if it is short.
|
||||
|
||||
The mail can be CC'd to the extension maintainer (see EXTENSIONS).
|
||||
NOTE: only MIME attachments of type 'text/*' are accepted. The
|
||||
easiest way to accomplish this, is to make the extension
|
||||
'.txt'.
|
||||
|
||||
Please make the subject prefix "[PATCH]".
|
||||
Test scripts should be included in the same email.
|
||||
Explain what has been fixed/added/changed by your patch.
|
||||
|
||||
Include the patch as an attachment. Note: only MIME attachments of
|
||||
type 'text/*' are accepted. The easiest way to accomplish this is to
|
||||
make the file extension '.txt'.
|
||||
|
||||
Explain what has been fixed/added/changed by your patch. Test scripts
|
||||
should be included in the email.
|
||||
|
||||
Include the bug id(s) which can be closed by your patch.
|
||||
|
||||
Finally, update any open bugs and add a link to the source of your
|
||||
patch.
|
||||
Finally, add the bug Id(s) which can be closed by your patch, if any.
|
||||
|
||||
|
||||
What happens after you submit your patch
|
||||
----------------------------------------
|
||||
If your patch is easy to review and obviously has no side-effects,
|
||||
it might be committed relatively quickly.
|
||||
----------------------------------------
|
||||
If your patch is easy to review and has obviously no side-effects,
|
||||
it might take up to a few hours until someone commits it.
|
||||
|
||||
Because PHP is a volunteer-driven effort more complex patches will
|
||||
require patience on your side. If you do not receive feedback in a few
|
||||
days, consider resubmitting the patch. Before doing this think about
|
||||
Because this is a volunteer-driven effort, more complex patches will
|
||||
require more patience on your side.
|
||||
|
||||
If you did not receive any feedback in a few days, please consider
|
||||
resubmitting the description of your patch, along-side with
|
||||
these questions:
|
||||
|
||||
- Did I review the mail list archives to see if these kind of
|
||||
changes had been discussed before?
|
||||
- Did I explain my patch clearly?
|
||||
- Is my patch too hard to review? Because of which factors?
|
||||
- Are there any unwanted white space changes?
|
||||
- Is my patch too hard to review? Because of which factors?
|
||||
- Should I split it up in multiple parts?
|
||||
- Are there any unwanted whitespace changes?
|
||||
|
||||
|
||||
What happens when your patch is applied
|
||||
---------------------------------------
|
||||
Your name will be included together with your email address in the SVN
|
||||
commit log. If your patch affects end users, a brief description
|
||||
What happens when your patch is applied?
|
||||
----------------------------------------
|
||||
Your name will be included together with your email address in the CVS
|
||||
commit log. If your patch affects end-users, a brief description
|
||||
and your name might be added to the NEWS file.
|
||||
|
||||
Thank you for patching PHP!
|
||||
|
||||
Thank you for submitting patch for PHP!
|
||||
+28
-175
@@ -271,6 +271,9 @@ CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
|
||||
buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime);
|
||||
buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime);
|
||||
buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime);
|
||||
if (buf->st_mtime != buf->st_atime) {
|
||||
buf->st_atime = buf->st_mtime;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -428,31 +431,6 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
register unsigned long h;
|
||||
char *bucket_key = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
|
||||
char *bucket_key_start = (char *)bucket_key;
|
||||
const char *e = bucket_key + strlen(bucket_key);
|
||||
|
||||
if (!bucket_key) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (h = 2166136261U; bucket_key < e;) {
|
||||
h *= 16777619;
|
||||
h ^= *bucket_key++;
|
||||
}
|
||||
/* if no SID were present the path is returned. Otherwise a Heap
|
||||
allocated string is returned. */
|
||||
if (bucket_key_start != path) {
|
||||
LocalFree(bucket_key_start);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
/* }}} */
|
||||
#else
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
|
||||
{
|
||||
register unsigned long h;
|
||||
@@ -466,7 +444,6 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len) /
|
||||
return h;
|
||||
}
|
||||
/* }}} */
|
||||
#endif /* defined(PHP_WIN32) */
|
||||
|
||||
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
@@ -487,11 +464,7 @@ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
|
||||
|
||||
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
|
||||
|
||||
@@ -524,12 +497,8 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
|
||||
if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
|
||||
realpath_cache_bucket *bucket = malloc(size);
|
||||
unsigned long n;
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
bucket->key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
|
||||
bucket->key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
bucket->path = (char*)bucket + sizeof(realpath_cache_bucket);
|
||||
memcpy(bucket->path, path, path_len+1);
|
||||
bucket->path_len = path_len;
|
||||
@@ -558,12 +527,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
|
||||
|
||||
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
|
||||
|
||||
@@ -590,22 +554,6 @@ CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int realpath_cache_size(TSRMLS_D)
|
||||
{
|
||||
return CWDG(realpath_cache_size);
|
||||
}
|
||||
|
||||
CWD_API int realpath_cache_max_buckets(TSRMLS_D)
|
||||
{
|
||||
return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
}
|
||||
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
|
||||
{
|
||||
return CWDG(realpath_cache);
|
||||
}
|
||||
|
||||
|
||||
#undef LINK_MAX
|
||||
#define LINK_MAX 32
|
||||
|
||||
@@ -616,13 +564,13 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
#ifdef TSRM_WIN32
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
TSRM_ALLOCA_FLAG(use_heap_large)
|
||||
#else
|
||||
struct stat st;
|
||||
#endif
|
||||
realpath_cache_bucket *bucket;
|
||||
char *tmp;
|
||||
TSRM_ALLOCA_FLAG(use_heap)
|
||||
TSRM_ALLOCA_FLAG(use_heap_large)
|
||||
|
||||
while (1) {
|
||||
if (len <= start) {
|
||||
@@ -722,14 +670,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
/* File is a reparse point. Get the target */
|
||||
HANDLE hLink = NULL;
|
||||
REPARSE_DATA_BUFFER * pbuffer;
|
||||
unsigned int retlength = 0;
|
||||
int bufindex = 0, isabsolute = 0;
|
||||
unsigned int retlength = 0, rname_off = 0;
|
||||
int bufindex = 0, rname_len = 0, isabsolute = 0;
|
||||
wchar_t * reparsetarget;
|
||||
BOOL isVolume = FALSE;
|
||||
char printname[MAX_PATH];
|
||||
char substitutename[MAX_PATH];
|
||||
int printname_len, substitutename_len;
|
||||
int substitutename_off = 0;
|
||||
|
||||
if(++(*ll) > LINK_MAX) {
|
||||
return -1;
|
||||
@@ -750,108 +693,37 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
CloseHandle(hLink);
|
||||
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
rname_len = pbuffer->SymbolicLinkReparseBuffer.PrintNameLength/2;
|
||||
rname_off = pbuffer->SymbolicLinkReparseBuffer.PrintNameOffset/2;
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
printname[printname_len] = 0;
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
}
|
||||
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
|
||||
isabsolute = 1;
|
||||
rname_len = pbuffer->MountPointReparseBuffer.PrintNameLength/2;
|
||||
rname_off = pbuffer->MountPointReparseBuffer.PrintNameOffset/2;
|
||||
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
} else {
|
||||
isabsolute = 1;
|
||||
}
|
||||
else {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(isabsolute && substitutename_len > 4) {
|
||||
/* Do not resolve volumes (for now). A mounted point can
|
||||
target a volume without a drive, it is not certain that
|
||||
all IO functions we use in php and its deps support
|
||||
path with volume GUID instead of the DOS way, like:
|
||||
d:\test\mnt\foo
|
||||
\\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo
|
||||
*/
|
||||
if (strncmp(substitutename, "\\??\\Volume{",11) == 0
|
||||
|| strncmp(substitutename, "\\\\?\\Volume{",11) == 0) {
|
||||
isVolume = TRUE;
|
||||
substitutename_off = 0;
|
||||
} else
|
||||
/* do not use the \??\ and \\?\ prefix*/
|
||||
if (strncmp(substitutename, "\\??\\", 4) == 0
|
||||
|| strncmp(substitutename, "\\\\?\\", 4) == 0) {
|
||||
substitutename_off = 4;
|
||||
}
|
||||
/* Convert wide string to narrow string */
|
||||
for(bufindex = 0; bufindex < rname_len; bufindex++) {
|
||||
*(path + bufindex) = (char)(reparsetarget[rname_off + bufindex]);
|
||||
}
|
||||
|
||||
if (!isVolume) {
|
||||
char * tmp = substitutename + substitutename_off;
|
||||
for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) {
|
||||
*(path + bufindex) = *(tmp + bufindex);
|
||||
}
|
||||
|
||||
*(path + bufindex) = 0;
|
||||
j = bufindex;
|
||||
} else {
|
||||
j = len;
|
||||
}
|
||||
|
||||
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf(stderr, "reparse: print: %s ", printname);
|
||||
fprintf(stderr, "sub: %s ", substitutename);
|
||||
fprintf(stderr, "resolved: %s ", path);
|
||||
#endif
|
||||
*(path + bufindex) = 0;
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
j = bufindex;
|
||||
|
||||
if(isabsolute == 1) {
|
||||
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -869,7 +741,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
if(link_is_dir) {
|
||||
*link_is_dir = directory;
|
||||
@@ -999,7 +870,6 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
time_t t;
|
||||
int ret;
|
||||
int add_slash;
|
||||
void *tmp;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
|
||||
@@ -1144,16 +1014,7 @@ verify:
|
||||
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
state->cwd_length = path_length;
|
||||
|
||||
tmp = realloc(state->cwd, state->cwd_length+1);
|
||||
if (tmp == NULL) {
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
state->cwd = (char *) tmp;
|
||||
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1);
|
||||
memcpy(state->cwd, resolved_path, state->cwd_length+1);
|
||||
if (verify_path(state)) {
|
||||
CWD_STATE_FREE(state);
|
||||
@@ -1165,15 +1026,7 @@ verify:
|
||||
}
|
||||
} else {
|
||||
state->cwd_length = path_length;
|
||||
tmp = realloc(state->cwd, state->cwd_length+1);
|
||||
if (tmp == NULL) {
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
state->cwd = (char *) tmp;
|
||||
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1);
|
||||
memcpy(state->cwd, resolved_path, state->cwd_length+1);
|
||||
ret = 0;
|
||||
}
|
||||
@@ -1342,7 +1195,7 @@ static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
static int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
{
|
||||
FILETIME mtime, atime;
|
||||
HANDLE hFile;
|
||||
@@ -1518,7 +1371,7 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
|
||||
/* rename on windows will fail if newname already exists.
|
||||
MoveFileEx has to be used */
|
||||
#ifdef TSRM_WIN32
|
||||
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0;
|
||||
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0) ? -1 : 0;
|
||||
#else
|
||||
retval = rename(oldname, newname);
|
||||
#endif
|
||||
|
||||
+2
-10
@@ -238,9 +238,6 @@ extern virtual_cwd_globals cwd_globals;
|
||||
CWD_API void realpath_cache_clean(TSRMLS_D);
|
||||
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
|
||||
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
|
||||
CWD_API int realpath_cache_size(TSRMLS_D);
|
||||
CWD_API int realpath_cache_max_buckets(TSRMLS_D);
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
@@ -291,7 +288,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
|
||||
/* rename on windows will fail if newname already exists.
|
||||
MoveFileEx has to be used */
|
||||
#if defined(TSRM_WIN32)
|
||||
# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0)
|
||||
# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0 ? -1 : 0)
|
||||
#else
|
||||
# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
|
||||
#endif
|
||||
@@ -314,13 +311,8 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
|
||||
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
|
||||
|
||||
#if HAVE_UTIME
|
||||
# ifdef TSRM_WIN32
|
||||
# define VCWD_UTIME(path, time) win32_utime(path, time)
|
||||
# else
|
||||
# define VCWD_UTIME(path, time) utime(path, time)
|
||||
# endif
|
||||
#define VCWD_UTIME(path, time) utime(path, time)
|
||||
#endif
|
||||
|
||||
#define VCWD_CHMOD(path, mode) chmod(path, mode)
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
|
||||
|
||||
+33
-212
@@ -30,7 +30,7 @@
|
||||
#include "TSRM.h"
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include <Sddl.h>
|
||||
|
||||
#include "tsrm_win32.h"
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
|
||||
@@ -42,21 +42,25 @@ static tsrm_win32_globals win32_globals;
|
||||
|
||||
static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
{
|
||||
HANDLE process_token = NULL;
|
||||
|
||||
globals->process = NULL;
|
||||
globals->shm = NULL;
|
||||
globals->process_size = 0;
|
||||
globals->shm_size = 0;
|
||||
globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com");
|
||||
globals->impersonation_token = NULL;
|
||||
|
||||
/* Set it to INVALID_HANDLE_VALUE
|
||||
* It will be initialized correctly in tsrm_win32_access or set to
|
||||
* NULL if no impersonation has been done.
|
||||
* the impersonated token can't be set here as the impersonation
|
||||
* will happen later, in fcgi_accept_request (or whatever is the
|
||||
* SAPI being used).
|
||||
*/
|
||||
globals->impersonation_token = INVALID_HANDLE_VALUE;
|
||||
globals->impersonation_token_sid = NULL;
|
||||
/* Access check requires impersonation token. Create a duplicate token. */
|
||||
if(OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_QUERY, &process_token)) {
|
||||
DuplicateToken(process_token, SecurityImpersonation, &globals->impersonation_token);
|
||||
}
|
||||
|
||||
/* impersonation_token will be closed when the process dies */
|
||||
if(process_token != NULL) {
|
||||
CloseHandle(process_token);
|
||||
process_token = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
@@ -79,12 +83,9 @@ static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
|
||||
free(globals->comspec);
|
||||
|
||||
if (globals->impersonation_token && globals->impersonation_token != INVALID_HANDLE_VALUE ) {
|
||||
if(globals->impersonation_token) {
|
||||
CloseHandle(globals->impersonation_token);
|
||||
}
|
||||
if (globals->impersonation_token_sid) {
|
||||
free(globals->impersonation_token_sid);
|
||||
}
|
||||
}
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void)
|
||||
@@ -103,97 +104,8 @@ TSRM_API void tsrm_win32_shutdown(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
|
||||
{
|
||||
PSID pSid = TWG(impersonation_token_sid);
|
||||
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
|
||||
TCHAR *ptcSid = NULL;
|
||||
char *bucket_key = NULL;
|
||||
|
||||
if (!pSid) {
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
|
||||
if (!bucket_key) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(bucket_key, pathname, strlen(pathname));
|
||||
return bucket_key;
|
||||
}
|
||||
|
||||
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
|
||||
if (!bucket_key) {
|
||||
LocalFree(ptcSid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(bucket_key, ptcSid, strlen(ptcSid));
|
||||
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
|
||||
|
||||
LocalFree(ptcSid);
|
||||
return bucket_key;
|
||||
}
|
||||
|
||||
|
||||
PSID tsrm_win32_get_token_sid(HANDLE hToken)
|
||||
{
|
||||
BOOL bSuccess = FALSE;
|
||||
DWORD dwLength = 0;
|
||||
PTOKEN_USER pTokenUser = NULL;
|
||||
PSID sid;
|
||||
PSID *ppsid = &sid;
|
||||
DWORD sid_len;
|
||||
PSID pResultSid = NULL;
|
||||
|
||||
/* Get the actual size of the TokenUser structure */
|
||||
if (!GetTokenInformation(
|
||||
hToken, TokenUser, (LPVOID) pTokenUser, 0, &dwLength)) {
|
||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
pTokenUser = (PTOKEN_USER)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength);
|
||||
if (pTokenUser == NULL) {
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
|
||||
/* and fetch it now */
|
||||
if (!GetTokenInformation(
|
||||
hToken, TokenUser, (LPVOID) pTokenUser, dwLength, &dwLength)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
sid_len = GetLengthSid(pTokenUser->User.Sid);
|
||||
|
||||
/* ConvertSidToStringSid(pTokenUser->User.Sid, &ptcSidOwner); */
|
||||
pResultSid = malloc(sid_len);
|
||||
if (!pResultSid) {
|
||||
goto Finished;
|
||||
}
|
||||
if (!CopySid(sid_len, pResultSid, pTokenUser->User.Sid)) {
|
||||
goto Finished;
|
||||
}
|
||||
return pResultSid;
|
||||
|
||||
Finished:
|
||||
if (pResultSid) {
|
||||
free(pResultSid);
|
||||
}
|
||||
/* Free the buffer for the token groups. */
|
||||
if (pTokenUser != NULL) {
|
||||
HeapFree(GetProcessHeap(), 0, (LPVOID)pTokenUser);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
{
|
||||
time_t t;
|
||||
HANDLE thread_token;
|
||||
PSID token_sid;
|
||||
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
|
||||
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
|
||||
DWORD priv_set_length = sizeof(PRIVILEGE_SET);
|
||||
@@ -202,10 +114,11 @@ 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;
|
||||
HANDLE process_token = NULL;
|
||||
|
||||
BOOL bucket_key_alloc = FALSE;
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
time_t t;
|
||||
|
||||
TSRMLS_FETCH();
|
||||
|
||||
@@ -213,6 +126,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD type;
|
||||
return GetBinaryType(pathname, &type) ? 0 : -1;
|
||||
} else {
|
||||
if(access(pathname, mode)) {
|
||||
return errno;
|
||||
}
|
||||
|
||||
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
|
||||
@@ -221,58 +138,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
pathname = real_path;
|
||||
}
|
||||
|
||||
if(access(pathname, mode)) {
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* If only existence check is made, return now */
|
||||
if (mode == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Only in NTS when impersonate==1 (aka FastCGI) */
|
||||
|
||||
/*
|
||||
AccessCheck() requires an impersonation token. We first get a primary
|
||||
token and then create a duplicate impersonation token. The
|
||||
impersonation token is not actually assigned to the thread, but is
|
||||
used in the call to AccessCheck. Thus, this function itself never
|
||||
impersonates, but does use the identity of the thread. If the thread
|
||||
was impersonating already, this function uses that impersonation context.
|
||||
*/
|
||||
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
|
||||
DWORD err = GetLastError();
|
||||
if (GetLastError() == ERROR_NO_TOKEN) {
|
||||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
|
||||
TWG(impersonation_token) = NULL;
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* token_sid will be freed in tsrmwin32_dtor */
|
||||
token_sid = tsrm_win32_get_token_sid(thread_token);
|
||||
if (!token_sid) {
|
||||
if (TWG(impersonation_token_sid)) {
|
||||
free(TWG(impersonation_token_sid));
|
||||
}
|
||||
TWG(impersonation_token_sid) = NULL;
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
/* Different identity, we need a new impersontated token as well */
|
||||
if (!TWG(impersonation_token_sid) || !EqualSid(token_sid, TWG(impersonation_token_sid))) {
|
||||
if (TWG(impersonation_token_sid)) {
|
||||
free(TWG(impersonation_token_sid));
|
||||
}
|
||||
TWG(impersonation_token_sid) = token_sid;
|
||||
|
||||
/* Duplicate the token as impersonated token */
|
||||
if (!DuplicateToken(thread_token, SecurityImpersonation, &TWG(impersonation_token))) {
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
|
||||
if (CWDG(realpath_cache_size_limit)) {
|
||||
t = time(0);
|
||||
bucket = realpath_cache_lookup(pathname, strlen(pathname), t TSRMLS_CC);
|
||||
@@ -286,7 +151,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Do a full access check because access() will only check read-only attribute */
|
||||
if(mode == 0 || mode > 6) {
|
||||
if(bucket != NULL && bucket->is_rvalid) {
|
||||
@@ -299,13 +164,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
fAccess = bucket->is_writable;
|
||||
goto Finished;
|
||||
}
|
||||
desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE;
|
||||
desired_access = FILE_GENERIC_WRITE;
|
||||
} else if(mode <= 4) {
|
||||
if(bucket != NULL && bucket->is_rvalid) {
|
||||
fAccess = bucket->is_readable;
|
||||
goto Finished;
|
||||
}
|
||||
desired_access = FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS;
|
||||
desired_access = FILE_GENERIC_READ;
|
||||
} else { // if(mode <= 6)
|
||||
if(bucket != NULL && bucket->is_rvalid && bucket->is_wvalid) {
|
||||
fAccess = bucket->is_readable & bucket->is_writable;
|
||||
@@ -329,15 +194,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
MapGenericMask(&desired_access, &gen_map);
|
||||
|
||||
if(!AccessCheck((PSECURITY_DESCRIPTOR)psec_desc, TWG(impersonation_token), desired_access, &gen_map, &privilege_set, &priv_set_length, &granted_access, &fAccess)) {
|
||||
goto Finished_Impersonate;
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
/* Keep the result in realpath_cache */
|
||||
if(bucket != NULL) {
|
||||
if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) {
|
||||
if(desired_access == FILE_GENERIC_READ) {
|
||||
bucket->is_rvalid = 1;
|
||||
bucket->is_readable = fAccess;
|
||||
}
|
||||
@@ -347,13 +210,12 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
Finished_Impersonate:
|
||||
Finished:
|
||||
if(psec_desc != NULL) {
|
||||
free(psec_desc);
|
||||
psec_desc = NULL;
|
||||
}
|
||||
|
||||
Finished:
|
||||
if(real_path != NULL) {
|
||||
free(real_path);
|
||||
real_path = NULL;
|
||||
@@ -443,45 +305,21 @@ TSRM_API FILE *popen(const char *command, const char *type)
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, type_len = strlen(type), read, mode;
|
||||
int fno, str_len = strlen(type), read, mode;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
BOOL res;
|
||||
process_pair *proc;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
HANDLE thread_token = NULL;
|
||||
HANDLE token_user = NULL;
|
||||
BOOL asuser = TRUE;
|
||||
|
||||
process_pair *proc;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (!type) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*The following two checks can be removed once we drop XP support */
|
||||
type_len = strlen(type);
|
||||
if (type_len <1 || type_len > 2) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0; i < type_len; i++) {
|
||||
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
|
||||
return NULL;
|
||||
}
|
||||
ptype++;
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -493,7 +331,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
read = (type[0] == 'r') ? TRUE : FALSE;
|
||||
mode = ((type_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
|
||||
if (read) {
|
||||
in = dupHandle(in, FALSE);
|
||||
@@ -510,29 +348,12 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
dwCreateFlags |= CREATE_NO_WINDOW;
|
||||
}
|
||||
|
||||
/* Get a token with the impersonated user. */
|
||||
if(OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
|
||||
DuplicateTokenEx(thread_token, MAXIMUM_ALLOWED, &security, SecurityImpersonation, TokenPrimary, &token_user);
|
||||
} else {
|
||||
DWORD err = GetLastError();
|
||||
if (err == ERROR_NO_TOKEN) {
|
||||
asuser = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
CloseHandle(token_user);
|
||||
} else {
|
||||
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
if (!res) {
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
|
||||
return NULL;
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
CloseHandle(process.hThread);
|
||||
proc = process_get(NULL TSRMLS_CC);
|
||||
|
||||
@@ -64,7 +64,6 @@ typedef struct {
|
||||
int shm_size;
|
||||
char *comspec;
|
||||
HANDLE impersonation_token;
|
||||
PSID impersonation_token_sid;
|
||||
} tsrm_win32_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -90,7 +89,6 @@ typedef struct {
|
||||
#define SHM_RND FILE_MAP_WRITE
|
||||
#define SHM_REMAP FILE_MAP_COPY
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void);
|
||||
TSRM_API void tsrm_win32_shutdown(void);
|
||||
@@ -99,7 +97,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
TSRM_API FILE *popen(const char *command, const char *type);
|
||||
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(int key, int size, int flags);
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags);
|
||||
|
||||
@@ -62,6 +62,18 @@ unix.h \
|
||||
stdlib.h \
|
||||
dlfcn.h)
|
||||
|
||||
dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
|
||||
dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
|
||||
case $host_alias in
|
||||
*darwin[[89]]*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADERS([ \
|
||||
mach-o/dyld.h
|
||||
],[],[][])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ if (function_exists("date_default_timezone_set")) {
|
||||
date_default_timezone_set("UTC");
|
||||
}
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
function simple() {
|
||||
$a = 0;
|
||||
for ($i = 0; $i < 1000000; $i++)
|
||||
|
||||
+11
-12
@@ -359,8 +359,7 @@ var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
?>
|
||||
===DONE===
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
*** Testing unset(), empty() & isset() with scalar variables ***
|
||||
-- Iteration 1 --
|
||||
@@ -1186,11 +1185,11 @@ bool(true)
|
||||
|
||||
*** Testing unset(), emtpy() & isset() with resource variables ***
|
||||
-- Iteration 1 --
|
||||
resource(%d) of type (stream)
|
||||
resource(5) of type (stream)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (stream)
|
||||
resource(5) of type (stream)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1199,11 +1198,11 @@ bool(false)
|
||||
Notice: Undefined variable: resource in %s on line %d
|
||||
NULL
|
||||
-- Iteration 2 --
|
||||
resource(%d) of type (stream)
|
||||
resource(6) of type (stream)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (stream)
|
||||
resource(6) of type (stream)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1218,7 +1217,7 @@ bool(false)
|
||||
bool(true)
|
||||
|
||||
*** Testing unset(), empty() & isset() with objects ***
|
||||
object(Point)#%d (3) {
|
||||
object(Point)#1 (3) {
|
||||
["x"]=>
|
||||
int(30)
|
||||
["y"]=>
|
||||
@@ -1240,7 +1239,7 @@ bool(false)
|
||||
|
||||
Notice: Undefined variable: lable in %s on line %d
|
||||
bool(true)
|
||||
object(Point)#%d (3) {
|
||||
object(Point)#1 (3) {
|
||||
["x"]=>
|
||||
int(30)
|
||||
["y"]=>
|
||||
@@ -1248,7 +1247,7 @@ object(Point)#%d (3) {
|
||||
["lable"]=>
|
||||
string(6) "Point1"
|
||||
}
|
||||
object(Point)#%d (2) {
|
||||
object(Point)#1 (2) {
|
||||
["y"]=>
|
||||
int(40)
|
||||
["lable"]=>
|
||||
@@ -1256,7 +1255,7 @@ object(Point)#%d (2) {
|
||||
}
|
||||
bool(false)
|
||||
bool(true)
|
||||
object(Point)#%d (0) {
|
||||
object(Point)#1 (0) {
|
||||
}
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1277,7 +1276,7 @@ array(3) {
|
||||
[2]=>
|
||||
string(9) "testPoint"
|
||||
}
|
||||
object(Point)#%d (3) {
|
||||
object(Point)#1 (3) {
|
||||
["x"]=>
|
||||
int(5)
|
||||
["y"]=>
|
||||
@@ -1330,4 +1329,4 @@ bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(10)
|
||||
===DONE===
|
||||
Done
|
||||
+4
-4
@@ -18,17 +18,17 @@ var_dump($a->$b->$c[1]);
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
Notice: Undefined variable: c in %s on line %d
|
||||
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
int(1)
|
||||
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
Notice: Undefined variable: b in %s on line %d
|
||||
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
int(0)
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
@@ -41,14 +41,12 @@ $db = new hariCow;
|
||||
|
||||
var_dump($db);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: db in %sbug30162.php on line 35
|
||||
NULL
|
||||
object(hariCow)#%d (2) {
|
||||
object(hariCow)#1 (2) {
|
||||
["x"]=>
|
||||
string(1) "x"
|
||||
["y"]=>
|
||||
string(1) "y"
|
||||
}
|
||||
===DONE===
|
||||
@@ -30,7 +30,7 @@ ppp
|
||||
|
||||
echo "$htm\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT---
|
||||
abc
|
||||
abc
|
||||
abc
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = create_function('', 'return 1; }');
|
||||
$y = create_function('', 'function a() { }; return 2;');
|
||||
$z = create_function('', '{');
|
||||
$w = create_function('', 'return 3;');
|
||||
|
||||
var_dump(
|
||||
$x,
|
||||
$y(),
|
||||
$z,
|
||||
$w(),
|
||||
$y != $z
|
||||
);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
|
||||
|
||||
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
|
||||
bool(false)
|
||||
int(2)
|
||||
bool(false)
|
||||
int(3)
|
||||
bool(true)
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
static $avoid_crash = 0;
|
||||
|
||||
if ($avoid_crash++ == 1) {
|
||||
print "This method shouldn't be called when using parent::func!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
call_user_func_array(array($this, 'parent::func'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(26) "A::func: This should work!"
|
||||
@@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
call_user_func_array(array($this, 'parent::func2'), array($str));
|
||||
call_user_func_array(array($this, 'parent::func3'), array($str));
|
||||
call_user_func_array(array($this, 'parent::func22'), array($str));
|
||||
call_user_func_array(array($this, 'parent::inexistent'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%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
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
call_user_func_array(array($this, 'self::func2'), array($str));
|
||||
call_user_func_array(array($this, 'self::func3'), array($str));
|
||||
call_user_func_array(array($this, 'self::inexistent'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%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
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48899 (is_callable returns true even if method does not exist in parent class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ParentClass { }
|
||||
|
||||
class ChildClass extends ParentClass {
|
||||
public function testIsCallable() {
|
||||
var_dump(is_callable(array($this, 'parent::testIsCallable')));
|
||||
}
|
||||
public function testIsCallable2() {
|
||||
var_dump(is_callable(array($this, 'static::testIsCallable2')));
|
||||
}
|
||||
}
|
||||
|
||||
$child = new ChildClass();
|
||||
$child->testIsCallable();
|
||||
$child->testIsCallable2();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48912 (Namespace causes unexpected strict behaviour with extract())
|
||||
--FILE--
|
||||
<?php
|
||||
namespace A;
|
||||
|
||||
function test()
|
||||
{
|
||||
extract(func_get_arg(0));
|
||||
}
|
||||
|
||||
test(array('x' => 1));
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration).
|
||||
--FILE--
|
||||
<?php
|
||||
class TestObject implements Iterator
|
||||
{
|
||||
public $n = 0;
|
||||
function valid()
|
||||
{
|
||||
return ($this->n < 3);
|
||||
}
|
||||
function current() {return $this->n;}
|
||||
function next() {$this->n++;}
|
||||
function key() { }
|
||||
function rewind() {$this->n = 0;}
|
||||
}
|
||||
|
||||
|
||||
$array_object = new TestObject();
|
||||
|
||||
foreach ((true ? $array_object : $array_object) as $item) echo "$item\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
1
|
||||
2
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #49472 (Constants defined in Interfaces can be overridden)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface ia {
|
||||
const c = 'Sea';
|
||||
const y = 2;
|
||||
}
|
||||
|
||||
class Foo implements ia {
|
||||
}
|
||||
|
||||
class FooBar extends Foo implements ia {
|
||||
const x = 1;
|
||||
const c = 'Ocean';
|
||||
|
||||
public function show() {
|
||||
return ia::c;
|
||||
}
|
||||
}
|
||||
|
||||
new FooBar;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot inherit previously-inherited or override constant c from interface ia in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #49866 (Making reference on string offsets crashes PHP)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = "string";
|
||||
$b = &$a[1];
|
||||
$b = "f";
|
||||
echo $a;
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot create references to/from string offsets nor overloaded objects in %sbug49866.php on line 3
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #49908 (throwing exception in __autoload crashes when interface is not defined)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function __autoload($className) {
|
||||
var_dump($className);
|
||||
|
||||
if ($className == 'Foo') {
|
||||
class Foo implements Bar {};
|
||||
} else {
|
||||
throw new Exception($className);
|
||||
}
|
||||
}
|
||||
|
||||
new Foo;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "Foo"
|
||||
%unicode|string%(3) "Bar"
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(7): __autoload('Bar')
|
||||
#1 %s(13): __autoload('Foo')
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->file = null;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50146 (property_exists: Closure object cannot have properties)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$obj = function(){};
|
||||
|
||||
var_dump(property_exists($obj,'foo'));
|
||||
|
||||
$ref = new ReflectionObject($obj);
|
||||
var_dump($ref->hasProperty('b'));
|
||||
|
||||
var_dump(isset($obj->a));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Catchable fatal error: Closure object cannot have properties in %s on line %d
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50174 (Incorrectly matched docComment)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestClass
|
||||
{
|
||||
/** const comment */
|
||||
const C = 0;
|
||||
|
||||
function x() {}
|
||||
}
|
||||
|
||||
$rm = new ReflectionMethod('TestClass', 'x');
|
||||
var_dump($rm->getDocComment());
|
||||
|
||||
class TestClass2
|
||||
{
|
||||
/** const comment */
|
||||
const C = 0;
|
||||
|
||||
public $x;
|
||||
}
|
||||
|
||||
$rp = new ReflectionProperty('TestClass2', 'x');
|
||||
var_dump($rp->getDocComment());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50255 (isset() and empty() silently casts array to object)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arr = array('foo' => 'bar');
|
||||
|
||||
print "isset\n";
|
||||
var_dump(isset($arr->foo));
|
||||
var_dump(isset($arr->bar));
|
||||
var_dump(isset($arr['foo']));
|
||||
var_dump(isset($arr['bar']));
|
||||
print "empty\n";
|
||||
var_dump(empty($arr->foo));
|
||||
var_dump(empty($arr->bar));
|
||||
var_dump(empty($arr['foo']));
|
||||
var_dump(empty($arr['bar']));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
isset
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
empty
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50261 (Crash When Calling Parent Constructor with call_user_func())
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class testClass {
|
||||
function testClass($x) {
|
||||
echo __METHOD__, " (". $x . ")\n";
|
||||
}
|
||||
}
|
||||
|
||||
class testClass2 extends testClass {
|
||||
function __construct() {
|
||||
static $x = 0;
|
||||
|
||||
if ($x) {
|
||||
print "Infinite loop...\n";
|
||||
} else {
|
||||
$x++;
|
||||
|
||||
parent::__construct(1);
|
||||
testclass::__construct(2);
|
||||
call_user_func(array('parent', '__construct'), 3);
|
||||
call_user_func(array('testclass', '__construct'), 4);
|
||||
call_user_func(array('testclass', 'testclass'), 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new testClass2;
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
testClass::testClass (1)
|
||||
testClass::testClass (2)
|
||||
testClass::testClass (3)
|
||||
testClass::testClass (4)
|
||||
testClass::testClass (5)
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50394: Reference argument converted to value in __call
|
||||
--FILE--
|
||||
<?php
|
||||
function inc( &$x ) { $x++; }
|
||||
|
||||
class Proxy {
|
||||
function __call( $name, $args ) {
|
||||
echo "$name called!\n";
|
||||
call_user_func_array( 'inc', $args );
|
||||
}
|
||||
}
|
||||
|
||||
$arg = 1;
|
||||
$args = array( &$arg );
|
||||
$proxy = new Proxy;
|
||||
call_user_func_array( array( $proxy, 'bar' ), $args );
|
||||
call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
|
||||
var_dump($arg);
|
||||
--EXPECT--
|
||||
bar called!
|
||||
bar called!
|
||||
int(3)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Testing call_user_func inside namespace
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace testing {
|
||||
function foobar($str) {
|
||||
var_dump($str);
|
||||
}
|
||||
|
||||
abstract class bar {
|
||||
protected function prot($str) {
|
||||
print "Shouldn't be called!\n";
|
||||
}
|
||||
}
|
||||
class foo extends bar {
|
||||
private function priv($str) {
|
||||
print "Shouldn't be called!\n";
|
||||
}
|
||||
}
|
||||
|
||||
call_user_func(__NAMESPACE__ .'\foobar', 'foobar');
|
||||
|
||||
$class = __NAMESPACE__ .'\foo';
|
||||
call_user_func(array(new $class, 'priv'), 'foobar');
|
||||
call_user_func(array(new $class, 'prot'), 'foobar');
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%string|unicode%(6) "foobar"
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Testing call_user_func() with autoload and passing invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function __autoload($class) {
|
||||
var_dump($class);
|
||||
}
|
||||
|
||||
call_user_func(array('foo', 'bar'));
|
||||
call_user_func(array('', 'bar'));
|
||||
call_user_func(array($foo, 'bar'));
|
||||
call_user_func(array($foo, ''));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "foo"
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d
|
||||
|
||||
Notice: Undefined variable: foo in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
|
||||
|
||||
Notice: Undefined variable: foo in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Testing call_user_func() with closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = function() {
|
||||
static $instance;
|
||||
|
||||
if (is_null($instance)) {
|
||||
$instance = function () {
|
||||
return 'OK!';
|
||||
};
|
||||
}
|
||||
|
||||
return $instance;
|
||||
};
|
||||
|
||||
var_dump(call_user_func(array($foo, '__invoke'))->__invoke());
|
||||
var_dump(call_user_func(function() use (&$foo) { return $foo; }, '__invoke'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "OK!"
|
||||
object(Closure)#%d (1) {
|
||||
[%u|b%"static"]=>
|
||||
array(1) {
|
||||
[%u|b%"instance"]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Calling non-static method with call_user_func()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
public function teste() {
|
||||
$this->a = 1;
|
||||
}
|
||||
}
|
||||
|
||||
call_user_func(array('foo', 'teste'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d
|
||||
|
||||
Fatal error: Using $this when not in object context in %s on line %d
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Passing Closure as parameter to an non-existent function
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
public static function __callstatic($x, $y) {
|
||||
var_dump($x,$y);
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function teste() {
|
||||
return foo::x(function &($a=1,$b) { });
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(call_user_func(array('foo', 'teste')));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d
|
||||
%string|unicode%(1) "x"
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (1) {
|
||||
["parameter"]=>
|
||||
array(2) {
|
||||
["$a"]=>
|
||||
string(10) "<required>"
|
||||
["$b"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Check call to non-ref function with call-time refs
|
||||
--FILE--
|
||||
<?php
|
||||
function my_errorhandler($errno,$errormsg) {
|
||||
global $my_var;
|
||||
$my_var=0x12345;
|
||||
echo $errormsg."\n";
|
||||
return true;
|
||||
}
|
||||
$oldhandler = set_error_handler("my_errorhandler");
|
||||
$my_var = str_repeat("A",64);
|
||||
$data = call_user_func_array("substr_replace",array(&$my_var, new StdClass(),1));
|
||||
echo "OK!";
|
||||
--EXPECT--
|
||||
Object of class stdClass could not be converted to string
|
||||
Object of class stdClass to string conversion
|
||||
OK!
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Closure 033: Recursive var_dump on closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = function () use(&$a) {};
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
&object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Testing recursion detection with Closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = function () use (&$x) {
|
||||
$h = function () use ($x) {
|
||||
var_dump($x);
|
||||
return 1;
|
||||
};
|
||||
return $h();
|
||||
};
|
||||
|
||||
var_dump($x());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
[%u|b%"x"]=>
|
||||
&object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
[%u|b%"x"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
@@ -16,3 +16,9 @@ Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
|
||||
string(%d) "foo"
|
||||
resource(%d) of type (stream)
|
||||
--UEXPECTF--
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
|
||||
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
|
||||
unicode(%d) "foo"
|
||||
resource(%d) of type (stream)
|
||||
@@ -22,3 +22,16 @@ array(4) {
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
--UEXPECTF--
|
||||
array(4) {
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[u"value"]=>
|
||||
array(0) {
|
||||
}
|
||||
[0]=>
|
||||
int(0)
|
||||
[u"key"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -16,5 +16,5 @@ class test implements test1, test2 {
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot inherit previously-inherited or override constant FOO from interface test2 in %s on line %d
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot inherit previously-inherited constant FOO from interface test2 in %s on line %d
|
||||
@@ -1,5 +1,6 @@
|
||||
--TEST--
|
||||
Test function_exists() function : error conditions
|
||||
--INI--
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
|
||||
@@ -26,3 +26,6 @@ $a->foo();
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
bool(false)
|
||||
--UEXPECT--
|
||||
unicode(3) "bar"
|
||||
bool(false)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Check if get_required_files works
|
||||
--CREDITS--
|
||||
Sebastian Schürmann
|
||||
sschuermann@chip.de
|
||||
Testfest 2009 Munich
|
||||
--FILE--
|
||||
<?php
|
||||
$files = get_required_files();
|
||||
var_dump($files);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
%string|unicode%(%d)%s
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in global scope
|
||||
--INI--
|
||||
--INIT--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope
|
||||
--INI--
|
||||
--INIT--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope - 2
|
||||
--INI--
|
||||
--INIT--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope - 3
|
||||
--INI--
|
||||
--INIT--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -15,4 +15,4 @@ class foobar implements foo {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot inherit previously-inherited or override constant foo from interface foo in %s on line %d
|
||||
Fatal error: Cannot inherit previously-inherited constant foo from interface foo in %s on line %d
|
||||
@@ -7,3 +7,5 @@ namespace test\foo;
|
||||
var_dump(__NAMESPACE__);
|
||||
--EXPECT--
|
||||
string(8) "test\foo"
|
||||
--UEXPECT--
|
||||
unicode(8) "test\foo"
|
||||
@@ -5,3 +5,5 @@
|
||||
var_dump(__NAMESPACE__);
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
--UEXPECT--
|
||||
unicode(0) ""
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Crash when function parameter modified via unexpected reference
|
||||
--FILE--
|
||||
<?php
|
||||
function my_errorhandler($errno,$errormsg) {
|
||||
global $my_var;
|
||||
$my_var = 0;
|
||||
return true;
|
||||
}
|
||||
set_error_handler("my_errorhandler");
|
||||
$my_var = str_repeat("A",64);
|
||||
$data = call_user_func_array("explode",array(new StdClass(), &$my_var));
|
||||
$my_var=array(1,2,3);
|
||||
$data = call_user_func_array("implode",array(&$my_var, new StdClass()));
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Done.
|
||||
@@ -19,7 +19,7 @@ echo $HTTP_SESSION_VARS;
|
||||
echo "\nok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Directive 'register_long_arrays' is deprecated in PHP %d.%d and greater in Unknown on line 0
|
||||
PHP Warning: Directive 'register_long_arrays' is deprecated in PHP %d.%d and greater in Unknown on line 0
|
||||
ok
|
||||
|
||||
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d
|
||||
|
||||
@@ -19,7 +19,7 @@ echo $x;
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Directive 'register_globals' is deprecated in PHP %d.%d and greater in Unknown on line 0
|
||||
PHP Warning: Directive 'register_globals' is deprecated in PHP %d.%d and greater in Unknown on line 0
|
||||
1
|
||||
|
||||
Deprecated: Function session_register() is deprecated in %s on line %d
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
unset() CV 7 (indirect unset() of global variable in import_request_variables())
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--GET--
|
||||
x=2
|
||||
--FILE--
|
||||
|
||||
+3
-9
@@ -1067,15 +1067,9 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
}
|
||||
|
||||
/* during shutdown the symbol table table can be still null */
|
||||
if (!EG(active_symbol_table)) {
|
||||
Z_TYPE_P(z_context) = IS_NULL;
|
||||
} else {
|
||||
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
|
||||
Z_TYPE_P(z_context) = IS_ARRAY;
|
||||
zval_copy_ctor(z_context);
|
||||
}
|
||||
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
|
||||
Z_TYPE_P(z_context) = IS_ARRAY;
|
||||
zval_copy_ctor(z_context);
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*5);
|
||||
params[0] = &z_error_type;
|
||||
|
||||
+19
-6
@@ -79,7 +79,18 @@
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
|
||||
#if HAVE_MACH_O_DYLD_H
|
||||
#include <mach-o/dyld.h>
|
||||
|
||||
/* MH_BUNDLE loading functions for Mac OS X / Darwin */
|
||||
void *zend_mh_bundle_load (char* bundle_path);
|
||||
int zend_mh_bundle_unload (void *bundle_handle);
|
||||
void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name);
|
||||
const char *zend_mh_bundle_error(void);
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H) && !defined(ZEND_WIN32)
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
@@ -105,6 +116,13 @@
|
||||
# define DL_ERROR dlerror
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(HAVE_MACH_O_DYLD_H)
|
||||
# define DL_LOAD(libname) zend_mh_bundle_load(libname)
|
||||
# define DL_UNLOAD zend_mh_bundle_unload
|
||||
# define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s)
|
||||
# define DL_ERROR zend_mh_bundle_error
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(ZEND_WIN32)
|
||||
# define DL_LOAD(libname) LoadLibrary(libname)
|
||||
# define DL_FETCH_SYMBOL GetProcAddress
|
||||
@@ -710,11 +728,6 @@ END_EXTERN_C()
|
||||
FREE_ZVAL(pzv); \
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
#define MAKE_COPY_ZVAL(ppzv, pzv) \
|
||||
*(pzv) = **(ppzv); \
|
||||
zval_copy_ctor((pzv)); \
|
||||
INIT_PZVAL((pzv));
|
||||
|
||||
#define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) { \
|
||||
int is_ref, refcount; \
|
||||
|
||||
+18
-56
@@ -1038,13 +1038,13 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
Z_SET_ISREF_PP(q);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL);
|
||||
} else {
|
||||
zval *r;
|
||||
zval *q;
|
||||
|
||||
ALLOC_ZVAL(r);
|
||||
*r = **p;
|
||||
INIT_PZVAL(r);
|
||||
zval_copy_ctor(r);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&r, sizeof(zval*), NULL);
|
||||
ALLOC_ZVAL(q);
|
||||
*q = **p;
|
||||
INIT_PZVAL(q);
|
||||
zval_copy_ctor(q);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&q, sizeof(zval*), NULL);
|
||||
}
|
||||
zend_hash_move_forward_ex(&class_type->default_static_members, &pos);
|
||||
}
|
||||
@@ -2114,7 +2114,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
|
||||
zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
#if HAVE_LIBDL
|
||||
#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H)
|
||||
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
|
||||
if (module->handle) {
|
||||
DL_UNLOAD(module->handle);
|
||||
@@ -2335,13 +2335,12 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_is_callable_check_class(const char *name, int name_len, zend_fcall_info_cache *fcc, int *strict_class, char **error TSRMLS_DC) /* {{{ */
|
||||
static int zend_is_callable_check_class(const char *name, int name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int ret = 0;
|
||||
zend_class_entry **pce;
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
|
||||
*strict_class = 0;
|
||||
if (name_len == sizeof("self") - 1 &&
|
||||
!memcmp(lcname, "self", sizeof("self") - 1)) {
|
||||
if (!EG(scope)) {
|
||||
@@ -2366,7 +2365,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
|
||||
if (!fcc->object_ptr) {
|
||||
fcc->object_ptr = EG(This);
|
||||
}
|
||||
*strict_class = 1;
|
||||
ret = 1;
|
||||
}
|
||||
} else if (name_len == sizeof("static") - 1 &&
|
||||
@@ -2379,7 +2377,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
|
||||
if (!fcc->object_ptr) {
|
||||
fcc->object_ptr = EG(This);
|
||||
}
|
||||
*strict_class = 1;
|
||||
ret = 1;
|
||||
}
|
||||
} else if (zend_lookup_class_ex(name, name_len, 1, &pce TSRMLS_CC) == SUCCESS) {
|
||||
@@ -2394,7 +2391,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
|
||||
} else {
|
||||
fcc->called_scope = fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : fcc->calling_scope;
|
||||
}
|
||||
*strict_class = 1;
|
||||
ret = 1;
|
||||
} else {
|
||||
if (error) zend_spprintf(error, 0, "class '%.*s' not found", name_len, name);
|
||||
@@ -2405,7 +2401,7 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
|
||||
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce_org = fcc->calling_scope;
|
||||
int retval = 0;
|
||||
@@ -2463,7 +2459,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
EG(scope) = ce_org;
|
||||
}
|
||||
|
||||
if (!zend_is_callable_check_class(Z_STRVAL_P(callable), clen, fcc, &strict_class, error TSRMLS_CC)) {
|
||||
if (!zend_is_callable_check_class(Z_STRVAL_P(callable), clen, fcc, error TSRMLS_CC)) {
|
||||
EG(scope) = last_scope;
|
||||
return 0;
|
||||
}
|
||||
@@ -2490,15 +2486,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
|
||||
lmname = zend_str_tolower_dup(mname, mlen);
|
||||
if (strict_class &&
|
||||
fcc->calling_scope &&
|
||||
mlen == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1 &&
|
||||
!memcmp(lmname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
|
||||
fcc->function_handler = fcc->calling_scope->constructor;
|
||||
if (fcc->function_handler) {
|
||||
retval = 1;
|
||||
}
|
||||
} else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) {
|
||||
if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) {
|
||||
retval = 1;
|
||||
if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) &&
|
||||
EG(scope) &&
|
||||
@@ -2531,37 +2519,12 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
} else {
|
||||
get_function_via_handler:
|
||||
if (fcc->object_ptr && fcc->calling_scope == ce_org) {
|
||||
if (strict_class && ce_org->__call) {
|
||||
fcc->function_handler = emalloc(sizeof(zend_internal_function));
|
||||
fcc->function_handler->internal_function.type = ZEND_INTERNAL_FUNCTION;
|
||||
fcc->function_handler->internal_function.module = ce_org->module;
|
||||
fcc->function_handler->internal_function.handler = zend_std_call_user_call;
|
||||
fcc->function_handler->internal_function.arg_info = NULL;
|
||||
fcc->function_handler->internal_function.num_args = 0;
|
||||
fcc->function_handler->internal_function.scope = ce_org;
|
||||
fcc->function_handler->internal_function.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
|
||||
fcc->function_handler->internal_function.function_name = estrndup(mname, mlen);
|
||||
fcc->function_handler->internal_function.pass_rest_by_reference = 0;
|
||||
fcc->function_handler->internal_function.return_reference = ZEND_RETURN_VALUE;
|
||||
call_via_handler = 1;
|
||||
retval = 1;
|
||||
} else if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) {
|
||||
if (fcc->object_ptr) {
|
||||
if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) {
|
||||
fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen TSRMLS_CC);
|
||||
if (fcc->function_handler) {
|
||||
if (strict_class &&
|
||||
(!fcc->function_handler->common.scope ||
|
||||
!instanceof_function(ce_org, fcc->function_handler->common.scope TSRMLS_CC))) {
|
||||
if ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
efree(fcc->function_handler->common.function_name);
|
||||
}
|
||||
efree(fcc->function_handler);
|
||||
}
|
||||
} else {
|
||||
retval = 1;
|
||||
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
|
||||
}
|
||||
retval = 1;
|
||||
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
|
||||
}
|
||||
}
|
||||
} else if (fcc->calling_scope) {
|
||||
@@ -2717,7 +2680,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = zend_is_callable_check_func(check_flags, callable, fcc, 0, error TSRMLS_CC);
|
||||
ret = zend_is_callable_check_func(check_flags, callable, fcc, error TSRMLS_CC);
|
||||
if (fcc == &fcc_local &&
|
||||
fcc->function_handler &&
|
||||
((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION &&
|
||||
@@ -2735,7 +2698,6 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
|
||||
{
|
||||
zval **method = NULL;
|
||||
zval **obj = NULL;
|
||||
int strict_class = 0;
|
||||
|
||||
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) {
|
||||
zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj);
|
||||
@@ -2763,7 +2725,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!zend_is_callable_check_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), fcc, &strict_class, error TSRMLS_CC)) {
|
||||
if (!zend_is_callable_check_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), fcc, error TSRMLS_CC)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2795,7 +2757,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
|
||||
}
|
||||
}
|
||||
|
||||
ret = zend_is_callable_check_func(check_flags, *method, fcc, strict_class, error TSRMLS_CC);
|
||||
ret = zend_is_callable_check_func(check_flags, *method, fcc, error TSRMLS_CC);
|
||||
if (fcc == &fcc_local &&
|
||||
fcc->function_handler &&
|
||||
((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION &&
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
|
||||
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info)
|
||||
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
|
||||
+17
-6
@@ -512,7 +512,20 @@ static unsigned int _zend_mm_cookie = 0;
|
||||
/* optimized access */
|
||||
#define ZEND_MM_FREE_BLOCK_SIZE(b) (b)->info._size
|
||||
|
||||
#ifndef ZEND_MM_ALIGNMENT
|
||||
# define ZEND_MM_ALIGNMENT 8
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 3
|
||||
#elif ZEND_MM_ALIGNMENT < 4
|
||||
# undef ZEND_MM_ALIGNMENT
|
||||
# undef ZEND_MM_ALIGNMENT_LOG2
|
||||
# define ZEND_MM_ALIGNMENT 4
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 2
|
||||
#endif
|
||||
|
||||
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
|
||||
|
||||
/* Aligned header size */
|
||||
#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
|
||||
#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block))
|
||||
#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_small_free_block))
|
||||
#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE)
|
||||
@@ -696,14 +709,12 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
unsigned int n;
|
||||
unsigned int index = 0;
|
||||
|
||||
n = offset[_size & 15];
|
||||
while (n == 4) {
|
||||
do {
|
||||
n = offset[_size & 15];
|
||||
_size >>= 4;
|
||||
index += n;
|
||||
n = offset[_size & 15];
|
||||
}
|
||||
|
||||
return index + n;
|
||||
} while (n == 4);
|
||||
return index;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -27,20 +27,6 @@
|
||||
#include "../TSRM/TSRM.h"
|
||||
#include "zend.h"
|
||||
|
||||
#ifndef ZEND_MM_ALIGNMENT
|
||||
# define ZEND_MM_ALIGNMENT 8
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 3
|
||||
#elif ZEND_MM_ALIGNMENT < 4
|
||||
# undef ZEND_MM_ALIGNMENT
|
||||
# undef ZEND_MM_ALIGNMENT_LOG2
|
||||
# define ZEND_MM_ALIGNMENT 4
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 2
|
||||
#endif
|
||||
|
||||
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
|
||||
|
||||
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
|
||||
|
||||
typedef struct _zend_leak_info {
|
||||
void *addr;
|
||||
size_t size;
|
||||
|
||||
@@ -747,7 +747,7 @@ ZEND_FUNCTION(get_class)
|
||||
zend_uint name_len = 0;
|
||||
int dup;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o!", &obj) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o", &obj) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1755,7 +1755,6 @@ ZEND_FUNCTION(create_function)
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
} else {
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
+33
-46
@@ -37,7 +37,6 @@
|
||||
typedef struct _zend_closure {
|
||||
zend_object std;
|
||||
zend_function func;
|
||||
HashTable *debug_info;
|
||||
} zend_closure;
|
||||
|
||||
/* non-static since it needs to be referenced */
|
||||
@@ -152,9 +151,7 @@ static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member TSRML
|
||||
|
||||
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (has_set_exists != 2) {
|
||||
ZEND_CLOSURE_PROPERTY_ERROR();
|
||||
}
|
||||
ZEND_CLOSURE_PROPERTY_ERROR();
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -182,11 +179,6 @@ static void zend_closure_free_storage(void *object TSRMLS_DC) /* {{{ */
|
||||
destroy_op_array(&closure->func.op_array TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (closure->debug_info != NULL) {
|
||||
zend_hash_destroy(closure->debug_info);
|
||||
efree(closure->debug_info);
|
||||
}
|
||||
|
||||
efree(closure);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -230,53 +222,48 @@ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function
|
||||
static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(object TSRMLS_CC);
|
||||
HashTable *rv;
|
||||
zval *val;
|
||||
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
|
||||
|
||||
*is_temp = 0;
|
||||
|
||||
if (closure->debug_info == NULL) {
|
||||
ALLOC_HASHTABLE(closure->debug_info);
|
||||
zend_hash_init(closure->debug_info, 1, NULL, ZVAL_PTR_DTOR, 0);
|
||||
*is_temp = 1;
|
||||
ALLOC_HASHTABLE(rv);
|
||||
zend_hash_init(rv, 1, NULL, ZVAL_PTR_DTOR, 0);
|
||||
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
|
||||
zend_symtable_update(rv, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
if (closure->debug_info->nApplyCount == 0) {
|
||||
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
|
||||
zend_symtable_update(closure->debug_info, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
if (arg_info) {
|
||||
zend_uint i, required = closure->func.common.required_num_args;
|
||||
if (arg_info) {
|
||||
zend_uint i, required = closure->func.common.required_num_args;
|
||||
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
|
||||
for (i = 0; i < closure->func.common.num_args; i++) {
|
||||
char *name, *info;
|
||||
int name_len, info_len;
|
||||
if (arg_info->name) {
|
||||
name_len = zend_spprintf(&name, 0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
arg_info->name);
|
||||
} else {
|
||||
name_len = zend_spprintf(&name, 0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
i + 1);
|
||||
}
|
||||
info_len = zend_spprintf(&info, 0, "%s",
|
||||
i >= required ? "<optional>" : "<required>");
|
||||
add_assoc_stringl_ex(val, name, name_len + 1, info, info_len, 0);
|
||||
efree(name);
|
||||
arg_info++;
|
||||
for (i = 0; i < closure->func.common.num_args; i++) {
|
||||
char *name, *info;
|
||||
int name_len, info_len;
|
||||
if (arg_info->name) {
|
||||
name_len = zend_spprintf(&name, 0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
arg_info->name);
|
||||
} else {
|
||||
name_len = zend_spprintf(&name, 0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
i + 1);
|
||||
}
|
||||
zend_symtable_update(closure->debug_info, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
|
||||
info_len = zend_spprintf(&info, 0, "%s",
|
||||
i >= required ? "<optional>" : "<required>");
|
||||
add_assoc_stringl_ex(val, name, name_len + 1, info, info_len, 0);
|
||||
efree(name);
|
||||
arg_info++;
|
||||
}
|
||||
zend_symtable_update(rv, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
return closure->debug_info;
|
||||
return rv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+307
-379
File diff suppressed because it is too large.
Load diff
+12
-51
@@ -144,11 +144,9 @@ struct _zend_vm_stack {
|
||||
void **top;
|
||||
void **end;
|
||||
zend_vm_stack prev;
|
||||
void *elements[1];
|
||||
};
|
||||
|
||||
#define ZEND_VM_STACK_ELEMETS(stack) \
|
||||
((void**)(((char*)(stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack))))
|
||||
|
||||
#define ZEND_VM_STACK_GROW_IF_NEEDED(count) \
|
||||
do { \
|
||||
if (UNEXPECTED((count) > \
|
||||
@@ -158,10 +156,10 @@ struct _zend_vm_stack {
|
||||
} while (0)
|
||||
|
||||
static inline zend_vm_stack zend_vm_stack_new_page(int count) {
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count);
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(sizeof(*page)+sizeof(page->elements[0])*(count-1));
|
||||
|
||||
page->top = ZEND_VM_STACK_ELEMETS(page);
|
||||
page->end = page->top + count;
|
||||
page->top = page->elements;
|
||||
page->end = page->elements + count;
|
||||
page->prev = NULL;
|
||||
return page;
|
||||
}
|
||||
@@ -209,7 +207,7 @@ static inline void *zend_vm_stack_pop(TSRMLS_D)
|
||||
{
|
||||
void *el = *(--EG(argument_stack)->top);
|
||||
|
||||
if (UNEXPECTED(EG(argument_stack)->top == ZEND_VM_STACK_ELEMETS(EG(argument_stack)))) {
|
||||
if (UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->elements)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
EG(argument_stack) = p->prev;
|
||||
efree(p);
|
||||
@@ -223,32 +221,15 @@ static inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
|
||||
|
||||
size = (size + (sizeof(void*) - 1)) / sizeof(void*);
|
||||
|
||||
/* the following comparison must be optimized out at compile time */
|
||||
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
|
||||
int extra = (ZEND_MM_ALIGNMENT - ((zend_uintptr_t)EG(argument_stack)->top & (ZEND_MM_ALIGNMENT - 1))) / sizeof(void*);
|
||||
|
||||
if (UNEXPECTED(size + extra + ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*) >
|
||||
(zend_uintptr_t)EG(argument_stack)->end - (zend_uintptr_t)EG(argument_stack)->top)) {
|
||||
zend_vm_stack_extend(size TSRMLS_CC);
|
||||
} else {
|
||||
void **old_top = EG(argument_stack)->top;
|
||||
|
||||
EG(argument_stack)->top += extra;
|
||||
/* store old top on the stack */
|
||||
*EG(argument_stack)->top = (void*)old_top;
|
||||
EG(argument_stack)->top += ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*);
|
||||
}
|
||||
} else {
|
||||
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
|
||||
}
|
||||
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
|
||||
ret = (void*)EG(argument_stack)->top;
|
||||
EG(argument_stack)->top += size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC)
|
||||
static inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
|
||||
{
|
||||
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
|
||||
if (UNEXPECTED(EG(argument_stack)->elements == (void**)ptr)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
EG(argument_stack) = p->prev;
|
||||
@@ -258,28 +239,10 @@ static inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
|
||||
{
|
||||
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
EG(argument_stack) = p->prev;
|
||||
efree(p);
|
||||
} else {
|
||||
/* the following comparison must be optimized out at compile time */
|
||||
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
|
||||
ptr = (void*)(((char*)ptr) - ZEND_MM_ALIGNED_SIZE(sizeof(void*)));
|
||||
EG(argument_stack)->top = *(void***)ptr;
|
||||
} else {
|
||||
EG(argument_stack)->top = (void**)ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void** zend_vm_stack_push_args(int count TSRMLS_DC)
|
||||
{
|
||||
|
||||
if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count) ||
|
||||
if (UNEXPECTED(EG(argument_stack)->top - EG(argument_stack)->elements < count) ||
|
||||
UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->end)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
@@ -290,14 +253,14 @@ static inline void** zend_vm_stack_push_args(int count TSRMLS_DC)
|
||||
while (count-- > 0) {
|
||||
void *data = *(--p->top);
|
||||
|
||||
if (UNEXPECTED(p->top == ZEND_VM_STACK_ELEMETS(p))) {
|
||||
if (UNEXPECTED(p->top == p->elements)) {
|
||||
zend_vm_stack r = p;
|
||||
|
||||
EG(argument_stack)->prev = p->prev;
|
||||
p = p->prev;
|
||||
efree(r);
|
||||
}
|
||||
*(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count) = data;
|
||||
*(EG(argument_stack)->elements + count) = data;
|
||||
}
|
||||
return EG(argument_stack)->top++;
|
||||
}
|
||||
@@ -315,7 +278,7 @@ static inline void zend_vm_stack_clear_multiple(TSRMLS_D)
|
||||
*p = NULL;
|
||||
zval_ptr_dtor(&q);
|
||||
}
|
||||
zend_vm_stack_free_int(p TSRMLS_CC);
|
||||
zend_vm_stack_free(p TSRMLS_CC);
|
||||
}
|
||||
|
||||
static inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC)
|
||||
@@ -388,8 +351,6 @@ ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execut
|
||||
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
|
||||
#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */
|
||||
#define ZEND_USER_OPCODE_DISPATCH 2 /* call original opcode handler */
|
||||
#define ZEND_USER_OPCODE_ENTER 3 /* enter into new op_array without recursion */
|
||||
#define ZEND_USER_OPCODE_LEAVE 4 /* return to calling op_array within the same executor */
|
||||
|
||||
#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */
|
||||
|
||||
|
||||
+1
-15
@@ -837,13 +837,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
||||
for (i=0; i<fci->param_count; i++) {
|
||||
zval *param;
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION
|
||||
&& (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0
|
||||
&& !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
|
||||
&& PZVAL_IS_REF(*fci->params[i])) {
|
||||
SEPARATE_ZVAL(fci->params[i]);
|
||||
}
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
|
||||
&& !PZVAL_IS_REF(*fci->params[i])) {
|
||||
|
||||
@@ -1155,7 +1148,6 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
zval *local_retval_ptr=NULL;
|
||||
zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
|
||||
zend_op **original_opline_ptr = EG(opline_ptr);
|
||||
int orig_interactive = CG(interactive);
|
||||
|
||||
EG(return_value_ptr_ptr) = &local_retval_ptr;
|
||||
EG(active_op_array) = new_op_array;
|
||||
@@ -1163,11 +1155,9 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
}
|
||||
CG(interactive) = 0;
|
||||
|
||||
zend_execute(new_op_array TSRMLS_CC);
|
||||
|
||||
CG(interactive) = orig_interactive;
|
||||
if (local_retval_ptr) {
|
||||
if (retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
@@ -1226,7 +1216,6 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
zend_op *opline, *end;
|
||||
zend_op *ret_opline;
|
||||
int orig_interactive;
|
||||
|
||||
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE)
|
||||
|| CG(active_op_array)->backpatch_count>0
|
||||
@@ -1282,10 +1271,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
orig_interactive = CG(interactive);
|
||||
CG(interactive) = 0;
|
||||
zend_execute(CG(active_op_array) TSRMLS_CC);
|
||||
CG(interactive) = orig_interactive;
|
||||
|
||||
if (EG(exception)) {
|
||||
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
|
||||
@@ -1482,7 +1468,7 @@ void zend_unset_timeout(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
if (EG(timeout_seconds)) {
|
||||
{
|
||||
struct itimerval no_timeout;
|
||||
|
||||
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
|
||||
|
||||
@@ -217,6 +217,67 @@ ZEND_API zend_extension *zend_get_extension(const char *extension_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
|
||||
*
|
||||
*/
|
||||
|
||||
#if HAVE_MACH_O_DYLD_H
|
||||
|
||||
void *zend_mh_bundle_load(char* bundle_path)
|
||||
{
|
||||
NSObjectFileImage bundle_image;
|
||||
NSModule bundle_handle;
|
||||
NSSymbol bundle_init_nssymbol;
|
||||
void (*bundle_init)(void);
|
||||
|
||||
if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE);
|
||||
NSDestroyObjectFileImage(bundle_image);
|
||||
|
||||
/* call the init function of the bundle */
|
||||
bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init");
|
||||
if (bundle_init_nssymbol != NULL) {
|
||||
bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
|
||||
bundle_init();
|
||||
}
|
||||
|
||||
return bundle_handle;
|
||||
}
|
||||
|
||||
int zend_mh_bundle_unload(void *bundle_handle)
|
||||
{
|
||||
NSSymbol bundle_fini_nssymbol;
|
||||
void (*bundle_fini)(void);
|
||||
|
||||
/* call the fini function of the bundle */
|
||||
bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini");
|
||||
if (bundle_fini_nssymbol != NULL) {
|
||||
bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol);
|
||||
bundle_fini();
|
||||
}
|
||||
|
||||
return (int) NSUnLinkModule(bundle_handle, NULL);
|
||||
}
|
||||
|
||||
void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name)
|
||||
{
|
||||
NSSymbol symbol;
|
||||
symbol = NSLookupSymbolInModule(bundle_handle, symbol_name);
|
||||
return NSAddressOfSymbol(symbol);
|
||||
}
|
||||
|
||||
const char *zend_mh_bundle_error(void)
|
||||
{
|
||||
/* Witness the state of the art error reporting */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+3
-12
@@ -46,21 +46,15 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
|
||||
|
||||
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int result = FAILURE;
|
||||
|
||||
if (ini_entry->modified) {
|
||||
if (ini_entry->on_modify) {
|
||||
zend_try {
|
||||
/* even if on_modify bails out, we have to continue on with restoring,
|
||||
since there can be allocated variables that would be freed on MM shutdown
|
||||
and would lead to memory corruption later ini entry is modified again */
|
||||
result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
|
||||
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
|
||||
} zend_end_try();
|
||||
}
|
||||
if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) {
|
||||
/* runtime failure is OK */
|
||||
return 1;
|
||||
}
|
||||
if (ini_entry->value != ini_entry->orig_value) {
|
||||
efree(ini_entry->value);
|
||||
}
|
||||
@@ -315,11 +309,8 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /*
|
||||
}
|
||||
|
||||
if (EG(modified_ini_directives)) {
|
||||
if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
|
||||
zend_hash_del(EG(modified_ini_directives), name, name_length);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
|
||||
zend_hash_del(EG(modified_ini_directives), name, name_length);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
+2449
-2539
File diff suppressed because it is too large.
Load diff
+24
-94
@@ -54,9 +54,7 @@
|
||||
#define YYSTATE YYGETCONDITION()
|
||||
#define yytext ((char*)SCNG(yy_text))
|
||||
#define yyleng SCNG(yy_leng)
|
||||
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
|
||||
yyleng = (unsigned int)x; } while(0)
|
||||
|
||||
#define yyless(x) YYCURSOR = yytext + x
|
||||
/* #define yymore() goto yymore_restart */
|
||||
|
||||
/* perform sanity check. If this message is triggered you should
|
||||
@@ -105,17 +103,6 @@ ZEND_API ts_rsrc_id ini_scanner_globals_id;
|
||||
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
#endif
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
} else { \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
@@ -169,28 +156,12 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
|
||||
|
||||
/* {{{ init_ini_scanner()
|
||||
*/
|
||||
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
|
||||
static void init_ini_scanner(TSRMLS_D)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
|
||||
zend_error(E_WARNING, "Invalid scanner mode");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
SCNG(lineno) = 1;
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = fh;
|
||||
|
||||
if (fh != NULL) {
|
||||
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
|
||||
} else {
|
||||
ini_filename = NULL;
|
||||
}
|
||||
|
||||
SCNG(scanner_mode) = ZEND_INI_SCANNER_NORMAL;
|
||||
zend_stack_init(&SCNG(state_stack));
|
||||
BEGIN(INITIAL);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -228,14 +199,15 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
|
||||
char *buf;
|
||||
size_t size;
|
||||
|
||||
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE ||
|
||||
init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE
|
||||
) {
|
||||
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
init_ini_scanner(TSRMLS_C);
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = fh;
|
||||
yy_scan_buffer(buf, size TSRMLS_CC);
|
||||
|
||||
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -246,12 +218,11 @@ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
|
||||
{
|
||||
int len = strlen(str);
|
||||
|
||||
if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
init_ini_scanner(TSRMLS_C);
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = NULL;
|
||||
yy_scan_buffer(str, len TSRMLS_CC);
|
||||
|
||||
ini_filename = NULL;
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -337,18 +308,19 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
TABS_AND_SPACES [ \t]
|
||||
WHITESPACE [ \t]+
|
||||
CONSTANT [a-zA-Z][a-zA-Z0-9_]*
|
||||
LABEL [^=\n\r\t;|&$~(){}!"\[]+
|
||||
LABEL [a-zA-Z0-9*._-]*
|
||||
TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
|
||||
OPERATORS [&|~()!]
|
||||
DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^\n\r;]
|
||||
RAW_VALUE_CHARS [^=\n\r;]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
DOUBLE_QUOTES_CHARS ([^$"\\]|("\\"[^"])|{LITERAL_DOLLAR}|"\\"["][^\r\n])
|
||||
|
||||
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
@@ -378,9 +350,6 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
}
|
||||
|
||||
<INITIAL>{LABEL}"["{TABS_AND_SPACES}* { /* Start of option with offset */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace and [ */
|
||||
EAT_TRAILING_WHITESPACE_EX('[');
|
||||
|
||||
@@ -401,12 +370,6 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
}
|
||||
|
||||
<ST_VARNAME>{LABEL} { /* Variable name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace */
|
||||
EAT_TRAILING_WHITESPACE();
|
||||
|
||||
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
|
||||
}
|
||||
|
||||
@@ -424,12 +387,6 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
}
|
||||
|
||||
<INITIAL>{LABEL} { /* Get option name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace */
|
||||
EAT_TRAILING_WHITESPACE();
|
||||
|
||||
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
|
||||
}
|
||||
|
||||
@@ -496,47 +453,20 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>{DOUBLE_QUOTES_CHARS}+("\\"["])? { /* Escape double quoted string contents */
|
||||
if(yyleng > 1 && yytext[yyleng-1] == '"' && yytext[yyleng-2] == '\\') {
|
||||
yyless(yyleng-1);
|
||||
yyleng--;
|
||||
}
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>["]{TABS_AND_SPACES}* { /* Double quoted '"' string ends */
|
||||
yy_pop_state(TSRMLS_C);
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>[^] { /* Escape double quoted string contents */
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '"':
|
||||
if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '$':
|
||||
if (*YYCURSOR == '{') {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') {
|
||||
YYCURSOR++;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
YYCURSOR--;
|
||||
break;
|
||||
}
|
||||
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{WHITESPACE} {
|
||||
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Tue Dec 8 12:24:52 2009 */
|
||||
/* Generated by re2c 0.13.5 on Tue May 19 08:53:54 2009 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Nov 16 23:30:01 2009 */
|
||||
/* Generated by re2c 0.13.5 on Mon May 04 19:38:30 2009 */
|
||||
#line 1 "Zend/zend_language_scanner.l"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -685,12 +685,12 @@ ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSRMLS_DC)
|
||||
{
|
||||
if (SCNG(script_org)) {
|
||||
efree(SCNG(script_org));
|
||||
SCNG(script_org) = NULL;
|
||||
}
|
||||
SCNG(script_org_size) = n;
|
||||
SCNG(script_org_size) = n;
|
||||
SCNG(script_org) = (unsigned char*)erealloc(SCNG(script_org), SCNG(script_org_size));
|
||||
memcpy(SCNG(script_org) + SCNG(script_org_size) - n, buf, n);
|
||||
|
||||
SCNG(script_org) = (unsigned char*)emalloc(SCNG(script_org_size) + 1);
|
||||
memcpy(SCNG(script_org), buf, n);
|
||||
SCNG(script_org) = (unsigned char*)erealloc(SCNG(script_org), SCNG(script_org_size) + 1);
|
||||
*(SCNG(script_org)+SCNG(script_org_size)) = '\0';
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -683,12 +683,12 @@ ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSRMLS_DC)
|
||||
{
|
||||
if (SCNG(script_org)) {
|
||||
efree(SCNG(script_org));
|
||||
SCNG(script_org) = NULL;
|
||||
}
|
||||
SCNG(script_org_size) = n;
|
||||
SCNG(script_org_size) = n;
|
||||
SCNG(script_org) = (unsigned char*)erealloc(SCNG(script_org), SCNG(script_org_size));
|
||||
memcpy(SCNG(script_org) + SCNG(script_org_size) - n, buf, n);
|
||||
|
||||
SCNG(script_org) = (unsigned char*)emalloc(SCNG(script_org_size) + 1);
|
||||
memcpy(SCNG(script_org), buf, n);
|
||||
SCNG(script_org) = (unsigned char*)erealloc(SCNG(script_org), SCNG(script_org_size) + 1);
|
||||
*(SCNG(script_org)+SCNG(script_org_size)) = '\0';
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Sep 10 15:34:33 2009 */
|
||||
/* Generated by re2c 0.13.5 on Mon May 04 19:38:30 2009 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
|
||||
|
||||
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC)
|
||||
{
|
||||
zend_function *destructor = object ? object->ce->destructor : NULL;
|
||||
zend_function *destructor = object->ce->destructor;
|
||||
|
||||
if (destructor) {
|
||||
zval *obj;
|
||||
|
||||
@@ -1227,12 +1227,6 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
|
||||
if (result==op1) { /* special case, perform operations on result */
|
||||
uint res_len = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
||||
|
||||
if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) {
|
||||
efree(Z_STRVAL_P(result));
|
||||
ZVAL_EMPTY_STRING(result);
|
||||
zend_error(E_ERROR, "String size overflow");
|
||||
}
|
||||
|
||||
Z_STRVAL_P(result) = erealloc(Z_STRVAL_P(result), res_len+1);
|
||||
|
||||
memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
|
||||
+29
-40
@@ -940,7 +940,6 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -1100,7 +1099,7 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
|
||||
FREE_OP1_VAR_PTR();
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -2329,12 +2328,16 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
|
||||
}
|
||||
|
||||
#ifndef ZEND_VM_EXPORT
|
||||
if (zend_execute == execute && !EG(exception)) {
|
||||
EX(call_opline) = opline;
|
||||
ZEND_VM_ENTER();
|
||||
} else {
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
}
|
||||
#else
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
EG(opline_ptr) = &EX(opline);
|
||||
EG(active_op_array) = EX(op_array);
|
||||
@@ -2659,9 +2662,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -2687,10 +2688,6 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -3574,33 +3571,28 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else if (OP1_TYPE == IS_CONST ||
|
||||
((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ce && ce->get_iterator) {
|
||||
if (OP1_TYPE != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -3691,7 +3683,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
{
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1;
|
||||
zval *array = EX_T(opline->op1.u.var).var.ptr;
|
||||
zval *array = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
zval **value;
|
||||
char *str_key;
|
||||
uint str_key_len;
|
||||
@@ -3701,6 +3693,8 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
int key_type = 0;
|
||||
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
|
||||
|
||||
PZVAL_LOCK(array);
|
||||
|
||||
switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
|
||||
default:
|
||||
case ZEND_ITER_INVALID:
|
||||
@@ -3913,7 +3907,7 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
|
||||
zend_free_op free_op2;
|
||||
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -4243,13 +4237,12 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
|
||||
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
|
||||
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
|
||||
|
||||
if (iface) {
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -4261,8 +4254,8 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
int catched = 0;
|
||||
zval restored_error_reporting;
|
||||
|
||||
void **stack_frame = (void**)(((char*)EX(Ts)) +
|
||||
(ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
|
||||
void **stack_frame = (void**)EX(Ts) +
|
||||
(sizeof(temp_variable) * EX(op_array)->T) / sizeof(void*);
|
||||
|
||||
while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
|
||||
zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
|
||||
@@ -4358,10 +4351,6 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
|
||||
default:
|
||||
|
||||
+95
-130
@@ -52,13 +52,13 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
|
||||
zend_vm_enter:
|
||||
/* Initialize execute_data */
|
||||
execute_data = (zend_execute_data *)zend_vm_stack_alloc(
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
|
||||
sizeof(zend_execute_data) +
|
||||
sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) +
|
||||
sizeof(temp_variable) * op_array->T TSRMLS_CC);
|
||||
|
||||
EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
|
||||
EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data));
|
||||
memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
|
||||
EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
|
||||
EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
|
||||
EX(fbc) = NULL;
|
||||
EX(called_scope) = NULL;
|
||||
EX(object) = NULL;
|
||||
@@ -330,12 +330,16 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
|
||||
}
|
||||
|
||||
#if 1
|
||||
if (zend_execute == execute && !EG(exception)) {
|
||||
EX(call_opline) = opline;
|
||||
ZEND_VM_ENTER();
|
||||
} else {
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
}
|
||||
#else
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
EG(opline_ptr) = &EX(opline);
|
||||
EG(active_op_array) = EX(op_array);
|
||||
@@ -598,8 +602,8 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
|
||||
int catched = 0;
|
||||
zval restored_error_reporting;
|
||||
|
||||
void **stack_frame = (void**)(((char*)EX(Ts)) +
|
||||
(ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
|
||||
void **stack_frame = (void**)EX(Ts) +
|
||||
(sizeof(temp_variable) * EX(op_array)->T) / sizeof(void*);
|
||||
|
||||
while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
|
||||
zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
|
||||
@@ -695,10 +699,6 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
|
||||
default:
|
||||
@@ -889,13 +889,12 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
|
||||
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
|
||||
|
||||
if (iface) {
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -1332,7 +1331,6 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -2110,33 +2108,28 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else if (IS_CONST == IS_CONST ||
|
||||
((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ce && ce->get_iterator) {
|
||||
if (IS_CONST != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -4609,7 +4602,6 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
zval_dtor(free_op1.var);
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -5378,33 +5370,28 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else if (IS_TMP_VAR == IS_CONST ||
|
||||
((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ce && ce->get_iterator) {
|
||||
if (IS_TMP_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -7851,7 +7838,6 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -8292,9 +8278,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -8320,10 +8304,6 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -8735,33 +8715,28 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else if (IS_VAR == IS_CONST ||
|
||||
((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ce && ce->get_iterator) {
|
||||
if (IS_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -8851,8 +8826,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
zval *array = EX_T(opline->op1.u.var).var.ptr;
|
||||
zend_free_op free_op1;
|
||||
zval *array = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
zval **value;
|
||||
char *str_key;
|
||||
uint str_key_len;
|
||||
@@ -8862,6 +8837,8 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
int key_type = 0;
|
||||
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
|
||||
|
||||
PZVAL_LOCK(array);
|
||||
|
||||
switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
|
||||
default:
|
||||
case ZEND_ITER_INVALID:
|
||||
@@ -9864,7 +9841,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -10804,7 +10781,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(
|
||||
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -11667,7 +11644,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -12553,7 +12530,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -13416,7 +13393,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -14353,7 +14330,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -14756,7 +14733,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -15807,7 +15784,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -16739,7 +16716,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int
|
||||
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -17929,7 +17906,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON
|
||||
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -18986,7 +18963,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -20043,7 +20020,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -21359,7 +21336,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(
|
||||
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -21711,7 +21688,6 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OP
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -22152,9 +22128,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -22180,10 +22154,6 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -22585,33 +22555,28 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else if (IS_CV == IS_CONST ||
|
||||
((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ce && ce->get_iterator) {
|
||||
if (IS_CV != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -23567,7 +23532,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
|
||||
}
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -24345,7 +24310,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i
|
||||
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -25204,7 +25169,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
|
||||
}
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -25985,7 +25950,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -26844,7 +26809,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
|
||||
}
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -27675,7 +27640,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int
|
||||
zend_free_op free_op2;
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
@@ -28074,7 +28039,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HA
|
||||
}
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -29026,7 +28991,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
|
||||
}
|
||||
|
||||
/* We are going to assign the result by reference */
|
||||
if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
|
||||
if (opline->extended_value) {
|
||||
Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
|
||||
@@ -29852,7 +29817,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int
|
||||
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||
zend_vm_enter:
|
||||
/* Initialize execute_data */
|
||||
execute_data = (zend_execute_data *)zend_vm_stack_alloc(
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
|
||||
sizeof(zend_execute_data) +
|
||||
sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) +
|
||||
sizeof(temp_variable) * op_array->T TSRMLS_CC);
|
||||
|
||||
EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
|
||||
EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data));
|
||||
memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
|
||||
EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
|
||||
EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
|
||||
EX(fbc) = NULL;
|
||||
EX(called_scope) = NULL;
|
||||
EX(object) = NULL;
|
||||
|
||||
+7
-7
@@ -1688,7 +1688,7 @@ dnl PHP_BROKEN_GLIBC_FOPEN_APPEND
|
||||
dnl
|
||||
AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [
|
||||
AC_MSG_CHECKING([for broken libc stdio])
|
||||
AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
|
||||
AC_CACHE_VAL(have_broken_glibc_fopen_append,[
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
int main(int argc, char *argv[])
|
||||
@@ -1714,8 +1714,8 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
[_cv_have_broken_glibc_fopen_append=no],
|
||||
[_cv_have_broken_glibc_fopen_append=yes ],
|
||||
[have_broken_glibc_fopen_append=no],
|
||||
[have_broken_glibc_fopen_append=yes ],
|
||||
AC_TRY_COMPILE([
|
||||
#include <features.h>
|
||||
],[
|
||||
@@ -1723,11 +1723,11 @@ AC_TRY_COMPILE([
|
||||
choke me
|
||||
#endif
|
||||
],
|
||||
[_cv_have_broken_glibc_fopen_append=yes],
|
||||
[_cv_have_broken_glibc_fopen_append=no ])
|
||||
[have_broken_glibc_fopen_append=yes],
|
||||
[have_broken_glibc_fopen_append=no ])
|
||||
)])
|
||||
|
||||
if test "$_cv_have_broken_glibc_fopen_append" = "yes"; then
|
||||
if test "$have_broken_glibc_fopen_append" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+])
|
||||
else
|
||||
@@ -2780,7 +2780,7 @@ AC_DEFUN([PHP_DETECT_SUNCC],[
|
||||
AC_MSG_RESULT([no]),
|
||||
SUNCC="yes"
|
||||
GCC="no"
|
||||
test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
|
||||
test -n "$auto_cflags" && CFLAGS="-fsimple=2 -xnorunpath -xO4 -xalias_level=basic -xipo=1 -xlibmopt -xprefetch_level=1 -xprefetch=auto -xstrconst -xtarget=native -zlazyload"
|
||||
GCC=""
|
||||
AC_MSG_RESULT([yes])
|
||||
)
|
||||
|
||||
+10
-18
@@ -1,7 +1,7 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP Version 5 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997-2006 The PHP Group |
|
||||
# | Copyright (c) 1997-2007 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 3.01 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -20,7 +20,9 @@
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
SUBDIRS = Zend TSRM
|
||||
ZENDDIR = Zend
|
||||
|
||||
SUBDIRS = $(ZENDDIR) TSRM
|
||||
|
||||
STAMP = buildmk.stamp
|
||||
|
||||
@@ -31,10 +33,11 @@ all: $(STAMP) $(ALWAYS)
|
||||
@$(MAKE) -s -f build/build2.mk
|
||||
|
||||
generated_lists:
|
||||
@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
|
||||
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
|
||||
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
|
||||
@echo makefile_am_files = $(ZENDDIR)/Makefile.am \
|
||||
TSRM/Makefile.am > $@
|
||||
@echo config_h_files = $(ZENDDIR)/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = $(ZENDDIR)/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
|
||||
$(ZENDDIR)/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
|
||||
|
||||
$(STAMP): build/buildcheck.sh
|
||||
@build/buildcheck.sh $(STAMP)
|
||||
@@ -64,18 +67,7 @@ snapshot:
|
||||
|
||||
cvsclean-work:
|
||||
@for i in `find . -name .cvsignore`; do \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a .libs || true); \
|
||||
done
|
||||
|
||||
svnclean-work:
|
||||
@for i in `find . -type d -not -path '*/.svn/*' | grep -v '.svn'`; do \
|
||||
(cd $$i 2>/dev/null && rm -rf `svn propget svn:ignore . | grep -v config.nice` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
|
||||
done
|
||||
|
||||
gitclean-work:
|
||||
@if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
|
||||
(echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
|
||||
fi; \
|
||||
git clean -X -f -d;
|
||||
|
||||
.PHONY: $(ALWAYS) snapshot
|
||||
+4
-4
@@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $ac_version; IFS=' '
|
||||
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
@@ -48,9 +48,9 @@ fi
|
||||
|
||||
if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
echo "buildconf: Your version of autoconf likely contains buggy cache code."
|
||||
echo " Running vcsclean for you."
|
||||
echo " Running cvsclean for you."
|
||||
echo " To avoid this, install autoconf-2.13."
|
||||
./vcsclean
|
||||
./cvsclean
|
||||
stamp=
|
||||
fi
|
||||
|
||||
|
||||
Vendored
+793
-899
File diff suppressed because it is too large.
Load diff
@@ -32,11 +32,38 @@ if test "$dev" = "0" -a "$devok" = "0"; then
|
||||
echo "use buildconf --force to override this check."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$ZENDDIR"; then
|
||||
if grep "PHP_MAJOR_VERSION 5" main/php_version.h >/dev/null; then
|
||||
v=5
|
||||
else
|
||||
v=4
|
||||
fi
|
||||
|
||||
if test "$v" = "5"; then
|
||||
if test -r "Zend/OBJECTS2_HOWTO"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine1 2>/dev/null
|
||||
mv ZendEngine2 Zend
|
||||
fi
|
||||
else
|
||||
if test -r "Zend/zend_execute_globals.h"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine2 2>/dev/null
|
||||
mv ZendEngine1 Zend
|
||||
fi
|
||||
fi
|
||||
|
||||
ZENDDIR=Zend
|
||||
echo "using default Zend directory"
|
||||
fi
|
||||
|
||||
rm -f generated_lists
|
||||
|
||||
if test "$debug" = "yes"; then
|
||||
${MAKE:-make} -s -f build/build.mk SUPPRESS_WARNINGS=""
|
||||
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR" SUPPRESS_WARNINGS=""
|
||||
else
|
||||
${MAKE:-make} -s -f build/build.mk
|
||||
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR"
|
||||
fi
|
||||
Vendored
+20
-80
@@ -1,10 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2008-01-23'
|
||||
timestamp='2005-08-03'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -56,8 +55,8 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -107,7 +106,7 @@ set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
@@ -161,7 +160,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
@@ -208,11 +206,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:SolidBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
@@ -330,7 +325,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
@@ -532,7 +527,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[456])
|
||||
*:AIX:*:[45])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@@ -769,19 +764,12 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
i*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
@@ -791,18 +779,9 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
x86:Interix*:[34]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
@@ -836,16 +815,6 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
@@ -882,11 +851,7 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
@@ -905,11 +870,7 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
@@ -958,15 +919,9 @@ EOF
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
@@ -1009,7 +964,7 @@ EOF
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
#ifdef __INTEL_COMPILER
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
@@ -1019,11 +974,7 @@ EOF
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
@@ -1225,15 +1176,6 @@ EOF
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1243,6 +1185,7 @@ EOF
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
*86) UNAME_PROCESSOR=i686 ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
@@ -1321,9 +1264,6 @@ EOF
|
||||
i*86:skyos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
|
||||
exit ;;
|
||||
i*86:rdos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-rdos
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
@@ -1484,9 +1424,9 @@ This script, last modified $timestamp, has failed to recognize
|
||||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
and
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
||||
Vendored
+37
-116
@@ -1,10 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2008-01-16'
|
||||
timestamp='2005-07-08'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -72,8 +71,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -120,9 +119,8 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
|
||||
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@@ -173,10 +171,6 @@ case $os in
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco6)
|
||||
os=-sco5v6
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco5)
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@@ -193,10 +187,6 @@ case $os in
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco5v6*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@@ -241,16 +231,15 @@ case $basic_machine in
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fido | fr30 | frv \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@@ -268,27 +257,28 @@ case $basic_machine in
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| mt \
|
||||
| ms1 \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m32c)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
@@ -296,9 +286,6 @@ case $basic_machine in
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||
;;
|
||||
ms1)
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
@@ -318,18 +305,18 @@ case $basic_machine in
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| avr-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
@@ -349,33 +336,30 @@ case $basic_machine in
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| ms1-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
m32c-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@@ -447,14 +431,6 @@ case $basic_machine in
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
@@ -487,8 +463,8 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
@@ -680,14 +656,6 @@ case $basic_machine in
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
@@ -703,10 +671,6 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
@@ -732,9 +696,6 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
;;
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
@@ -833,14 +794,6 @@ case $basic_machine in
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
@@ -850,12 +803,6 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pc98)
|
||||
basic_machine=i386-pc
|
||||
;;
|
||||
pc98-*)
|
||||
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
@@ -912,10 +859,6 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
@@ -942,10 +885,6 @@ case $basic_machine in
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sde)
|
||||
basic_machine=mipsisa32-sde
|
||||
os=-elf
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
@@ -957,9 +896,6 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh5el)
|
||||
basic_machine=sh5le-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
@@ -1049,10 +985,6 @@ case $basic_machine in
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@@ -1169,7 +1101,7 @@ case $basic_machine in
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@@ -1242,23 +1174,21 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
| -skyos* | -haiku*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1410,12 +1340,6 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@@ -1425,9 +1349,9 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
@@ -1453,9 +1377,6 @@ case $basic_machine in
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
|
||||
+50
-37
@@ -31,7 +31,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(README.SVN-RULES)
|
||||
AC_INIT(README.CVS-RULES)
|
||||
|
||||
PHP_CONFIG_NICE(config.nice)
|
||||
|
||||
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=2
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -122,6 +122,21 @@ dnl or the contents of libs.
|
||||
$php_shtool mkdir -p libs
|
||||
rm -f libs/*
|
||||
|
||||
dnl Darwin 9 hack
|
||||
dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
|
||||
dnl causes errors in all current and past versions of Autoconf, we do a little
|
||||
dnl messing with the CFLAGS here to trick it.
|
||||
php_did_darwin9_cheat=0
|
||||
case $host_alias in
|
||||
*darwin9*)
|
||||
hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'`
|
||||
if test x"$hasg" = "x"; then
|
||||
php_did_darwin9_cheat=1
|
||||
CFLAGS="$CFLAGS -gstabs"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Checks for programs.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
@@ -155,7 +170,7 @@ dnl Check if bison generated files exist when bison does not..
|
||||
case $php_cv_bison_version in
|
||||
""|invalid[)]
|
||||
if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
|
||||
AC_MSG_ERROR([bison is required to build PHP/Zend when building a SVN checkout!])
|
||||
AC_MSG_ERROR([bison is required to build PHP/Zend when building a CVS checkout!])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -202,12 +217,9 @@ case $host_cpu in
|
||||
;;
|
||||
sparc*)
|
||||
if test "$SUNCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -xc99=all -xmemalign=8s"
|
||||
fi
|
||||
;;
|
||||
i386)
|
||||
if test "$SUNCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -xc99=all"
|
||||
CFLAGS="$CFLAGS -xmemalign=8i"
|
||||
else
|
||||
CFLAGS=""
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -244,6 +256,7 @@ case $host_alias in
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
|
||||
php_multiple_shlib_versions_ok=yes
|
||||
;;
|
||||
*beos*)
|
||||
@@ -392,6 +405,7 @@ dnl Check for inet_aton
|
||||
dnl in -lc, -lbind and -lresolv
|
||||
PHP_CHECK_FUNC(inet_aton, resolv, bind)
|
||||
|
||||
|
||||
dnl Then headers.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
@@ -414,7 +428,6 @@ arpa/inet.h \
|
||||
arpa/nameser.h \
|
||||
assert.h \
|
||||
crypt.h \
|
||||
dns.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
ieeefp.h \
|
||||
@@ -473,6 +486,16 @@ assert.h
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
|
||||
dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
|
||||
case $host_alias in
|
||||
*darwin[[89]]*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADERS([mach-o/dyld.h],[],[],[])
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_FOPENCOOKIE
|
||||
PHP_BROKEN_GETCWD
|
||||
PHP_BROKEN_GLIBC_FOPEN_APPEND
|
||||
@@ -578,6 +601,7 @@ putenv \
|
||||
realpath \
|
||||
random \
|
||||
rand_r \
|
||||
res_search \
|
||||
scandir \
|
||||
setitimer \
|
||||
setlocale \
|
||||
@@ -609,15 +633,13 @@ tzset \
|
||||
unlockpt \
|
||||
unsetenv \
|
||||
usleep \
|
||||
nanosleep \
|
||||
utime \
|
||||
vsnprintf \
|
||||
vasprintf \
|
||||
asprintf \
|
||||
)
|
||||
|
||||
dnl Some systems (like OpenSolaris) do not have nanosleep in libc
|
||||
AC_CACHE_CHECK([for nanosleep], ac_cv_func_nanosleep, [PHP_CHECK_FUNC_LIB(nanosleep, rt)])
|
||||
|
||||
dnl Check for getaddrinfo, should be a better way, but...
|
||||
dnl Also check for working getaddrinfo
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
@@ -769,8 +791,8 @@ if test "$PHP_DEBUG" = "yes"; then
|
||||
changequote([,])
|
||||
dnl add -O0 only if GCC or ICC is used
|
||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -g -O0"
|
||||
CXXFLAGS="$CXXFLAGS -g -O0"
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
CXXFLAGS="$CXXFLAGS -O0"
|
||||
fi
|
||||
if test "$SUNCC" = "yes"; then
|
||||
if test -n "$auto_cflags"; then
|
||||
@@ -1160,7 +1182,6 @@ EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR`
|
||||
EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
|
||||
EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
|
||||
EXPANDED_BINDIR=`eval echo $bindir`
|
||||
EXPANDED_SBINDIR=`eval echo $sbindir`
|
||||
EXPANDED_LIBDIR=$libdir
|
||||
EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
|
||||
EXPANDED_DATADIR=$datadir
|
||||
@@ -1176,7 +1197,6 @@ AC_SUBST(INCLUDE_PATH)
|
||||
AC_SUBST(EXPANDED_PEAR_INSTALLDIR)
|
||||
AC_SUBST(EXPANDED_EXTENSION_DIR)
|
||||
AC_SUBST(EXPANDED_BINDIR)
|
||||
AC_SUBST(EXPANDED_SBINDIR)
|
||||
AC_SUBST(EXPANDED_LIBDIR)
|
||||
AC_SUBST(EXPANDED_DATADIR)
|
||||
AC_SUBST(EXPANDED_SYSCONFDIR)
|
||||
@@ -1221,14 +1241,12 @@ if test "$PHP_CLI" != "no"; then
|
||||
PHP_INSTALL_CLI_TARGET="install-cli"
|
||||
PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c,, cli)
|
||||
PHP_INSTALLED_SAPIS="cli $PHP_SAPI"
|
||||
PHP_EXECUTABLE="\$(top_builddir)/\$(SAPI_CLI_PATH)"
|
||||
else
|
||||
PHP_INSTALLED_SAPIS="$PHP_SAPI"
|
||||
fi
|
||||
|
||||
PHP_SUBST_OLD(PHP_INSTALLED_SAPIS)
|
||||
|
||||
PHP_SUBST(PHP_EXECUTABLE)
|
||||
PHP_SUBST(PHP_CLI_TARGET)
|
||||
PHP_SUBST(PHP_SAPI_OBJS)
|
||||
PHP_SUBST(PHP_CLI_OBJS)
|
||||
@@ -1245,7 +1263,6 @@ PHP_SUBST_OLD(php_abs_top_builddir)
|
||||
PHP_SUBST_OLD(php_abs_top_srcdir)
|
||||
|
||||
PHP_SUBST(bindir)
|
||||
PHP_SUBST(sbindir)
|
||||
PHP_SUBST(exec_prefix)
|
||||
PHP_SUBST_OLD(program_prefix)
|
||||
PHP_SUBST_OLD(program_suffix)
|
||||
@@ -1330,14 +1347,6 @@ PHP_CONFIGURE_PART(Configuring libtool)
|
||||
|
||||
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
|
||||
|
||||
dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
|
||||
dnl This hack works around it. Ugly.
|
||||
case $host_alias in
|
||||
*darwin9*|*darwin10*)
|
||||
ac_cv_exeext=
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
|
||||
dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
|
||||
AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
|
||||
@@ -1361,6 +1370,15 @@ SHARED_LIBTOOL='$(LIBTOOL)'
|
||||
|
||||
CC=$old_CC
|
||||
|
||||
dnl Finish the Darwin hack
|
||||
if test "$php_did_darwin9_cheat" -eq 1; then
|
||||
if test "$PHP_DEBUG" = "1"; then
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
|
||||
else
|
||||
CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
|
||||
fi
|
||||
fi
|
||||
|
||||
PHP_CONFIGURE_PART(Generating files)
|
||||
|
||||
CXXFLAGS_CLEAN=$CXXFLAGS
|
||||
@@ -1561,18 +1579,13 @@ X
|
||||
fi
|
||||
|
||||
if test "$PHP_SIGCHILD" != "yes"; then
|
||||
if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
|
||||
cat <<X
|
||||
+--------------------------------------------------------------------+
|
||||
| Notice: |
|
||||
| If you encounter <defunc> processes when using a local Oracle |
|
||||
| database, set the value BEQUEATH_DETACH=YES in Oracle Net's |
|
||||
| sqlnet.ora file on the PHP host, or set the environment variable |
|
||||
| BEQUEATH_DETACH to YES before starting Apache. If the problem |
|
||||
| still occurs, then recompile PHP and specify --enable-sigchild |
|
||||
| when configuring. |
|
||||
| If you encounter <defunc> processes when using a local Oracle-DB |
|
||||
| please recompile PHP and specify --enable-sigchild when configuring|
|
||||
| (This problem has been reported under Linux using Oracle >= 8.1.5) |
|
||||
X
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
${MAKE:-make} -f build/build.mk cvsclean-work
|
||||
File renamed without changes.
+11
-3
@@ -21,6 +21,8 @@
|
||||
#ifndef PHP_BCMATH_H
|
||||
#define PHP_BCMATH_H
|
||||
|
||||
#if HAVE_BCMATH
|
||||
|
||||
#include "libbcmath/src/bcmath.h"
|
||||
|
||||
extern zend_module_entry bcmath_module_entry;
|
||||
@@ -48,12 +50,18 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
|
||||
long bc_precision;
|
||||
ZEND_END_MODULE_GLOBALS(bcmath)
|
||||
|
||||
#ifdef ZTS
|
||||
# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
|
||||
#if ZTS
|
||||
#define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
|
||||
#else
|
||||
# define BCG(v) (bcmath_globals.v)
|
||||
#define BCG(v) (bcmath_globals.v)
|
||||
#endif
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(bcmath)
|
||||
|
||||
#else
|
||||
|
||||
#define phpext_bcmath_ptr NULL
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PHP_BCMATH_H */
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
bcdiv — Divide two arbitrary precision numbers
|
||||
--CREDITS--
|
||||
TestFest2009
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcdiv('10.99', '0');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcdiv(): Division by zero in %s.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bcdiv — Divide two arbitrary precision numbers
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcdiv('1', '2', '3', '4');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcdiv() expects at most 3 parameters, 4 given in %s.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bcmod — Get modulus of an arbitrary precision number
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcmod('1', '2', '3');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcmod() expects exactly 2 parameters, 3 given in %s.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod('1');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcpowmod() expects at least 3 parameters, 1 given in %s.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod('1', '2');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcpowmod() expects at least 3 parameters, 2 given in %s.php on line %d
|
||||
Loaded 100 of 2107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user