diff options
author | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
---|---|---|
committer | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
commit | 0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc (patch) | |
tree | 04bbcd1a5da16ea5246d39c1bcae45b9eb67c526 | |
parent | 1fa8ecd082607858084994ad7081ef06e37db5f5 (diff) | |
parent | 6a50a8640c562a41d90c7ab46affa767b97d2621 (diff) | |
download | php-git-0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (367 commits)
fix unix/win dir separators
Fix bug #63173: Crash when invoking invalid array callback
Correct the test summary
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Avoid calling select if maxfd returned by curl_multi_fdset is -1
Fixing NEWS file
Fixed bug #63111 (is_callable() lies for abstract static method)
updated lib versions
Fix folding
fix bug #63015 (Incorrect arginfo for DOMErrorHandler)
Bug #63000: MCAST_JOIN_GROUP on OSX is broken
Fixed bug #61442 (exception threw in __autoload can not be catched)
Merging PR #116
Merged GitHub PR #190: Support for the HTTP PATCH method in CLI webserver
updated libary versions
split tests for the new zlib version on win
Fixed Bug #63103 (ext\curl\tests\bug62839.phpt broken)
update news
Support building PHP with the native client toolchain.
...
651 files changed, 10606 insertions, 26168 deletions
diff --git a/.gitattributes b/.gitattributes index 1f4a7195b7..9ed6e5f4b9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,6 +15,7 @@ ext/dba/libflatfile/flatfile.c ident ext/dba/libcdb/cdb_make.c ident ext/dba/libcdb/cdb.c ident ext/filter/filter.c ident +ext/zip/php_zip.c ident README.input_filter ident run-tests.php ident sapi/nsapi/nsapi.c ident diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..a375a359dd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: php + +php: + # We only specify one version so we only get one worker + - 5.4 + +notifications: + email: false + +script: exit 0 diff --git a/CODING_STANDARDS b/CODING_STANDARDS index ae8ee04190..7413be453c 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -2,11 +2,11 @@ PHP Coding Standards ======================== -This file lists several standards that any programmer, adding or changing -code in PHP, should follow. Since this file was added at a very late +This file lists several standards that any programmer adding or changing +code in PHP should follow. Since this file was added at a very late stage of the development of PHP v3.0, the code base does not (yet) fully follow it, but it's going in that general direction. Since we are now -well into the version 4 releases, many sections have been recoded to use +well into version 5 releases, many sections have been recoded to use these rules. Code Implementation @@ -24,6 +24,7 @@ Installing PHP + Installing a PHP extension on Windows + Compiling shared PECL extensions with the pecl command + Compiling shared PECL extensions with phpize + + php-config + Compiling PECL extensions statically into PHP * Problems? + Read the FAQ @@ -83,7 +84,7 @@ General Installation Considerations With PHP you can also write desktop GUI applications using the PHP-GTK extension. This is a completely different approach than writing web pages, as you do not output any HTML, but manage windows and objects - within them. For more information about PHP-GTK, please » visit the + within them. For more information about PHP-GTK, please » visit the site dedicated to this extension. PHP-GTK is not included in the official PHP distribution. @@ -92,9 +93,9 @@ General Installation Considerations will also find information on the command line executable in the following sections. - PHP source code and binary distributions for Windows can be found at » - http://www.php.net/downloads.php. We recommend you to choose a » mirror - nearest to you for downloading the distributions. + PHP source code and binary distributions for Windows can be found at + » http://www.php.net/downloads.php. We recommend you to choose a + » mirror nearest to you for downloading the distributions. __________________________________________________________________ __________________________________________________________________ @@ -140,9 +141,9 @@ Table of Contents * A web server * Any module specific components (such as GD, PDF libs, etc.) - When building directly from SVN sources or after custom modifications + When building directly from Git sources or after custom modifications you might also need: - * autoconf: 2.13 + * autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0) * automake: 1.4+ * libtool: 1.4.x+ (except 1.4.2) * re2c: Version 0.13.4 or newer @@ -375,12 +376,12 @@ Apache 2.x on Unix systems For information on why, read the related FAQ entry on using Apache2 with a threaded MPM - The » Apache Documentation is the most authoritative source of + The » Apache Documentation is the most authoritative source of information on the Apache 2.x server. More information about installation options for Apache may be found there. - The most recent version of Apache HTTP Server may be obtained from » - Apache download site, and a fitting PHP version from the above + The most recent version of Apache HTTP Server may be obtained from + » Apache download site, and a fitting PHP version from the above mentioned places. This quick guide covers only the basics to get started with Apache 2.x and PHP. For more information read the » Apache Documentation. The version numbers have been omitted here, to ensure @@ -498,7 +499,7 @@ service httpd restart This should not be undertaken without being aware of the consequences of this decision, and having at least a fair understanding of the - implications. The Apache documentation regarding » MPM-Modules + implications. The Apache documentation regarding » MPM-Modules discusses MPMs in a great deal more detail. Note: @@ -520,7 +521,7 @@ Lighttpd 1.4 on Unix systems This section contains notes and hints specific to Lighttpd 1.4 installs of PHP on Unix systems. - Please use the » Lighttpd trac to learn how to install Lighttpd + Please use the » Lighttpd trac to learn how to install Lighttpd properly before continuing. Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is @@ -627,15 +628,15 @@ Sun, iPlanet and Netscape servers on Sun Solaris current web servers read the note about subrequests. You can find more information about setting up PHP for the Netscape - Enterprise Server (NES) here: » - http://benoit.noss.free.fr/php/install-php4.html + Enterprise Server (NES) here: + » http://benoit.noss.free.fr/php/install-php4.html To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers, enter the proper install directory for the --with-nsapi=[DIR] option. The default directory is usually /opt/netscape/suitespot/. Please also read /php-xxx-version/sapi/nsapi/nsapi-readme.txt. - 1. Install the following packages from » http://www.sunfreeware.com/ + 1. Install the following packages from » http://www.sunfreeware.com/ or another download site: + autoconf-2.13 + automake-1.4 @@ -837,7 +838,7 @@ Testing Using Variables Some server supplied environment variables are not defined in the - current » CGI/1.1 specification. Only the following variables are + current » CGI/1.1 specification. Only the following variables are defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD, @@ -855,20 +856,20 @@ HP-UX specific installation notes There are two main options for installing PHP on HP-UX systems. Either compile it, or install a pre-compiled binary. - Official pre-compiled packages are located here: » - http://software.hp.com/ + Official pre-compiled packages are located here: + » http://software.hp.com/ Until this manual section is rewritten, the documentation about compiling PHP (and related extensions) on HP-UX systems has been - removed. For now, consider reading the following external resource: » - Building Apache and PHP on HP-UX 11.11 + removed. For now, consider reading the following external resource: + » Building Apache and PHP on HP-UX 11.11 __________________________________________________________________ __________________________________________________________________ OpenBSD installation notes - This section contains notes and hints specific to installing PHP on » - OpenBSD 3.6. + This section contains notes and hints specific to installing PHP on + » OpenBSD 3.6. Using Binary Packages @@ -900,12 +901,12 @@ Using Binary Packages (install the PEAR libraries) # pkg_add php4-pear-4.3.8.tgz - Read the » packages(7) manual page for more information about binary + Read the » packages(7) manual page for more information about binary packages on OpenBSD. Using Ports - You can also compile up PHP from source using the » ports tree. + You can also compile up PHP from source using the » ports tree. However, this is only recommended for users familiar with OpenBSD. The PHP 4 port is split into two sub-directories: core and extensions. The extensions directory generates sub-packages for all of the supported @@ -926,7 +927,7 @@ Common Problems automatically installs into the correct chroot directories, so no special modification is needed there. More information on the OpenBSD Apache is available in the » OpenBSD FAQ. - * The OpenBSD 3.6 package for the » gd extension requires XFree86 to + * The OpenBSD 3.6 package for the » gd extension requires XFree86 to be installed. If you do not wish to use some of the font features that require X11, install the php4-gd-4.3.8-no_x11.tgz package instead. @@ -951,18 +952,26 @@ Required software Solaris installs often lack C compilers and their related tools. Read this FAQ for information on why using GNU versions for some of these - tools is necessary. The required software is as follows: + tools is necessary. + + For unpacking the PHP distribution you need + * tar + * gzip or + * bzip2 + + For compiling PHP you need * gcc (recommended, other C compilers may work) * make - * flex + * GNU sed + + For building extra extensions or hacking the code of PHP you might also + need + * flex (up to PHP 5.2) + * re2c * bison * m4 * autoconf * automake - * perl - * gzip - * tar - * GNU sed In addition, you will need to install (and possibly compile) any additional software specific to your configuration, such as Oracle or @@ -971,14 +980,16 @@ Required software Using Packages You can simplify the Solaris install process by using pkgadd to install - most of your needed components. + most of your needed components. The Image Packaging System (IPS) for + Solaris 11 Express also contains most of the required components for + installation using the pkg command. __________________________________________________________________ __________________________________________________________________ Debian GNU/Linux installation notes - This section contains notes and hints specific to installing PHP on » - Debian GNU/Linux. + This section contains notes and hints specific to installing PHP on + » Debian GNU/Linux. Warning Unofficial builds from third-parties are not supported here. Any bugs @@ -1205,6 +1216,7 @@ Table of Contents * Installing a PHP extension on Windows * Compiling shared PECL extensions with the pecl command * Compiling shared PECL extensions with phpize + * php-config * Compiling PECL extensions statically into PHP __________________________________________________________________ @@ -1227,8 +1239,8 @@ Introduction to PECL Installations To this php.ini file, or through the use of the dl() function. When building PHP modules, it's important to have known-good versions - of the required tools (autoconf, automake, libtool, etc.) See the » - Anonymous SVN Instructions for details on the required tools, and + of the required tools (autoconf, automake, libtool, etc.) See the + » Anonymous Git Instructions for details on the required tools, and required versions. __________________________________________________________________ __________________________________________________________________ @@ -1247,7 +1259,7 @@ Downloading PECL extensions the PECL web site are available for download and installation using the » pecl command. Specific revisions may also be specified. * SVN Most PECL extensions also reside in SVN. A web-based view may - be seen at » http://svn.php.net/viewvc/pecl/. To download straight + be seen at » http://svn.php.net/viewvc/pecl/. To download straight from SVN, the following sequence of commands may be used: $ svn checkout http://svn.php.net/repository/pecl/extname/trunk extname @@ -1279,7 +1291,7 @@ Where to find an extension? PHP extensions are usually called "php_*.dll" (where the star represents the name of the extension) and they are located under the - "PHP\ext" ("PHP\extensions" in PHP4) folder. + "PHP\ext" ("PHP\extensions" in PHP 4) folder. PHP ships with the extensions most useful to the majority of developers. They are called "core" extensions. @@ -1365,7 +1377,7 @@ Resolving problems Compiling shared PECL extensions with the pecl command - PECL makes it easy to create shared PHP extensions. Using the » pecl + PECL makes it easy to create shared PHP extensions. Using the » pecl command, do the following: $ pecl install extname @@ -1424,6 +1436,51 @@ $ make __________________________________________________________________ __________________________________________________________________ +php-config + + php-config is a simple shell script for obtaining information about the + installed PHP configuration. + + When compiling extensions, if you have multiple PHP versions installed, + you may specify for which installation you'd like to build by using the + --with-php-config option during configuration, specifying the path of + the respective php-config script. + + The list of command line options provided by the php-config script can + be queried anytime by running php-config with the -h switch: +Usage: /usr/local/bin/php-config [OPTION] +Options: + --prefix [...] + --includes [...] + --ldflags [...] + --libs [...] + --extension-dir [...] + --include-dir [...] + --php-binary [...] + --php-sapis [...] + --configure-options [...] + --version [...] + --vernum [...] + + CAPTION: Command line options + + Option Description + --prefix Directory prefix where PHP is installed, e.g. /usr/local + --includes List of -I options with all include files + --ldflags LD Flags which PHP was compiled with + --libs Extra libraries which PHP was compiled with + --extension-dir Directory where extensions are searched by default + --include-dir Directory prefix where header files are installed by + default + --php-binary Full path to php CLI or CGI binary + --php-sapis Show all SAPI modules available + --configure-options Configure options to recreate configuration of + current PHP installation + --version PHP version + --vernum PHP version as integer + __________________________________________________________________ + __________________________________________________________________ + Compiling PECL extensions statically into PHP You might find that you need to build a PECL extension statically into @@ -1485,11 +1542,11 @@ Other problems If you are still stuck, someone on the PHP installation mailing list may be able to help you. You should check out the archive first, in case someone already answered someone else who had the same problem as - you. The archives are available from the support page on » - http://www.php.net/support.php. To subscribe to the PHP installation - mailing list, send an empty mail to » - php-install-subscribe@lists.php.net. The mailing list address is » - php-install@lists.php.net. + you. The archives are available from the support page on + » http://www.php.net/support.php. To subscribe to the PHP installation + mailing list, send an empty mail to + » php-install-subscribe@lists.php.net. The mailing list address is + » php-install@lists.php.net. If you want to get help on the mailing list, please try to be precise and give the necessary details about your environment (which operating @@ -1504,11 +1561,11 @@ Bug reports If you think you have found a bug in PHP, please report it. The PHP developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can report bugs using the - bug-tracking system at » http://bugs.php.net/. Please do not send bug + bug-tracking system at » http://bugs.php.net/. Please do not send bug reports in mailing list or personal letters. The bug system is also suitable to submit feature requests. - Read the » How to report a bug document before submitting any bug + Read the » How to report a bug document before submitting any bug reports! __________________________________________________________________ __________________________________________________________________ @@ -1528,14 +1585,14 @@ The configuration file The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web - server is started. For the CGI and CLI version, it happens on every + server is started. For the CGI and CLI versions, it happens on every invocation. - php.ini is searched in these locations (in order): + php.ini is searched for in these locations (in order): * SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD) - * The PHPRC environment variable. Before PHP 5.2.0 this was checked + * The PHPRC environment variable. Before PHP 5.2.0, this was checked after the registry key mentioned below. * As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined @@ -1543,33 +1600,33 @@ The configuration file [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for - IniFilePath in these keys, then the first one found will be used as - the location of the php.ini (Windows only). + IniFilePath in any of these keys, the first one found will be used + as the location of the php.ini (Windows only). * [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only). - * Current working directory (except CLI) + * Current working directory (except CLI). * The web server's directory (for SAPI modules), or directory of PHP - (otherwise in Windows) + (otherwise in Windows). * Windows directory (C:\windows or C:\winnt) (for Windows), or - --with-config-file-path compile time option + --with-config-file-path compile time option. - If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is - e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI - name can be determined by php_sapi_name(). + If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example, + php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI + name can be determined with php_sapi_name(). Note: - The Apache web server changes the directory to root at startup + The Apache web server changes the directory to root at startup, causing PHP to attempt to read php.ini from the root filesystem if it exists. - The php.ini directives handled by extensions are documented - respectively on the pages of the extensions themselves. The list of the - core directives is available in the appendix. Probably not all PHP - directives are documented in the manual though. For a complete list of + The php.ini directives handled by extensions are documented on the + respective pages of the extensions themselves. A list of the core + directives is available in the appendix. Not all PHP directives are + necessarily documented in this manual: 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. + commented php.ini file. Alternatively, you may find » the latest + php.ini from Git helpful too. Example #1 php.ini example ; any text on a line after an unquoted semicolon (;) is ignored @@ -1635,12 +1692,13 @@ Where a configuration setting may be set CAPTION: Definition of PHP_INI_* modes - Mode Value Meaning - PHP_INI_USER 1 Entry can be set in user scripts (like with ini_set()) - or in the Windows registry - PHP_INI_PERDIR 6 Entry can be set in php.ini, .htaccess or httpd.conf - PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf - PHP_INI_ALL 7 Entry can be set anywhere + Mode Meaning + PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or + in the Windows registry. Since PHP 5.3, entry can be set in .user.ini + PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or + .user.ini (since PHP 5.3) + PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf + PHP_INI_ALL Entry can be set anywhere __________________________________________________________________ __________________________________________________________________ @@ -1788,13 +1846,9 @@ Installation each request to play in, further weaknesses are introduced into PHP's system. - If you feel you have to use a threaded MPM, look at a FastCGI + If you want to use a threaded MPM, look at a FastCGI configuration where PHP is running in its own memory space. - And finally, this warning against using a threaded MPM is not as - strong for Windows systems because most libraries on that - platform tend to be threadsafe. - Unix/Windows: Where should my php.ini file be located? By default on Unix it should be in /usr/local/lib which is <install-path>/lib. Most people will want to change this at @@ -1,6 +1,280 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2012, PHP 5.4.4 +?? ??? 2012, PHP 5.4.8 + +- CLI server: + . Changed response to unknown HTTP method to 501 according to RFC. + (Niklas Lindgren). + . Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190. + (Lars) + +- Core: + . Added optional second argument for assert() to specify custom message. Patch + by Lonny Kapelushnik (lonny@lonnylot.com). (Lars) + . Support building PHP with the native client toolchain. (Stuart Langley) + . Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry) + . Fixed bug #63093 (Segfault while load extension failed in zts-build). + (Laruence) + . Fixed bug #62976 (Notice: could not be converted to int when comparing + some builtin classes). (Laruence) + . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values" + Windows registry). (aserbulov at parallels dot com) + . Fixed bug #62907 (Double free when use traits). (Dmitry) + . Fixed bug #61767 (Shutdown functions not called in certain error + situation). (Dmitry) + . Fixed bug #60909 (custom error handler throwing Exception + fatal error + = no shutdown function). (Dmitry) + . Fixed bug #60723 (error_log error time has changed to UTC ignoring default + timezo). (Laruence) + +- DOM: + . Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob) + +- OpenSSL: + . Implemented FR #61421 (OpenSSL signature verification missing RMD160, + SHA224, SHA256, SHA384, SHA512). (Mark Jones) + +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + +- SPL: + . Bug #62987 (Assigning to ArrayObject[null][something] overrides all + undefined variables). (Laruence) + +- mbstring: + . Allow passing null as a default value to mb_substr() and mb_strcut(). Patch + by Alexander Moskaliov via GitHub PR #133. (Lars) + +- Filter extension: + . Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty + string or false. (Lars) + +- Sockets + . Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by + Igor Wiedler). (Lars) + +?? ??? 2012, PHP 5.4.7 + +- Core: + . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence) + . Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds). + . Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not + set). (Felipe) + . Fixed bug #62763 (register_shutdown_function and extending class). + (Laruence) + . Fixed bug #62725 (Calling exit() in a shutdown function does not return + the exit value). (Laruence) + . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence) + . Fixed bug #62716 (munmap() is called with the incorrect length). + (slangley@google.com) + . Fixed bug #62358 (Segfault when using traits a lot). (Laruence) + . Fixed bug #62328 (implementing __toString and a cast to string fails) + (Laruence) + . Fixed bug #51363 (Fatal error raised by var_export() not caught by error + handler). (Lonny Kapelushnik) + . Fixed bug #40459 (Stat and Dir stream wrapper methods do not call + constructor). (Stas) + +- CURL: + . Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed). + (Pierrick) + . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick) + +- Intl: + . Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo) + . Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo) + . Fix bug #62915 (defective cloning in several intl classes). (Gustavo) + +- Installation: + . Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia) + +- PCRE: + . Fixed bug #55856 (preg_replace should fail on trailing garbage). + (reg dot php at alf dot nu) + +- PDO: + . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) + +- Reflection: + . Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing + trait methods as private). (Felipe) + . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong + result). (Laruence) + +- Session: + . Fixed bug (segfault due to retval is not initialized). (Laruence) + . Fixed bug (segfault due to PS(mod_user_implemented) not be reseted + when close handler call exit). (Laruence) + +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + +- SPL: + . Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) + (Laruence) + . Implemented FR #62840 (Add sort flag to ArrayObject::ksort). (Laruence) + +- Standard: + . Fixed bug #62836 (Seg fault or broken object references on unserialize()). + (Laruence) + +- FPM: + . Merged PR 121 by minitux to add support for slow request counting on PHP + FPM status page. (Lars) + +16 Aug 2012, PHP 5.4.6 + +- CLI Server: + . Implemented FR #62700 (have the console output 'Listening on + http://localhost:8000'). (pascal.chevrel@free.fr) + +- Core: + . Fixed bug #62661 (Interactive php-cli crashes if include() is used in + auto_prepend_file). (Laruence) + . Fixed bug #62653: (unset($array[$float]) causes a crash). (Nikita Popov, + Laruence) + . Fixed bug #62565 (Crashes due non-initialized internal properties_table). + (Felipe) + . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK + with run-test.php). (Laruence) + +- CURL: + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). + (r.hampartsumyan@gmail.com, Laruence) + +- DateTime: + . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + +- Fileinfo: + . Fixed bug #61964 (finfo_open with directory causes invalid free). + (reeze.xia@gmail.com) + +- Intl: + . Fixed bug #62564 (Extending MessageFormatter and adding property causes + crash). (Felipe) + +- MySQLnd: + . Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence) + +- readline: + . Fixed bug #62612 (readline extension compilation fails with + sapi/cli/cli.h: No such file). (Johannes) + +- Reflection: + . Implemented FR #61602 (Allow access to name of constant used as default + value). (reeze.xia@gmail.com) + +- SimpleXML: + . Implemented FR #55218 Get namespaces from current node. (Lonny) + +- SPL: + . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance + gives Segmentation fault). (Laruence, Gustavo) + . Fixed bug #61527 (ArrayIterator gives misleading notice on next() when + moved to the end). (reeze.xia@gmail.com) + +- Streams: + . Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build). + (Laruence) + +- Zlib: + . Fixed bug #55544 (ob_gzhandler always conflicts with + zlib.output_compression). (Laruence) + +19 Jul 2012, PHP 5.4.5 + +- Core: + . Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed + Salt). (Anthony Ferrara) + . Fixed bug #62432 (ReflectionMethod random corrupt memory on high + concurrent). (Johannes) + . Fixed bug #62373 (serialize() generates wrong reference to the object). + (Moriyoshi) + . Fixed bug #62357 (compile failure: (S) Arguments missing for built-in + function __memcmp). (Laruence) + . Fixed bug #61998 (Using traits with method aliases appears to result in + crash during execution). (Dmitry) + . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that + includes a semi-colon). (Pierrick) + . Fixed potential overflow in _php_stream_scandir (CVE-2012-2688). + (Jason Powell, Stas) + +- EXIF: + . Fixed information leak in ext exif (discovered by Martin Noga, + Matthew "j00ru" Jurczyk, Gynvael Coldwind) + +- FPM: + . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat) + . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat) + . Fixed bug #62153 (when using unix sockets, multiples FPM instances + . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start). + (fat) + . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat) + . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat) + . Fixed bug #61295 (php-fpm should not fail with commented 'user' + . Fixed bug #61218 (FPM drops connection while receiving some binary values + in FastCGI requests). (fat) + . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat) + for non-root start). (fat) + . Fixed bug #61026 (FPM pools can listen on the same address). (fat) + can be launched without errors). (fat) + +- Iconv: + . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas) + +- Intl: + . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo) + . ResourceBundle constructor now accepts NULL for the first two arguments. + (Gustavo) + . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called + twice). (Gustavo) + . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo) + . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks + pattern). (Gustavo) + . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo) + +- JSON: + . Fixed bug #61359 (json_encode() calls too many reallocs). (Stas) + +- libxml: + . Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM + SAPI). (Gustavo) + +- Phar: + . Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe) + +- Readline: + . Fixed bug #62186 (readline fails to compile - void function should not + return a value). (Johannes) + +- Reflection: + . Fixed bug #62384 (Attempting to invoke a Closure more than once causes + segfault). (Felipe) + . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks + with constant). (Laruence) + +- Sockets: + . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe) + +- SPL: + . Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to + dot files). (Laruence) + . Fixed bug #62262 (RecursiveArrayIterator does not implement Countable). + (Nikita Popov) + +- XML Writer: + . Fixed bug #62064 (memory leak in the XML Writer module). + (jean-pierre dot lozi at lip6 dot fr) + +- Zip: + . Upgraded libzip to 0.10.1 (Anatoliy) + +14 Jun 2012, PHP 5.4.4 + +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) - CLI Server: . Implemented FR #61977 (Need CLI web-server support for files with .htm & @@ -11,16 +285,12 @@ PHP NEWS . Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi). (Laruence, reeze.xia@gmail.com) -- CURL: - . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). - (Laruence) - - Core: . Fixed missing bound check in iptcparse(). (chris at chiappa.net) + . Fixed CVE-2012-2143. (Solar Designer) + . Fixed bug #62097 (fix for for bug #54547). (Gustavo) . Fixed bug #62005 (unexpected behavior when incrementally assigning to a member of a null object). (Laruence) - . Fixed bug #61998 (Using traits with method aliases appears to result in - crash during execution). (Dmitry) . Fixed bug #61978 (Object recursion not detected for classes that implement JsonSerializable). (Felipe) . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy) @@ -29,12 +299,15 @@ PHP NEWS . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy) . Fixed bug #61782 (__clone/__destruct do not match other methods when checking access controls). (Stas) + . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo) . Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash). (Laruence) . Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference). (Laruence) . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown phase). (Laruence) + . Fixed bug #61713 (Logic error in charset detection for htmlentities). + (Anatoliy) . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov) . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables (without apache2)). (Laruence) @@ -44,46 +317,39 @@ PHP NEWS set to null). (Anatoliy) . Changed php://fd to be available only for CLI. -- Phar: - . Fix bug #61065 (Secunia SA44335). (Rasmus) - -- Pgsql: - . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki) +- CURL: + . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). + (Laruence) - Fileinfo . Fixed bug #61812 (Uninitialised value used in libmagic). (Laruence, Gustavo) - -- FPM - . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat) - . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat) - . Fixed bug #61295 (php-fpm should not fail with commented 'user' - for non-root start). (fat) - . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat) - . Fixed bug #61026 (FPM pools can listen on the same address). (fat) - . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start). - (fat) - . Fixed bug #62153 (when using unix sockets, multiples FPM instances - can be launched without errors). (fat) - . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat) - . Fixed bug #61218 (FPM drops connection while receiving some binary values - in FastCGI requests). (fat) - . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat) + . Fixed bug #61566 failure caused by the posix lseek and read versions + under windows in cdf_read(). (Anatoliy) + . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a + directory descriptor under windows. (Anatoliy) - Intl - . ResourceBundle constructor now accepts NULL for the first two arguments. - (Gustavo) + . Fixed bug #62082 (Memory corruption in internal function + get_icu_disp_value_src_php()). (Gustavo) - Libxml: . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)). (Laruence) - -- Sockets: - . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe) - -- XML Writer: - . Fixed bug #62064 (memory leak in the XML Writer module). - (jean-pierre dot lozi at lip6 dot fr) + +- PDO: + . Fixed bug #61755 (A parsing bug in the prepared statements can lead to + access violations). (Johannes) + +- Phar: + . Fixed bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus) + +- Pgsql: + . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki) + +- Streams: + . Fixed bug #61961 (file_get_contents leaks when access empty file with + maxlen set). (Reeze) - Zlib: . Fixed bug #61820 (using ob_gzhandler will complain about headers already @@ -173,23 +439,6 @@ PHP NEWS . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled). (Johannes) -- Readline: - . Fixed bug #61088 (Memory leak in readline_callback_handler_install). - (Nikic, Laruence) - -- Session - . Fixed bug #60634 (Segmentation fault when trying to die() in - SessionHandler::write()). (Ilia) - -- SOAP - . Fixed bug #61423 (gzip compression fails). (Ilia) - . Fixed bug #60887 (SoapClient ignores user_agent option and sends no - User-Agent header). (carloschilazo at gmail dot com) - . Fixed bug #60842, #51775 (Chunked response parsing error when - chunksize length line is > 10 bytes). (Ilia) - . Fixed bug #49853 (Soap Client stream context header option ignored). - (Dmitry) - - PDO . Fixed bug #61292 (Segfault while calling a method on an overloaded PDO object). (Laruence) @@ -207,12 +456,29 @@ PHP NEWS . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL bytes). (Nikita Popov) +- Readline: + . Fixed bug #61088 (Memory leak in readline_callback_handler_install). + (Nikic, Laruence) + - Reflection: . Implemented FR #61602 (Allow access to the name of constant used as function/method parameter's default value). (reeze.xia@gmail.com) . Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invokeArgs()). (Laruence) +- Session + . Fixed bug #60634 (Segmentation fault when trying to die() in + SessionHandler::write()). (Ilia) + +- SOAP + . Fixed bug #61423 (gzip compression fails). (Ilia) + . Fixed bug #60887 (SoapClient ignores user_agent option and sends no + User-Agent header). (carloschilazo at gmail dot com) + . Fixed bug #60842, #51775 (Chunked response parsing error when + chunksize length line is > 10 bytes). (Ilia) + . Fixed bug #49853 (Soap Client stream context header option ignored). + (Dmitry) + - SPL: . Fixed bug #61453 (SplObjectStorage does not identify objects correctly). (Gustavo) @@ -669,6 +935,73 @@ PHP NEWS . Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression). (Mike) +14 Jun 2012, PHP 5.3.14 + +- CLI SAPI: + . Fixed bug #61546 (functions related to current script failed when chdir() + in cli sapi). (Laruence, reeze.xia@gmail.com) + +- CURL: + . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). + (Laruence) + +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) + +- Core: + . Fixed CVE-2012-2143. (Solar Designer) + . Fixed missing bound check in iptcparse(). (chris at chiappa.net) + . Fixed bug #62373 (serialize() generates wrong reference to the object). + (Moriyoshi) + . Fixed bug #62005 (unexpected behavior when incrementally assigning to a + member of a null object). (Laruence) + . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy) + . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo) + . Fixed bug #61730 (Segfault from array_walk modifying an array passed by + reference). (Laruence) + . Fixed bug #61713 (Logic error in charset detection for htmlentities). + (Anatoliy) + . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename + set to null). (Anatoliy) + . Changed php://fd to be available only for CLI. + +- Fileinfo: + . Fixed bug #61812 (Uninitialised value used in libmagic). + (Laruence, Gustavo) + +- Iconv extension: + . Fixed a bug that iconv extension fails to link to the correct library + when another extension makes use of a library that links to the iconv + library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail. + (Moriyoshi) + +- Intl: + . Fixed bug #62082 (Memory corruption in internal function + get_icu_disp_value_src_php()). (Gustavo) + +- JSON + . Fixed bug #61537 (json_encode() incorrectly truncates/discards + information). (Adam) + +- PDO: + . Fixed bug #61755 (A parsing bug in the prepared statements can lead to + access violations). (Johannes) + +- Phar: + . Fix bug #61065 (Secunia SA44335). (Rasmus) + +- Streams: + . Fixed bug #61961 (file_get_contents leaks when access empty file with + maxlen set). (Reeze) + +08 May 2012, PHP 5.3.13 +- CGI + . Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311. + (Stas) + +03 May 2012, PHP 5.3.12 +- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus) + 26 Apr 2012, PHP 5.3.11 - Core: diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS index a8e36c2b6f..3fa944ee3b 100644 --- a/README.RELEASE_PROCESS +++ b/README.RELEASE_PROCESS @@ -127,33 +127,34 @@ Rolling a stable release 2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``. -3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections) +3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections) 4. Commit those changes 5. run the "scripts/dev/credits" script in php-src and commit the changes in the credits files in ext/standard. -6. tag the repository with the version f.e. "``cvs tag php_4_4_1``" +6. tag the repository with the version f.e. "``git tag -s php-5.4.1``" (of course, you need to change that to the version you're rolling an RC for). When making 5.X release, you need to tag the Zend directory separately!! 7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate -was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get +was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get a new RC or not. This is to make sure ``version_compare()`` can correctly work. 8. Commit those changes -9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4 -branch if you're rolling 4.4.x releases). +9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4 +branch if you're rolling 5.5.x releases). -10. You do not have to update the tree, but of course you can with "``cvs up -dP``". +10. You do not have to update the tree, but of course you can with "``git pull +origin <branch>``". -11. run: ``./makedist php 4.4.1``, this will export the tree, create configure +11. run: ``./makedist php 5.4.1``, this will export the tree, create configure and build two tarballs (one gz and one bz2). -12. Commit those two tarballs to CVS (phpweb/distributions) +12. Commit those two tarballs to Git (php-distributions.git) 13. Once the release has been tagged, contact the PHP Windows development team (internals-win@lists.php.net) so that Windows binaries can be created. Once @@ -171,6 +172,9 @@ Getting the stable release announced a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4) + b. In case multiple PHP minor versions are in active development you have + to manually copy the old information to include/releases.inc + 2. Edit ``phpweb/include/version.inc`` and change (X=major release number): a. ``$PHP_X_VERSION`` to the correct version @@ -187,7 +191,7 @@ Getting the stable release announced f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows") 3. Update the ChangeLog file for the given major version -f.e. ``ChangeLog-4.php`` from the NEWS file +f.e. ``ChangeLog-5.php`` from the NEWS file a. go over the list and put every element on one line @@ -207,9 +211,9 @@ f.e. ``ChangeLog-4.php`` from the NEWS file V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/`` -4. ``cp releases/4_4_0.php releases/4_4_1.php`` +4. ``cp releases/5_4_0.php releases/5_4_1.php`` -5. ``cvs add releases/4_4_1.php`` +5. ``git add releases/5_4_1.php`` 6. Update the ``releases/*.php`` file with relevant data. The release announcement file should list in detail: @@ -232,17 +236,6 @@ to upgrade. php-general@lists.php.net and internals@lists.php.net with a text similar to http://news.php.net/php.internals/17222. -10. Update ``php-bugs-web/include/functions.php`` to include the new version -number, and remove the RC from there. - -11. Update ``qaweb/include/release-qa.php`` - - - Update $QA_RELEASES with the appropriate information, which means bumping - the version number to an upcoming version. - - Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version, - so replace 5.3.7 with 5.3.8 within $QA_RELEASES. - Re-releasing the same version (or -pl) -------------------------------------- @@ -343,6 +343,13 @@ PHP 5.4 UPGRADE NOTES - Since 5.4.5, resourcebundle_create() accepts null for the first two arguments. +- Since 5.4.6, SimpleXMLElement::getDocNamespaces() has and extra parameter which + allows for toggling if the list of namespaces starts from the document root + or from the node you call the method on + +- Since 5.4.7, ctor is always called when new user stream wrapper object is created. + Before, it was called only when stream_open was called. + ============================== 5. Changes to existing classes ============================== @@ -513,6 +520,11 @@ b. Extensions with changed behavior - is_link now works properly for symbolic links on Windows Vista or later. Earlier systems do not support symbolic links. +- As of PHP 5.4.5 and above the COM extension isn't compiled statically in PHP + anymore but shared. It'll still be delivered with the standard PHP release but + must be activated manually with the "extension = php_com_dotnet.dll" directive + in php.ini. + ================== 12. New in PHP 5.4 ================== diff --git a/Zend/ChangeLog b/Zend/ChangeLog deleted file mode 100644 index ef4e71c87a..0000000000 --- a/Zend/ChangeLog +++ /dev/null @@ -1,22097 +0,0 @@ -2005-08-05 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - - * zend_operators.c - tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Antony Dovgal <antony@zend.com> - - * tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c: - Fixed possible memory corryption during compilation of <?php foreach($a as - $b); ?> - - * (PHP_5_0) - zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Jani Taskinen <jani.taskinen@sci.fi> - - * LICENSE: - - Bumber up year - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_strtod.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h - zend_vm.h: - Bump up the year - - * README.ZEND_VM: - Nuked DOS EOLs - -2005-08-02 Dmitry Stogov <dmitry@zend.com> - - * zend_execute_API.c - zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - -2005-08-02 Dmitry Stogov <dmitry@zend.com> - - * bench.php: - Removed warnings - -2005-07-29 Ilia Alshanetsky <ilia@prohost.org> - - * zend_vm_def.h - zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - -2005-07-29 Anantha Kesari H Y <hyanantha@novell.com> - - * acconfig.h - acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_vm_execute.h: - update generated file - -2005-07-28 Andi Gutmans <andi@zend.com> - - * zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-26 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_execute_API.c: - bug #33865 - -2005-07-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - Fix #33853 - -2005-07-22 Dmitry Stogov <dmitry@zend.com> - - * zend.c - zend.c - tests/bug33802.phpt - tests/bug33802.phpt - tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h: - Fixed bug with returning from internal function by reference - -2005-07-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-18 Rasmus Lerdorf <rasmus@lerdorf.com> - - * zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Dmitry Stogov <dmitry@zend.com> - - * zend_API.c - zend_API.h: - Fixed bug in new module statrup mechanism - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * tests/bug33558.phpt - tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/bug33710.phpt: - typo - -2005-07-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky <ilia@prohost.org> - - * zend_compile.c: - Added missing init. - -2005-07-14 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Dmitry Stogov <dmitry@zend.com> - - * (php_5_1_0b3) - zend_execute_API.c - zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky <ilia@prohost.org> - - * zend_vm_def.h - zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-08 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix test when session.save_handler is "user" - -2005-07-07 Dmitry Stogov <dmitry@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_objects.c - zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_stream.c - zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Dmitry Stogov <dmitry@zend.com> - - * zend_execute_API.c - zend_hash.c - zend_hash.h - tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-04 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.h - zend_execute.c - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - - * zend_API.h - zend_execute_API.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-03 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak - -2005-06-30 Dmitry Stogov <dmitry@zend.com> - - * zend_API.c - zend_API.h: - Restored old behavior of zend_statup_module() - -2005-06-29 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix conditions for freeing - - * zend_API.c - zend_API.c: - add comment - - * (PHP_5_0) - zend_execute.c: - fix conditions - -2005-06-28 Antony Dovgal <antony@zend.com> - - * zend_execute.c: - fix leak: when dup was <success>ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix previous patch - - * zend_vm_execute.h: - update - - * zend_execute.c - zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - -2005-06-27 Jani Taskinen <jani.taskinen@sci.fi> - - * zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - -2005-06-27 Stanislav Malyshev <stas@zend.com> - - * zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_exceptions.c - zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-24 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * zend_compile.c - zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * tests/bug30519.phpt - tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-23 Dmitry Stogov <dmitry@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * tests/bug28377.phpt - tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - - * tests/bug32660.phpt - tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * tests/bug30828.phpt - tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * zend_execute.c - tests/bug27268.phpt - tests/bug27268.phpt: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-22 Dmitry Stogov <dmitry@zend.com> - - * (php_5_1_0b2) - zend_builtin_functions.c - zend_builtin_functions.c - zend_execute_API.c - zend_execute_API.c - tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * tests/bug29896.phpt - tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Stanislav Malyshev <stas@zend.com> - - * (php_5_1_0b2) - zend_vm.h - zend_vm_execute.h - zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal <antony@zend.com> - - * (php_5_1_0b2) - zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Dmitry Stogov <dmitry@zend.com> - - * (php_5_1_0b2) - zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * tests/bug33257.phpt - tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen <jani.taskinen@sci.fi> - - * (php_5_1_0b2) - tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov <dmitry@zend.com> - - * tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - zend.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky <ilia@prohost.org> - - * (php_5_1_0b2) - zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-20 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-20 Dmitry Stogov <dmitry@zend.com> - - * (php_5_1_0b2) - zend_object_handlers.c - zend_object_handlers.c: - Fixed possible crash on $x = $obj->$non_string - -2005-06-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (php_5_1_0b2) - zend_reflection_api.c: - - Fix bug #33389 by fixing copying - - * zend_reflection_api.c: - - Show true/flase - -2005-06-19 Derick Rethans <php@derickrethans.nl> - - * tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-17 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/bug29368.phpt - tests/bug30856.phpt - tests/bug30961.phpt - tests/bug31720.phpt - tests/bug32226.phpt - tests/bug33277.phpt: - No short-tags! - -2005-06-17 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - -2005-06-17 Antony Dovgal <antony@zend.com> - - * (PHP_5_0) - zend_API.c - zend_list.c: - MFH: improve error messages in internal classes - - * zend_API.c - zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - -2005-06-17 Dmitry Stogov <dmitry@zend.com> - - * zend_object_handlers.c - zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal <antony@zend.com> - - * zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov <dmitry@zend.com> - - * zend_API.c - zend_API.h - zend_extensions.h - zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Internal functions/methods can now return by reference - - * zend_execute.c: - - Fix TSRM build - -2005-06-16 Dmitry Stogov <dmitry@zend.com> - - * bench.php: - typo - - * zend.h - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_modules.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c - zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Compilation warnings - - * zend_compile.c - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c - zend_execute.h: - export zval getters - -2005-06-16 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Dmitry Stogov <dmitry@zend.com> - - * zend.c - zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/bug32428.phpt: - typofix - -2005-06-14 Ilia Alshanetsky <ilia@prohost.org> - - * bench.php: - more accurate timing function. - -2005-06-14 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen <jani.taskinen@sci.fi> - - * Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * Zend.m4: - typofix - - * Zend.m4 - acinclude.m4: - fix standalone build - -2005-06-13 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Specializer optimization - - * zend.c - zend.h - zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - - * zend_reflection_api.c - tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-11 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to -dev - - * (php_5_1_0b1) - zend.h: - - Go with 5.1.0b1 - -2005-06-10 Dmitry Stogov <dmitry@zend.com> - - * (php_5_1_0b1) - tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * tests/bug31177.phpt - tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - zend_reflection_api.c - zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - zend_execute.c - zend_execute.h - zend_extensions.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - zend_compile.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * tests/bug33277.phpt: - add test for this TBF bug - - * zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov <dmitry@zend.com> - - * zend.c - zend.c - zend_execute_API.c - zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev <stas@zend.com> - - * tests/bug33277.phpt - tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Dmitry Stogov <dmitry@zend.com> - - * zend.c - zend.c: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * zend_language_scanner.l - zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - -2005-06-08 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * zend_compile.c - zend_compile.c: - Fixed valgrind errors - - * zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c: - Fixed lookups for previos opcodes - - * zend_execute_API.c - zend_execute_API.c - tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * tests/bug30140.phpt - tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/bug32322.phpt - tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * tests/bug30820.phpt - tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - - * tests/bug30961.phpt - tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen <jani.taskinen@sci.fi> - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky <ilia@prohost.org> - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen <jani.taskinen@sci.fi> - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky <ilia@prohost.org> - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov <dmitry@zend.com> - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-06 Derick Rethans <php@derickrethans.nl> - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - - * zend_objects_API.c - zend_objects_API.c - tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * tests/bug32799.phpt - tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * tests/bug32596.phpt - tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - - * (PHP_5_0) - tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * tests/bug32993.phpt - tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - - * tests/bug33171.phpt - tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - -2005-06-06 Wez Furlong <wez.php@thebrainroom.net> - - * zend_language_scanner.l: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_stream.c - zend_stream.h - tests/halt01.phpt - tests/halt02.phpt - tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Dmitry Stogov <dmitry@zend.com> - - * tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * (PHP_5_0) - zend.c - zend_execute_API.c - tests/bug30394.phpt - tests/bug30394.phpt: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * zend_compile.c - zend_compile.c - tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * tests/bug30080.phpt - tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_execute.c - tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * tests/bug27598.phpt - tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * tests/object_handlers.phpt - tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-01 Dmitry Stogov <dmitry@zend.com> - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30791.phpt: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * tests/bug30791.phpt - tests/bug30791.phpt: - - file bug30791.phpt was initially added on branch PHP_5_0. - -2005-05-31 Magnus Määttä <novell@kiruna.se> - - * tests/bug27304.phpt: - Fix test - -2005-05-31 Dmitry Stogov <dmitry@zend.com> - - * zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-29 Jani Taskinen <jani.taskinen@sci.fi> - - * Zend.m4: - - Unify the "configure --help" texts - -2005-05-29 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * Zend.m4 - acinclude.m4: - avoid code duplication in bison version test - -2005-05-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-27 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug22836.phpt - tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-26 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute_API.c - tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * tests/bug33116.phpt - tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_reflection_api.c - tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - tests/bug27304.phpt - tests/bug32981.phpt: - - Add new tests - - * tests/bug27304.phpt - tests/bug27304.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - - - Add new tests - -2005-05-22 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Stanislav Malyshev <stas@zend.com> - - * zend.c - zend.c: - fix leak - -2005-05-19 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_object_handlers.c: - Backported fix for bug #30451 - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev <stas@zend.com> - - * zend.c - zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - tests/bug29890.phpt: - test - - * tests/bug29890.phpt - tests/bug29890.phpt: - - test - - * zend_execute_API.c - zend_execute_API.c: - fix #29890 - crash when function call fails - - * zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * zend_object_handlers.c: - fix #30451 static properties don't work properly - - * tests/bug29689.phpt - tests/bug30451.phpt: - tests - - * tests/bug29689.phpt - tests/bug29689.phpt - tests/bug30451.phpt - tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Määttä <novell@kiruna.se> - - * tests/bug31828.phpt - tests/bug32080.phpt: - Fix tests. - -2005-05-13 Antony Dovgal <tony2001@phpclub.net> - - * (PHP_5_0) - zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-06 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_object_handlers.h: - typofix :) - -2005-05-05 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31525.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - - * tests/bug31525.phpt - tests/bug31525.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - -2005-05-04 Stanislav Malyshev <stas@zend.com> - - * zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - zend_execute.c: - clarify some magic - -2005-05-04 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * tests/bug30707.phpt - tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - zend_execute.c: - ws - - * tests/bug30162.phpt - tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Dmitry Stogov <dmitry@zend.com> - - * tests/unset_cv07.phpt: - Fixed notice message - -2005-05-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - tests/bug32252.phpt: - - Add test - -2005-05-03 Dmitry Stogov <dmitry@zend.com> - - * zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - - * tests/bug32296.phpt - tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - -2005-05-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-04-29 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_object_handlers.c: - compile fix - - * tests/bug30332.phpt - tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov <dmitry@zend.com> - - * zend_API.c - zend_API.c - tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * tests/bug30332.phpt - tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_execute.c - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt - tests/bug32852.phpt - tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - -2005-04-29 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/bug22836.phpt - tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - -2005-04-28 Dmitry Stogov <dmitry@zend.com> - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - - * tests/bug29015.phpt - tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - -2005-04-27 Dmitry Stogov <dmitry@zend.com> - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * zend_compile.c - zend_compile.c - tests/bug29104.phpt - tests/bug29104.phpt - tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - - * tests/bug32674.phpt - tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov <dmitry@zend.com> - - * tests/bug30889.phpt - tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * tests/bug32429.phpt: - fix - - * zend_API.c - zend_API.c - tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * tests/bug30702.phpt - tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * zend_builtin_functions.c - tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-25 Andrei Zmievski <andrei@gravitonic.com> - - * zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Dmitry Stogov <dmitry@zend.com> - - * tests/bug29944.phpt - tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - - * zend_compile.c - zend_compile.c - tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_hash.c: - ws - -2005-04-25 Dmitry Stogov <dmitry@zend.com> - - * zend_hash.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - zend_hash.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Correct grammar. - -2005-04-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug29674.phpt - tests/bug30161.phpt - tests/bug30346.phpt: - - Add new tests - -2005-04-21 Jani Taskinen <jani.taskinen@sci.fi> - - * tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - -2005-04-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_compile.c - zend_exceptions.c: - No c++ comments in C code - -2005-04-18 Dmitry Stogov <dmitry@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c - zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Fix special cases of property_exists() - - * zend_object_handlers.c: - - Fix logic - -2005-04-16 Sara Golemon <php@alphaweb.net> - - * tests/method_exists.phpt: - method_exists() regression test - - * zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski <andrei@gravitonic.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-12 Stanislav Malyshev <stas@zend.com> - - * zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_operators.c: - - Fix memory corruption found by rob - - * tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - - * zend_builtin_functions.c: - - Add property_exits() - - * zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - - * zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * zend_object_handlers.c - zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-07 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_alloc.c - zend_alloc.h: - - Nuke the code duplication - - * zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Zeev Suraski <zeev@zend.com> - - * (PHP_5_0) - zend_alloc.c - zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * zend_alloc.c - zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-04 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-03 Jani Taskinen <jani.taskinen@sci.fi> - - * (PHP_5_0) - zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-03-31 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-26 Jani Taskinen <jani.taskinen@sci.fi> - - * zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - -2005-03-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_vm_execute.h: - - Second part of removing temp solution - - * zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-23 Andrei Zmievski <andrei@gravitonic.com> - - * zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-21 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug31102.phpt: - - Added missing description (thanks jani) - - * tests/bug31102.phpt: - - Add new test - -2005-03-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * zend_object_handlers.c: - - Fix #31185 - - * zend_execute_API.c: - - Fix all incarnations of bug #30266 - -2005-03-19 Andi Gutmans <andi@zend.com> - - * zend_interfaces.c - zend_interfaces.h: - - Fix typos - -2005-03-16 Wez Furlong <wez.php@thebrainroom.net> - - * (PHP_5_0) - zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong <wez.php@thebrainroom.net> - - * zend.c - zend_API.c - zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-14 Zeev Suraski <zeev@zend.com> - - * zend_ini.c: - Clarify logic - -2005-03-14 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c: - ws - -2005-03-13 Stanislav Malyshev <stas@zend.com> - - * zend_stream.c - zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - - Actually this is a much better error decription - - * zend_execute_API.c - tests/bug32290.phpt - tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_vm_def.h - zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-11 Anantha Kesari H Y <hyanantha@novell.com> - - * (PHP_5_0) - acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug32252.phpt: - - Add new test - - * tests/bug27145.phpt - tests/bug27145.phpt: - - Irrelevant - - * zend_object_handlers.c: - - Don't touch refcount/is_ref - -2005-03-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug28442.phpt - tests/bug28442.phpt: - - - Bugfix #28442 - - * zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y <hyanantha@novell.com> - - * (PHP_5_0) - acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - zend.h: - NetWare can make use of ./configure generated zend_config.h - - * (PHP_5_0) - Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_vm_execute.h: - - #31562 2nd part - - * zend_vm_def.h: - - Fix #31562 - -2005-03-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.h - zend_compile.c - zend_interfaces.c - zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * tests/bug32226.phpt - tests/bug32226.phpt: - - - Add updated description - - * zend_builtin_functions.c - tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l - zend_language_scanner.l: - Revert // </script> patch - -2005-03-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Fix by Tim - -2005-03-06 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_compile.c - zend_compile.c: - Fixed compile warning (bug #32046) - - * zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31672 (</script> not considered closing tag if - MFH: preceded by one-line comment) - - * zend_language_scanner.l: - Fix the fix for one line comments with <script..> </script> tags - -2005-02-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_object_handlers.c: - - If silence if wanted we do not error out - - * zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * zend_API.h: - - These must be initailized - - * zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * Zend.m4: - - Cache the version check results - -2005-02-24 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l: - - Make one line comments work the same with <script ...> </script> as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag </script > but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - - * zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans <andi@zend.com> - - * zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-23 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev <stas@zend.com> - - * zend.h - zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * Zend.m4: - Fix cross-compile - - * acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Anantha Kesari H Y <hyanantha@novell.com> - - * zend.h: - NetWare can include autoconf generated config headers - - * acconfig.h: - NetWare can make use of the configure script generated header file. - -2005-02-21 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * Makefile.am: - - Add missing entry. - -2005-02-20 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa <rui_hirokawa@ybb.ne.jp> - - * (PHP_5_0) - zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * zend_API.c: - - No C++ ruleZ here - - * zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * zend_API.c: - - Incrementation is done elsewhere - - * zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - Zend.m4 - zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * Zend.m4 - zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c - zend_reflection_api.c: - - Be more gracious in reflection API - - * zend_language_scanner.l: - - Fix doc comment handling - -2005-02-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Cleanup foreach handling - -2005-02-10 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_strtod.c - zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-07 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - -2005-02-06 Zeev Suraski <zeev@zend.com> - - * (PHP_5_0) - zend_ini_scanner.l: - Correct fix for #28803 - - * zend_ini_scanner.l: - Correct fix for #28804 - -2005-02-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-04 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * zend_API.c - zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-03 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l - zend_ini_scanner.l: - ws fix - -2005-02-02 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * tests/bug31720.phpt: - test for Bug #31720 - - * tests/bug31720.phpt - tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov <dmitry@zend.com> - - * zend.h - zend.h - zend_object_handlers.c - zend_object_handlers.c - tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - - * tests/bug31683.phpt - tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - -2005-02-01 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * tests/bug_debug_backtrace.phpt - tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - -2005-01-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-25 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - -2005-01-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_execute.c - zend_interfaces.c - tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * zend_interfaces.c - zend_vm_def.h - zend_vm_execute.h - tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * Makefile.frag: - - Fix dependency - - * zend_vm_def.h - zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_vm_def.h - zend_vm_execute.h - tests/bug30725.phpt: - - Second and last part of #30725 fix - - * zend_interfaces.c: - - Allow getIterator() to fail - - * tests/bug30725.phpt: - - - Add new test - -2005-01-22 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - Zend.m4 - configure.in - zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - - * Zend.m4 - configure.in - zend_strtod.c: - - Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h - zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-20 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend.h - zend_constants.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - -2005-01-19 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - -2005-01-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_ini_parser.y: - - Fix memleak - -2005-01-18 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - - * zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - -2005-01-17 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - -2005-01-15 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend_API.c: - - Fix WS - - * (PHP_5_0) - zend_API.c: - - Change to using DL_UNLOAD macro. - - * zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-13 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-12 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt - tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * tests/bug31098.phpt - tests/bug31436.phpt: - - - Test renaming - - * zend_vm_execute.h - tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-10 Rasmus Lerdorf <rasmus@lerdorf.com> - - * zend.h - zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * header - zend_arg_defs.c - zend_strtod.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - - Added missing header sections. - - * acinclude.m4 - configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - -2005-01-09 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include <some_header.h> to make sure the correct file is - used. - - * zend.h: - - Fix outside-source-tree builds. Always include generated header files - with #include <some_header.h> to make sure the correct file is used. - - * zend.c: - MFB: - Rationalize code a bit - -2005-01-03 Stanislav Malyshev <stas@zend.com> - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2004-12-30 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - MFH: - Fixed bug #28930 (PHP sources pick wrong header files generated by - bison). - - * zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - - Fixed bug #28930 (PHP sources pick wrong header files generated by bison) - - * Zend.m4 - acinclude.m4: - MFB_4_3: Quote macro names in AC_DEFUN() - -2004-12-27 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - MFB - - * (PHP_5_0) - zend_builtin_functions.c: - Fix desc - -2004-12-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: Need to unmangle the class name here - - * zend_reflection_api.c: - - Need to unmangle the class name here - -2004-12-27 Zeev Suraski <zeev@zend.com> - - * (PHP_5_0) - zend_exceptions.c: - Add descriptions - -2004-12-27 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug22836.phpt - tests/bug22836.phpt - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to use one space - -2004-12-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - More proto/error message fixes - - * zend_reflection_api.c: - - Small fixlet (by Tony) - -2004-12-24 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h - zend_vm_execute.h: - New sarbage collector's bug was fixed (the behavior should be the same as - in PHP_5_0) - - * zend_execute.c - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 - -2004-12-21 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - zend_strtod.c: - MFH: - Use correct header files (in c99 compliant way). uint32_t is - preferred. - - * zend_strtod.c: - - Use correct header files (in c99 compliant way). uint32_t is preferred. - -2004-12-20 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_strtod.c: - Better fix for endian compile problems. - -2004-12-17 Andi Gutmans <andi@zend.com> - - * zend_object_handlers.c: - - Fixed Bug #30562 Segmentation fault with __call() - -2004-12-17 Derick Rethans <php@derickrethans.nl> - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed strtod for Irix and some other strange platform - -2004-12-16 Derick Rethans <php@derickrethans.nl> - - * zend_strtod.c - zend_strtod.c: - - MF43: Make it compile on HPUX on Itanium 2 - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed bug #31107 (strtod on solaris9/intel) - -2004-12-16 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * (PHP_5_0) - ChangeLog: - - MFH: Fix typo (avaliable -> available). (bug #28725) - - * ChangeLog: - - Fix typo (avaliable -> available). (bug #28725) - -2004-12-16 Derick Rethans <php@derickrethans.nl> - - * zend_strtod.c: - - MF43: Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - - * (PHP_5_0) - zend_strtod.c: - - Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - -2004-12-15 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - 5.0.4-dev - - * (PHP_5_0) - zend.h: - - Redo 5.0.3 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - Roll PHP 5.0.3 - -2004-12-14 Derick Rethans <php@derickrethans.nl> - - * zend_strtod.c - zend_strtod.c: - - MFH: Fixed compile error related to bug #28605. - -2004-12-13 Derick Rethans <php@derickrethans.nl> - - * zend_operators.c: - - Added "G" modifier to ini setting number format. - -2004-12-10 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.3RC2 - -2004-12-07 Dmitry Stogov <dmitry@zend.com> - - * zend_exceptions.c - zend_exceptions.c: - Fixed bug #30904 (segfault when recording soapclient into session). - -2004-12-06 Stanislav Malyshev <stas@zend.com> - - * tests/bug30998.phpt: - add test - - * zend.c - zend.c: - port fix for #30998: Crash when user error handler returns false on amd64 - -2004-12-06 Dmitry Stogov <dmitry@zend.com> - - * zend_compile.c - zend_compile.c - tests/bug30922.phpt: - Fixed bug #30922 (reflective functions crash PHP when interfaces extend - themselves) - - * tests/bug30922.phpt - tests/bug30922.phpt: - - file bug30922.phpt was initially added on branch PHP_5_0. - -2004-12-06 Stanislav Malyshev <stas@zend.com> - - * (PHP_5_0) - zend_builtin_functions.c: - if fetch called not from PHP function, ptr can be NULL - -2004-12-01 Ilia Alshanetsky <ilia@prohost.org> - - * zend_strtod.c: - MFB: Removed extra space that causes problems for some compilers. - - * (PHP_5_0) - zend_strtod.c: - Removed extra space that causes problems for some compilers. - -2004-12-01 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_strtod.c: - - revert unwanted change - - * zend_strtod.c - zend_strtod.c: - - Fixed MacOSX compilation (Patch by Christian) - - * (PHP_5_0) - zend.h: - - And in Zend/ too. - -2004-12-01 Dmitry Stogov <dmitry@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug29883.phpt - tests/bug29883.phpt - tests/bug29883.phpt: - Fixed bug #29883 (isset gives invalid values on strings). - -2004-11-30 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - Go with 5.0.3RC1 - -2004-11-29 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_operators.c: - - MF43: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - - * zend_operators.c: - - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - -2004-11-25 Zeev Suraski <zeev@zend.com> - - * (PHP_5_0) - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_object_handlers.c - zend_object_handlers.h: - Reverting get_method() signature change - -2004-11-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults) - - * tests/bug30856.phpt: - - - Add new test - -2004-11-17 Stanislav Malyshev <stas@zend.com> - - * (PHP_5_0) - zend_execute_API.c: - fix #30543 - - * zend_execute_API.c: - fix crash - -2004-11-16 Derick Rethans <php@derickrethans.nl> - - * zend_strtod.c - zend_strtod.c: - - Make this compile for the Mac again - -2004-11-15 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_strtod.c: - - MFH: Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - - * zend_strtod.c: - - Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - -2004-11-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_reflection_api.c: - MFH #30783 Apache crash when using ReflectionFunction::getStaticVariables() - MFH proto fixes - - * zend_reflection_api.c: - - Bugix #30783: Apache crash when using - ReflectionFunction::getStaticVariables() - -2004-11-09 Andrei Zmievski <andreiz@gravitonic.com> - - * zend_ini_parser.y: - Revert inadvertent commit. - - * zend_ini_parser.y: - .dylib extension are Mach-O shared libraries that meant for linking - against. Loadable modules (aka bundles) can have any extension, so we - should probably stick with .so - - http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod - -2004-11-05 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_execute_API.c: - - Fix for bug #30367, #30490 and possibly #30011. - -2004-11-04 Edin Kadribasic <edink@emini.dk> - - * Zend.dsp - ZendTS.dsp: - Added zend_strtod.* to the build - - * zend_strtod.c - zend_strtod.h: - Make zend_strtod compile on windows - -2004-11-04 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * (PHP_5_0) - Makefile.am: - - MFH: Add entry for zend_strtod.c in belief that this is still active. - - * Makefile.am: - - Add entry for zend_strtod.c in belief that this is still active. - -2004-11-03 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * Zend.m4: - - Don't show grep outputs - -2004-11-03 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - MFH: Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - - * zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - -2004-11-03 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * Zend.m4 - zend.h - zend_execute.c: - - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't - support weak symbol aliasing at this time. - -2004-11-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Trying to invoke function not methot here - - * zend_reflection_api.c: - - Fix invokeargs() with static methods - -2004-11-03 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_def.h - zend_vm_execute.h: - Fixed "isset() and the new VM" bug. - -2004-11-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * (PHP_5_0) - zend_API.c: - MFH: Patch by Joe Orton <jorton@redhat.com>. - - * zend_API.c: - Patch by Joe Orton <jorton@redhat.com>. - -2004-10-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Add ReflectionFunction::invokeArgs(array) - - Add ReflectionMethod::invokeArgs(obj, array) - -2004-10-31 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Invokation -> Invocation - -2004-10-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.h: - Bump version (as discussed with Andi) - - * (PHP_5_0) - zend_execute.c: - - Fix (readd function name which got lost during earlier comit) - - * zend_reflection_api.c: - - Be consistent and use names as keys (found by johannes) - - * zend_extensions.h - zend_modules.h: - - Bump API version - - * (PHP_5_0) - zend_extensions.h - zend_modules.h: - Bump api after latest changes - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - MFH change zend_object_handlers->get_method() - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_vm_def.h - zend_vm_execute.h: - - Change zend_object_handlers->get_method() to allow aggregation for - internal classes - - * Makefile.frag: - - New architecture needs one more dependency - - * zend_exceptions.c - zend_reflection_api.c: - - Fix protos - -2004-10-29 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - For Ilia: - - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - Hope this works well. I will MFH tomorrow if no one complains. - -2004-10-28 Dmitry Stogov <dmitry@zend.com> - - * README.ZEND_VM - zend_vm_gen.php: - --without-lines changed to --with-lines - -2004-10-28 Andi Gutmans <andi@zend.com> - - * zend_vm_execute.skl - zend_vm_gen.php: - - Fix typo - -2004-10-27 Andi Gutmans <andi@zend.com> - - * zend_vm_opcodes.h: - - Oops missed this one - - * zend_operators.c: - - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a - boolean). - - Need to discuss where the real problem is. - - * README.ZEND_VM: - - Tiny fixes - - * README.ZEND_VM - zend_compile.h - zend_vm_execute.h - zend_vm_gen.php: - - Improve comments, docs, code... - -2004-10-26 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Patch from Andrey Hristov: - I have cooked a small patch which allows is_subclass_of() the accept - not only an object as first parameter but a string as well. When string - is passed the function checks whether the class specified is subclass of - the second parameter - class a{} - class b{} extends a{} - is_subclass_of("a", "a") //false - is_subclass_of("b", "a") //true - currently only objects are allowed as first parameter - -2004-10-26 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_operators.c: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - * zend_operators.c: - Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). - -2004-10-23 Andi Gutmans <andi@zend.com> - - * zend_vm_execute.h: - - Add missing file - -2004-10-22 Andi Gutmans <andi@zend.com> - - * zend_vm_handlers.h - zend_vm_spec.h: - - Nuke another two files - - * Makefile.frag - zend_execute.c - zend_vm.h - zend_vm_def.h - zend_vm_execute.skl - zend_vm_gen.php: - - Commit new VM - - Old one is tagged as PRE_NEW_VM_GEN_PATCH - - Still doing work so more commits to come. Don't complain (yet) :) - - * (PRE_NEW_VM_GEN_PATCH) - zend_execute.c: - - Fix crash (MFB PHP5_0) - -2004-10-21 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend_execute.c: - - Fix bug #30395 (Apache Child Segmentation fault in specific PHP-Code) - -2004-10-20 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - If object handles are equal then save the comparison of properties in - - the == operator. - -2004-10-18 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_modules.h: - including zend_compile.h for NetWare as NetWare uses MetroWerks Code - warrior compiler which does not allow declarations of following kind - before defining the types. - extern struct _zend_arg_info first_arg_force_ref[2]; - -2004-10-16 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - One more test (WS) - - * zend_compile.c: - - WS fix to test commit - -2004-10-16 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_compile.c - zend_compile.c: - Fix for 30457 - -2004-10-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Allow to omit object/classname in get_parent_class() which makes it - compatible with the signature and behavior of get_class() - -2004-10-13 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Don't allow access modifiers in interfaces. Explicitly stating public - - should also be disallowed but we don't have a way to detect it today. - -2004-10-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - Bug #30381 Strange results with get_class_vars() - - * (PHP_5_0) - zend_builtin_functions.c: - MFH Fix visibility of get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix visibility in get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix set_exception_handler - -2004-10-10 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * .cvsignore - tests/.cvsignore: - Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. - -2004-10-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Revert automatic pass arg_info - -2004-10-08 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix BC break with default in switch() having to be at the end. - -2004-10-08 Anantha Kesari H Y <hyanantha@novell.com> - - * acconfig.h - zend_config.nw.h: - explicitly including sys/select.h as NetWare LibC sys/types.h does not - include sys/select.h implicitly as other LibC - -2004-10-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Fix Bug #30344 - -2004-10-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Add arginfo ZEND_ARG_SEND_AUTOMATIC which lets the compiler automatically - determine whether pass by ref is possible or pass by value is needed. - -2004-10-05 Dmitry Stogov <dmitry@zend.com> - - * tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv07.phpt: - Test files are fixed. - - * zend_execute.c - zend_vm_handlers.h - tests/unset_cv11.phpt: - Fixed unset() bug that was introduced with CV optimization patch - - * zend_execute_API.c - zend_vm_handlers.h - tests/unset.inc - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv05.phpt - tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - Added test cases for CV optimization patch - -2004-10-04 Andi Gutmans <andi@zend.com> - - * zend_API.h - zend_execute_API.c: - - Rename delete_global_variable() to zend_delete_global_variable() - - * Zend.m4 - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c - zend_vm.h - zend_vm_handlers.h - zend_vm_spec.h: - - Commit the variable fetch optimization. - - Extensions which delete global variables need to use new special - function - - delete_global_variable() (I'm about to rename it) to remove them. - - Will post to internals@ or via commit messages if there's anything else. - -2004-10-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Bugfix #27798 - - * tests/bug27798.phpt: - - - Add new test - -2004-10-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - tests/bug28444.phpt - tests/bug29368.phpt: - - Add new tests - - * tests/bug28444.phpt - tests/bug29368.phpt: - - - Add new test - -2004-10-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * Makefile.frag: - - Add makefile fragment which simplifies working on the executer - -2004-09-30 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Small improvement to DVAL_TO_ZVAL macro - -2004-09-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - MFB (synch correctly not only for one problem) - - * zend_API.c: - - Refix the fix - -2004-09-29 Andi Gutmans <andi@zend.com> - - * bench.php - tests/bench.php: - - Move bench.php to Zend/ - -2004-09-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_objects.c: - Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) - -2004-09-28 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Return the warning until we check if we can change the type of str.len - -2004-09-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c - zend_reflection_api.h: - - publish reflection_class_factory() as zend_reflection_class_factory() - -2004-09-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_reflection_api.c: - MFH fix several property handling issues - - * zend_reflection_api.c: - - Make internally used properties read-only and fix default properties - - * zend_exceptions.c: - - Fix memeleak - - * zend_reflection_api.c: - - Declare properties - -2004-09-27 Andi Gutmans <andi@zend.com> - - * README.ZEND_VM: - - Document zend_vm_use_old_executor() for Derick. - -2004-09-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Fix Reflection_Class to ReflectionClass in docu/messages - - * zend_execute_API.c: - - Fix warning - - * zend_compile.c - zend_stream.c: - - Fix warning - - * zend_builtin_functions.c - zend_reflection_api.c: - - Fix warnings - - * zend_interfaces.c: - Fix warnign - -2004-09-27 Andi Gutmans <andi@zend.com> - - * zend_variables.c - zend_variables.h: - - Use zval_ctor_func() for wrapper and update the prototype to void - - * zend_variables.c - zend_variables.h: - - Make zval_copy_ctor() return void like dtor(). No one ever checks the - - return value which is SUCCESS always. - -2004-09-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.h - zend_variables.h: - - Fix build - -2004-09-26 Andi Gutmans <andi@zend.com> - - * zend.h - zend_variables.c - zend_variables.h: - - Apply Thies and Sterling's patch which doesn't call ctor/dtor functions - - for types which don't require it (BOOL/NULL/LONG/DOUBLE) - - Breaks serialization!!! - -2004-09-24 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_API.c: - selectively avoiding module cleanup code for apache 1 build and removing a - duplicate code - -2004-09-24 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_spec.h: - Fixed specializer bug. - -2004-09-23 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - PHP 5.0.3-dev - - * zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_opcode.c - zend_vm.h: - - Commit new VM architecture. This one allows people (aka Derick) to - - ask the engine to use function handler mode. Will update the README - - about that. - - * (PHP_5_0) - zend.h: - - Roll 5.0.2 - -2004-09-23 Ilia Alshanetsky <ilia@prohost.org> - - * tests/bug20240.phpt: - Fixed test. - -2004-09-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Bugfix # 30209 - -2004-09-23 Andi Gutmans <andi@zend.com> - - * tests/bench.php: - - Commit synthetic benchmark - -2004-09-23 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - Reverted the NetWare Specific Stack limit related patches as asked by Andi - -2004-09-22 Anantha Kesari H Y <hyanantha@novell.com> - - * zend_execute_API.c - zend_globals.h: - NetWare specific stack limit checks - - * zend_API.c: - Aligned the ifdef NETWARE blocks to first column. - - * zend_execute.c: - Stack limit will be checked while executing the script - - * zend_config.nw.h: - To avoid redefinition (of free, alloca etc.) compilation errors in Zend. - - * zend_API.c: - When Apache is unloaded, it calls dlclose on all the PHP extensions - that are loaded in memory. In the case of Apache 1.3, this call is - blocking indefinitely. As a work around, this call is bypassed for Apache - 1.3 build on NetWare only. This means that none of the loaded PHP - extensions are unloaded. They will have to be manually unloaded before - re-loading the Apache 1.3 again. - - * zend.h: - defined ZEND_PATHS_SEPERATOR to semicolon for NetWare - - * acconfig.h: - enabled macros to call the proper LibC functions - -2004-09-22 Dmitry Stogov <dmitry@zend.com> - - * zend_vm_handlers.h - zend_vm_spec.h: - Specializer was updated with executor's fixes. - - * zend_execute.c - zend_execute.c: - Fixed bug #29566 (foreach/string handling strangeness (crash)). - - * zend_execute.c: - Fixed bug in fix for bug #29707 - -2004-09-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute.h: - - Fix for bug #29707 - -2004-09-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Bugfix #30146 (ReflectionProperty->getValue() requires instance for static - property) - - * zend_reflection_api.c: - Bugfix #30148 (ReflectionMethod->isConstructor() fails for inherited - classes) - -2004-09-17 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c - zend_objects_API.c - zend_objects_API.h: - fix crash when dtor is fialing on shutdown - -2004-09-16 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - Go with PHP 5.0.2RC1 - - * tests/bug27669.phpt: - - Add test for bug #27669 - -2004-09-16 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_language_parser.y: - ZTS fix. - -2004-09-16 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix bug #27669 (Dmitry). - Fixes: - <? - class A - { - function hello() - { - echo "Hello World\n"; - } - } - $y[0] = 'hello'; - A::$y[0](); - ?> - -2004-09-15 Ilia Alshanetsky <ilia@prohost.org> - - * zend_operators.h: - MFH: Fixed a bug causing ".123" * "90" and alike to return a 0. - - * (PHP_5_0) - zend_operators.h: - Fixed a bug causing ".123" * "90" and alike to return a 0. - -2004-09-15 Derick Rethans <php@derickrethans.nl> - - * zend_config.w32.h: - - Windows support strcoll too. - -2004-09-13 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - Antony Dovgal's error message improvement - #27290 - -2004-09-11 Derick Rethans <php@derickrethans.nl> - - * zend_operators.c - zend_operators.h: - - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions - which - makes them sort based on the current locale. (Derick) - - * (PHP_5_0) - zend_operators.c - zend_operators.h: - - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which - makes - them sort based on the current locale. (Derick) - -2004-09-11 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Resolve undefined behavior (joe at redhat) - -2004-09-10 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - This one fixes rather strange problem - ZE allows multiple declarations - of the same class constant. - - It could be a minor BC break, but I'm sure it's a bug. (Antony Dovgal - aka tony2001) - -2004-09-09 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - - Revert API bump - - * README.ZEND_VM: - - Commit VM explanation. - - * zend.c: - - Recommit - - * zend_API.c - zend_API.h - zend_compile.c: - - Recommit: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - - * zend_extensions.h: - - Recommit: - - Bump the API number to work around this major breakage. - - * ChangeLog - zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_opcode.c: - - Roll back VM commit - -2004-09-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - - Drop namespace relict - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_compile.c: - MFH signature check/method registration - - * zend_API.c - zend_API.h - zend_compile.c: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - -2004-09-09 Derick Rethans <php@derickrethans.nl> - - * zend_extensions.h: - - Bump the API number to work around this major breakage. - -2004-09-09 Dmitry Stogov <dmitry@zend.com> - - * zend_vm.h: - We will use CALL dispatch method for compilers other then GCC. It is more - safe. - -2004-09-09 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - Fix the fix. - -2004-09-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c: - - Fix handling of exceptions in dtors - -2004-09-05 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_ini_parser.y: - Fix reverse dependency - -2004-09-04 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - Don't destroy object when calling overloaded cast method in - - zend_parse_parameters() - -2004-09-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_compile.c: - Fugbix typo. - -2004-08-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - ZEND_CHANGES: - MFH: Add some information about array overloading - - * ZEND_CHANGES: - Add some information about array overloading - -2004-08-30 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix crash #29893 - -2004-08-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - String offset starts with 0, fix isset($str[$len]) - - * (PHP_5_0) - zend_compile.c: - MFH: Bugfix #29882 isset crashes on arrays - - * zend_compile.c: - Bugfix #29882 isset crashes on arrays - -2004-08-27 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - - Fix leak report for 0 byte allocations (Dmitry) - -2004-08-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_compile.c: - MFH: Enforce semantics: Classes cannot extend Interfaces - - * zend_compile.c: - Enforce semantics: Classes cannot extend Interfaces - - * tests/bug29828.phpt: - Fix test: Classes cannot extend Interfaces - - * zend_compile.c: - Drop doubled check - - * zend_compile.c: - - Bugfix #29828 Interfaces no longer work - - * tests/bug29828.phpt: - - Add new test - -2004-08-25 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Add interface_exists() and differentiate between classes and interfaces - (Andrey Hristov) - -2004-08-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - Add missing brackets - -2004-08-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - - Drop unused variable - - * zend_execute_API.c - zend_globals.h: - - Boost up __autoload() calls by caching the lookup - -2004-08-23 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Improve performance of switch() - -2004-08-23 Zeev Suraski <zeev@zend.com> - - * (PHP_5_0) - zend_reflection_api.c: - Fix names - -2004-08-21 Sara Golemon <php@alphaweb.net> - - * zend_compile.c: - Bugfix#29777 Some compilers don't like // style comments - -2004-08-20 Sara Golemon <php@alphaweb.net> - - * zend_ini_parser.y: - Fix compile - -2004-08-19 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Cleanup - - * zend.c - zend_execute_API.c - zend_globals.h: - - Second wave of garbage removal. - - * zend_compile.h - zend_execute.c: - - Stop using garbage. Please let me know if you find any bugs resulting - - of this patch (very likely). (Dmitry, Andi) - -2004-08-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Implement #29728: Reflection API Feature: Default parameter value. - . ReflectionParameter::isDefaultValueAvailable() - . ReflectionParameter::getDefaultValue() - - * zend_reflection_api.c: - - Nedd to work on copy - -2004-08-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Show default value of optional parameters of user defined functions. - -2004-08-18 Andrei Zmievski <andreiz@gmail.com> - - * zend_ini_parser.y: - Forgot to turn off debugging. - - * zend_ini_parser.y - zend_ini_scanner.l: - Re-add my patch for .ini variable access. - -2004-08-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_reflection_api.c: - MFH: Fix bug #29447: Reflection API issues - - * zend_reflection_api.c: - - Fix bug #29447: Reflection API issues - -2004-08-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Remove unnecessary check - -2004-08-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Add missing check - -2004-08-12 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - Back to 5.0.2-dev - - * (PHP_5_0) - zend.h: - - Roll 5.0.1 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC2 - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Don't use magic numbers - - * zend_compile.c - zend_execute.c: - - Significantly improve performance of foreach($arr as $data). (Marcus) - -2004-08-11 Ilia Alshanetsky <ilia@prohost.org> - - * zend_highlight.c: - MFH: Fixed bug #29607 (highlighting code with HEREDOC produces invalid - output). - - * (PHP_5_0) - zend_highlight.c: - Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). - -2004-08-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - More meaningfull error message - -2004-08-11 Derick Rethans <php@derickrethans.nl> - - * (PHP_5_0) - zend_alloc.h: - - MFH: Patch to allow the Zend memory allocators to be disabled. - - * zend_alloc.h: - - Added missing defines. - -2004-08-10 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - - * zend_highlight.c: - Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - -2004-08-10 Andi Gutmans <andi@zend.com> - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC1 - -2004-08-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - - Fix warnings - -2004-08-07 Andi Gutmans <andi@zend.com> - - * zend_alloc.h: - - Commit Derick's patch for allowing Zend to use regular libc memory - - allocation functions. Mainly useful in conjunction with tools such as - - valgrind which enables us to find bugs we might not find with the - - current memory managers boundary protection. - -2004-08-05 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - Eliminate unneeded variable. - -2004-08-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c - tests/bug29523.phpt: - - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) - -2004-08-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES: - Update - - * (PHP_5_0) - zend_builtin_functions.c - tests/bug29505.phpt: - - MFH Bug #29505 get_class_vars() severely broken when used with arrays - - * tests/bug29505.phpt: - - Add new test - - * zend_builtin_functions.c: - - Fixed Bug #29505 get_class_vars() severely broken when used with arrays - -2004-08-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Add methods to check parameter count - - * (PHP_5_0) - zend_compile.c: - MFH Change to use memcmp instead of strcmp - - * zend_compile.c: - - Change to use memcmp instead of strcmp - -2004-08-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix typo - -2004-08-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_parser.y - zend_language_scanner.l: - - Remove all for now - - * zend_compile.c - zend_compile.h - zend_execute_API.c: - MFB: Enforce protocol on magic methods/functions - -2004-08-02 Ilia Alshanetsky <ilia@prohost.org> - - * (PHP_5_0) - zend_execute.c: - MFH: A gentler (performance wise) allocation of buffer for temp variables. - - * zend_execute.c: - A gentler (performance wise) allocation of buffer for temp variables. - -2004-08-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_execute_API.c: - - Enforce protocol on magic methods/functions - -2004-07-30 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute_API.c - zend_ptr_stack.c - zend_ptr_stack.h: - - More ptr_stack optimizations and cleanups - - * zend_alloc.c - zend_alloc.h - zend_execute.c - zend_fast_cache.h - zend_ptr_stack.h: - - Improve performance by inlining zend_ptr_stack_n_push(). var_args can - usually not be inlined by compilers. - -2004-07-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.c: - - Increase performance of *sort() and some internal sort operations. - -2004-07-29 Sara Golemon <php@alphaweb.net> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Revert goto opcode - - * zend_execute.c: - &tmp and label are the same thing, don't free it till we're done with it. - - * zend_compile.c - zend_execute.c: - Plug some memory leaks and promote unknown label to E_ERROR. - If someone tries to jump to a non-existant label execution really - shouldn't try to carry on. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Add goto operator by popular request. - -2004-07-28 Wez Furlong <wez.php@thebrainroom.net> - - * zend_ini.c: - Fix: ini entries for dl()'d modules now work under ZTS - Side-effect: avoid possible crashes when multiple threads load/unload - modules and mess with the global hash table. - -2004-07-28 Andi Gutmans <andi@zend.com> - - * zend.h - zend.h: - - Fix MAC OSX to always use native DSO loading - -2004-07-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_exceptions.c: - - Be specific about visibility - -2004-07-27 Wez Furlong <wez.php@thebrainroom.net> - - * zend_builtin_functions.c: - Fix two possible crashes. Latter is unlikely unless you are doing scary - things, but former looks nasty. - -2004-07-26 Stanislav Malyshev <stas@zend.com> - - * zend_interfaces.c: - quick fix for #29382 - -2004-07-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Show visibility errors (try to fix #29354) - - * (PHP_5_0) - zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - MFH: Fix bug #29368 : The destructor is called when an exception is - thrown from the constructor - - * zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - Fix bug #29368 : The destructor is called when an exception is thrown - from the constructor - - * zend.c - zend.h - zend_execute.h - zend_execute_API.c: - - Execute destructors earlier (Florian Schaper, fschaper at intux org) - - * zend_reflection_api.c: - - Add ReflectionParameter::isOptional() to test whether a parameter is - optional and also show this information in export. - - * zend_exceptions.c: - - Add optional parameters $filename and $lineno to ErrorException - constructor to allow overwriting automatically retrieved information. - -2004-07-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix 0 Byte leak after alloca to emalloc change - -2004-07-22 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Fix bug in handling of protected properties - -2004-07-21 Edin Kadribasic <edink@emini.dk> - - * zend_builtin_functions.c: - Fixed build - -2004-07-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * (PHP_5_0) - zend_builtin_functions.c: - MFH: Fixded #29291: get_class_vars() return names with NULLs - - * zend_builtin_functions.c: - - Fixded #29291: get_class_vars() return names with NULLs - -2004-07-20 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_alloc.c - zend_alloc.h: - - Add safe_pemalloc() - -2004-07-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Fixed bug 28895 again (long live the dead) - -2004-07-20 Zeev Suraski <zeev@zend.com> - - * zend_exceptions.c: - Fix prototypes - - * zend_exceptions.c: - Add descriptions - -2004-07-20 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - add todo - - * (PHP_5_0) - zend_ini.h - zend_ini_parser.y: - export ini parser - -2004-07-19 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Fix prototypes: Reflection_* -> Reflection*. - - * zend_reflection_api.c: - Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise - an ReflectionException instead of returning NULL on failure. - - * zend_reflection_api.c: - Do not use contracted forms. - -2004-07-19 Stanislav Malyshev <stas@zend.com> - - * zend_ini.h - zend_ini_parser.y: - export INI parser - - * zend_object_handlers.c: - __set and __get will be called not only when variable doesn't exist but - also when it's - invisible - -2004-07-19 Andi Gutmans <andi@zend.com> - - * zend_extensions.h - zend_modules.h: - - Bump API number due to empty_string change - - * zend.c - zend.h - zend_API.h - zend_alloc.h - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_variables.c: - - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() - used to return "" and not bool(false). It's not worth keeping it because - STR_FREE() and zval_dtor() always have to check for it and it slows down - the general case. In addition, it seems that empty_string has been - abused - quite a lot, and was used not only for setting zval's but generally in - PHP code instead of "", which wasn't the intention. Last but not least, - nuking empty_string should improve stability as I doubt every place - correctly checked if they are not mistakenly erealloc()'ing it or - calling efree() on it. - NOTE: Some code is probably broken. Each extension maintainer should - check and see that my changes are OK. Also, I haven't had time to touch - PECL yet. Will try and do it tomorrow. - -2004-07-18 Wez Furlong <wez.php@thebrainroom.net> - - * zend_execute_API.c: - No point allocating 0 bytes - -2004-07-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_parser.y - zend_language_scanner.l: - - Speed up by making null/false/true reserved word which allows to drop - an opcode (FETCH_CONSTANT) for every usage. - - * zend_execute.c: - Bugfix #28464 catch() does not catch exceptions by interfaces - -2004-07-16 Ilia Alshanetsky <ilia@prohost.org> - - * zend_operators.h: - MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). - - * (PHP_5_0) - zend_operators.h: - Fixed bug #28800 (strings beginning with "inf" improperly converted). - -2004-07-15 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_alloc.h: - - Improve performance of zend_alloc by stopping the size from being a bit - - field. - -2004-07-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_exceptions.c - zend_exceptions.h: - - Add new class ErrorException to encapsulate errors in exceptions - - * zend_dynamic_array.h: - - Fix prototype - -2004-07-14 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: - be consistent with write_dimension - - * zend_object_handlers.c: - fix #28957 - -2004-07-13 Andi Gutmans <andi@zend.com> - - * zend.h: - - 5.0.1-dev - -2004-07-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_constants.c: - Bugfix #29116 Zend constant warning uses memory after free (jdolecek at - NetBSD dot org) - -2004-07-13 Andi Gutmans <andi@zend.com> - - * (php_5_0_0) - zend.h: - - Roll PHP 5.0.0 - -2004-07-12 Ilia Alshanetsky <ilia@prohost.org> - - * (php_5_0_0RC4) - zend_execute.c: - Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). - -2004-07-12 Andi Gutmans <andi@zend.com> - - * (php_5_0_0RC4) - zend.c: - - Convert zend_class_entry -> zend_class_entry * - -2004-07-10 Jon Parise <jon+php@csh.rit.edu> - - * zend.c: - DragonFly BSD is derived from FreeBSD and requires the same floating point - precision fix. - -2004-07-10 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_hash.c - zend_variables.c: - - Better stability during premature shutdown of request startup - -2004-07-05 Andi Gutmans <andi@zend.com> - - * zend_mm.h: - - Disable zend_mm for 5.0.0 - -2004-07-03 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - - Should fix mem leak with ZEND_MM. I made this change a while ago and - - rolled it back but I don't remember why. Please test! - -2004-07-01 Ilia Alshanetsky <ilia@prohost.org> - - * zend_constants.c: - Do not use alloca() where it can be easily abused by the users. - - -2004-06-25 Wez Furlong <wez.php@thebrainroom.net> - - * zend_stream.c - zend_stream.h: - export zend stream functions for zend extensions under windows - -2004-06-24 Sara Golemon <php@alphaweb.net> - - * zend_execute.c: - Ease off on severity of new error (Using Resources as array offsets) - -2004-06-23 Sara Golemon <php@alphaweb.net> - - * zend_execute.c: - BugFix #28879 Inconsistent behavior between explicit and implicit array - creation. - - Changes: - - Throw E_WARNING "Illegal offset type" when explicitly creating - array elements with objects, arrays, or resorces as indexes. - This matches implicit creation w/ obj/arr indices. - - Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)" - when implicitly creating array with resource as index. (BC) - -2004-06-19 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Reflection_* -> Reflection*. Patch by Timm Friebe. - -2004-06-18 Sara Golemon <php@alphaweb.net> - - * zend_execute.c: - Another typo in converting array index doubles to long. - -2004-06-18 George Schlossnagle <george@omniti.com> - - * zend_builtin_functions.c: - fix for 28213. - - class_name and call_type should be reinitialized on every loop iter. - -2004-06-17 Sara Golemon <php@alphaweb.net> - - * zend_builtin_functions.c: - String length in parse_parameters should be int - -2004-06-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - -2004-06-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_scanner.l: - Need {} here - -2004-06-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_scanner.l: - - Require a single white-space char after /** to start a doc comment that - way we prevent /*** from becoming a doc comment (as requested Derick). - - * zend_API.h: - Add missing declaration - - * zend_reflection_api.c: - Small code layout change - - * zend_language_scanner.l: - Do not require NEWLINE at start of doccomment - - * zend_reflection_api.c: - Bugfix #28699: Reflection api bugs - -2004-06-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP - -2004-06-07 Andi Gutmans <andi@zend.com> - - * zend.h: - - Go back to -dev (Shouldn't need another RC) - - * (php_5_0_0RC3) - zend.h: - - Roll RC3 - -2004-06-06 Stefan Esser <sesser@suspekt.org> - - * zend_compile.h - zend_opcode.c: - Fixed Zend Function Destructor to use correct TSRM handle. - -2004-06-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Fix #28641: Instance of Interface - -2004-06-03 Andi Gutmans <andi@zend.com> - - * (php_5_0_0RC3RC2) - zend.h: - - Prepare for RC3RC2 - -2004-06-02 Andi Gutmans <andi@zend.com> - - * zend_mm.h: - - Don't use ZEND_MM in Windows - -2004-06-02 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix incdec - make value's refcount non-zero when passing to - write_property - otherwise __set caller cleanup could kill it. - -2004-06-01 Andi Gutmans <andi@zend.com> - - * zend.c: - - If user error handler returns "false" then we relay to the built in error - handler - -2004-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Refcount must not be set separatley again. - - * zend_reflection_api.c - zend_reflection_api.c: - Add missing initialization - - * zend_compile.c: - - -2004-05-28 Andrei Zmievski <andreiz@gmail.com> - - * zend.c: - Allow user-defined error handlers to indicate whether default error - handler should be re-invoked, by returning true or false. - -2004-05-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Prevent possible problems with illegal properties - -2004-05-28 Derick Rethans <php@derickrethans.nl> - - * zend_builtin_functions.c: - - Make the default mask for user defined error handlers include ALL errors, - including E_STRICT. - -2004-05-27 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to RC3-dev until we roll final - - * (php_5_0_0RC3RC1) - zend_execute.c: - - Fix problem with exceptions returning from include(). (Dmitry) - - * (php_5_0_0RC3RC1) - zend.h: - - RC3RC1 - -2004-05-26 Wez Furlong <wez.php@thebrainroom.net> - - * zend_object_handlers.c: - Fix leak on systems where alloca isn't really alloca. - -2004-05-26 Andrei Zmievski <andreiz@gmail.com> - - * zend_constants.c: - Avoid unnecessary and silly copying of constant name when registering. - -2004-05-26 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - - Fix memory manager problem - -2004-05-26 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Update Reflection API class names. Whitespace fixes. - -2004-05-25 Andi Gutmans <andi@zend.com> - - * zend_objects_API.h: - - Nuke unused decleration - - * zend_alloc.c - zend_alloc.h: - - More fixes - - * zend_alloc.c - zend_alloc.h: - - Make fix compile. - - * zend_alloc.c - zend_alloc.h: - - Fix memory leak in mem cache in conjunction with Zend MM. How come no one - - noticed this? :) - -2004-05-23 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - - Fix problem with object being destroyed more than once - - * zend_builtin_functions.c: - - Fix the following script (it crashed): - <?php - class ErrorHandler { - function __construct() { - set_error_handler(array(&$this, 'handle')); - } - - function __destruct() { - restore_error_handler(); - } - - function handle($code, $msg, $file, $line, $locals) { - } - } - - new ErrorHandler(); - ?> - -2004-05-20 Wez Furlong <wez.php@thebrainroom.net> - - * zend_exceptions.c - zend_exceptions.h: - Revert; obviously I missed the function at the bottom of the file... - - * zend_exceptions.c - zend_exceptions.h: - Export this, so extensions may throw their own exception objects that - they have already instantiated. - -2004-05-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - Need to operate on module pointer in hash table - -2004-05-18 Wez Furlong <wez.php@thebrainroom.net> - - * zend_execute_API.c: - Fix bug #28438: win32 build fails in non-zts mode - -2004-05-18 Stanislav Malyshev <stas@zend.com> - - * zend_API.c: - Z_TYPE_P is for zvals - -2004-05-18 Wez Furlong <wez.php@thebrainroom.net> - - * zend_API.c: - Register according to the type specified by the module. - (Helps to fix dl() bug) - -2004-05-18 Sara Golemon <php@alphaweb.net> - - * zend_execute.c: - Bugfix#28404 When type is double we need to access dval, not lval - -2004-05-17 Andrei Zmievski <andreiz@gmail.com> - - * zend_ini_parser.y - zend_ini_scanner.l: - Revert the .ini vars patch. Will have to try again next Christmas - apparently. - - * zend_ini_parser.y: - Fix the apparent bug (; at the end of parse rule block). - -2004-05-17 Wez Furlong <wez.php@thebrainroom.net> - - * zend_objects_API.c - zend_objects_API.h: - As discussed with Andi, add this helper API for setting the object pointer - from - within the constructor. - - Please read the comment for notes about how to use it; in general, you - don't - need it, so don't use it. - -2004-05-14 Andrei Zmievski <andrei@gravitonic.com> - - * zend_ini_parser.y - zend_ini_scanner.l: - Adding ability to refer to existing .ini variables from within .ini - files. Example: - - open_basedir = ${open_basedir} ":/new/dir" - -2004-05-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - - Centralize register and hash operations for startup/register_module - in new zend_register_module_ex(). - - * zend_API.c: - - Revert to 1.249 - -2004-05-11 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Don't allow passing NULL to type hinted parameter. - -2004-05-10 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - - Fix comparison of objects - - Clarify convert_object_to_type() - -2004-05-10 Stefan Esser <sesser@suspekt.org> - - * zend_alloc.c: - Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly - problems. - -2004-05-04 Wez Furlong <wez.php@thebrainroom.net> - - * zend_iterators.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add count_elements handler for overloaded objects. - -2004-05-02 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Fix comparison of two objects in non-compatibility mode. - -2004-05-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Don't load modules twice - -2004-04-29 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - Fix bug #27876 - -2004-04-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_exceptions.h: - Fix c++ builds - -2004-04-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - - Optional parameter to class_exists() that can be used to bypass - __autoload() which can be helpfull in __autoload() itself. - - * zend_interfaces.c: - - Fix warnings - - * zend_interfaces.c - zend_interfaces.h - zend_iterators.h: - - no unneccessary retval initialization - - new c-level iterator handler invalidate_current that is optionally - used to clear internal caching like in implementation of Iterator - -2004-04-27 Andi Gutmans <andi@zend.com> - - * zend_reflection_api.c: - - Fix prototypes - -2004-04-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Fix prototype - -2004-04-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - Skip correct amount of stack entries - - * zend_interfaces.c: - Capture potential problem by error message - - * zend_reflection_api.c: - Show number of classes - -2004-04-25 Andi Gutmans <andi@zend.com> - - * zend.h: - - RC3-dev - - * (php_5_0_0RC2) - zend.h: - - RC2 - -2004-04-23 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fixed bug #27923. foreach() without a key should not check if the key - - is a reference (Adam) - -2004-04-21 Andi Gutmans <andi@zend.com> - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC2) - zend.h: - - Prepare for RC2RC2 (if everything is OK especially Zeev's interface - - patch I'll roll RC2 tomorrow). - -2004-04-21 Zeev Suraski <zeev@zend.com> - - * (php_5_0_0RC2RC2) - zend_compile.c: - Restore fatal error in case a method that's supposed to implement an - interface/abstract method, breaks its prototype - -2004-04-20 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Fix bug #27283 - Exceptions where the last catch() statement was - sometimes - - skipped. - -2004-04-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - show ini entries and classes for extensions. - -2004-04-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Retval may not be set when zend_execute() is overloaded - -2004-04-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Handle failure in get_current_data - -2004-04-14 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - - Add comment - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC1) - zend.h: - - RC2RC1 - -2004-04-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_exceptions.c: - Classnames shall start with an uppercase character - -2004-04-13 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - Fix debug_backtrace to show arguments again - We need to merge code from debug_backtrace & debug_print_backtrace at - some point! - -2004-04-13 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - - Fix API no of Engine 2. The first number is the engine version and the - - rest is the API_NO. This way engine2_api_no is always greater than - - engine1_api_no. - - * zend.c - zend_exceptions.c - zend_exceptions.h: - - Add hook for exception handler (Derick) - -2004-04-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - Fix order of macro parameter (synch with other macros) - -2004-04-12 Andi Gutmans <andi@zend.com> - - * OBJECTS2_HOWTO - zend_extensions.h - zend_ini.c - zend_ini.h - zend_modules.h: - - modifyable -> modifiable - -2004-04-09 Andi Gutmans <andi@zend.com> - - * zend_object_handlers.c: - - Fix bug #26441 (When __set() returned a value it corrupted it) - -2004-04-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Bugfix #27519 Reflection_Function constructor crashes with non-existant - function's name - -2004-04-07 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Hopefully fix the debug_backtrace() code. - - * zend_builtin_functions.c: - - Fix crash bug in zend_debug_backtrace(). No idea how come this survived - - for so long.... - -2004-04-04 Ilia Alshanetsky <ilia@prohost.org> - - * zend_objects_API.c: - Removed unused variable. - -2004-04-03 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Patch by Timm Friebe: - It changes - set_exception_handler() to accept the pseudo-type "callable" (instead of - a string referring to a global function). - - - Examples: - set_exception_handler('function_name'); - set_exception_handler(array('class_name', 'static_method')); - set_exception_handler(array($instance, 'instance_method')); - - - This also makes set_exception_handler() more consistent with all the - other callback functionality, e.g. set_error_handler(). - - * zend_operators.c: - - Nuke more old junk - - * zend.h - zend_operators.c - zend_operators.h: - - Nuke code which hasn't been in use for ages. - -2004-04-01 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - MFB: Revert patch for bug #27782. - - * zend_execute.c - tests/bug27731.phpt: - Fixed reversed condition for error reporting. - -2004-03-31 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c: - Fixed BUG in zend_post_incdec_property - -2004-03-31 Andi Gutmans <andi@zend.com> - - * zend_reflection_api.c: - - Fix typo - -2004-03-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug26695.phpt: - Fix test - -2004-03-30 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). - -2004-03-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - TSRM fix - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_globals.h - zend_reflection_api.c: - - Fix Reflection class names - - Add ability to get the extension an internal class was defined in - -2004-03-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * acconfig.h: - NAN==NAN doest work (Ard) - - * zend_builtin_functions.c: - Allow mixed case search for extensions - -2004-03-29 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: - -clonning+cloning - -2004-03-29 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c: - Implicit clonning strict warning was added for ze1_compatibility_mode - -2004-03-29 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c - tests/bug27731.phpt: - Fixed bug #27731 (error_reporting() inside @ block fails to set - error_reporting level). - -2004-03-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Use lowercasing here - - * zend.c: - Initialize the complete struct - -2004-03-28 Stanislav Malyshev <stas@zend.com> - - * zend_language_parser.y: - check writability on =& too - - * zend_execute.c: - - call set handler if assigning to object having this handler - - cleanup: use macros to access object internal vars - - * zend_interfaces.c: - preserve ZEND_API in definition - - * zend_interfaces.h: - declare as extern - -2004-03-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Fix memleak found by Timm - -2004-03-28 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: - centralize object-to-scalar conversion, make it work with get handler - - * zend.c: - try get handler on printable conversion - - * zend_object_handlers.h: - some more clear comments - - * zend_operators.c: - Use macros for object parts access - -2004-03-28 Dmitry Stogov <dmitry@zend.com> - - * zend_execute_API.c: - fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt - passes again) - -2004-03-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Even though it is uncommented it should be right - -2004-03-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_compile.c: - Force destructors to have empty signatures - -2004-03-26 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix build (thanks to Timm) - -2004-03-25 Derick Rethans <php@derickrethans.nl> - - * zend_language_scanner.l: - - Remove old and deprecated <?php_track_vars?> scanner token. - -2004-03-25 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - If __construct() is defined then it will always take precedence over - - old style constructors. - -2004-03-25 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - no need to use result for RECV's - as in PHP4 - - * zend_execute.c: - Use get/set handlers for increment.decrement ops on objects - -2004-03-25 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - /* The compiler is not-reentrant. Make sure we __autoload() only during - run-time - * (doesn't impact fuctionality of __autoload() - */ - -2004-03-25 Dmitry Stogov <dmitry@zend.com> - - * zend_execute_API.c: - Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. - -2004-03-24 Dmitry Stogov <dmitry@zend.com> - - * zend.c - zend_execute_API.c - zend_globals.h: - New autoload protection schema was implemented (Using HashTable instead of - boolean flag) - -2004-03-24 Derick Rethans <php@derickrethans.nl> - - * zend_operators.c: - - Revert bogus commit - - * zend_operators.c: - - Fixed NEWS - -2004-03-24 Dmitry Stogov <dmitry@zend.com> - - * tests/bug27641.phpt: - Fixed bug #27641 (Object cloning in ze1_compatibility_mode was - reimplemented) - - * zend_execute.c - zend_variables.c: - Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was - reimplemented (Dmitry, Andi) - -2004-03-22 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix bug - - * zend_execute.c: - - Remove whitespace - -2004-03-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Improve consistency - -2004-03-21 Stanislav Malyshev <stas@zend.com> - - * zend_objects_API.c - zend_objects_API.h: - return zval *, to make it useful for read_property - - * zend_objects_API.c: - update to new API - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - API change for read_property: - instead of bool silent it now gets fetch type - This can be used for creating proxy objects for write contexts - -2004-03-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Nuke unused code - -2004-03-18 Andi Gutmans <andi@zend.com> - - * zend.h: - - Back to RC2-dev - -2004-03-18 Zeev Suraski <zeev@zend.com> - - * (php_5_0_0RC1) - zend.h: - Prepare to roll RC1 - - * (php_5_0_0RC1) - zend_execute.c: - Fix possible data corruption with __set() - -2004-03-18 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - Improve error message - on E_STRICT, method is actually called, - so the error shouldn't say it cannot be called. - -2004-03-18 Andi Gutmans <andi@zend.com> - - * (php_5_0_0RC1) - zend_compile.c: - - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. - - * (php_5_0_0RC1) - ZEND_CHANGES: - - Update Changes - -2004-03-17 Sascha Schumann <sascha@schumann.cx> - - * zend_multiply.h: - Readd x86 implementation - -2004-03-17 Andi Gutmans <andi@zend.com> - - * (php_5_0_0RC1RC2) - zend_multiply.h: - - Improved patch for support multiplication on 64bit machines - - * (php_5_0_0RC1RC2) - zend_execute.c: - - Fix tiny bug (one of the reasons we can't support __toString() for - - regular objects). - - * (php_5_0_0RC1RC2) - zend.c: - - Stop make_printable_zval() from calling __toString() - - * zend_execute.c: - - Fixed problem with __toString(). Due to the engine's architecture it is - - currently not possible to call __toString() anywhere besides print & - eval. - - Follow up will be on internals@ - -2004-03-17 Stanislav Malyshev <stas@zend.com> - - * (php_5_0_0RC1RC2) - zend_compile.c: - fix typo - -2004-03-17 Andi Gutmans <andi@zend.com> - - * zend_multiply.h - zend_operators.c: - - Apply Ard's patch to support multiplication & overflow on both 32bit - and 64bit machines - -2004-03-16 Derick Rethans <php@derickrethans.nl> - - * zend.c - zend.h - zend_API.h - zend_modules.h: - - Replaced the exec_finished hook by the zend_post_deactive hook for - extensions. The new hook will be run after the symbol table and - destructors - are run. (Derick) - - * zend_modules.h: - - Bump API number so that it actually differs from PHP 4. This is needed - because we don't want PHP 4 and PHP 5 extensions to be in the same - directory - when doing "make install" for shared, or phpize'd extensions. - -2004-03-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - Fix SEGV in certain conditions while calling static methods - -2004-03-16 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h: - Add ability to disable JIT for a particular auto global - -2004-03-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - TSRM fix - -2004-03-16 Sascha Schumann <sascha@schumann.cx> - - * zend.h: - Enable ptr format check for GCC 3.1 and higher - -2004-03-16 Ilia Alshanetsky <ilia@prohost.org> - - * zend.h: - Do not allow 3.0.4 for __attribute__. - - * zend.h: - Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive) - -2004-03-16 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix problem when using old-style constructors it wasn't being inherited - correctly. - -2004-03-16 Derick Rethans <php@derickrethans.nl> - - * zend_execute_API.c: - - Spaces to tabs - -2004-03-16 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - If the called method is static then don't define $this - - * zend_execute.c - zend_execute_API.c: - - Error out if get_method() isn't defined. - - Use calling scope of internal function callee when calling a method - using static syntax (array("A", "func")); - -2004-03-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Improve error message - -2004-03-15 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Restore E_NOTICE for longs and doubles. - -2004-03-15 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend.h: - - Fixed bug #24582 (extensions can not be loaded dynamically in - Solaris/iPlanet) - -2004-03-15 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) - -2004-03-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - Make object parameter optional - -2004-03-14 Ilia Alshanetsky <ilia@prohost.org> - - * zend.c: - Fixed bug #27590 (crash during shutdown when freeing persistent resources - in ZTS mode). - -2004-03-14 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Fix windows build - - * zend_execute_API.c: - - Fix for bug #27504 - - * zend_builtin_functions.c: - - Fixing bug #27123 - - * zend_operators.c: - - Improve compatibility mode and compare objects according to property - - comparison (sucky but this is how PHP 4 behaved). - - * zend.c: - - Fix flow of logic - - * zend_operators.c: - - Support old style of converting objects to long/double/bool. - - This is only enabled in compatibility mode, else it calls cast_object() - - and if that is not available we return 1 (true) so that the following - - code would work: - if ($obj) { - } - -2004-03-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_operators.c: - Fix: Add return type void - -2004-03-14 Andi Gutmans <andi@zend.com> - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Support Cast operator in convert_to_* so that we support internal - - extensions such as SimpleXML. This is for Sterling. - - * zend_operators.c: - - Fix memory leak in the following code (Dmitry): - <?php - $a = array(); - $a .= "x"; - ?> - - * zend_operators.c: - - Initial commit which allows comparing overloaded objects with native - - types (only for internal classes and not for user-land classes). - -2004-03-11 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - - Real fix for bug #27535 (Dmitry) - - * zend_objects_API.c: - - Attempt to fix bug #27535 - -2004-03-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES: - Rename hasMore() to valid() as discussed. (Part VI) - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_interfaces.c - zend_language_parser.y - zend_reflection_api.c: - Clearify the different method/class flags (as discussed with Andi). - - * zend.h: - No longer needed - -2004-03-09 Andi Gutmans <andi@zend.com> - - * zend_constants.c: - - Fix crash: - <?php - class ResourceFormat - { - const IMG = 1; - } - - class Image - { - const RESOURCE_FORMAT = ResourceFormat::IMG; - } - - print_r(constant('Image::RESOURCE_FORMAT')); - ?> - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Nuke unused code. - -2004-03-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_interfaces.c - zend_iterators.h: - Rename hasMore() to valid() as discussed. (Part II) - - * zend_interfaces.c: - Rename hasMore() to valid() as discussed. (Part I) - - * zend_execute_API.c: - Check count. - - * zend_reflection_api.c: - Add another missing conversion - -2004-03-05 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix some small problems I introduce in last patch. - - * zend_compile.c: - - Finally fix the following: - $xml_mem = - simplexml_load_string('<bookbody><part><chapter><page>1</page></chapter></part></bookbody>'); - /* The following works fine */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter->page as $page) { - print $page; - } - } - /* The following segfaults */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter as $chapter) { // Difference here from previous - example - print $chapter; - } - } - -2004-03-04 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_language_scanner.l: - - Fix memleak when scanner is called from within tokenizer extension. - -2004-03-04 Stanislav Malyshev <stas@zend.com> - - * zend_execute.h: - fix the fix - - * zend_execute.h: - oops, fix cut&paste gone bad - - * zend_execute.h: - Fix object true value: if we are in compat mode and it's Zend object - - use PHP4 rules. Otherwise, object is always true. - -2004-03-04 Derick Rethans <php@derickrethans.nl> - - * zend_constants.h - zend_operators.h: - - Fixed a 64bit issue (for zend_builtin_functions.c, module_number is an - int). - - Change the MAX_LENGTH_OF_LONG constant to 20, as LONG_MAX is 20 - characters. - (Patches by Ard Biesheuven) - - * tests/zend_operators.phpt: - - Added instance_of test (patch by Ard Biesheuvel) - -2004-03-04 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - Disallow redefining ctors and cleanup - - * zend_mm.c: - Handle out of memory/bad size situation gracefully, without getting into - loop - -2004-03-03 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - - Fix crash: - <? - class foo { - function __destruct() { - foreach ($this->x as $x); - } - } - new foo(); - echo 'OK'; - ?> - -2004-03-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - Fix zend_parse_method_parameters_ex() and make it consistant with - zend_parse_method_parameters(). - -2004-03-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix leaks (although there might be still a problem here). - - * zend_execute.c: - - Fix leak (Dmitry) - - * zend_compile.c: - - Fix crash in: - <?php - class Foo { - public $attributes= array(); - - function export() { - foreach ($this->attributes as $name => $attr) { - } - } - } - - $f= new Foo(); - $f->export(); - ?> - - * zend_objects.c: - - Improve fix for protecting destructor's from exceptions. - - I was killing the current exception completely which was wrong. - -2004-03-01 Andi Gutmans <andi@zend.com> - - * zend_objects.c: - - Fix crash in destructors(). You can't throw an exception in destructors - as there is no guaranteed time when the destructor will be called. - - * zend_reflection_api.c: - - Fix leak - - * zend_reflection_api.c: - - Fix crash in reflection API (pierre) - - * zend.c - zend_exceptions.c - zend_execute_API.c: - - Fix crash in exception handling (zend_exception_error(...) and - zend_eval_string_ex() were buggy (Dmitry, Andi) - -2004-03-01 Derick Rethans <php@derickrethans.nl> - - * zend_compile.h: - - Typo fix (by Jan) - - * zend_builtin_functions.c: - - Fixed bug #27443 (defined() returns wrong type). - -2004-02-29 Andi Gutmans <andi@zend.com> - - * zend_reflection_api.c: - - Apply fixes by Timm. - - * zend_compile.c: - - Change prototype isA check not to check the constructor. - - Only give an E_STRICT for non-isA compliant code as opposed to - E_COMPILE_ERROR. - -2004-02-29 Stanislav Malyshev <stas@zend.com> - - * zend_compile.h: - add ZEND_API there too for opcode handlers - -2004-02-29 Derick Rethans <php@derickrethans.nl> - - * zend_execute.c: - - Initialize memory to \0 so that we can reliable detect whether a specific - opcode element is in use. - -2004-02-29 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - export opcode table - -2004-02-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_compile.h: - Add some comments - - * zend_API.c - zend_compile.c - zend_execute.c: - Fixes for abstract classes/methods - -2004-02-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_parser.y - zend_language_scanner.l: - Fix __METHOD__ (noticed by Davey Sahfik) - - * zend_reflection_api.c: - Fix problem with Reflection_Property (patch from Timm slightly modified). - -2004-02-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects_API.c: - As Andi found out the dtor may increase the refcount. - -2004-02-25 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_builtin_functions.c: - ws + cs - -2004-02-25 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_execute.c: - Fix leak in foreach ($o->mthd()->arr) - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - - Improve ARG_INFO() macros to support supplying required_num_args - - Initial fix for foreach($o->mthd()->arr) crash (now leaks) - -2004-02-25 Derick Rethans <php@derickrethans.nl> - - * zend_highlight.c: - - Use <span> instead of <font> in highlight_string(). (Patch by - mg@iceni.pl) - -2004-02-25 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_exceptions.c: - Improve error messages - -2004-02-25 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: - - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't - only affect auto-clone). - - Perform implementation checks even with simple inheritance (off when - compatibility mode is enabled). - - Restore default arguments in interfaces and handle it correctly. - - Move registration of internal classes later in the startup sequence - in order to have INI options available. - -2004-02-25 Derick Rethans <php@derickrethans.nl> - - * zend_exceptions.c: - - Fixed bug #27391 (typo in Fatal Error message). - -2004-02-25 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_compile.c - zend_compile.h - zend_opcode.c: - - Abstract methods cannot have defaults for arguments - - Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b) - prototypes - -2004-02-25 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Proto fixes. - -2004-02-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects_API.c: - Fix object destruction/free in shutdown - - set destructor_called even when no dtor is given - - use free_storage even when no dtor hat to be called - - * zend_objects_API.c: - Checking once for dtor is enough - -2004-02-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Fix class flags when handling abstract methods - -2004-02-23 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Improve precendence: - - <?php - - $obj->foo = "Blah"; - - if (!$obj instanceof StdClass) { - print "No"; - } else { - print "Yes"; - } - - * zend_language_parser.y: - - Decrease precedence of instanceof so that the following is true: - php -r 'var_export((object)1 instanceof stdClass);'; - Patch by Jan Lehnardt - -2004-02-22 Derick Rethans <php@derickrethans.nl> - - * zend_operators.c: - - Fixed bug #27354 (Modulus operator crashes PHP). - -2004-02-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES: - Add some more obviously needed information - -2004-02-20 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * zend.h - zend_API.h - zend_iterators.h - zend_operators.h - zend_variables.h: - more EXTERN_C wrapping of ZEND_API prototypes - -2004-02-20 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_opcode.c: - ws fix - -2004-02-18 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * zend.h - zend_builtin_functions.h - zend_extensions.h - zend_indent.h - zend_interfaces.h - zend_object_handlers.h - zend_objects.h - zend_objects_API.h - zend_ptr_stack.h - zend_stack.h - zend_stream.h: - wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C - for C++ extension support - -2004-02-18 Zeev Suraski <zeev@zend.com> - - * zend.c: - Forward-port fixlet from PHP 4 (thanks to Michael Sisolak) - -2004-02-17 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_list.c: - MFB: - Fix bug #26753 (zend_fetch_list_dtor_id() does not check NULL - strings) - -2004-02-16 Derick Rethans <php@derickrethans.nl> - - * ZEND_CHANGES: - - Clearify clone behavior, fixed clone example (Patch by Jan Lehnardt) - -2004-02-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call - -2004-02-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_iterators.c: - dtor's may not be called from free_storage handlers - -2004-02-12 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b4) - zend_execute.c: - - Remove old code - -2004-02-12 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * (php_5_0_0b4) - ZEND_CHANGES: - making sure that the provided examples actualy work (or at least do not - generate no parse errors) unless they are really expected to fail - -2004-02-12 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b4) - zend_object_handlers.c: - - This was too strict. - -2004-02-12 Zeev Suraski <zeev@zend.com> - - * (php_5_0_0b4) - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_interfaces.c - zend_object_handlers.c: - - Check return-by-reference bit when implementing interface prototypes - - Add infrastructure for built-in functions to hint whether they - return by reference or not. It is NOT currently used for anything, - except for interface prototypes (you can use it to request that the - function that implements your prototype returns by reference or - doesn't return by reference). - For downwards compatibility - by default, interface prototypes are - agnostic as to whether the function that implements them returns - by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with - ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - - Fix ArrayAccess::getOffset() to conduct additional checks. - If your getOffset() should work with multidimensional arrays - it - must return by reference. - -2004-02-12 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b4) - zend_object_handlers.h: - - Add comments to read/write property/dimension for extension authors - -2004-02-12 Zeev Suraski <zeev@zend.com> - - * zend_default_classes.h: - zend_default_classes.h -> zend_exceptions.h - -2004-02-12 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b4) - Makefile.am: - - Add zend_exceptions.c - -2004-02-12 Zeev Suraski <zeev@zend.com> - - * (php_5_0_0b4) - ZendTS.dsp - zend.c - zend_default_classes.c - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_reflection_api.c: - Centralize exceptions code in zend_exceptions.[ch]. - Remove zend_default_classes.h (use zend_exceptions.h instead) - - NOTE: This currently breaks the build, fixes to php-src and pecl coming - soon - -2004-02-12 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Use zend_throw_exception_object() in throw_handler to make sure it - - does all the checks - -2004-02-12 Zeev Suraski <zeev@zend.com> - - * zend_default_classes.c - zend_default_classes.h - zend_exceptions.c - zend_exceptions.h - zend_execute.h - zend_execute_API.c: - Exceptions updates: - - - Enforce exceptions to be derived from class Exception. This allows - users to perform catch-all. It's not yet complete, so don't get - comfortable with it just yet :) Updates are coming soon. - - Implement zend_throw_exception() using zend_throw_exception_ex() - -2004-02-12 Andi Gutmans <andi@zend.com> - - * zend_execute.h - zend_execute_API.c: - - Add API function to throw exception by using an object - -2004-02-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Must be initialized in ZTS mode - - * ZEND_CHANGES - ZEND_CHANGES: - Update - - * zend_compile.c - zend_language_parser.y: - Fix: <interface> [extends <interface> [, <ineterface>]* ] - -2004-02-11 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix leaks in assignments to overloaded objects - - * zend_execute.c: - Fix leak with overloaded objects, when they're used just "for the hell - of it" :) - - * zend_execute.c: - Fixed a bug the caused overloaded array indices to be converted to strings - - * zend_execute.c: - Turn off bogus warnings with overloaded dimensions and += (and friends) - - * zend_execute.c: - Improve the implementation of unset() on array dimensions to be more - consistent with that of regular variables and string offsets - - * zend_execute_API.c: - Fix bug #25038 - - * zend_reflection_api.c: - Fix crash (patch by Rob Richards) - - * zend.c - zend_execute_API.c: - Fix exceptions thrown without a stack frame - Always enable set_exception_handler() - - * zend_list.h: - Change FETCH_RESOURCE to return false on error instead of null, for - consistency with other error situations - - * zend_compile.c: - Fix bug #26802 (the right aspects of it found by Marcus, anyway :) - - * tests/bug26802.phpt: - Fix and clarify the test case - - * zend_execute_API.c: - Complete the fix for handling of exceptions happening during the - argument passing phase of function calls (fixes bug #26866) - - * zend_execute_API.c: - whitespace - -2004-02-10 Zeev Suraski <zeev@zend.com> - - * tests/bug26698.phpt: - Ignore the memleak in this test - - * zend_execute.c: - Fix bug #26698 (exceptions handled properly during argument passing to - functions) - - * zend_default_classes.c: - Fix bug #27186 - - * zend_execute_API.c: - Fix bug #26869 - - * zend_execute.c: - Fix refcounting of ++/+= overloading (fix leak in __get()/__set() - based classes) - -2004-02-10 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Nuke more unused code - -2004-02-10 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix handling in assignment using multidimensional array syntax to string - offset ($s = "FUBAR"; $s[0][0] = 1;) - -2004-02-10 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - We will go with PHP 4 behavior. With the new object model assigning by - reference has lost a lot of its importance. - - * zend_compile.c: - - Remove junk - -2004-02-10 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix exception handling in opcodes spanned across multiple oplines (fixes - the crash in __set()) - - * zend_execute.c: - - Fix pre/post increment for overloaded objects - - Fix binary-assign-op for overloaded objects - - NOTE: This requires the implementation of the 'get' callback! - -2004-02-10 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * tests/bug22836.phpt: - - Correcting test. - -2004-02-08 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fix write-mode of overloaded objects when using array dimensions - -2004-02-08 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - - Check if free_storage exists - -2004-02-05 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Committing for Jan. - -2004-02-05 Ilia Alshanetsky <ilia@prohost.org> - - * zend_compile.c - tests/bug27145.phpt: - Fixed bug #27145 (Unmangle private/protected property names before printing - then inside error messages). - -2004-02-04 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Fix exceptions happening inside internal functions called through - zend_user_function() - - * zend_execute_API.c: - Remove double initialization - -2004-02-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.h: - Add new prototype - - * zend_reflection_api.c: - Fix reflection - - * zend_iterators.c: - Fix warnings - -2004-02-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fixlet - - * zend_compile.c: - Fix handling of $this in some cases - - * zend_compile.c: - Handle additional cases - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_language_parser.y: - Reinstate early-binding for classes. - - Note that this is available for downwards compatibility only - and it - doesn't - work if you use new features (namely, interfaces). Generally, people - should - declare their classes before using them, but we just didn't want hell to - break - loose (c) - - * zend_opcode.c: - Optimize - - * zend_compile.c: - - Improve $this assignment detection and generalize some code in - zend_compile.c - - * zend_compile.c: - -Error out when trying to re-assign $this - - * zend_objects_API.c - zend_objects_API.h: - The valid bit was necessary after all - restored - - * zend_objects_API.c: - Fixlets - - * zend_compile.c - zend_objects.c: - - Small fixes - - * zend_execute.c: - - Improve wording - - * zend_execute_API.c - zend_iterators.c - zend_objects.c - zend_objects_API.c - zend_objects_API.h - zend_reflection_api.c: - Change destructor implementation (details will follow on internals@) - -2004-02-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug24884.phpt: - Update tests - - * zend_objects.c: - Nuke unused variable - - * zend_compile.c: - Fix Warning - -2004-02-03 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - clone/__clone() related changes. - -2004-02-03 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Remove unused variable - - * zend_objects_API.c - zend_objects_API.h: - Remove more garbage - valid bit was not really necessary - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c - zend_objects_API.h: - - Clean garbage (delete was nuked a long time ago) - -2004-02-03 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - More unneeded code removed. - -2004-02-03 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_language_scanner.l: - Abort on parse error in an include file (patch by Ilia) - - * zend_compile.c: - Remove redundant code - - * zend_execute.c: - Fix try/catch block logic - - * zend_compile.c - zend_objects.c: - Perform a bitwise copy of the object even when __clone() is defined. - __clone() is back to not requiring any arguments, as $that is no longer - needed ($this already contains a copy of the original object, by the time - we __clone() is executed). - Calling the parent clone is done using parent::__clone() - - * zend_compile.c - zend_compile.h - zend_default_classes.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Rewrote exception support. Fixes a few limitations and bugs in the old - implementation, and allows exceptions to 'fire' much earlier than before. - - Instructions on how to use the new mechanism will follow on internals@ - shortly... - - Note - this (most probably) breaks the current implementation of - set_exception_handler() - -2004-02-02 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_objects.c: - Redesign the clone() feature to fix some fundamental flaws in the previous - implementation. - - Using clone directly is now done using - $replica = clone $src; - - Clone methods must now be declared as follows: - function __clone($that) - { - } - - Clone methods in derived classes can call the __clone method of their - parent - classes using parent::__clone($that) - -2004-01-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Throw an exception in case a reflection object cannot be found and do not - override the exception from constructors in static method calls. - -2004-01-30 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Apply the same parse error handling to (include|require)_once as the one - for - their non-once counterparts. - -2004-01-28 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Tweak checks to detect some additional cases. - Reorder checks to make more sense. - - * zend_compile.c: - - Error message fix - - Prevent inheritance of the same constant from two interfaces - - * zend_compile.c: - Fixlets - - * zend_compile.c - zend_compile.h: - Prevent classes from implementing interfaces that have the same function - - * zend_execute.c: - Whitespace - - * zend_compile.c: - Code relayout - - * zend_execute_API.c: - Forward-port fix for timeouts under Windows - -2004-01-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c - zend_interfaces.h: - - Export struct zend_user_iterator - - Ad 'it' to function prefix to prevent naming clashes - - Export zend_user_it_free_current - -2004-01-25 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Fixed bug #26814 (On parse error include included file, terminate - execution script). - -2004-01-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_iterators.c - zend_iterators.h: - Respect proeprty visibility in foreach - - * tests/bug26696.phpt: - Update test - -2004-01-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling - internal non-static methods statically. - -2004-01-24 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c - zend_execute_API.c: - Change message as proposed by Jon. - -2004-01-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Simplify detection of methods that must be called dynamic (with object) - - * zend_execute.c - zend_execute_API.c: - Disallow calling __clone/__construct/__destruct static - Send an E_STRICT when calling a non static method static - - * zend_API.c - zend_compile.c - zend_compile.h: - Disallow static declaration of clone - -2004-01-23 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_constants.h - zend_ini.h: - Silence some compile warnings - -2004-01-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Fix internal access to exception properties - -2004-01-19 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute.h: - - Hopefully fix bug #26696. - - Please let me know if hell-breaks loose - -2004-01-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - Add zend_get_module_started() to quickly check whether a module is present - and its MINIT function has been called. - -2004-01-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.h - zend_execute_API.c: - Improove debug capabilities - - * zend_reflection_api.c: - Fix some casing issues - -2004-01-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - - - * zend_interfaces.c: - Fix inheritance rule for interface Traversable - -2004-01-17 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * tests/bug26802.phpt: - - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 - -2004-01-17 Ilia Alshanetsky <ilia@prohost.org> - - * zend_object_handlers.c - zend_object_handlers.h: - Expose zend_std_call_user_call(), needed for implementation of things like - __call handlers. - -2004-01-17 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - Nuke compile warning by using the LANG_SCNG macro instead - -2004-01-16 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_reflection_api.c: - - Fixed bug #26640 (__autoload() not invoked by Reflection classes) - - -2004-01-15 Zeev Suraski <zeev@zend.com> - - * zend.c: - Nice patch Christian, but it wasn't at all enabled? :) - - Fix bug #26883 - -2004-01-14 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Don't allow interfaces to implement anything - -2004-01-14 Andi Gutmans <andi@zend.com> - - * zend_operators.h: - - Remove bogus macros - -2004-01-13 Wez Furlong <wez.php@thebrainroom.net> - - * zend_ini_parser.y: - Don't treat strings containing : as potential constant names in - the .ini parser. - This fixes Bug #26893 - -2004-01-12 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Return the PHP 4 behavior of not allowing class declerations within - - class declerations. This happened when declaring a class within a - - method. - class A { - function foo() { - class B { - } - } - } - -2004-01-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - Add missing macro - -2004-01-11 Wez Furlong <wez.php@thebrainroom.net> - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - TSRMLS fix - -2004-01-11 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Re-allow conditional class declerations. Needless to say that I also - - think it's not great coding.. Use polymorphism instead :) - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - - This should fix the problem of conditional function decleration on the - - same line of code not to work. You should re-evaluate your coding style - - if you really code this way :) - -2004-01-10 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Remove conflict - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_operators.c: - Added error mask to set_error_handler() - Patch by Christian Schneider <cschneid@cschneid.com> - -2004-01-09 Wez Furlong <wez.php@thebrainroom.net> - - * acconfig.h: - support for building asm in the unix buildsys. - Also, when ZEND_ACCONFIG_H_NO_C_PROTOS is defined, - omit the C prototypes from the configuration header - so that it can be included into asm files. - -2004-01-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * RFCs/002.txt: - this one is declined - -2004-01-09 Wez Furlong <wez.php@thebrainroom.net> - - * zend_object_handlers.h: - must be extern to avoid problems with some compilers - -2004-01-09 Stanislav Malyshev <stas@zend.com> - - * tests/bug26077.phpt: - fix expect - - * zend_compile.c: - Bug #25816 - disallow arrays in class constants - - * tests/bug26077.phpt: - add test - - * zend_compile.c - zend_execute.c: - Fix Bug #26077 - memory leak when new() result is not assigned - and no constructor defined - -2004-01-08 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_scanner.h - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Happy new year and PHP 5 for rest of the files too.. - -2004-01-08 Andi Gutmans <andi@zend.com> - - * zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l: - - - A belated happy holidays (by two years) - -2004-01-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Reimplement part of Bug #24608 that was reverted too - - * zend_execute.c: - Revert patch that allowed to call sttaic methods via $method() - -2004-01-06 Ilia Alshanetsky <ilia@prohost.org> - - * zend_mm.c: - Check if realloc() succeeds or not. (Noticed by Andrey) - -2004-01-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug26802.phpt: - Update - -2004-01-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - tests/bug26802.phpt: - Fixed bug #26802 - - * tests/bug26802.phpt: - Fix test - - * tests/bug26801.phpt - tests/bug26802.phpt: - Add new test - - * tests/bug26696.phpt: - Update test - -2004-01-05 Stanislav Malyshev <stas@zend.com> - - * zend_API.c: - Fix bug #26543 - check parent:: and self:: in class names - - * zend_execute.c - zend_object_handlers.c: - Bug #24608 - fix interaction between __accessors and get_property_ptr - -2004-01-03 Derick Rethans <php@derickrethans.nl> - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_reflection_api.c: - - Fixed var_export() to show public, protected and private modifiers - properly. - - Exported (un)mangle_property_name. - -2004-01-02 Andrei Zmievski <andrei@gravitonic.com> - - * zend_default_classes.c: - Do not show exception message if it's empty. - - -2003-12-31 Andrei Zmievski <andrei@gravitonic.com> - - * zend_default_classes.c: - Make default message look better. - -2003-12-30 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Fix typos - -2003-12-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES: - Update - -2003-12-30 Ilia Alshanetsky <ilia@prohost.org> - - * tests/bug26696.phpt: - Added test case for bug #26696. - -2003-12-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix (string) conversion - - * zend.c: - Add missing notice - - * zend_execute_API.c: - Fix __autoload() with derived classes - -2003-12-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - WS - - * zend_API.h - zend_compile.c: - Fix order of class_entry member initialization (needed for example for DOM) - -2003-12-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_parser.y: - Fixed bug #26065 (Crash when nesting classes) - - * tests/bug26698.phpt: - Add new test - - * zend_objects.c: - Simplify - - * zend_object_handlers.c: - Fix __tostring() and concatenation - -2003-12-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_execute.c: - Fix warning - -2003-12-25 Ilia Alshanetsky <ilia@prohost.org> - - * zend_highlight.c: - Fixed Bug #26703 (Certain characters inside strings incorrectly treated as - keywords). Original patch by vrana@php.net. - -2003-12-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c - zend_execute_API.c - zend_globals.h - tests/bug26697.phpt: - Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload - results in segfault). - -2003-12-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/bug26229.phpt - tests/bug26695.phpt: - Add more tests - - * tests/bug24884.phpt - tests/bug26166.phpt: - Fix tests now that class names are shown in correct casing - - * zend_compile.c: - Preserve class name casing. - - * zend_reflection_api.c: - Fixed bug #26695 (Reflection API does not recognize mixed-case class hints) - - * zend_object_handlers.c: - Fixed bug #26675 (Segfault on ArrayAccess use) - Update NEWS - -2003-12-22 Wez Furlong <wez.php@thebrainroom.net> - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h: - export these symbols for use by SPL as a shared extension - -2003-12-19 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b3RC2) - zend_language_parser.y: - - Nuke another rule (thanks to Jan for noticing this) - -2003-12-19 Dmitry Stogov <dmitry@zend.com> - - * (php_5_0_0b3RC2) - zend.c: - Bug #25547 (error_handler and array index with function call) was fixed - tests/lang/bug25547.phpt - -2003-12-19 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Nuke unused code - -2003-12-19 Dmitry Stogov <dmitry@zend.com> - - * (php_5_0_0b3RC2) - zend_execute.c: - Error reporting on unset string offset was added (Bug #24773 - Zend/tests/bug24773.phpt) - - * zend_execute.c: - Assign_op operators (+=) were fixed for elements of overloaded objects - -2003-12-18 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Nuke C++ comment - - * zend_execute.c: - - Revert patch 1.566 - -2003-12-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fixed bug #24837 Incorrect behaviour of PPP using foreach. - -2003-12-17 Zeev Suraski <zeev@zend.com> - - * (php_5_0_0b3RC1) - zend_execute.c: - This part of the if was necessary after all. - Refix bug #22510 - -2003-12-17 Dmitry Stogov <dmitry@zend.com> - - * (php_5_0_0b3RC1) - zend_execute_API.c: - -** empty log message *** - - * (php_5_0_0b3RC1) - zend_compile.c: - Dynamic function call from object's property was fixed - (See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt") - - * zend_execute_API.c: - Access to globals/autoglobals from class __destructor was fixed. - (see "tests/lang/bug24908.phpt" and - "tests/classes/destructor_and_globals.phpt") - -2003-12-16 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_compile.h - zend_object_handlers.h - zend_stream.h: - Sync: Export externally used functions. - -2003-12-16 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - export class initialization function - - * zend_object_handlers.c: - export externally used functions - - * zend_stream.c: - export function - -2003-12-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c - zend_object_handlers.c - zend_object_handlers.h: - Reenable __tostring() magic for print,echo,concatenation,function naming... - but not for other internal things. - -2003-12-15 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_execute.c: - ws + cs (no c++ comments in c code) - -2003-12-15 Dmitry Stogov <dmitry@zend.com> - - * zend_execute.c: - Bug #24773 was fixed (Zend/tests/bug24773.phpt) - Assign_op operators (+=) were fixed for elements of overloaded objects - Memory leaks during accessing ptoperies/elements of overloaded objects - were fixed - - * zend_execute_API.c - zend_reflection_api.c: - Memory corruptions were fixed in zend_str_tolower_copy() - -2003-12-14 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - Fix behavior of return-by-reference functions. Remove erroneous warnings, - add E_STRICT warnings in case you return something by reference that - you're - not supposed to (anything that's not a variable, or a return-value of a - function that returned by reference). - - * zend.h - zend_execute.c - zend_execute.h: - Some cleanup - -2003-12-13 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_operators.c: - Fixes for POSIX compliancy. - -2003-12-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Free is needed in non ZTS too - - * zend.c: - Fix memleaks in ZTS mode - - * zend.c: - Fix memleaks - -2003-12-12 Ilia Alshanetsky <ilia@prohost.org> - - * zend_constants.c: - Do not copy extra byte. - -2003-12-11 Ilia Alshanetsky <ilia@prohost.org> - - * zend.h: - Fixed extra byte allocation for TRUE/FALSE/ZEND_THREAD_SAFE/NULL constants. - -2003-12-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught - Exception - -2003-12-11 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Refix bug #24773 - -2003-12-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_object_handlers.c: - Handle getter failure and allow to bypass thrown exceptions. - - * zend_execute.c: - read_dimension() handler might return 0, handle this. - -2003-12-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - Do not double copy the string - -2003-12-09 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * zend_operators.c - zend_operators.h: - - Brought ext/bcmath to the new millennium - -2003-12-09 Andi Gutmans <andi@zend.com> - - * zend_constants.c: - - Fix overallocation (thanks to Ilia) - -2003-12-08 Derick Rethans <php@derickrethans.nl> - - * zend_builtin_functions.c: - - Make it compile again - -2003-12-07 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c: - Apply Andrey Hristov's patch adding get_declared_interfaces() - -2003-12-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - This test is against interfaces not abstract classes. - - * zend_default_classes.c: - Show the exception message again after __toString() magic has been dropped. - -2003-12-05 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - - Remove two unneeded convert_to_string() (found by Marcus) - - Change illegal use of string offset to E_ERROR - -2003-12-05 Ilia Alshanetsky <ilia@prohost.org> - - * zend_default_classes.c: - Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. - -2003-12-04 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_execute.c: - Revert crap. - - * zend_execute.c: - Raise error in case dereference is performed on a scalar value. - -2003-12-03 Ilia Alshanetsky <ilia@prohost.org> - - * tests/bug24773.phpt: - Test case for bug #24773. - -2003-12-03 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_execute.c: - This kind of error should be caught. (suggested by Andi, thanks) - - * zend_execute.c: - Fix bug #24773 (unset()ing string offsets crashes PHP) - -2003-12-03 Derick Rethans <php@derickrethans.nl> - - * zend_execute.c: - - Remove newline from error message - -2003-12-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_object_handlers.c: - Remove automatic call to __toString() since it is supposed to cause too - much trouble. See discussion on the mailing list. - -2003-12-02 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_operators.c: - - Revert the revert of these patches. This overloading can only be used - - by C extensions such as SimpleXML and *NOT* PHP code. Reasons given - - on the mailing list and problem with reentrancy inside the opcodes. - - * zend_compile.c: - - Fix for bug #26182 - - * zend_errors.h: - - Don't include E_STRICT in E_ALL. - -2003-12-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - Free the zval container only if it should be freed and was not copied. - -2003-12-01 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Change to E_STRICT so as not to break existing scripts. - - Thanks Edin - - * zend_builtin_functions.c: - - Nuke property_exists(). We need to fix isset() and this is already - - supported in reflection API. In any case, it's best not to add new - - functions in the general namespace except for keeping engine consistency - (which would have been true in this case) - - * zend_API.c: - - Revert auto-conversion in parameter API - - * zend_operators.c: - - Don't automatically call __toString() in convert_to_string_ex(). - - use __toString() in your code. - - Keep the auto-case in make_printable_zval. - -2003-11-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Check return value of exception::__tostring() - - * tests/bug20240.phpt: - Fix test - -2003-11-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_iterators.c: - Fix memleak - -2003-11-29 Ilia Alshanetsky <ilia@prohost.org> - - * zend_highlight.c - zend_language_scanner.l: - Fixed bug #26463 (Incorrect handling of semicolons after heredoc) - -2003-11-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - This takes the address of a zval ptr - - * zend_API.h: - Add macros to return values of other zvals. - This is needed because one cannot use REPLACE_ZVAL_VALUE with - return_value. - -2003-11-29 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Restore original patch for bug #26281. - - -2003-11-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Revert accidential commit until decision - - * zend_compile.c - zend_default_classes.c: - Make exception code more robust: - - Fix error in calculation of trace-string length - - Allow to overload __strostring() and make it work for uncaught - exceptions - - Show exception thrown while displaying exceptions - -2003-11-28 Ilia Alshanetsky <ilia@prohost.org> - - * zend_API.c: - Add removed lcname, it is still needed. - -2003-11-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Convert objects to string if string is required by newer parameter parsing - since we do this for older parameter parsing does so too. - - * zend_object_handlers.c: - The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * - writeobj. to allow it the api needs to be changed to zval **writeobj. - - * zend_builtin_functions.c: - Add a support function to check for property existance which is different - from checking a property from being empty/set. - Update test #26182. - -2003-11-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_operators.h: - Add new interface ArrayAccess to use objects as Arrays - -2003-11-24 Andi Gutmans <andi@zend.com> - - * zend_constants.c: - - Fix newly introduced bug which stopped class constants from working. - - Thanks to Jan Lehnardt for reporting it. - -2003-11-24 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * RFCs/004.txt: - No longer needed. - -2003-11-24 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_reflection_api.c: - - Fix __autoload() to preserve class case. - - Heads up, this patch might break stuff so please let me know if you - - bump into any problems. - -2003-11-23 Andi Gutmans <andi@zend.com> - - * zend_reflection_api.c: - - Allocation optimizations by Timm Friebe - -2003-11-21 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Cleaner patch for bug #26281. - -2003-11-19 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c - tests/bug26281.phpt: - Possible fix for bug #26281 & test case. - -2003-11-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - Add method alias macro - -2003-11-18 Andi Gutmans <andi@zend.com> - - * zend.c - zend_builtin_functions.c - zend_constants.c - zend_errors.h - zend_language_parser.y: - - Add E_STRICT, to be used to warn purists (like Jani :) - -2003-11-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Backpatch the correct opcode for list(), property overloading needs more - opcodes (Bugfix #26257). - - * zend_interfaces.c: - Use correct order - - * zend_interfaces.c: - Use correct macro/function - -2003-11-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - Correct destruction - -2003-11-13 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_operators.c: - Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) - -2003-11-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES - zend_interfaces.c: - IteratorAggregate::getIterator() cannot return anythingy else than objects - -2003-11-13 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Make sure internal clasess are malloced - -2003-11-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_iterators.c: - Don't use zend_class_entry indirection - - * zend_builtin_functions.c: - Bugfix #26010 (Bug on get_object_vars() function) - - * zend_object_handlers.c: - Correct default handlers - - * zend_iterators.c: - Need to update iterators handler table too. - - * zend_execute.c - zend_object_handlers.c: - Fix those warnings - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Split isset/isempty for object property and object dimension hooking. - - * zend_interfaces.c: - Little iterator improvement: ability to store index in iterator - -2003-11-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Add method reflection_class::implementsInterface() - Allow string & reflection_class in isSubclassOf() - - * zend_reflection_api.c: - Fix reflection_class::isSubclassOf() - - * zend.c - zend_object_handlers.c - zend_operators.c - tests/bug26166.phpt: - Handle exceptions in casting more gracefully. - This fixes bug #26166 - -2003-11-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - Make __autoload() faster - - * zend_execute.c - zend_iterators.h: - Update Iterators: Call next at the correct point in time. - - * zend_compile.c: - Add missing initialization. - - * zend_interfaces.h: - Make these class entries available for inheriting classes - -2003-11-06 Ilia Alshanetsky <ilia@prohost.org> - - * zend_operators.c: - Fixed bug #26148 (Print the notice before modifying variable on type - mismatch). - - - Patch by: morten-bugs dot php dot net at afdelingp dot dk - -2003-11-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c - zend_interfaces.c: - Prevent some SEGV's when Exceptions are thorown inside iterators. - - * zend_builtin_functions.c: - Removedouble efree call - -2003-11-04 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_object_handlers.c: - __tostring() handler should be binary-safe - - * tests/bug26010.phpt: - Fix one more test - -2003-11-04 Stanislav Malyshev <stas@zend.com> - - * Makefile.am: - add zend_iterators.c zend_interfaces.c to make - -2003-10-31 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * tests/bug26010.phpt: - Add test case for bug #26010 - -2003-10-30 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - make CATCH opcode use "class" T like other opcodes do - via IS_CONST - -2003-10-30 Andi Gutmans <andi@zend.com> - - * (php_5_0_0b2) - ZEND_CHANGES: - - Beta 2 - -2003-10-29 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_operators.h: - Use pretty macro instead. - -2003-10-28 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Head up! I'm reverting the patch which allows for expressions in constant - - declerations. Allowing the access of other constants in this code is - - flawed. We are reverting back to PHP 4's static scalars. - - Don't worry if you get the following msg when compiling: - - "zend_language_parser.y contains 3 useless nonterminals and 22 useless - rules" - - I didn't nuke the code in case we have some brilliant ideas after beta 2 - -2003-10-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_interfaces.c: - Give some freedon to c iterators but not in userspace. - -2003-10-28 Shane Caraveo <shane@caraveo.com> - - * zend_compile.c: - fix crash in do_implement_interface when compiling - pear/PHPUnit/Framework/TestCase.php line 63 - while only interface_gets_implemented is the issue in this instance, both - these vars were unitialized, causing potential other issues - -2003-10-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - Add zend_make_callable() which allows to make zval's callable zval's. - At the moment this function only converts strings of the form - class::method - to an array(class,method). - - * zend_default_classes.c - zend_reflection_api.c: - This forces a better error message for non working clone calls. - - * zend_default_classes.c: - And use things to throw an exception here - - * zend_default_classes.c: - You shall not clone Exception instances - - * zend_reflection_api.c: - You shall not clone reflection_xx instances - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-25 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Fugbix typo. - - * ZEND_CHANGES: - s/Throwable/Printable: Exception has become an internal class since I - initially documented interfaces. - -2003-10-24 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Fix typo - -2003-10-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_execute_API.c: - Revert accidental commit - - * ZEND_CHANGES - zend_API.c - zend_execute_API.c: - Zend/ZEND_CHANGES - -2003-10-23 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Zend.dsp - ZendTS.dsp: - Add zend_interfaces.{c|h}. - -2003-10-22 Ilia Alshanetsky <ilia@prohost.org> - - * zend.c: - Fixed bug #25922 (Crash in error handler when 5th argument is modified). - -2003-10-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c - zend_interfaces.c - zend_interfaces.h: - Impement userspace iterator interfaces and tests. See tests for details - on the names. - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Expand Interface C API. - In short: zend_class_entry->interface_gets_implemented() allows to modify - the class entry of a class when an interface gets implemented. - - * zend_default_classes.c: - The string conversion method should be named __toString() - -2003-10-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES: - Make this clear - -2003-10-20 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Add comment from Timm - -2003-10-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-19 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Nuke const in function parameters. I just can't remember why this exists - - and it seems no one else remembers either. It has no semantic meaning. - -2003-10-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.h - zend_API.h - zend_compile.c - zend_iterators.h: - Fix class/iterator relationship & handling - - * zend_iterators.c: - Fallback to old behavior until we have a default iterator that respects - visibility we do the array trick. - - * zend_iterators.h: - Change order: Optional rewind() to end of structure - -2003-10-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * ZendTS.dsp: - WS - - * zend_reflection_api.c: - Show if a class/object is iterateable - - * ZendTS.dsp - zend.h - zend_API.h - zend_default_classes.c - zend_execute.c - zend_iterators.c - zend_iterators.h: - Added c-api for iterators - - * zend_reflection_api.c: - Fix showing final/abstract for classes - -2003-10-17 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_parser.y: - Fixed formatting issue. - - * zend_alloc.c: - Fixed if() condition. - -2003-10-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - Add oo support function zend_class_implements() - - * zend_default_classes.c: - Fix cast function - -2003-10-14 Andi Gutmans <andi@zend.com> - - * zend_mm.c: - - Argh, the suffering copy&paste can cause - - * zend_alloc.c: - - Fix compile problem. - - * zend_mm.c: - - Fix the fix by making sure the new block is in the right free list. - -2003-10-14 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: - The freed one is a hashtable - may matter if Hashtables are allocated - differently - -2003-10-14 Andi Gutmans <andi@zend.com> - - * zend_mm.c: - - Support merging free block which was created by reallocing to smaller - - size. This should fix some performance issues. This code is still not - - thoroughly tested. - -2003-10-09 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Allow foo::$bar() - -2003-10-07 Rasmus Lerdorf <rasmus@lerdorf.com> - - * Zend.m4: - MFB bison configure test fix - -2003-10-07 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix bug #17997 (Warning when switch & reference are combined) - - * zend_ini_parser.y: - Fix the fix :) - Not thoroughly tested, but appears to work fine - -2003-10-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_ini_parser.y: - Bugfix #25770 Segfault with PHP and bison 1.875 - -2003-10-05 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Remove unused callback - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Remove redundant callback, simplify API - -2003-10-05 Shane Caraveo <shane@caraveo.com> - - * (BEFORE_HANDLERS_RESHUFFLE) - zend_API.h: - this little piggy broke lots of things...eg. _function_check_flag in - reflection api. - -2003-10-03 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_API.c: - Fixed bug #24766 (strange result array from unpack()) - - * zend.h: - Bug #25738 (alloca() related problems on the Darwin platform) - - * zend_API.h: - Ensure lval to have a *boolean* value. - -2003-10-03 Jani Taskinen <jani.taskinen@kolumbus.fi> - - * Zend.m4: - Aligned configure help texts. - -2003-09-30 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_compile.c: - Remove redundant '\n' - -2003-09-26 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * zend_alloc.c: - signed/unsigned compiler warning fixes - -2003-09-25 Georg Richter <phpinfo@t-online.de> - - * zend_alloc.c: - fixed compiler warning - removed dead code - - * zend_hash.h: - changed ulong to long to avoid compiler warnings (comparison between signed - and unsigned) - -2003-09-22 Ilia Alshanetsky <ilia@prohost.org> - - * zend.c - zend_language_scanner.l: - Added missing format. - -2003-09-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Add public array Reflection_Class::getDefaultProperties() - -2003-09-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c: - Nuke vars no longer needed - - * zend_builtin_functions.c - zend_reflection_api.c: - Go with studlyCaps - - * zend_reflection_api.c: - Change tostring() into __toString() to match method name used in casting. - - * zend.c - zend_operators.c: - Fallback to default behaviour for unsupported object type conversions - - * zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Allow partial type conversion support for objects. - - Add support for object to string conversion from userspace by method - __toString() and add a test. - - * zend_API.c: - Add missing check - -2003-09-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_execute.c: - Show name of missing function as typed - - * zend_default_classes.c: - Use studlyCaps in exception class - - * zend_compile.c: - Go with studlyCaps in error messages/backtrace/reflection output - -2003-09-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - - Make it clear whether it is an interface or a class - - Fix static properties - -2003-09-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Revert - need to look for a better solution - - * zend_execute.c: - Bugfix #25547 - -2003-09-15 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Simplify / fix - -2003-09-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Bugfix #25335 - -2003-09-14 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Commit 64-bit fixes to the standard operators - by Ard Biesheuvel (abies@php.net) - -2003-09-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.h: - Bugfix #25528 (by Ard Biesheuvel) - -2003-09-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_alloc.c: - Fix warnings - -2003-09-11 Stanislav Malyshev <stas@zend.com> - - * tests/dtor_scope.phpt: - add test - - * zend_execute_API.c: - ws - - * zend_execute_API.c: - Use scope from method, not from object - -2003-09-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Use type instead of constant - -2003-09-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Fix property inheritance where a derived class inherits a public property - and owns it as an implicit public property already (noticed by Brad). - - * zend.c: - Fix registering/derigistering of stdClass in ZTS and NON ZTS mode - -2003-09-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix foreach() called with non array - -2003-09-07 Stanislav Malyshev <stas@zend.com> - - * Zend.m4: - check for mach-o/dyld.h - needed for non-PHP ZE build - -2003-09-06 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Disallow to changing the backtrace - - * zend_reflection_api.c: - Add missing newline if no static methods are available - - * zend_reflection_api.c: - - Internal functions shall be static - - Fix more nesting - - * zend_reflection_api.c: - Fix logic - - * zend_reflection_api.c: - - Fix CS: {{{ / }}} - - Fix static reflection_*::export() - - Add class reflection_object which allows to show dynamic properties - - * zend_reflection_api.c: - Use %s where it makes more sense - -2003-09-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Simplify reflection_property::__constructor() and fix property factory - - * zend_reflection_api.c: - - Don't use resorved words as variable names. - - Improve several exception messages. - - Fix Reflection_Property::_construct() / getDeclaringClass() - - * zend_reflection_api.c: - Fix reflection_api::__construct() (noticed by Andrey) - - * zend_default_classes.c: - Provide string casting for exceptions by calling toString() - -2003-09-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_execute.c - zend_object_handlers.c: - Tests show updating consts must happen once at runtime (revert - optimization). - Add tests for static properties. - - * zend_reflection_api.c: - Add reflection_class::getstaticproerties() - -2003-09-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Partly revert and reintroduce hash table entries for the ctor. - - * zend_compile.c: - Nuke unused variable, too - - * zend_compile.c: - - Inheritance applies to __clone() too. - - No need to add additional functions for the constructor. - The handler uses the pointer as intended and doesn't look the the name. - - * zend_compile.c: - Cannot turn a static property into a non static one and vice versa - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c: - Fix handling of static properties initialized to arrays - - * zend_compile.c: - Add missing error messages when violating static property inheritance - rules. - - * zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c: - Fix static properties. - - * zend_compile.c: - Allow redeclareing a protected property as public. - -2003-09-03 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Revert bogus patch - One must *never* use E_CORE_* error levels! - -2003-09-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Clearly distinguish between Const, Static and Other members. - -2003-09-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Fix error messages - - * zend_API.c: - Allow redeclaring of protected properties as public (for internal classes). - - * zend_reflection_api.c: - Use appropriate function for property name unmangling. - - * zend_reflection_api.c: - Make these static as noticed by Andrey - - * zend_execute.c - zend_object_handlers.c - zend_objects.c: - Synch/Unify error messages related to function/method calls - - * zend_compile.c: - Fix error level - - * zend_API.c - zend_compile.c: - Currently we cannot support static ctor/dtor - - * zend_reflection_api.c: - These are implicit properties as denoted by the flag. Dynamic properties - only - exist in one single object and currently reflection api is not capable of - showing those. - -2003-08-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Don't repeat first const count(consts) time - - * zend_reflection_api.c: - Beautify output - - * zend_reflection_api.c: - Add reflection_parameters, patch by Timm Friebe - - * zend_default_classes.c: - Excluded chars < 32 when displaying string parameters that would obliterate - output. - -2003-08-31 Zeev Suraski <zeev@zend.com> - - * zend_arg_defs.c - zend_builtin_functions.c - zend_modules.h: - Attempt at fixing the linkage problem in Win32 - -2003-08-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Synch error message with other one to fix tests - - * zend_reflection_api.c: - Check whether we may access tat union - - * zend.c: - Revisited: Replace the non portable code by spprintf - - * zend_reflection_api.c: - Using zend_spprintf should be faster here - - * zend.c - zend.h - zend_default_classes.c: - Make vspprintf available as zend utility function. Use it in exception - output. - -2003-08-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Actually fetch the parameter - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c - zend_reflection_api.c: - - Calling abstract methods should be a error for consistency reason. - - So in reflection_api we use the reflection_exception again. - -2003-08-30 Andi Gutmans <andi@zend.com> - - * zend_default_classes.c: - - PLEASE stop commiting ^M's - -2003-08-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Even though it is ignored this should be correct - - * zend_default_classes.c: - Add frame numer and finally display stack trace in the message. - - * zend_default_classes.c: - Add exception::traceAsString() and exception::toString() - - * zend_reflection_api.c: - fci.function_table & fci.function_name are not needed since we use - zend_fcall_info_cache - - * zend_reflection_api.c: - Be precise - - * zend_reflection_api.c: - Actually using fcc would be a good idea - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c: - - The compiler can't detect all abstract function calls so we need to - check. - - * zend_default_classes.c: - Make those final (see comment) - -2003-08-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h: - - Add zend_merge_properties() which is designed to serve *_fetch_object(). - - Explain drawbacks of object_and_properties_init and - zend_merge_properties. - - * zend_reflection_api.c: - - Use zend_fcall_info_cache in invoke() to improve speed. - -2003-08-29 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix a problem in implicit public properties and inheritance - -2003-08-29 Sascha Schumann <sascha@schumann.cx> - - * zend_hash.c: - improve a number of zend_debug format strings - -2003-08-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - Need to tell zend_fetch_debug_backtrace() whether to skip top function or - not. - -2003-08-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c: - Add public read access to protected - - * zend_default_classes.c - zend_default_classes.h: - Add zend_throw_exception_ex() which allows to format exception messages. - - * zend.c: - Classe tables work this way - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - - Split debug_backtrace() into lowlevel c function and php function wrapper - - Add trace property to default method based on new - zend_fetch_debug_backtrace - -2003-08-28 Sascha Schumann <sascha@schumann.cx> - - * zend.h: - older gccs don't understand attribute((format)) on function pointers - - * zend.h: - ZEND_GCC_VERSION should always be defined to a number so we can use - simple comparisons all the time. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - Add format attribute to a number of functions - - Kill a few warnings - - * zend.h - zend_alloc.h: - cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that - they can be used by downstream applications - - * zend_alloc.h: - Enable attribute((malloc)) for GCC 2.96 - - * zend_alloc.h: - GCC 2 does not know about malloc yet. - - * zend_alloc.h: - provide attribute((malloc)) where appropiate - -2003-08-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Nuke unused variable - - * zend_reflection_api.c: - Fix reflection_class::newInstance() - -2003-08-25 Jani Taskinen <sniper@iki.fi> - - * zend.h: - - Fixed bug #25240 (spaces before pre-processor directives) - -2003-08-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Add missing check - - * zend_API.c: - Fix memory source of string duplication for non internal properties - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c - zend_execute_API.c - zend_variables.c - zend_variables.h: - - Provide appropriate way to destroy internal zval's. - - Allow internal zval's of type string and disallow complex types. - - Define the default string for extensions at class level instead of ctor. - - * zend_API.h - zend_compile.h - zend_reflection_api.c: - Don't identify alias'ed functions - -2003-08-24 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Use ""'s if you want empty strings. We want to crash on errors. - - * zend_compile.c: - Use pemalloc() - -2003-08-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Allow NULL, too - -2003-08-24 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Get rid of more ^M's - Marcus, please check your CVS client! - - * zend_default_classes.c: - Get rid of more ^M's - - * zend_compile.c: - line endings fix - - * zend_execute.c: - Never, ever, overwrite the refcount element of a connected zval! - -2003-08-24 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Add dedicated reflection_exception - - * zend_default_classes.c - zend_default_classes.h: - Allow to throw instances of classes derived from exception - - * zend.c - zend_default_classes.c - zend_default_classes.h - zend_execute.h - zend_execute_API.c: - - Provide a unified way to display uncaught exceptions, which shows - file/line/message info if possible. - - Add zend_eval_string_ex() to be able to handle exceptions in eval'd - code. - - Use above function to fix memleaks in CLI. - - * zend_reflection_api.c: - Make invoke() work - - * zend_reflection_api.c: - zend_parse_parameters 'O' works the way we need here - - * zend_reflection_api.c: - Not needed - - * zend_default_classes.c: - Make use method macros - - * zend_API.h: - One of PPP is needed, too - - * zend_reflection_api.c: - - Add Reflection_Function::isAlias - - Use ZEND_ME/ZEND_METHOD - - Fix static entries - - * zend_API.h - zend_compile.h: - - Add fn_flag ZEND_ACC_ALIAS - - Unify way of function_entry generation by new macro ZEND_FENTRY - - * zend_API.c: - Fix fn_flags handling - - * zend_API.c - zend_API.h - zend_default_classes.c: - Add property read code and use that in default exception class - -2003-08-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Allow zend_throw_exception() to also set the exception code - - * zend_default_classes.c: - Exception has 4 protected default properties (message,code,file,line). - They are all initialized at c-level constructor correctly. - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Internal classes can now have default properties. - - * zend_reflection_api.c: - Show ctor/dtor information and those don't return anything - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c: - - Flag ctor/dtor methods - - Use this to prevent memleaks when an exception gets thrown in ctors. - - * zend_default_classes.c: - Make exception code more robust - -2003-08-22 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c - zend_constants.h: - Replace *magic number* with a much nicer define. - - * zend_builtin_functions.c: - Set 2147483647 as the module number of user defined constants - Fixed a few bugs and cleaned up get_defined_constants(). - -2003-08-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Add function 'zend_throw_exception(char *message, int duplicate - TSRMLS_DC);' - to provide an easy way to throw exceptions for extension developers. - - * zend_API.c: - If ce not given than any object would do - - * zend_API.c: - Paramspec 'O' / zend_parse_method_params(): only if given check the class - type - -2003-08-20 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: - adhere to silence - -2003-08-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_alloc.c: - Fix counting number of leaks - -2003-08-19 Wez Furlong <wez.php@thebrainroom.net> - - * zend_execute.c: - fix build - -2003-08-18 Wez Furlong <wez.php@thebrainroom.net> - - * zend_ini.h: - linkage for C++ - -2003-08-18 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp - zend_execute.c - zend_execute_locks.h: - Prevent access to internal engine functionality - - * zend.h - zend_alloc.c - zend_compile.h - zend_execute.c: - - Improve tracking - - Fix several overloading issues - - * zend_API.c - zend_alloc.h - zend_hash.c - zend_hash.h - zend_ts_hash.c - zend_ts_hash.c - zend_ts_hash.h - zend_ts_hash.h: - Improve tracking - - * zend_compile.c: - ws - -2003-08-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c: - Fix warnings - -2003-08-17 Sascha Schumann <sascha@schumann.cx> - - * zend.h: - One bit fields need to be unsigned, otherwise there is no storage for - the sign bit - - "A signed bit field has a length of 1 bit." - - * zend_API.h: - explicitly cast size_t to zend_uint to avoid warnings on 64 bit platforms. - -2003-08-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Remove unnecessary if - - * zend_execute.c: - Put the code where it belongs - fixes a warning and confusion - - * zend_compile.c - zend_execute.c: - Implement a TBD: JMP to the end of foreach - - * zend_compile.c: - WS - - * zend_API.c: - - Show class names in error messages when dealing with methods - - Mark class as abstract if it gets an abstract method - -2003-08-16 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_API.h - zend_reflection_api.c: - Simplify abstract method declaration - - * zend_object_handlers.h: - WS - -2003-08-15 Sascha Schumann <sascha@schumann.cx> - - * zend_execute.c - zend_object_handlers.c: - Restrict scope of inline functions to compile unit - - Submitted by: Jason Greene <jason@inetgurus.net> - -2003-08-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects_API.c: - Add missing entry - - * zend_API.c: - - Show classes in case of methods - - Using sprintf here was a bad idea - -2003-08-12 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-11 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.c - zend_hash.h: - Bugfix 21918 - -2003-08-11 Masaki Fujimoto <masaki-f@fides.dti.ne.jp> - - * Zend.m4 - flex.skl - zend_compile.c - zend_globals.h - zend_highlight.c - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_multibyte.h: - - added script encoding support to Zend Engine 2. - this enables ZE2 to gracefully parse scripts written in UTF-8 (with - BOM), - UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with - '--enable-zend-multibyte' and '--enable-mbstring') - -2003-08-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Bugfix #24637 __destruct not called - -2003-08-09 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * zend_compile.c: - Fix segfault when a referenced parameter is specified with typehint. - Result of the node will never be used because verify_instanceof handler - has - been eliminated. - -2003-08-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c: - Precise destructor errors - -2003-08-07 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * tests/bug21478.phpt: - Add missing right parensis - -2003-08-07 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Clarify use of original_function_state_ptr - -2003-08-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - - Fix warnings - - Fix code - -2003-08-06 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - clarify :) - -2003-08-05 Jani Taskinen <sniper@iki.fi> - - * zend_execute_API.c: - Fix the build - -2003-08-05 Zeev Suraski <zeev@zend.com> - - * zend_API.h - zend_execute_API.c - zend_reflection_api.c: - Try to put an end to the endless number of call_user_function variants. - zend_call_function() now takes a structure that should contain all of the - necessary information. If further information is necessary in the future, - then we'll be able to add it without having to introduce a new function. - - As for caching - the 2nd, optional argument is a struct that can hold all - of the information that's necessary to invoke the function, including its - handler, scope and object it operates on (if any). Note that you may only - use a cache if the arguments you provide to zend_call_function() are - identical to the ones of the last call, except for the argument and return - value information. - - - The recently introduced fast_call_user_function() was removed - - I fixed most of the places that used fast_call_user_function() to use - caching - but there are still some that need to be fixed (XML and reflection) - -2003-08-05 Stanislav Malyshev <stas@zend.com> - - * tests/bug24699.phpt: - fix syntax - - * zend_execute_API.c: - remove stack clean - it makes trouble - -2003-08-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix ZTS - - * zend_execute_API.c: - Nuke unused variables - - * zend_reflection_api.c: - Add function/method parameter reflection - -2003-08-04 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute_API.c - tests/bug23104.phpt: - Fixed bug #23104 (hash position of static arrays not being reset) - -2003-08-04 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: - oops. forgot function - - * zend_execute_API.c: - fix crash #24842 - - * zend_compile.c: - fix leaks: bug #24831 - - * zend_execute.c: - use get_obj_zval_ptr - - * tests/bug24884.phpt: - add test - - * zend_execute.c: - Fix #24884 - clone $this - -2003-08-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Simplify code using XOR - - * zend.h: - Add logical XOR, proves to be quite useful lately - - * zend_opcode.c: - This check shouldn't be necessary - -2003-08-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_opcode.c: - Fix crash - - * zend_compile.c: - Fix test and add missing initialization - -2003-08-03 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Ensure functions have a valid access level - - * zend_API.c: - Default to public - -2003-08-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Not needed, will be copied from ptr->flags later - - * zend_builtin_functions.c: - Add missing arg info - -2003-08-03 Moriyoshi Koizumi <moriyoshi@at.wakwak.com> - - * tests/bug24635.phpt - tests/bug24699.phpt: - Style & WS fixes - -2003-08-03 Zeev Suraski <zeev@zend.com> - - * (BEFORE_ARG_INFO) - zend_API.c: - No need for this initialization - this function initializes all of the - elements of zend_internal_function - - * (BEFORE_ARG_INFO) - zend_execute.c: - Clean up. extended_value can only contain either ZEND_UNSET_DIM or - ZEND_UNSET_OBJ. - - * (BEFORE_ARG_INFO) - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c: - Generalize fetch_class - -2003-08-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Initialize all struct members: Necessary for reflection - - * zend_reflection_api.c: - Show interfaces - -2003-08-02 Wez Furlong <wez.php@thebrainroom.net> - - * zend_API.c: - fix usage of instanceof here too - -2003-08-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix warning - -2003-08-01 Wez Furlong <wez.php@thebrainroom.net> - - * zend_API.c: - better fix... - - * zend_API.c: - Fix "O" format for zend_parse_parameters - -2003-07-31 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Use instanceof_function() - - * zend_compile.c - zend_execute.c: - Finish the array overloading patch - - * zend_execute.c: - Cleanup - -2003-07-31 Andi Gutmans <andi@zend.com> - - * zend_hash.c: - - Fix logic. It was the wrong way around. - -2003-07-30 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_hash.c: - - Fix problem with hash when updating same bucket with data of different - sizes one after another. - - Fix number of arguments to read_dimension. - -2003-07-30 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of an opcode - - * zend_compile.c - zend_execute.c: - Support overloading of $foo["bar"] += "baz" - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve array overloading - support unset($foo["bar"]) - - * zend_compile.h: - Remove garbage - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_modules.h: - Add exec_finished() callback for modules - this is the last place where the - modules may touch the symbol table reliably - -2003-07-29 Ilia Alshanetsky <ilia@prohost.org> - - * tests/bug22836.phpt: - Test case for bug #22836. - -2003-07-29 Jani Taskinen <sniper@iki.fi> - - * zend.c: - Remove the obfuscation caused by the double "#ifdef ZTS" - -2003-07-27 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - fix compare - - * zend_compile.c: - use zend_binary_strncasecmp - - * zend_execute_API.c: - change shutdown order so that dtors would coexist with object error - handlers - - * zend_execute.c: - clean the right one - - * zend_execute_API.c: - make shutdown more granular so in case some dtor goes ape we still - can shut down cleanly - - * zend_compile.c - zend_execute.c - zend_objects.c: - make clone and throw coexist peacefully - - * tests/bug24635.phpt - tests/bug24699.phpt: - add test - - * zend_execute.c: - fix #24635: clean hash before putting into cache - - * zend_language_scanner.l: - fix crash #24550 - - * zend_compile.c - zend_constants.c: - fix leaks with class constants (bug #24699) - - * zend_compile.c: - make __clone call case insensitive, just as other calls are - -2003-07-24 Jani Taskinen <sniper@iki.fi> - - * tests/bug19859.phpt - tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt - tests/bug24436.phpt: - cleanup (CS+ws) - -2003-07-24 Zeev Suraski <zeev@zend.com> - - * tests/bug24436.phpt: - Fix expectations :) - - * zend_execute.c: - Fix logic and comments in ASSIGN_DIM - - * zend_compile.c: - Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, - Sterling ;) - - * zend_builtin_functions.c: - Fix each() binary safety for keys - - * zend_execute.c: - Fix assignments to numeric array indices - - * zend_compile.c: - Remove useless code - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Support references in foreach() - Syntax: - foreach ($arr as &$val) - foreach ($arr as $key => &$val) - - * zend_execute.c: - Fix binary safety in foreach() keys (fixes bug #24783) - - * zend.c: - Make print_r() binary safe with keys - -2003-07-23 Stanislav Malyshev <stas@zend.com> - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_opcode.c: - Remove namespace leftovers - -2003-07-23 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: - Go back to ZE1-like code - -2003-07-23 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - Fix segfault. Patch by Timm Friebe <thekid@thekid.de>. - -2003-07-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.h: - Fix for the moment - -2003-07-22 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Improve infrastructure of numeric handling of elements in symbol tables. - - When you want to work with a symbol table, and you don't know whether you - have a numeric ("string that looks like a number") or a string element in - your hands, use zend_symtable_*() functions, in place of zend_hash_*() - functions. - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Fix isset()/empty() for non-trivial object elements - (API change - read_property now accepts an extra element) - Fixes bug #24436 - -2003-07-21 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Fix bug #24499 - - * zend_execute.c: - Revert fix for #24729, and refix - -2003-07-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Go with a better fix for #24729 - -2003-07-21 George Schlossnagle <george@omniti.com> - - * zend_API.h: - reverted at Andi's request. replaced with more generic wrapper. - -2003-07-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Bugfix #24729 = new ; causes crash when is not set - -2003-07-20 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - should nt here - -2003-07-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_reflection_api.c: - Fix warnings and whitespace in output - - * zend_reflection_api.c: - Add support for instances in Reflection_Class. - -2003-07-20 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - removed references to smart_str, replaced with private string management - function. When snprintf is integrated into the engine, string_printf - should be altered to use that. - -2003-07-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects_API.c: - More informative errors here and these are real core errors - - * zend_execute.c: - Fix uncloneable objetcs - -2003-07-20 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - more of Timm's implementation. - -2003-07-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.c - zend_hash.h: - Make it a macro - -2003-07-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.c: - This is meant to be used in for(;has_more;next) - - * zend_hash.c - zend_hash.h: - Add missing function to ease implementations - -2003-07-19 Jani Taskinen <sniper@iki.fi> - - * zend.h: - Fix the HPUX alloca fix as suggested by Sascha - -2003-07-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c - zend_objects.h: - Shuffle code to ease writing clone handlers - -2003-07-19 Andi Gutmans <andi@zend.com> - - * zend.h: - - Don't use alloca on HP-UX (Moriyoshi Koizumi <moriyoshi@at.wakwak.com>) - -2003-07-16 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix bug in the verification of interface-function implementation - - * zend_compile.c - zend_compile.h - zend_execute.c: - More cleanup for assign-op handling of objects - - * zend_alloc.c: - Fix warning - -2003-07-12 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - WS - -2003-07-11 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - Add support for Z in zend_parse_parameters(). It will allow the extension - - to retreive the zval **, thus allowing it to use the convert_to_*_ex() - - family of functions to do type conversions without effecting the value - in - - the engine itself. (Josh Fuhs <fuhs@purdue.edu>) - -2003-07-08 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - initial refactoring for assign-op handling of objects - -2003-07-07 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Rework zend_do_declare_property and related code into one code base - - * zend_API.c: - Fix bug - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add get_dim callback - - * zend_execute.c: - Fix naming convention - -2003-07-07 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_execute.c: - - Help Zeev fixing ghosts :) - -2003-07-07 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c - zend_object_handlers.h: - whitespace - - * zend_objects_API.c: - Fix & whitespace - - * zend_object_handlers.c: - fixlet - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Initial support for overloading of array syntax for objects (very initial) - -2003-07-06 George Schlossnagle <george@omniti.com> - - * zend_API.c - zend_API.h: - add convenience functions or adding class properties. Ok'd for commit by - Andi. - -2003-07-04 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_mm.c - zend_mm.h: - - Add heap to memory manager. This should improve performance. - - Enabling it by default so that it gets tested. We should decide before - beta 2 if we want to revert back to malloc or not. - - Thanks to Sebastian for benchmarking it - -2003-07-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC - -2003-07-04 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - ws fix - -2003-07-03 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Allow final private methods - -2003-07-03 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - win build fixes (Rob Richards) - - * zend_reflection_api.c: - can't forget Andrei - -2003-07-03 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_execute.c: - enable Classname() constructor to be called via parent::__constructor() - - * tests/bug19859.phpt: - add test for Bug #19859 - - * zend_API.c - zend_execute_API.c: - Fix bug #19859 - allow fast_call_user_function to support __call - - * zend_builtin_functions.c: - fix the get_parent_class fix - -2003-07-03 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - more of Timm's patches, and mod authors line to give credit where credit is - due. - -2003-07-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c: - Temporairy solution to overcome shutdown propbelms with objects that have - hidden destructors. - - * zend_objects.c: - Reorganize this a bit to ensure the object memory is destructed before - showing the error. - - * zend_builtin_functions.c: - Bug #24399: is_subclass_of(): fix memleak, too - -2003-07-02 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Throughly fix scoping change. Fixes, among other things, bug #24403 - -2003-07-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_globals.h: - - Nuke CG(in_clone_method) - -2003-07-02 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix for bug #22367. - Heads up - this will break syntactical compatiblity, return($foo) will - not work with functions that return references - return $foo should be - used - instead. It never worked well before, and caused all sorts of odd bugs. - It *might* be possible to support this specifically, albeit unlikely - -2003-07-02 Sterling Hughes <sterling@bumblebury.com> - - * zend_execute_API.c: - optimize the case where the object is really a class name, as we don't need - to set EX(object) here. - - * zend_execute_API.c: - Timm Friebe points out that object detection should be done regardless of - the function pointer - -2003-07-02 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c: - Finally fix property cloning and fix the tests accordingly. - - -2003-07-02 Sterling Hughes <sterling@bumblebury.com> - - * zend_builtin_functions.c: - Fix bug #24445 - -2003-07-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_objects.c: - Fix __clone(). - - - * tests/bug20240.phpt: - Use both destructor and shutdown - - * zend_execute_API.c: - small bugfix - - * tests/bug24436.php - tests/bug24436.phpt: - Rename test to correct extension - - * zend_execute.c: - __clone might not be defined - - * zend_execute.c: - Fix __clone visibility - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.c: - Fix destructor visibility - -2003-07-01 Derick Rethans <d.rethans@jdimedia.nl> - - * tests/bug24436.php: - - Added test for bug #24436 - -2003-07-01 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - Timm Friebe's patches for code celanup and additional functions. - -2003-07-01 Jani Taskinen <sniper@iki.fi> - - * tests/.cvsignore - tests/bug21478.phpt - tests/zend2.php - tests/zend2.php.txt: - Missing .cvsignore, broken test, renamed zend2.php -> zend2.php.txt - -2003-07-01 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - ZTS fixes. - -2003-07-01 George Schlossnagle <george@omniti.com> - - * zend_reflection_api.c: - more incremental changes. add anything that needs a class factory. - - * zend_reflection_api.c: - all the easy parts of Reflection_Class - -2003-06-30 Shane Caraveo <shane@caraveo.com> - - * zend_operators.h: - this fixes including this header in a c++ file (vs6) - -2003-06-30 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.c: - nuke "main" as a reserved keyword - -2003-06-30 Andi Gutmans <andi@zend.com> - - * zend.c - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_mm.c - zend_opcode.c - zend_reflection_api.c: - - ZE coding style requires if ( instead of if( - -2003-06-30 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_reflection_api.c: - ZTS fixes. Remove unused local variables. - -2003-06-30 George Schlossnagle <george@omniti.com> - - * Makefile.am - Zend.dsp - ZendTS.dsp - zend_default_classes.c - zend_reflection_api.c - zend_reflection_api.h: - added support for Reflection_Function, the first part of - the reflection api - -2003-06-30 Sterling Hughes <sterling@bumblebury.com> - - * zend_builtin_functions.c: - move the check down a little so it catches all cases - - * zend_builtin_functions.c: - Fix bug #24399 from an excellent test case by edin - -2003-06-30 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Semantically it's a refcount increase, not a lock... - - * zend_execute.c: - Fix 'global' implementation (fixes, at least, bug #24396 - -2003-06-30 Sterling Hughes <sterling@bumblebury.com> - - * zend_operators.c: - revert back the optimization for now. - -2003-06-29 Ilia Alshanetsky <ilia@prohost.org> - - * zend_object_handlers.c: - Fixed bug #24279 (__get() crash when no value is returned) - -2003-06-29 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Remove namespace references. - -2003-06-29 Sterling Hughes <sterling@bumblebury.com> - - * zend_operators.c: - Very simple, but very effective optimization. Provides a signifigant speed - improvement to matches done via '=='. This checks that the lengths of two - strings are equal before performing a memcmp() on them. - -2003-06-23 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix crash :) - -2003-06-23 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - FIx leak - -2003-06-22 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_language_parser.y: - Fix complex expressions for class names in NEW - - * zend_language_parser.y: - Simplify - -2003-06-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_parser.y: - WS - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Add final classes - -2003-06-16 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - no need to init zval - assignment will init - - * zend_execute.c: - Fix bug #22592 - cascading assignments to string offsets - - * zend_constants.c: - support for self:: and parent:: constants - - * zend_builtin_functions.c: - fix lambda function static vars (related to #17115) - -2003-06-15 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_constants.c: - Fix ZTS build. - -2003-06-15 Stanislav Malyshev <stas@zend.com> - - * zend.c: - Fix bug #23279 - exception handler exits after first function call - - * zend_execute_API.c: - No need to duplicate code - zend_get_constant() knows to - handle class constants now - - * zend_execute_API.c: - Fix bug #18872 - Improper handling of class constants used as default - function argument values - - * zend_constants.c: - set ending \0 for string - - * zend_compile.c - zend_constants.c - zend_language_parser.y: - Fix bug #23384 - static class::constant constants should now - work in static & array expressions. - - * zend_execute_API.c: - Fix bug #21800 - initialize opcode handlers in interactive mode - -2003-06-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_hash.c: - ecalloc doesn't return NULL - - * zend.c: - Bugfix #24182: va_arg macro error in Zend/zend.c - -2003-06-10 Jani Taskinen <sniper@iki.fi> - - * zend_multiply.h: - - Missing $Id$ tag - -2003-06-10 James Cox <james@imajes.info> - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - updating license information in the headers. - -2003-06-09 Wez Furlong <wez.php@thebrainroom.net> - - * zend_execute_API.c: - Fix for Bug #23951 - -2003-06-09 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - remove NS leftover - -2003-06-09 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix bogus implicit declarations of properties (squash bug #23671) - -2003-06-09 Stanislav Malyshev <stas@zend.com> - - * zend_API.c - zend_execute_API.c: - Support 'self' and 'parent' in call_user_func() - -2003-06-09 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix indirect reference calls to bogus function names - -2003-06-09 Jani Taskinen <sniper@iki.fi> - - * zend_builtin_functions.c: - ws - -2003-06-08 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Fix casing issues in access level checks - - * zend.c - zend_compile.c - zend_compile.h: - Nicer handling of protected/private members in print_r() - - * zend_execute.c: - Fix handling of object property assignments in switch expressions - (bug #23925) - - * zend_builtin_functions.c: - Fix set_error_handler() - -2003-06-06 Sascha Schumann <sascha@schumann.cx> - - * zend_multiply.h: - mfb #24025 fix - -2003-06-04 Stanislav Malyshev <stas@zend.com> - - * zend.c: - fix non-ZTS build - -2003-06-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c: - Fix segfault. Again. - -2003-06-04 Stanislav Malyshev <stas@zend.com> - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - rm namespace leftovers - -2003-06-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c: - Fix segfault. #Hopefully not a Voodoo Fix[TM]. - -2003-06-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c - zend_execute.h: - Leftover. - -2003-06-02 Stanislav Malyshev <stas@zend.com> - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_object_handlers.c - zend_opcode.c: - MEGA-patch: namespaces are R.I.P. - -2003-06-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * tests/zend2.php: - No nested classes - - * tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt: - Add some ZE2 bug tests - - * zend_opcode.c: - Bugfix #23670: implements and extends cause Apache 2 crash - - * zend_constants.c: - Do it correct always - - * zend_compile.h: - Defining it once is enough - -2003-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend.c: - Fix init shutdown - -2003-05-31 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.c - zend_execute.c: - revert the function call caching patch until a new solution is decided - upon. - -2003-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_constants.c: - Fix constants (noticed by David Brown <dave@codewhore.org>) - - * zend_constants.c: - c->name_len already contains the '\0' - -2003-05-30 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix crash on exceptions when return value of the inside function is used - -2003-05-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c - zend_language_parser.y: - Fix ~ operator in class constants. - - * zend_compile.c - zend_compile.h - zend_operators.c: - Faster interface inheritance & faster inheritance checks - - * zend_language_scanner.l: - CS - -2003-05-29 Wez Furlong <wez.php@thebrainroom.net> - - * zend_compile.c: - Fix Bug #23285 (Potential Stack Overflow in zendlex). - -2003-05-28 Sterling Hughes <sterling@bumblebury.com> - - * zend_alloc.c: - no reason to do this at runtime - - * zend_compile.c - zend_execute.c: - Cache function call lookups with loops (store in a temporary variable on - the - result opline). - Assuming lazy concensus on message that GeorgeS sent to the list last week - -2003-05-27 Sterling Hughes <sterling@bumblebury.com> - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - Assume lazy consensus regarding the cast_object() patch. *Only* - implemented - from a internals perspective. This callback has been very useful for both - ext/mono and ext/simplexml - -2003-05-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_language_scanner.l: - Add pseudo constant __METHOD__ to easily report namespace::class::method. - - -2003-05-23 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.h: - Revert to sizeof() - -2003-05-23 Sterling Hughes <sterling@bumblebury.com> - - * zend_execute.c - zend_hash.c - zend_operators.c - zend_operators.h: - move HANDLE_NUMERIC() from the hash table implementation upstream to the - places that actually need to use it. - -2003-05-22 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - No need to copy here unless implicit_clone is active (noticed by rob) - -2003-05-21 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c - zend_builtin_functions.c - zend_constants.c - zend_object_handlers.c: - Make use optimized string lowering - - * zend_operators.c - zend_operators.h: - Use same parameter order as strcpy() - - * zend_API.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h: - Make zend_str_tolower_copy() a copy function (like stccpy). - Supply a dup version (like estrdup). - Fix tolower() handling. - -2003-05-21 Jani Taskinen <sniper@iki.fi> - - * zend_builtin_functions.c: - Fixed bug #23619 (set_error_handler() registered handler not called for - object instances). (Jani, waboring@qualys.com) - -2003-05-21 Sterling Hughes <sterling@bumblebury.com> - - * zend_operators.c: - optimize loops. The check only exists for integers because that's the more - common optimization, and you actually lose performance if you check for - a double too (wierd but true). - - * zend_mm.h: - add some logic to detect zend_mm, which is really only useful when thread - safety support is enabled. - - * zend_mm.h: - leave this off until its more ready/stable - php5 actually beats php4.3.* in my benchmarks now - - - * zend_API.c: - use zend_str_tolower_copy() - - * zend_execute.c: - Bottom drawer optimization to avoid this comparison, but this OP is - executed - quite often (all of the fetch_* ops) - -2003-05-20 Sterling Hughes <sterling@bumblebury.com> - - * zend_operators.c: - bah humbug, use the pointer based version, which turns out to be an - instruction - faster - - * zend_operators.c: - use pointer arithmetic for the normal zend_str_tolower() - -2003-05-20 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - No need to copy the zval unless __clone() is called - -2003-05-20 Sterling Hughes <sterling@bumblebury.com> - - * zend_operators.c: - make this faster and sexier - - * zend_execute.c: - use the new zend_str_tolower_copy() function - - * zend_operators.c: - doesn't need to be register - - * zend_execute_API.c - zend_operators.c - zend_operators.h: - optimize the lookups by avoiding a copy and then another pass - - Naked Dancing Girls should be given to: Myself, Zeev, Marcus, - and George Schlossnagle (in no particular order) - - * zend_API.h - zend_execute_API.c: - add fast_call_user_function() - -2003-05-20 Hartmut Holzgraefe <hartmut@php-groupies.de> - - * zend_API.h - zend_constants.h - zend_operators.h: - C++ compile fixes - -2003-05-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute.c: - Fix exception memleak - -2003-05-19 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_execute.c: - fix __clone - -2003-05-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_execute_API.c: - One function call is enough - -2003-05-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Inheritance fix - -2003-05-07 Edin Kadribasic <edink@proventum.net> - - * zend_compile.c: - Reverting Marcus' incomplete patch which broke the build. - -2003-05-07 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_compile.c: - Inheritance fixes - -2003-05-04 Marcus Boerger <marcus.boerger@post.rwth-aachen.de> - - * zend_API.c: - Fix namespace issue: Only CG is needed here - - * zend_API.c - zend_API.h: - Allow functions in internal namespaces (for example factories) - - * zend_execute.c: - Modify the abstract error message so that it shows up to three methods not - implemented. - - * zend_execute.c: - Fix warnings - - * zend_compile.c: - Don't inherit twice what is needed only once - - * zend.c: - Fix bug #23162 user_error() crashs if > 1024 bytes (Marcus, Moriyoshi) - -2003-05-04 Sterling Hughes <sterling@bumblebury.com> - - * zend_default_classes.h: - semicolon - -2003-05-03 Sterling Hughes <sterling@bumblebury.com> - - * zend_default_classes.h: - proto - - * zend_default_classes.c: - add an accessor for the default exception - -2003-04-29 Sascha Schumann <sascha@schumann.cx> - - * zend_multiply.h: - Fix the *= operator - - Slightly modified patch by Wez Furlong - -2003-04-25 Jani Taskinen <sniper@iki.fi> - - * zend_language_scanner.l: - Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) - -2003-04-24 Sascha Schumann <sascha@schumann.cx> - - * zend_alloc.c - zend_alloc.h - zend_multiply.h: - add safe_emalloc - -2003-04-21 Stanislav Malyshev <stas@zend.com> - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - Change get_class() so that it returns qualified names for namespaced - classes. - - *HEADS UP*: get_class_name() handler interface is changed, now it should - allocate the space it returns with emalloc, and the users free it. If - anyone has problems with it or has suggestions how to do it without this - - please tell. - - Also: make function_exists() understand namespaces. - - * zend_execute.c: - make import * fail if such classes or functions already there - -2003-04-20 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.c: - Add check for final properties - -2003-04-20 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: - Check name before '::' so that it would be a namespace in - zend_lookup_ns_class - - * zend_builtin_functions.c: - refine the set_error_handler fix - - * zend_builtin_functions.c: - Fix for bug #21094 (set_error_handler can not accept methods), - by Timm Friebe - -2003-04-19 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c: - Corrected patch by Marcus Börger <helly@php.net>. - -2003-04-18 Sterling Hughes <sterling@bumblebury.com> - - * zend.c - zend_opcode.c: - Patch by Marcus Börger to fix some memleaks - -2003-04-18 Derick Rethans <d.rethans@jdimedia.nl> - - * zend.h - zend_extensions.c: - - Revert my symbol fix patch, and merge in Stas' fixes to Zend Engine 1. - - * zend.h: - - MacOSX also prepends the _ before symbols in bundles - -2003-04-17 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c: - Patch by Marcus Börger <helly@php.net>. - -2003-04-11 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_compile.c - zend_compile.h: - Fix warnings. - -2003-04-10 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.c: - satisfy andi's switch fetish ;-) - -2003-04-10 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_compile.c: - Fix ZTS build. Fix warning. - - * ZEND_CHANGES: - Document 'const' keyword. - -2003-04-10 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - allow expressions within constants, so the following is possible - - class foo { - const a = 1<<0; - const b = 1<<1; - const c = a | b; - } - - this makes const a compile-time expression. all other operators are - unaffected. - -2003-04-10 Zeev Suraski <zeev@zend.com> - - * zend_language_parser.y - zend_language_scanner.l: - Revert Harald's commit - -2003-04-10 George Schlossnagle <george@omniti.com> - - * zend_language_parser.y: - One line fix so that it will compile - -2003-04-09 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_language_parser.y - zend_language_scanner.l: - removing the *syntactical sugar* again - - -2003-04-08 Andrei Zmievski <andrei@gravitonic.com> - - * zend_builtin_functions.c: - Switch some functions to use new zend_lookup_ns_class() methods. This - means that they will accept both simple and fully qualified class names. - - * zend_API.c - zend_API.h: - Rename zend_register_internal_class_in_ns() to a better, less filling, - but with the same great taste zend_register_internal_ns_class(). - - * zend_execute.h - zend_execute_API.c: - Add zend_lookup_ns_class() function. - - * zend_operators.h: - Move memnstr into Zend and make an alias for BC in PHP. - -2003-04-07 Jani Taskinen <sniper@iki.fi> - - * zend_language_scanner.l: - Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) - -2003-04-07 Sterling Hughes <sterling@bumblebury.com> - - * zend_compile.h: - add markers that make this file easy to parse for external sources - -2003-04-04 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.h: - Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring - class methods to avoid name collisions. - -2003-04-04 Stanislav Malyshev <stas@zend.com> - - * zend_API.c - zend_API.h: - Fix namespace issues - -2003-04-03 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c: - Patch from Timm Friede for when EG(active_namespace) is NULL initially. - - * zend.c - zend_API.c - zend_compile.c: - Initialize all relevant zend_class_entry fields to avoid accidental - crashes. - -2003-04-03 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_list.c: - Leftover. - -2003-04-03 Sterling Hughes <sterling@bumblebury.com> - - * zend_list.c - zend_list.h: - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - -2003-04-02 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c - zend_API.h: - - Add zend_register_internal_namespace() API function. - - Add zend_register_internal_class_in_ns() API function. - - * zend_compile.h: - Simplify. - -2003-04-02 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_list.c: - - Fix whitespace - -2003-04-02 Sterling Hughes <sterling@bumblebury.com> - - * zend_list.c - zend_list.h: - add the ability for curl_multi_info to introspect the handles. - - -2003-04-02 Andrei Zmievski <andrei@gravitonic.com> - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Implement a different way to catch documentation comments. - - * zend_compile.c - zend_compile.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - Revert portions of the doc comment patch. There should be no parser - errors now. - -2003-04-02 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_compile.h - zend_execute.c: - allow class_exists() to work with namespaces too. - add CLASS_IS_NAMESPACE macro - - * zend_builtin_functions.c: - fix typo - - * zend_builtin_functions.c: - fix parameterless get_declared_classes call - -2003-04-01 Andrei Zmievski <andrei@gravitonic.com> - - * zend_execute.c: - Stas's patch on zend_execute.c (1.448 -> 1.449) resulted in a bug where - the namespaced member accesses didn't work. This should hopefully - correct it. - - * zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_opcode.c: - Split ZEND_NAMESPACE into user and internal namespaces. Hope this is - okay with engine folks. - -2003-04-01 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c: - improve namespace name hanfling - - * zend_builtin_functions.c: - fix get_declared_classes() - - * zend_language_parser.y - zend_language_scanner.l: - Add __NAMESPACE__ auto-constant. - - * zend_builtin_functions.c: - make get_declared_classes() work with namespaces (based on Tal Peer's - patch) - -2003-03-31 Andrei Zmievski <andrei@gravitonic.com> - - * zend.h - zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Multi-purpose patch: - - The fields of zend_namespace were not completely initialized which - led to a variety of problems. - - The occurrence of class/interface/namespace definition is now - captured. - - Functions/classes/interfaces/namespaces can be preceded by doc - comments which are stored for use by extensions. - -2003-03-31 Stanislav Malyshev <stas@zend.com> - - * zend.c: - Use strncpy instead of sprintf - -2003-03-30 Andrei Zmievski <andrei@gravitonic.com> - - * zend_language_parser.y: - Since zend_do_begin_class_member_function_call assumes the previous - opcode is FETCH_CONSTANT, swap the calls around. - -2003-03-30 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: - ZTS fix. - -2003-03-30 Stanislav Malyshev <stas@zend.com> - - * zend.c: - Try to report class name of the exception - - * zend_execute.c: - Fix namespace switch - -2003-03-29 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Add missing initialization - - * zend_compile.c: - Fix crash - - * zend_API.c - zend_compile.c - zend_compile.h: - Initial support for enforcing prototype of abstract/interface method - implementations - -2003-03-29 Sterling Hughes <sterling@bumblebury.com> - - * zend.c: - remove unused variable - -2003-03-27 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix fetch_class buglet - -2003-03-26 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c - zend_language_parser.y: - Un-nest namespaces - now namespace X { namespace Y {} } is a parse error - Also refine namespaced includes - -2003-03-26 Ilia Alshanetsky <ilia@prohost.org> - - * zend_compile.c: - Fixed bug #22900 (declaration of namespaces with same name results in - leaks). - -2003-03-26 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - Eliminate TSRMLS_FETCH() calls in destroy_op_array() and - zend_get_class_entry(). - - * zend_API.c - zend_object_handlers.c - zend_objects.c - zend_objects.h: - Eliminate TSRMLS_FETCH() calls in zend_objects_new() and - zend_objects_get_address(). - -2003-03-25 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Temporarily fix problem with inheriting from an internal class. This - might - - need some rework in the future (thanks to Marcus) - -2003-03-24 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - Fix {include|require}_once error message - if open - fails, don't use tream, use original name. - -2003-03-23 Andi Gutmans <andi@zend.com> - - * zend.c: - - Fix win32 build - -2003-03-23 Stanislav Malyshev <stas@zend.com> - - * zend.c: - resore namespace on shutdown - since some functions use - EG() and CG() pointers - -2003-03-23 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_default_classes.c: - ZTS fix. - -2003-03-23 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Another fix for implicit public, perhaps it was not such a good idea :I - -2003-03-23 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Zend.dsp - ZendTS.dsp - zend_default_classes.c: - Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with - ZendTS.dsp. ZTS fixes. - -2003-03-23 Sterling Hughes <sterling@bumblebury.com> - - * zend_default_classes.h: - DEFAULT_CLASSES_H not DEFAULT_INTERFACES_H - - * Makefile.am - zend.c - zend_default_classes.c - zend_default_classes.h: - add a standard Exception class. - -2003-03-22 Shane Caraveo <shane@caraveo.com> - - * zend_compile.h: - export functions needed by cli - - * zend_language_scanner.l: - fix crash in win32 debug build - -2003-03-20 Stanislav Malyshev <stas@zend.com> - - * Zend.m4: - Add stdlib.h too - it is needed fot strto{ld} - -2003-03-19 Andrei Zmievski <andrei@gravitonic.com> - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - - Keep track of starting/ending line numbers for user functions. - - Store last parsed doc comment in a compiler global for future use. - - * zend_API.c: - Lowercase the function name when used as key in the function name. The - original case is still preserved in zend_function structure. - -2003-03-18 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_object_handlers.c: - - Fix situation where a derived class declares a public (or implicit - public) - with the same name as a private in the parent - - Optimize 'static binding' of private properties a bit - -2003-03-18 Stig Bakken <ssb@fast.no> - - * RFCs/002.txt: - - email address change - -2003-03-17 Stanislav Malyshev <stas@zend.com> - - * zend_extensions.c: - MFZE1 - -2003-03-17 Jani Taskinen <sniper@iki.fi> - - * Makefile.am: - Added missing zend_mm.c file and renamed zend_object_API.c -> - zend_objects_API.c - -2003-03-13 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c: - Fix warning in va_start(). - -2003-03-12 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c: - Initialize the namespace when registering functions. - -2003-03-12 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix a crash bug in the implicit public declaration - -2003-03-11 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_object_handlers.c: - Fix handling of ::func() - -2003-03-10 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Clean redundant code - -2003-03-10 Jani Taskinen <sniper@iki.fi> - - * zend_compile.c: - Fixed some leaks. Patch by Moriyoshi - -2003-03-10 Shane Caraveo <shane@caraveo.com> - - * zend_config.w32.h: - fix isinf for win32 - -2003-03-09 Zeev Suraski <zeev@zend.com> - - * zend_language_parser.y: - Optimize - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix handling of ::foo - - * zend_compile.c: - Cleanup - -2003-03-09 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l: - - Nuke junk - -2003-03-09 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix parsing rules of namespaces/classes - - * zend_language_parser.y: - Add ability to use ::interface_name in implements - - * zend_compile.c: - Fix :: handling - -2003-03-07 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Dedicated to Greg Beaver <greg@chiaraquartet.net>. - - * ZEND_CHANGES: - Document 'final'. - - * ZEND_CHANGES: - Fix class type hints example. - - * ZEND_CHANGES: - Update 'abstract' section. - -2003-03-07 Jani Taskinen <sniper@iki.fi> - - * zend_ini.c - zend_ini.h: - Renamed OnUpdateInt -> OnUpdateLong to prevent further misunderstandings. - - * zend_execute.c: - Better fix for the memleaks (bug 19943) by Moriyoshi - -2003-03-06 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_execute.c: - Fix warnings - - * zend_execute.c: - Fix error message - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Require abstract classes to be explicitly declared 'abstract', in order to - avoid making developers traverse the entire class/interface hierarchy - before they can figure out whether a class is instantiable - (ok, so it makes sense :) - -2003-03-06 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - -german+english+. - - * ZEND_CHANGES: - D some TBDs - -2003-03-06 Jani Taskinen <sniper@iki.fi> - - * zend_execute.c: - Fixed bug #19943 (the memleaks) - -2003-03-06 Ilia Alshanetsky <ilia@prohost.org> - - * zend_highlight.c: - More cleanup of the zend_strip() function. - No longer strip __LINE__, since while it may become useless it could break - code where __LINE__ is passed as a function parameter. - - * zend_highlight.c: - Fixed in zend_strip() that corrupted heredoc. - Optimized the writing routine by moving from putchar() to fwrite(). - Changed hardcoded opcode # to it's defined name. - -2003-03-06 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - Change opcode name - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Add class type hints - -2003-03-05 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix auto globals - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Implement $obj::static_func() - - * zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c - zend_operators.c - zend_operators.h: - Add support for interfaces - -2003-03-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_language_parser.y: - Remove legacy code - - * zend_compile.c: - Remove redundant code - -2003-03-03 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_API.c: - add missing strtolower - - * zend_API.c - zend_API.h: - commiting zend_disable_class patch for George: - disabled classes will be replaced by dummy classes - that print a warning upon instanciation - -2003-03-02 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Fix destructors some more - - * zend_compile.c - zend_compile.h: - Improve infrastructure - - * zend.c - zend_compile.c - zend_compile.h: - Add infrastructure for JIT initialization of auto globals - -2003-03-01 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix mem leak - -2003-03-01 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Make __construct() have higher priority than class name functions - - for constructors. - - Fix problem with the engine allowing final/abstract for the same method. - - Both patches are by Marcus Börger. - -2003-02-27 Rasmus Lerdorf <rasmus@lerdorf.com> - - * zend_ini_scanner.l: - MFB: We know ini file scanning will never be interactive, so speed it up a - bit. Need a dynamic check for the language scanner. - -2003-02-26 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Syntactic sugar is sweet. - -2003-02-25 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Get the bits right - final/private fix - -2003-02-25 Jani Taskinen <sniper@iki.fi> - - * acconfig.h: - Do not redefine zend_isnan if it is already defined. - - * Zend.m4: - - Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). - -2003-02-24 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - fix exception handling - -2003-02-24 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l: - Add 'final' - -2003-02-24 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Remove obsolete not on redeclaring protected members. - - * ZEND_CHANGES: - Leftover. - - * ZEND_CHANGES: - Initial documentation of namespace {}. - -2003-02-23 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Move abstract inheritance logic to the right spot - - * zend_compile.c: - Fixed abstract handling in inheritence - -2003-02-20 Wez Furlong <wez.php@thebrainroom.net> - - * zend_stream.c: - -cough* - Fix another stupid mistake. - -2003-02-20 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Allow namespaces to have a number of parts. I.e., now you can do: - namespace foo { - function abc() {} - } - ... - namespace foo { - functio def() {} - } - -2003-02-19 Wez Furlong <wez.php@thebrainroom.net> - - * zend_stream.c: - Fix stupid mistake that only affected interactive mode. - -2003-02-18 Rasmus Lerdorf <rasmus@lerdorf.com> - - * zend_stream.c: - fileno() needs a FILE * here, and at least on FreeBSD with gcc-2.95.3 - it is unable to figure out that this is indeed a FILE * and hence it - won't compile without this cast. - -2003-02-18 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_scanner.l - zend_opcode.c: - Avoid using a C++ reserved word - -2003-02-18 Wez Furlong <wez.php@thebrainroom.net> - - * ZendTS.dsp - flex.skl: - Fixup build for win32 - - * Makefile.am - flex.skl - zend.c - zend.h - zend_compile.h - zend_execute.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l - zend_stream.c - zend_stream.h: - Implement simple stream support in the ZE scanners. - -2003-02-17 Zeev Suraski <zeev@zend.com> - - * zend_language_parser.y: - Whitespace & minor renames - - * zend_language_parser.y: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve handling of static member variables - - * zend_config.w32.h - zend_ini_parser.y: - Improve Win32 build performance - -2003-02-16 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix complex cases of self-assignments (bugs #21600, #22231) - - * zend_execute.c: - Make EG(This) and EG(scope) available to internal methods - - * zend_execute.c: - Revert patches - they weren't ready yet! - - * zend.c: - Fix initialization - -2003-02-16 Georg Richter <georg.richter@phpev.de> - - * zend_execute.c: - fixed compiler warning - - * zend_execute.c: - tested patch from Zeev (fixes oo-bug in ext/mysqli) - -2003-02-16 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_language_parser.y: - add support for ::foo syntax meaning "global one" - - * zend_compile.c: - remove debug prints - -2003-02-16 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - ZTS fixes - -2003-02-16 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: - namespace patch - static variable access - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Namespace patch. Big changes: - 1. Nested classes are gone. - 2. New syntax for namespaces: - namespace foo { - class X { ... } - function bar { ... } - var x = 1; - const ZZ = 2; - } - 3. Namespaced symbol access: $x = new foo::X; - etc. - For now, namespaces are case insensitive, just like classes. - Also, there can be no global class and namespace with the same name - (to avoid ambiguities in :: resolution). - -2003-02-15 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_scanner.l: - Added feature #19645 (ini parser can now handle quoted multi-line values). - -2003-02-14 Thies C. Arntzen <thies@thieso.net> - - * zend_execute_API.c: - init current_execute_data befor we start executing - - * Makefile.am: - ups - - * Makefile.am: - add really nice dump_bt function for debugging in gdb - -2003-02-13 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Fix error handling in illegal property access - -2003-02-13 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_language_scanner.l: - MFB PHP_4_3 - -2003-02-12 Ilia Alshanetsky <ilia@prohost.org> - - * zend_API.c - zend_API.h: - Removed zend_get_module(), this function is not used by anything and more - importantly. it does not work. It tries to find data based on numeric keys - in hash table using string keys. - -2003-02-12 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix declaration of class members that don't have an explicit access - modifier - -2003-02-11 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix require() handling - that's an old bug! - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Improve parser handling of 'abstract' - -2003-02-10 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix zend_initialize_class_data() - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h: - Centralize class initialization - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo - is not explicitly declared - - Forbid multiple declaration of the same variable - - * zend_execute.c: - whitespace - - * zend_API.c - zend_compile.c: - Add missing destructors - -2003-02-10 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: - update static constants too - -2003-02-10 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - Fix get_parent_class() - - * zend_object_handlers.c: - Restore missing check - - * zend_execute.c - zend_execute_API.c: - Add ability to reference self:: and parent:: in constant initializers - (bug #21849) - - * zend_execute.c: - Remove redundant code - -2003-02-09 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix the array() problem (and probably some other problems too) - -2003-02-08 Georg Richter <georg.richter@phpev.de> - - * zend_API.c - zend_API.h: - fixed zend_parse_method_param - -2003-02-08 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_builtin_functions.c: - zend_config.h (and its Win32 version) is already included by zend.h - -2003-02-08 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - The string.h is already available through zend.h, so the manual inclusion - is not necessary. - -2003-02-07 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - Added a check to ensure that string.h is available before trying to use it. - - Thanks Andi. - - * zend_builtin_functions.c: - Added missing header. - -2003-02-07 Zeev Suraski <zeev@zend.com> - - * zend_globals.h - zend_object_handlers.c: - Improve PPP handling of properties - - * zend_config.w32.h: - Better fix - - * zend_config.w32.h: - Fix Windows build - -2003-02-07 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - Fixed bug #15734 (Added an optional parameter to get_defined_constants(), - which if passed, will include information regarding who created the - constant). - -2003-02-06 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in - Zend Engine functions, if "zend" is specified as the module name). - Made get_extension_funcs() on failure. - -2003-02-06 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix the 2nd buglet in the error message :) - - * zend_object_handlers.c: - Fix check - - * zend_hash.c - zend_hash.h: - Fix prototype (may have caused stack corruption) - -2003-02-05 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - - read_property cleanup - - Implement unset/isset/empty for PPP - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_opcode.c: - Rework static class properties - now supports access restrictions - - * zend_hash.c - zend_hash.h: - Add quick_exists() - - * zend_object_handlers.c: - Add PPP support for arrays - - * zend_compile.c: - Fix buglet in error message - -2003-02-04 Zeev Suraski <zeev@zend.com> - - * zend_object_handlers.c: - Missing update - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_object_handlers.c - zend_opcode.c - zend_ts_hash.c - zend_ts_hash.h: - Reimplement PPP properties - -2003-02-03 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_API.h: - Build fix. - -2003-02-02 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_API.c - zend_API.h: - extend the parameter parsing API by two functions - for parsing method parameters with automatic - detection if the function was called as such or as - a class method (with a valid this ptr). - if called as a function the first parameter has to be - the object it is operating on, if called as a method - this is used. - - -2003-02-02 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_operators.h: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Core rearrangements - move Zend Objects specific code to their - specific implementation file - -2003-02-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix warning - -2003-02-01 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_ini_scanner.l - zend_language_scanner.l: - Fix build. - -2003-02-01 Jani Taskinen <sniper@iki.fi> - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Added some missing CVS $Id$ tags, headers and footers. - -2003-01-30 Ilia Alshanetsky <ilia@prohost.org> - - * zend_operators.c: - Fixed compiler warning regarding signed/unsigned int comparisons. - -2003-01-30 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_ts_hash.c - zend_ts_hash.h: - fix non-zts build for wez - -2003-01-30 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute_API.c: - Fix ZTS build. - -2003-01-29 Stanislav Malyshev <stas@zend.com> - - * zend_compile.h - zend_execute_API.c - zend_opcode.c: - Add additional stage to post-session cleanup. - We need separate cleanup stage because of the following problem: - Suppose we destroy class X, which destroys function table, - and in function table we have function foo() that has static $bar. Now if - object of class X was assigned to $bar, its destructor will be called and - will - fail since X's function table is in mid-destruction. - So we want first of all to clean up all data and then move to tables - destruction. - Note that only run-time accessed data need to be cleaned up, pre-defined - data can not contain objects and thus are not probelmatic. - -2003-01-29 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_object_handlers.c: - Code rearrangements - -2003-01-29 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: - Fix object destructors: - zend_objects_store_call_destructors is not used anymore, we rely on - symbol tables cleaners to destroy all objects. - - * zend_objects_API.c: - extra safety - - * zend_compile.c: - fix memory leak - -2003-01-29 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_object_handlers.c: - Fix assignments to $this. - Fixes the 'make install' problem reported on php-dev - -2003-01-28 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix a ticks related crash - - * (PHP_5_0_dev_before_13561_fix) - zend_execute.c: - Allow methods in parent classes to call protected methods in derived - classes - -2003-01-27 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - Replace MAKE_VAR opcode with special 'data' opcode - This opcode is not executeable but only holds data for opcodes - that need more than two arguments (presently only ASSIGN_OBJ and the ilk - but - in the future also ASSIGN_DIM) - -2003-01-26 Sascha Schumann <sascha@schumann.cx> - - * zend_API.c: - Replace snprintf() call using zend_error's capabilities - -2003-01-23 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Let the scope propagate to internal functions - -2003-01-23 Jani Taskinen <sniper@iki.fi> - - * zend_execute_API.c: - Fixed bug: #14542, register_shutdown_function() timeout problem - -2003-01-22 Stanislav Malyshev <stas@zend.com> - - * OBJECTS2_HOWTO: - some small refinements for get_class_* - -2003-01-22 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Fixed bug #21814 (Allow booleans to be used as array keys). - -2003-01-21 Sterling Hughes <sterling@bumblebury.com> - - * zend_objects_API.c: - fix by phanto to the cloning - -2003-01-19 Zeev Suraski <zeev@zend.com> - - * Zend.m4: - relabel - -2003-01-19 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - Restore for now old statics behaviour (so that indirect $$var references - would work again). Comprehensive fix will follow later. - -2003-01-19 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: - ini patch to allow 'entry[] = value' entries - -2003-01-17 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_objects.c - zend_objects.h: - export zend_objects_destroy_object() - static inline was meaningless anyways as the function - was only used as a callback handler and was never - called directly - - * zend_objects_API.c - zend_objects_API.h: - make std_object_handlers struct available for shared modules - -2003-01-16 Ilia Alshanetsky <ilia@prohost.org> - - * zend_execute.c: - Fixed bug #20933 (isset/empty didn't work when used on string offsets). - -2003-01-15 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Revert int -> unsigned int change for str.len - -2003-01-15 Sascha Schumann <sascha@schumann.cx> - - * zend.h: - Revert commit which turned the lengths of strings into zend_uint. - -2003-01-14 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Change "is" to "instanceof" as it explains better what the operator - means. - - "is_a" was also appropriate but ugly. - -2003-01-14 Stanislav Malyshev <stas@zend.com> - - * zend_API.c: - fix memory leaks and key size - -2003-01-14 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_parser.y: - MFZE2 - -2003-01-14 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - fix warning - - * zend_API.c - zend_API.h: - Make add_property_ functions work via write_property handler - - * zend.c - zend_object_handlers.c: - ws - -2003-01-14 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_parser.y: - Reverting previous patch. - -2003-01-13 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_parser.y: - MFZE2 - -2003-01-13 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - - Don't check if the handle is bogus. We should crash. - -2003-01-12 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_modules.h: - fix wrong dereferenciation - -2003-01-12 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: - fix inheritance - - * zend_API.h: - Remove handle_property from here too - - * zend.c - zend.h - zend_compile.c: - RIP handle_* functions. ZE2 will use __ handlers instead. - - * zend_object_handlers.c: - Move Z_OBJ_P here. - - * zend_operators.h: - Remove Z_OBJ - it's internal to Zend objects, no generic function except - those in zend_object_handlers.c should use it. - Add Z_OBJ_HANDLER macro for easy access to handlers - -2003-01-12 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.c - zend.h - zend_builtin_functions.c: - ZTS fixes. - -2003-01-12 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: - add get_class_name handler - - * zend.c: - Use generic handlers instead of Z_OBJ - -2003-01-12 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_modules.h: - - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - partially revert previous commit and - change zend_modules.h to include - a forward declaration to zend_ini_entry - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - added zend_ini_entry to zend_modules_entry as - discussed with zeev - - * zend_builtin_functions.c: - fix 'use of uninitialized variable' warning - -2003-01-12 Stanislav Malyshev <stas@zend.com> - - * zend_objects_API.c: - validate handle - -2003-01-12 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_ini.h - zend_variables.c: - Implemented compatibility mode - To enable - zend2.implicit_clone = on in php.ini or using ini_set() - -2003-01-11 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix typo and whitespace - -2003-01-11 Derick Rethans <d.rethans@jdimedia.nl> - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c: - - Ported the zend_execute_internal hook to ZendEngine2. - -2003-01-11 Harald Radi <harald.radi+coding.php@nme.at> - - * zend_ts_hash.c: - freed reader twice instead of writer and reader - -2003-01-10 Ilia Alshanetsky <ilia@prohost.org> - - * zend_alloc.c: - MFZE2 - -2003-01-10 Andrei Zmievski <andrei@gravitonic.com> - - * zend_API.c: - Automatically register constructor, destructor, and clone function when - class methods are registered. - -2003-01-09 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Found some more occurences of that elusive bug... - - * zend_compile.c: - Fix one lousy, annoying lurking bug (memory corruption) - Sebastian - try coWiki again please... - - * zend_API.h: - Unify and make it easy to add code into the broken-string error handler - - * zend_language_parser.y: - Fix writability checks - - * zend.c: - Fix leak - -2003-01-08 James Cox <james@imajes.info> - - * zend.h: - cvs is dev not alpha. - -2003-01-08 Ilia Alshanetsky <ilia@prohost.org> - - * zend_builtin_functions.c: - MFZE2 - -2003-01-05 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - MFZE1 - lineno fix - -2003-01-02 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix incorrect linkage of access-levels, when using private methods - -2003-01-01 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_operators.h: - Win32 build fix - -2003-01-01 Stanislav Malyshev <stas@zend.com> - - * zend_operators.h: - use handler for Z_OBJPROP - -2003-01-01 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Fix Wez's problem - -2002-12-31 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - Bump year. - -2002-12-31 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.h: - fix level of indirection - -2002-12-30 Andrei Zmievski <andrei@gravitonic.com> - - * zend_execute_API.c: - Adjust the error message. - -2002-12-30 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.h: - Oops, fix it indeed - - * zend_object_handlers.h: - Better check - -2002-12-26 Andrei Zmievski <andrei@gravitonic.com> - - * zend_compile.c: - do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or - FAILURE. - -2002-12-14 Ilia Alshanetsky <ilia@prohost.org> - - * zend_language_scanner.l: - MFZE2 - -2002-12-10 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix check to allow for static+access level modifiers - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Allow variables to have both 'static' modifier and an access level. - NOTE: This only works at the syntax level right now (parser). It - doesn't actually work as of yet - all statics are considered - public for now - - Prevent users from putting more restrictions on methods in derived - classes - (i.e., you cannot make a public method private in a derived class, etc.) - -2002-12-09 Andi Gutmans <andi@zend.com> - - * zend_mm.c: - - Fix a bug which I just introduced. - - * zend_mm.c: - - Fix typo - - * zend_mm.c: - - Improvements - - * zend_mm.c - zend_mm.h: - - First attempt to improve memory manager during realloc()'s - -2002-12-08 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Remove comment - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Treat the absence of an access type just as if 'public' was supplied - - * zend_compile.c: - Simplify/fix inheritance checks - - * zend_execute.c: - Support private/protected constructors - -2002-12-07 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Update. - -2002-12-07 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix error messages - - * zend_language_parser.y - zend_language_scanner.l: - Remove unintentional code - -2002-12-07 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Dissallow using parent, self and main as class names - -2002-12-06 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_hash.h - zend_language_parser.y - zend_language_scanner.l: - - Implement public/protected/private methods. - - Prevent instantiation of classes with abstract methods. - Based in part on Marcus's patch. - -2002-12-01 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - - Allow enabling of memory cache with zend_mm - - * zend.c - zend.c - zend.h - zend.h - zend_builtin_functions.c - zend_builtin_functions.c: - - MFZE1 - - * zend.c - zend.h - zend_builtin_functions.c: - - Revert as the patch doesn't compile - - * zend.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_indent.c - zend_object_handlers.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_variables.c: - h WHitespace - - * zend.c: - - Initialize constants_updated (by Marcus) - - * zend_builtin_functions.c: - - Nuke use of deprecated macro - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - FN_IS_STATIC -> FN_STATIC - - * zend.c: - - Fix crash - - * zend_compile.c - zend_compile.h: - - My personal cleanups - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_language_parser.y - zend_object_handlers.c: - - Commit Marcus' cleanup of abstract and static inheritance and improve - - error messages - -2002-11-22 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_API.c: - - Initialize all functions to non-static (patch by Marcus Börger - <marcus.boerger@t-online.de>. - -2002-11-22 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: - Show class name as well. Patch by Marcus Börger. - - * zend_execute.c: - Show the name of the abstract method in the error. - - * zend_compile.h: - Fix prototype. - -2002-11-20 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_builtin_functions.c: - - MFZE1: Disable leak() and crash() when not using debug mode - -2002-11-20 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Add abstract methods - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l: - - Fix build (thanks Marcus) - - Implement abstract methods, syntax: - - abstract function foo($vars); - - I don't see any reason why modifiers such as static/public need to be - - used with abstract. PHP is weakly typed and there would be no meaning to - - this anyway. People who want a strictly typed compiled language are - - looking in the wrong place. - -2002-11-19 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: - MFZE1 - error_reporting fix - -2002-11-18 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l: - - MFZE1 - -2002-11-17 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix the leak - -2002-11-16 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l - zend_language_scanner.l: - - MFZE1 - - * Zend.m4 - configure.in: - - MFZE1 - - * zend_hash.c: - - Commit fix for bug #19566 (I think it's by Marcus :) - -2002-11-14 Andrei Zmievski <andrei@gravitonic.com> - - * zend_llist.h: - MFZE1 - -2002-11-13 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - semi-fix string offsets crash - now it doesn't crash, but still leaks - - * zend_object_handlers.c: - fix static - -2002-11-11 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Update with statics - -2002-11-11 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: - Fugbix typo. - -2002-11-11 Ilia Alshanetsky <ilia@prohost.org> - - * zend.h: - MFZE1 - -2002-11-10 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - MFZE1 - -2002-11-10 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - fix statics - make it behave like $this (fetch type "static") - Side effect: indirect references to statics won't work. - -2002-11-06 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: - Fix ZTS build. - -2002-11-06 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - fix zend_assign_to_object_op - -2002-11-05 Ilia Alshanetsky <ilia@prohost.org> - - * zend_language_scanner.l: - MFZE1 - -2002-11-05 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - - Shift around zend_op members - - * ZEND_CHANGES: - - A couple of updates - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Add support for static methods. Basically methods which are defined as - - static don't have $this. That's the whole difference. - - * tests/zend2.php: - - $clone -> $that - - * zend_execute_API.c: - - Fix bug introduced with type change of free_op1/2 - - * zend_language_parser.y - zend_language_scanner.l: - - ATTENTION: Finally nuke old_function and cfunction. I think it is time - - to get rid of these BC notations. This is from the days of the move from - - PHP/FI 2 -> PHP 3 - -2002-11-05 Ilia Alshanetsky <ilia@prohost.org> - - * zend_hash.c: - Revert of previous patch. - -2002-11-05 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_objects.c: - - Change the automatically created variable $clone in __clone() to - - $that as discussed at the PHP Conference. If there are any objections - - alternative names please let me know. The reason for changing it from - - $clone is because $clone sounds as if it's the newly cloned object and - - not the old one. - -2002-11-05 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h: - avoid using 'class' in exported functions - it annoys c++ - -2002-11-05 Stig Bakken <ssb@fast.no> - - * zend.c: - Fixed some special cases that were crashing for the exception default - handler. - -2002-11-04 Ilia Alshanetsky <ilia@prohost.org> - - * zend_compile.c: - Silence compiler warnings. - - * zend_hash.c: - If ordered is not set a random compiler assigned value of *p2 would be - used, - this patch fixes the problem by initializing *p2 to NULL. - - * zend_operators.c: - Silence compile warning, ctype.h is needed for tolower() function. - - * zend_language_scanner.l: - MFZE1 - -2002-11-02 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_language_scanner.l: - - Fix segfault when __CLASS__ was used outside a class definition - - * zend.c: - - MFZE1 - -2002-11-02 Ilia Alshanetsky <ilia@prohost.org> - - * zend_language_scanner.l: - MFZE1 (20214). - -2002-11-01 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix unset($this->foo) - -2002-10-24 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_opcode.c: - Also tune jmpz_ex - - * zend_execute.c - zend_opcode.c - zend_compile.h: - - Improve performance of part of the jmps. More to follow. - -2002-10-23 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_compile.c: - - This might improve performance. Commiting it so that I can check it on - - Linux - - * zend_execute.c: - - Make Ts access a macro. I need this for my next patch which should - - improve performance but not sure yet if it will. - -2002-10-22 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Nuke unused get_incdec_op() - - Nuke old comment - - * zend_compile.h - zend_execute.c - zend_globals.h: - Improve overall engine performance - - * zend_execute.c: - Fix bug reported by Daniel T. Gorski - -2002-10-21 Thies C. Arntzen <thies@thieso.net> - - * zend_builtin_functions.c: MFZE1 - -2002-10-20 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: looks like this message should go - - * zend_compile.c: Fix private handling - -2002-10-20 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_highlight.c - zend_highlight.h: Sync zend_html_puts parameter list with Zend Engine 1. - -2002-10-19 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Fix compile warning. - - * zend_opcode.c - zend_compile.h - zend_execute.c: - Improve opcode dispatching - -2002-10-18 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.c - zend_execute.c: - - Change opcode dispatch mechanism to use a function per opcode and use - - a lookup table using the opcode # to call the correct function. - - Still have lots of tuning to do. - - * zend_execute.c: - Cleanup - -2002-10-16 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: Fix ZTS build. - -2002-10-16 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_execute.c: Fix class static members: now the following code works: - <?php - - class Foo { - static $c = "Parent"; - } - - class Child extends Foo { - } - - Foo::$c = "Hello"; - - var_dump(Child::$c); - ?> - and returns "Hello" (class statics are not copied anymore, but looked up in - runtime) - - * zend_compile.c - zend_compile.h - zend_execute.c: Fix and generalize $this handling. - ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be - used instead as the sign that it's a fetch from $this - -2002-10-14 Ilia Alshanetsky <ilia@prohost.org> - - * zend_ini_parser.y - zend_ini_scanner.l - zend_globals.h: MFZE1 - -2002-10-14 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_language_parser.y: - Support new classname::$class_name, e.g.: - <? - - class foo::bar { - public $hello = "Hello, World\n"; - } - - $name = "bar"; - $obj = new foo::$name; - print $obj->hello; - ?> - -2002-10-13 Ilia Alshanetsky <ilia@prohost.org> - - * zend_extensions.h: Increased the API number. (re: floats patch) - -2002-10-12 Ilia Alshanetsky <ilia@prohost.org> - - * zend_operators.c - zend_operators.h - zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (floats & locale issue) - -2002-10-10 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Fugbix typo. - -2002-10-10 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: add comment - - * zend_object_handlers.c: fix memory leaks - -2002-10-09 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: Fix object write handler behaviour: - * If this value is already set to given value, don't try to set it again. - * If we have reference, we should not move it. - * If we are assigning referenced variable, we should separate it. - -2002-10-09 Ilia Alshanetsky <ilia@prohost.org> - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 zend_str_tolower issue. - -2002-10-07 Andi Gutmans <andi@zend.com> - - * tests/zend2.php: - Fix test - - * zend_execute.c: - - Require $this-> when calling a methods. This whole automatic lookup - - first in the class and then in the global scope is confusing, slow and - - not quite BC compatible. - - * zend.c - zend_compile.c - zend_globals.h: - - Allow access to private/protected variables of $clone inside the __clone() - - method - -2002-10-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix problem with unsetting object members. - -2002-10-01 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Fix problem when crashing on illegal tokens in class name during class - - definition. - -2002-09-30 Derick Rethans <d.rethans@jdimedia.nl> - - * ZEND_CHANGES: - No tabs :) - -2002-09-28 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_builtin_functions.c: - Fix for defines... - - * zend_builtin_functions.c: - Fix build in non-ZTS mode - -2002-09-26 Ilia Alshanetsky <ilia@prohost.org> - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 - -2002-09-25 Stanislav Malyshev <stas@zend.com> - - * zend_extensions.h: - Propmote API NO year, so that it will never be the same as ZE1 API NO - -2002-09-24 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Fix leak - - * zend_language_parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Megapatch to try and support inheritance from sub-classes. Things might - - be *very* buggy now so don't get too upset if that happens. - - I still need to improve some stuff but it's a good step (hopefully). - -2002-09-23 Andi Gutmans <andi@zend.com> - - * zend_globals.h - zend_ini.c - zend_language_parser.y: - MFZE1. - -2002-09-21 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - Someone screwed this up. - -2002-09-19 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_ini.c: - Make Colin happy - -2002-09-19 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_execute_API.c: MFZE1 - connection_status() fix - - * zend.c: Fix non ZTS build - - * zend.c: Fix that obscure crash in Debug_TS mode - -2002-09-18 Zeev Suraski <zeev@zend.com> - - * zend.c: - Fix the thread-safe initialization of the ZE2. This should solve some - sporadic crashes, as well as the problem with the built-in constants. - - * zend_constants.c: Remove dead code - - * zend_builtin_functions.c: Add useful debugging function - -2002-09-17 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: Add tracking for hashtable allocation - - * zend.c: ZE2 fix - - * zend_compile.c: whitespace - - * zend.c - zend.h: MFZE1 - threading fix - -2002-09-16 Andrei Zmievski <andrei@php.net> - - * zend_API.h - zend_builtin_functions.c - zend_API.c - zend_execute_API.c: MFZE1 - -2002-09-15 Ilia Alshanetsky <ilia@prohost.org> - - * zend_highlight.c: Make zend actually strip comments. Bug #18151 - - * zend.c: - Make zend return a proper exit error code when it encounters a parse error. - -2002-09-15 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Hopefully fix problem with __autoload not working well with inherited classes. - - There might still be some weird situations I haven't thought of. - - * zend_list.c - zend_execute.c: - WS fix - "while (" instead of "while(" - - * zend_execute_API.c - zend_ini.c - zend_list.c - zend_object_handlers.c - zend_objects_API.c - zend_operators.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - WS - Always use "if (" and not "if(" - - * zend_execute_API.c: - WS - -2002-09-10 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c - zend_variables.c: MFZE1 - -2002-09-09 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: remove comment - -2002-09-08 Andi Gutmans <andi@zend.com> - - * zend.h: - Prepare for alpha 3 - -2002-09-05 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: quick-n-dirty inheritance support for __handlers - -2002-09-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Whitespace fixes. - -2002-09-04 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: remove dead code - - * ZEND_CHANGES - zend_object_handlers.c: Fix __call and add some docs - -2002-09-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_object_handlers.c: Fix ZTS build. - - * ZEND_CHANGES: TBD: __call(), __get(), __set(). - -2002-09-04 Stanislav Malyshev <stas@zend.com> - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_extensions.h - zend_object_handlers.c - zend_objects.c: Support for __get, __set and __call in classes. - This should work as follows: if class hasn't member with given name, - __get/__set is called. If class has no method with given name, __call is called. - __get/__set are not recursive, __call can be. - -2002-09-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Workaround for superfluous comma in var_export() result. - - * ZEND_CHANGES: - Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments. - -2002-09-03 Thies C. Arntzen <thies@thieso.net> - - * zend_builtin_functions.c: nuke warning - - * zend_builtin_functions.c: nuke unneeded stuff - -2002-09-03 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_ini.c: MFZE1 - -2002-09-03 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_ini.c: - Revert - - * zend_ini.c: - - MFH for: Apply rest of html errors fix (Patch by Jan Lehnardt <jan@php.net>) - -2002-09-03 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend.h: - Add html_errors to zend_utility_values. Patch by Jan Lehnardt <jan@php.net>. - -2002-09-03 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Fix typo - -2002-09-02 Thies C. Arntzen <thies@thieso.net> - - * zend_builtin_functions.c: - refine last patch. if the argument-stack is not consistent don't try to show - arguments. no call to zend_error is made as we might end up in an infinite - recursion if called from an error_handler. - so: if the arguments to functions aren't shown in debug_backtrace this is 'cause - the arument stack was not consistent when debug_backtrace was called. - - * zend_builtin_functions.c: - debug_backtrace() now checks the complete argument-stack for consistency. - -2002-09-02 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: MFZE1 - -2002-09-01 Andi Gutmans <andi@zend.com> - - * zend_llist.c: - Fix leak reported by "l0t3k" <cshmoove@hotmail.com> - -2002-09-01 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: MFZE1 - -2002-08-28 Thies Arntzen <thies@pb1.pair.com> - - * zend_builtin_functions.c - zend_execute_API.c: debug_backtrace() - - make args passed to functions called vy call_user_function available again. - - * zend_builtin_functions.c: debug_backtrace(): - - make args work if called from the error_handler - - fix refcount for args - - * zend.c: - clear current_execute_data on bailout as it would point into some freed area - on the stack. - -2002-08-28 derick <derick@pb1.pair.com> - - * zend.c: - MFZE1 - -2002-08-26 Thies Arntzen <thies@pb1.pair.com> - - * zend_builtin_functions.c: - debug_backtrace(): show name of included file for include and require calls - plus some small fixes suggested by andi. - -2002-08-24 Andi Gutmans <andi@pb1.pair.com> - - * zend_builtin_functions.c: - Whitespace - - * zend_builtin_functions.c: - Whitespace and better variable name - -2002-08-24 Thies Arntzen <thies@pb1.pair.com> - - * zend_builtin_functions.c: fix warning - -2002-08-23 Andi Gutmans <andi@pb1.pair.com> - - * Zend.m4: - Add \n to configure fprintf - - * zend_extensions.c: - dlerror -> DL_ERROR - -2002-08-23 Thies Arntzen <thies@pb1.pair.com> - - * zend_builtin_functions.c: - debug_backtrace: show include/require/eval as normal functions on the stack - -2002-08-23 derick <derick@pb1.pair.com> - - * zend_builtin_functions.c: - No spaces :) - -2002-08-23 Thies Arntzen <thies@pb1.pair.com> - - * zend_builtin_functions.c: - - debug_backtrace now also returns an array containing the arguments of the - called function. - - zeev, andi - is knowing the structure of the stack considered a bad thing in - zend_builtin_function? if yes i would have to create a new function in - zend_ptr_stack.c (but i think we are save this way) - - * zend_builtin_functions.c - zend_execute_API.c: - debug_backtrace: - added "type" ('->' or '::') for object calls. - made calls done thru call_user_func show-up correct in backtraces. - - andi, - does this look correct to you? - - * zend_execute.c: those are set by RETURN_FROM_EXECUTE - -2002-08-21 Thies Arntzen <thies@pb1.pair.com> - - * zend_execute.c: - zend_execute: make sure that current_execute_data points to the right thing - after coming back from recursion. - -2002-08-19 Zeev Suraski <zeev@pb1.pair.com> - - * zend_operators.c: MFZE1 - -2002-08-17 Andi Gutmans <andi@pb1.pair.com> - - * zend_execute.c: MFZE1 - -2002-08-17 Zeev Suraski <zeev@pb1.pair.com> - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-08-16 Stig Bakken <ssb@pb1.pair.com> - - * zend.c: * append emacs footer - - * zend.c: * remove builtin exception class - -2002-08-16 Andi Gutmans <andi@pb1.pair.com> - - * zend.c: - Fix whitespace - -2002-08-16 Stig Bakken <ssb@pb1.pair.com> - - * zend_execute_API.c - zend_globals.h - zend.c - zend_builtin_functions.c: - - Added set_exception_handler() function for registering a global, - catch-all exception handling function - - Added set_exception_handler() function for registering a global, - catch-all exception handling function (Stig) - -2002-08-15 Zeev Suraski <zeev@pb1.pair.com> - - * flex.skl - zend.c - zend_globals.h - zend_language_scanner.l: MFZE1 - -2002-08-14 jason <jason@pb1.pair.com> - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y: - MFZE1 (use token instead of global for opcode counting) - -2002-08-13 Andi Gutmans <andi@pb1.pair.com> - - * zend_execute_API.c: - - Fix crash when exception is raised in __autoload function - -2002-08-13 Zeev Suraski <zeev@pb1.pair.com> - - * zend.h: MFZE1 - -2002-08-08 sebastian <sebastian@pb1.pair.com> - - * zend_objects.c: Fix warning. - -2002-08-08 stas <stas@pb1.pair.com> - - * zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Add ZEND_API to functions - -2002-08-08 Andi Gutmans <andi@pb1.pair.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Make new 'is' operator work with classes only and return false when - - the object isn't of the said class or the value isn't an object. - - * zend_static_allocator.c: - Bad Harald! :) - -2002-08-08 Zeev Suraski <zeev@pb1.pair.com> - - * zend_alloc.c: MFZE1 - -2002-08-07 phanto <phanto@pb1.pair.com> - - * zend_static_allocator.c - zend_alloc.c - zend_config.w32.h - zend_hash.c - zend_ini.c - zend_llist.h - zend_mm.c - zend_operators.c: make win32 debug output more verbose - -2002-08-03 Andi Gutmans <andi@pb1.pair.com> - - * tests/zend2.php: - Small fix - -2002-08-03 Zeev Suraski <zeev@pb1.pair.com> - - * zend_execute.c: MFZE1 - -2002-08-01 stas <stas@pb1.pair.com> - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-07-30 jason <jason@pb1.pair.com> - - * zend_compile.c - zend_execute.c - zend_globals.h: MFZE1 global declare - - * zend_compile.c: Fix segfault - -2002-07-30 Andrei Zmievski <andrei@pb1.pair.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Adding 'is' operator that can be used to check the type of a variable, - or its class. - -2002-07-28 phanto <phanto@pb1.pair.com> - - * OBJECTS2_HOWTO: update the handlers struct - -2002-07-27 Andi Gutmans <andi@pb1.pair.com> - - * zend_compile.c - zend_execute_API.c: - - Make sure classes are first looked for in the current scope. - - Make sure that during inheritance the global scope is searched if the - - current one doesn't work. - -2002-07-26 Andi Gutmans <andi@pb1.pair.com> - - * zend_execute.c - zend.c - zend_builtin_functions.c - zend_compile.h: - - Fix problem with debug_backtrace() reported by Stig. We weren't reporting - - global function information because it wasn't available. We have to do - - an additional assignment per-function call so that it'll be available. - - Also don't define the global scope as function name _main_ but leave it - - empty so that frameworks like Pear can decide what they want to do. - -2002-07-25 sniper <sniper@pb1.pair.com> - - * Zend.m4: Fixed 3 major failures in this test: - - 1. Tests work better when they are actually run.. - 2. When file is opened, it should be closed sometime too. - 3. AC_TRY_RUN cleans after itself (rm -f conftest.*), so it's - good idea to read the values while the file still exists. - - -2002-07-24 Andi Gutmans <andi@pb1.pair.com> - - * zend_mm.c: - Fix some compile problems with the new configure checks. - -2002-07-24 James Cox <imajes@pb1.pair.com> - - * Zend.m4 - zend_mm.c: move testing for the alignment values into configure. - - * Zend.m4: ws fixes. - -2002-07-23 Andi Gutmans <andi@pb1.pair.com> - - * zend_hash.c: - Fix WS. - -2002-07-21 Andi Gutmans <andi@pb1.pair.com> - - * zend_compile.c: - - Fix bug reported by Sebastian where old constructors didn't work in - - nested classes. - -2002-07-18 derick <derick@pb1.pair.com> - - * zend.h - zend_extensions.c: - MFZE1 - MacOSX fixes by Marko Karppinen - -2002-07-17 Andi Gutmans <andi@pb1.pair.com> - - * zend_compile.c: - - Remove code which wasn't supposed to go into the patch. - - * zend_compile.c - zend_language_parser.y: - Rejuggle some code. - -2002-07-17 sniper <sniper@pb1.pair.com> - - * ZEND_CHANGES: This was mentioned already above (with an example too :) - -2002-07-16 Andi Gutmans <andi@pb1.pair.com> - - * ZEND_CHANGES: - Before I forget to list it, this was also added. - - * zend_language_scanner.l: - - Syntactic sugar - Add "public" as a synonym for "var". - - Now we have the three P's. - You can do: - - <? - class MyClass { - public $a; - private $b; - protected $c; - } - - ?> - -2002-07-15 derick <derick@pb1.pair.com> - - * zend_operators.c: - MFH of the crap removal - -2002-07-15 Andi Gutmans <andi@pb1.pair.com> - - * ZEND_CHANGES - zend.c - zend.h - zend_API.c - zend_compile.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - - Commit patch to support protected member variables (by Timm Friebe w/ - - some fixes by me). - - You can't access protected variables from outside the object. If you want - - to see a protected member from your ancestors you need to declare the - - member as protected in the class you want to use it in. You can't - - redeclare a protected variable as private nor the other way around. - - * zend_operators.c: - - Really implement bool increment/decrement as flip-flop. - -2002-07-14 Andi Gutmans <andi@pb1.pair.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - ZEND_CHANGES: - - Nuke delete(). It was a big mistake to introduce it and I finally - - understand why Java didn't do so. - - If you still want to control destruction of your object then either make - - sure you kill all references or create a destruction method which you - - call yourself. - - * zend_execute.c: - Nuke some unused code - -2002-07-14 derick <derick@pb1.pair.com> - - * zend_operators.c: MFZE1 - - * zend_operators.c: - MFZE1 - -2002-07-07 Andi Gutmans <andi@zend.com> - - * zend_objects_API.c: - Path which should improve previous fix. - - * zend_objects_API.c: - - First try at solving problem with different objects being allocated the - - same id. - -2002-07-07 Stanislav Malyshev <stas@zend.com> - - * zend_object_handlers.c: name length should be strlen+1 - -2002-07-07 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_language_parser.y: - Allow for 'class Namespace::Bar extends Foo' syntax. Patch by Timm Friebe <thekid@thekid.de>. - -2002-07-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix problem where scope was lost in nested function calls. - - Thanks to Timm Friebe for diving into this one. - -2002-07-06 Zeev Suraski <zeev@zend.com> - - * zend_language_parser.y: spelling fix - -2002-07-05 Stig Bakken <ssb@fast.no> - - * zend_builtin_functions.c: * folding fixes - -2002-07-01 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Fix bug when acccessing $this not in class scope. - - * zend_objects.h - zend_objects.c: - Export zend_object_get_address() - -2002-06-30 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - Remember to document autoload when I have time. - -2002-06-30 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_modules.h: - MFZE1 - -2002-06-29 Andi Gutmans <andi@zend.com> - - * zend.h: - Get ready for alpha2 - - * zend_execute_API.c: - Invalid -> Undefined - - * zend_language_parser.y: - Add missing semi-colon. - - * zend_execute_API.c - zend_execute.c: - Improve some error messages. - - * zend_compile.c: - Revert previous fix. - - * zend_compile.c: - Change E_ERROR -> E_COMPILE_ERROR where needed. - - * zend_compile.c: - - Fix for bug #17882. We complain if the same method is declared twice. - - * zend.h - zend_operators.c: - Fix bug 15037 - - Bump version to alpha2-dev - -2002-06-28 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - WS fix - -2002-06-26 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Autoloading support based on patch from Ivan Ristic. - - Again I hope this feature ends up working well because if it doesn't we - - might need to nuke it. This only works for global scoped classes and it - - will never work for sub-classes so don't even ask!!!!! - - Just define an __autoload() function in the global scope and it will be - - called with the class name as the parameter if it doesn't manage to find - - the class. - - * zend_API.c - zend_builtin_functions.c - zend_mm.h: - Centralize global class fetch - - * zend_alloc.c - zend_execute.c: - - Fix problem with scope's not changing correctly during method calls. - - Reapply a tiny optimization to the allocator so that in non-debug mode - - we clean memory without detecting leaks. - -2002-06-24 Andi Gutmans <andi@zend.com> - - * zend_fast_cache.h: - - MFZE1 (Turn off fast cache until we make sure it performs well.) - - * zend_alloc.c: - More fixes (warnings, bug fixes etc.) - - * zend_execute.c: - - Revert patch which checks at run-time if you're allowed to assign - - certain values by reference. - - We still need to find a solution for cases when this shouldn't be allowed - - as it might cause leaks. - - * zend_alloc.c: - Fix crash bug and clean up a bit. - -2002-06-24 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Zend.m4: IMHO, ZTS should no longer be labeled experimental. - -2002-06-24 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - MFZE1 - - * zend_alloc.c: - Don't use cache if we're using ZEND_MM - - * zend_mm.c: - - Hardcode alignment to 8. We might need a configure check for this. - - * zend_mm.c - zend_mm.h: - Improve memory manager to allocate small blocks quickly. - - * zend_alloc.h - zend_mm.h - zend_alloc.c: - - Don't keep allocated blocks in a linked list if we're in non-debug mode - - as now the memory manager takes care to nuke all leaking blocks. - - * zend.h - zend_types.h: - MFZE1 - -2002-06-23 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - - Fix problem with constructor not being inherited and called correctly. - - * zend_mm.c: - Fix small bug - - * zend_mm.c: - - Almost completely implement realloc(). It now resizes in place when - - possible. - -2002-06-22 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_mm.c: - Fix crash when zend_mm_shutdown is called more than once. - - * zend_alloc.c - zend_alloc.h - zend_globals.h - zend_language_parser.y: - MFZE1 - - * zend_constants.h - zend_objects.c - zend_variables.c - zend_variables.h - zend_constants.c - zend_alloc.c - zend_alloc.h: - Nuke persist_alloc(). - -2002-06-19 Andi Gutmans <andi@zend.com> - - * zend_globals.h: - - This was also supposed to be part of the previous ZEND_MM commit :) - - * zend_alloc.c: - - Oops, this was supposed to be part of the previous #ifdef ZEND_MM change - - * zend_mm.h: - Use #ifdef for ZEND_MM - - * zend_mm.c: - Make sure MAX is defined - - * zend_constants.c: - - Fix problem where you couldn't define constants with different cases but - - the same name. - -2002-06-18 Derick Rethans <d.rethans@jdimedia.nl> - - * zend.c: - MFZE1 - -2002-06-17 Andi Gutmans <andi@zend.com> - - * zend_mm.c: - Improve speed of alignment calculation - - * zend_mm.c - zend_mm.h - zend_alloc.c: - - Fix a bug and add code which frees actual allocated segments at the end - - of execution (this still doesn't work because some blocks remain - - referenced after the memory manager is killed. - - * zend_mm.c - zend_mm.h: - Save space per-allocated block. - -2002-06-16 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Fix bug in class constants - - Start centralizing main class lookups. This will help implement - - __autload() - - * zend_mm.c - zend_mm.h: - - Remove debug code which doesn't work anymore and add headers. - - * zend_globals.h - zend_mm.c - zend_mm.h - zend_alloc.c - ZendTS.dsp: - Commit an initial version of a home made memory manager. - - It's just for seeing if this would be an advantage to PHP in MT - - environments. If this is to become production material there is still - - a long way to go. - -2002-06-15 Andi Gutmans <andi@zend.com> - - * zend_objects.h - zend_objects_API.c: - - Fix copy&paste problem where we allocated according to an old structure - - decleration and not the new one. - -2002-06-11 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Don't show debug_backtrace() in the trace itself. - - This patch is a bit ugly because the whole code itself is pretty complex - - and hard to re-order. - - * zend_execute.c - zend_language_parser.y: - - Fix problem with assigning functions by reference. - -2002-06-11 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * RFCs/004.txt: Add __delegate(). - -2002-06-10 Harald Radi <harald.radi@nme.at> - - * zend_ts_hash.h - zend_ts_hash.c: added TS_HASH macro - -2002-06-10 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: Fix leak - -2002-06-09 Harald Radi <harald.radi@nme.at> - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.h: - only check for an available class entry instead of - the std_object_handlers on some places - - -2002-06-08 Andi Gutmans <andi@zend.com> - - * zend_hash.h - zend.h: - This should improve performance on Windows - - * zend_hash.h: - - Add a loop unrolled version of the hash function and a bit of an - - explanation about our hash function (Ralf S. Engelschall) - -2002-06-06 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * RFCs/004.txt: Add RFC on delegation. - -2002-06-05 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_execute.c: Remove unused local variable. - -2002-06-05 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c - zend_object_handlers.c: - - Allow overloaded objects to receive the method name in its original - - case. - -2002-06-05 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_llist.c: - Fix memleak (patch by Stefan Sesser) - -2002-06-04 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_ini_scanner.l: - Fix for bug #17462 (Patch by Edin Kadribasic) - -2002-05-31 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - Add zend_objects_API.* to dsp - - * zend_objects_API.c: - Fix build (one more coming up) - - * zend_objects.c: - Fix build - -2002-05-31 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Zend.dsp: Add zend_objects_API.c to project. - -2002-05-31 Stanislav Malyshev <stas@zend.com> - - * Makefile.am - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Generalize object storage and reference bookkeeping - -2002-05-30 Venkat Raghavan S <rvenkat@novell.com> - - * zend.h - zend_config.nw.h - acconfig.h: NetWare changes - -2002-05-26 Andi Gutmans <andi@zend.com> - - * zend_multibyte.c: - - Add empty zend_multibyte.c to allow build with 4.3.0-dev. - -2002-05-24 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Fugbix typo. - -2002-05-24 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - Add a bit of information. - -2002-05-20 Zeev Suraski <zeev@zend.com> - - * zend_API.h - zend_execute.h - zend_list.h: MFZE1 (Expose more C++ APIs) - -2002-05-14 Andi Gutmans <andi@zend.com> - - * zend_objects.c - zend_objects.h: - constructor_called is supposed to be destructor_called - -2002-05-13 Sterling Hughes <sterling@bumblebury.com> - - * zend_qsort.c: MFZE1 - -2002-05-13 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_builtin_functions.c: - MFZE1 - -2002-05-12 Zeev Suraski <zeev@zend.com> - - * zend_highlight.c: MFZE1 - -2002-05-12 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Rephrase. - - * ZEND_CHANGES: Beautify. - - * ZEND_CHANGES: Start documenting the debug backtracing. - - * ZEND_CHANGES: Whitespace fixes. - -2002-05-11 Zeev Suraski <zeev@zend.com> - - * zend_highlight.c - zend_highlight.h: MFZE1 - -2002-05-10 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Nuke C++ comment - - * zend_builtin_functions.c: - - Make debug_backtrace() return an array. Still not finished because I - might want to differentiate between method calls and static methods. - - Example: - $bt = debug_backtrace(); - foreach ($bt as $frame) { - if (isset($frame['class'])) { - print $frame['class']; - print "::"; - } - print $frame['function']; - print " ["; - print $frame['file']; - print ":"; - print $frame['line']; - print "]\n"; - } - -2002-05-08 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_builtin_functions.c: - - Hopefully fix problems with debug_backtrace() - -2002-05-08 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_builtin_functions.c: - MFZE1 - -2002-05-07 Andi Gutmans <andi@zend.com> - - * zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c: - - More debug backtrace work. It still doesn't work very well... - -2002-05-02 Andi Gutmans <andi@zend.com> - - * zend.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: Initial support for built-in backtracing. - There are still a few problems such as includes and calling other functions - from internal functions which aren't seen (will have to think if and how to - fix this). - Also the main scripts filename isn't available. Need to think about that. - -2002-04-30 Stanislav Malyshev <stas@zend.com> - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.h - zend_API.c: Make OBJCE return zend_class_entry*, also some cleanups - -2002-04-28 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_alloc.c - zend_alloc.h: Revert. - -2002-04-27 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_alloc.c - zend_alloc.h: - MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) - -2002-04-25 Harald Radi <h.radi@nme.at> - - * zend_config.w32.h: unbreak the win32 build - -2002-04-24 Harald Radi <h.radi@nme.at> - - * zend_API.c: MFZE1 saschas 'Avoid exceeding buffer limits' patch - -2002-04-23 Harald Radi <h.radi@nme.at> - - * zend_hash.c - zend_hash.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ts_hash.c - zend_ts_hash.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_API.c - zend_API.h - zend.h: some type cleanup work - -2002-04-22 Harald Radi <h.radi@nme.at> - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.h - zend_operators.h - zend_API.c - zend_API.h - zend_builtin_functions.c: added get_class_entry callback handler to the - object handlers structure - -2002-04-22 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Zend.m4: MFZE1: Change default value of inline-opt to yes (Sascha). - -2002-04-22 Harald Radi <h.radi@nme.at> - - * zend_config.w32.h - acconfig.h - flex.skl: fixed linkage warning under win32 - -2002-04-20 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: MFZE1 - -2002-04-19 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_list.c - zend_hash.c - zend_hash.h: - MFZE1: make sure the resource-list is always consistent during shutdown (Thies). - - * zend_hash.c: MFZE1: Fix imbalance bug (Zeev). - -2002-04-10 Jani Taskinen <sniper@iki.fi> - - * zend_language_scanner.l - zend_language_parser.y: MFZE1 - -2002-04-07 Stanislav Malyshev <stas@zend.com> - - * zend.h: make compatible with current PHP - - * zend_compile.c: sync - -2002-03-29 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_compile.c: - revert patch - -2002-03-25 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_compile.c: - MFZE1 - -2002-03-23 Andi Gutmans <andi@zend.com> - - * zend_ts_hash.c - zend_ts_hash.h: - - Fix build without ZTS. If someone has a nicer fix let me know. - -2002-03-21 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - No idea how this slipped in. Fix delete $obj statement. - -2002-03-20 Harald Radi <h.radi@nme.at> - - * ZendTS.dsp - zend.h - zend_ts_hash.c - zend_ts_hash.h: added thread safe hashtable which allows concurrent - reads but only exclusive writes - -2002-03-19 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y - zend.h: - - Finish covering all parsed methods to check for validity in parser. - - Change zval's refcount to zend_uint (If it doesn't slow down the Engine - - too much it should probably stay this way). If anyone has time to test - - the difference in speed between zend_ushort & zend_uint in zend.h of - - the struct _zval_struct (one line change) I'd be glad to get some - - figures. - -2002-03-18 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_language_parser.y: - - More fixes to check for member/function call legality. - -2002-03-17 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y - zend_compile.c: - - Start putting error handling where method calls are being used in a - - context where only writable variables should be used. - -2002-03-15 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - <?php - - function Hello() - { - print "Wrong one\n"; - } - - class MyClass { - static $hello = "Hello, World\n"; - - function Hello() - { - print self::$hello; - } - - function Trampoline() - { - Hello(); - } - } - - import function Trampoline from MyClass; - - Trampoline(); - ?> - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev <stas@zend.com> - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans <andi@zend.com> - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev <stas@zend.com> - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans <andi@zend.com> - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Support importing constants. e.g.: - <?php - - class MyOuterClass { - const Hello = "Hello, World\n"; - } - - import const Hello from MyOuterClass; - print Hello; - -2002-03-07 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - <?php - - class MyOuterClass { - class MyInnerClass { - function func1() - { - print "func1()\n"; - } - - function func2() - { - print "func2()\n"; - } - } - } - - import class * from MyOuterClass; - import function func2 from MyOuterClass::MyInnerClass; - - MyInnerClass::func1(); - func2(); - -2002-03-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - <?php - - class MyClass - { - function hello() - { - print "Hello, World\n"; - } - class MyClass2 - { - function hello() - { - print "Hello, World in MyClass2\n"; - } - } - } - - import function hello, class MyClass2 from MyClass; - - MyClass2::hello(); - hello(); - ?> - -2002-03-02 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans <andi@zend.com> - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans <andi@zend.com> - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - <? - class MyClass { - private $Hello = "Hello, World!\n"; - - function printHello() - { - print $this->Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev <stas@zend.com> - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski <andrei@ispi.net> - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: <?php - class MyException1 { - - } - - class MyException2 { - - } - - try { - throw new MyException2(); - } catch (MyException1 $m) { - print "Caught MyException1"; - } catch (MyException2 $m) { - print "Caught MyException2"; - } - -2002-02-10 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans <andi@zend.com> - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev <stas@zend.com> - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss <adam@indexdata.dk> - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans <andi@zend.com> - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise <jon@php.net>) - -2002-01-25 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen <thies@thieso.net> - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - <?php - $array = array('foo', 'bar'); - - uasort($array, 'cmp'); - - function cmp($a, $b) - { - return (strcmp($a[1], $b[1])); - } - ?> - -2002-01-14 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - <?php - - class MyException { - function __construct($exception) - { - $this->exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans <andi@zend.com> - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans <d.rethans@jdimedia.nl> - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans <andi@zend.com> - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - <? - class MyClass { - static $id = 0; - - function MyClass() - { - $this->id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans <andi@zend.com> - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans <andi@zend.com> - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans <andi@zend.com> - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans <andi@zend.com> - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans <andi@zend.com> - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Support constants. The following works now: - <? - class foo { - const GC = "foo constant\n"; - } - - define("GC", "Global constant\n"); - - namespace; - print GC; - namespace foo; - print GC; - namespace; - print foo::GC; - - ?> - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - <? - $hey = "Global hey\n"; - - class foo { - static $hey = "Namespace hey\n"; - function bar() - { - print "in foo::bar()\n"; - } - } - function bar() - { - print "in bar()\n"; - } - - bar(); - namespace foo; - bar(); - namespace; - bar(); - namespace foo; - $bar_indirect = "bar"; - $bar_indirect(); - - namespace; - print $hey; - namespace foo; - print $hey; - $hey = "Namespace hey #2\n"; - namespace; - print $hey; - $hey = "Global hey #2\n"; - namespace foo; - print $hey; - ?> - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - <?php - class foo - { - const hey = "hello"; - } - - print foo::hey; - ?> - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - <? - class foo - { - class bar - { - function init_values() - { - for ($i=1; $i<10; $i++) { - foo::bar::$hello[$i] = $i*$i; - } - } - - function print_values() - { - for ($i=1; $i<10; $i++) { - print foo::bar::$hello[$i] . "\n"; - } - } - } - } - - foo::bar::init_values(); - foo::bar::print_values(); - - for ($i=1; $i<10; $i++) { - print $hello[$i]?"Shouldn't be printed\n":""; - } - ?> - -2001-11-24 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: MFZE1 - -2001-11-05 stig <stig@pb1.pair.com> - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -<?php - - class foo - - { - - function bar() - - { - - print "bar() in class bar\n"; - - } - - - - class barbara - - { - - function bar() - - { - - print "bar() in class foo::barbara\n"; - - } - - } - - } - - - - $obj = new foo(); - - $obj->bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans <andi@zend.com> - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski <zeev@zend.com> - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans <andi@zend.com> - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski <zeev@zend.com> - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski <zeev@zend.com> - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans <andi@zend.com> - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann <sb@sebastian-bergmann.de> - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon <brianm@dealnews.com> - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski <zeev@zend.com> - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig <stig@pb1.pair.com> - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes <sterling@bumblebury.com> - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans <andi@zend.com> - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans <andi@zend.com> - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev <stas@zend.com> - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans <andi@zend.com> - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski <andrei@ispi.net> - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski <zeev@zend.com> - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski <zeev@zend.com> - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev <stas@zend.com> - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans <andi@zend.com> - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans <andi@zend.com> - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans <andi@zend.com> - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski <zeev@zend.com> - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski <zeev@zend.com> - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig <stig@pb1.pair.com> - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski <zeev@zend.com> - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans <andi@zend.com> - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha <sascha@pb1.pair.com> - - * zend.h: Fix build - -2001-07-27 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha <sascha@pb1.pair.com> - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski <andrei@ispi.net> - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans <andi@zend.com> - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski <zeev@zend.com> - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski <zeev@zend.com> - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen <thies@thieso.net> - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans <andi@zend.com> - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev <stas@zend.com> - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski <zeev@zend.com> - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans <andi@zend.com> - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans <andi@zend.com> - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf <rasmus@php.net> - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski <zeev@zend.com> - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans <andi@zend.com> - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski <zeev@zend.com> - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski <zeev@zend.com> - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski <zeev@zend.com> - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski <zeev@zend.com> - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha <sascha@pb1.pair.com> - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans <andi@zend.com> - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore <James@phpuk.org> - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans <andi@zend.com> - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha <sascha@pb1.pair.com> - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen <thies@thieso.net> - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha <sascha@pb1.pair.com> - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans <andi@zend.com> - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha <sascha@pb1.pair.com> - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen <thies@thieso.net> - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans <andi@zend.com> - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski <zeev@zend.com> - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans <andi@zend.com> - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski <zeev@zend.com> - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans <andi@zend.com> - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans <andi@zend.com> - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans <andi@zend.com> - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans <andi@zend.com> - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans <andi@zend.com> - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski <zeev@zend.com> - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski <zeev@zend.com> - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans <andi@zend.com> - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen <sniper@iki.fi> for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans <andi@zend.com> - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski <zeev@zend.com> - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha <sascha@pb1.pair.com> - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha <sascha@pb1.pair.com> - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski <andrei@ispi.net> - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans <andi@zend.com> - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski <andrei@ispi.net> - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans <andi@zend.com> - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans <andi@zend.com> - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev <stas@zend.com> - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans <andi@zend.com> - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski <andrei@ispi.net> - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski <andrei@ispi.net> - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans <andi@zend.com> - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen <thies@thieso.net> - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski <andrei@ispi.net> - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans <andi@zend.com> - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans <andi@zend.com> - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski <zeev@zend.com> - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski <zeev@zend.com> - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf <rasmus@php.net> - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski <zeev@zend.com> - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans <andi@zend.com> - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski <zeev@zend.com> - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans <andi@zend.com> - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski <zeev@zend.com> - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski <zeev@zend.com> - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski <zeev@zend.com> - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha <sascha@pb1.pair.com> - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev <stas@zend.com> - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans <andi@zend.com> - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev <stas@zend.com> - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski <zeev@zend.com> - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans <andi@zend.com> - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski <zeev@zend.com> - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski <zeev@zend.com> - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev <stas@zend.com> - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha <sascha@pb1.pair.com> - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha <sascha@pb1.pair.com> - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans <andi@zend.com> - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski <zeev@zend.com> - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha <sascha@pb1.pair.com> - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha <sascha@pb1.pair.com> - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski <zeev@zend.com> - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev <stas@zend.com> - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski <zeev@zend.com> - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev <stas@zend.com> - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans <andi@zend.com> - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev <stas@zend.com> - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski <zeev@zend.com> - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans <andi@zend.com> - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha <sascha@pb1.pair.com> - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans <andi@zend.com> - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski <zeev@zend.com> - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans <andi@zend.com> - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski <zeev@zend.com> - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski <zeev@zend.com> - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor <david@hedbor.org> - -2000-11-02 Zeev Suraski <zeev@zend.com> - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski <zeev@zend.com> - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski <zeev@zend.com> - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev <stas@zend.com> - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski <zeev@zend.com> - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev <stas@zend.com> - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski <zeev@zend.com> - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski <andrei@ispi.net> - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski <andrei@ispi.net> - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans <andi@zend.com> - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha <sascha@pb1.pair.com> - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans <andi@zend.com> - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans <andi@zend.com> - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans <andi@zend.com> - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski <zeev@zend.com> - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans <andi@zend.com> - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans <andi@zend.com> - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev <stas@zend.com> - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha <sascha@pb1.pair.com> - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans <andi@zend.com> - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev <stas@zend.com> - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev <stas@zend.com> - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev <stas@zend.com> - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski <zeev@zend.com> - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev <stas@zend.com> - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans <andi@zend.com> - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha <sascha@pb1.pair.com> - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans <andi@zend.com> - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans <andi@zend.com> - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski <zeev@zend.com> - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans <andi@zend.com> - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski <zeev@zend.com> - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha <sascha@pb1.pair.com> - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski <andrei@ispi.net> - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev <stas@zend.com> - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev <stas@zend.com> - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski <zeev@zend.com> - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans <andi@zend.com> - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev <stas@zend.com> - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen <thies@thieso.net> - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski <zeev@zend.com> - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans <andi@zend.com> - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev <stas@zend.com> - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha <sascha@pb1.pair.com> - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha <sascha@pb1.pair.com> - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski <zeev@zend.com> - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski <zeev@zend.com> - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans <andi@zend.com> - - * zend.h: version update - -2000-06-26 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans <andi@zend.com> - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans <andi@zend.com> - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans <andi@zend.com> - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev <stas@zend.com> - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha <sascha@pb1.pair.com> - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev <stas@zend.com> - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans <andi@zend.com> - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans <andi@zend.com> - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen <thies@thieso.net> - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha <sascha@pb1.pair.com> - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha <sascha@pb1.pair.com> - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha <sascha@pb1.pair.com> - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of <?php_track_vars?> - -2000-06-11 Andi Gutmans <andi@zend.com> - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski <zeev@zend.com> - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans <andi@zend.com> - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev <stas@zend.com> - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha <sascha@pb1.pair.com> - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha <sascha@pb1.pair.com> - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans <andi@zend.com> - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski <zeev@zend.com> - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen <thies@thieso.net> - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy <jk@kasenna.com>) - -2000-05-22 Zeev Suraski <zeev@zend.com> - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby <rubys@us.ibm.com> - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski <zeev@zend.com> - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha <sascha@pb1.pair.com> - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans <andi@zend.com> - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans <andi@zend.com> - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans <andi@zend.com> - - * zend_opcode.c: Fix order - -2000-05-17 sascha <sascha@pb1.pair.com> - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha <sascha@pb1.pair.com> - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen <thies@thieso.net> - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha <sascha@pb1.pair.com> - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans <andi@zend.com> - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha <sascha@pb1.pair.com> - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha <sascha@pb1.pair.com> - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha <sascha@pb1.pair.com> - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha <sascha@pb1.pair.com> - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans <andi@zend.com> - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen <thies@thieso.net> - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen <thies@thieso.net> - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski <zeev@zend.com> - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen <thies@thieso.net> - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans <andi@zend.com> - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski <zeev@zend.com> - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen <thies@thieso.net> - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen <thies@thieso.net> - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski <zeev@zend.com> - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski <zeev@zend.com> - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans <andi@zend.com> - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski <zeev@zend.com> - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski <zeev@zend.com> - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans <andi@zend.com> - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha <sascha@pb1.pair.com> - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski <zeev@zend.com> - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson <torben@pinc.com> - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans <andi@zend.com> - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby <rubys@us.ibm.com> - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen <thies@thieso.net> - - * zend.h - zend_execute.c: - <alloca.h> needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans <andi@zend.com> - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby <rubys@us.ibm.com> - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski <zeev@zend.com> - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans <andi@zend.com> - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen <thies@thieso.net> - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans <andi@zend.com> - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen <thies@thieso.net> - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen <thies@thieso.net> - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski <andrei@ispi.net> - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski <zeev@zend.com> - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski <andrei@ispi.net> - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans <andi@zend.com> - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski <andrei@ispi.net> - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans <andi@zend.com> - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig <stig@pb1.pair.com> - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski <zeev@zend.com> - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig <stig@pb1.pair.com> - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby <rubys@us.ibm.com> - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby <rubys@us.ibm.com> - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans <andi@zend.com> - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen <thies@thieso.net> - - * zend_operators.c: now - -2000-02-27 Egon Schmid <eschmid@s.netic.de> - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby <rubys@us.ibm.com> - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski <zeev@zend.com> - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha <sascha@pb1.pair.com> - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans <andi@zend.com> - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans <andi@zend.com> - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski <zeev@zend.com> - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans <andi@zend.com> - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski <andrei@ispi.net> - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans <andi@zend.com> - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen <thies@thieso.net> - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski <zeev@zend.com> - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski <zeev@zend.com> - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski <zeev@zend.com> - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen <thies@thieso.net> - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski <zeev@zend.com> - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans <andi@zend.com> - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen <thies@thieso.net> - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen <thies@thieso.net> - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen <thies@thieso.net> - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski <andrei@ispi.net> - - * zend_highlight.c: - Since we're highlighting code, put <code> and </code> around the code. - -2000-01-13 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha <sascha@pb1.pair.com> - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans <andi@zend.com> - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans <andi@zend.com> - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith <joey@joeysmith.com> - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha <sascha@pb1.pair.com> - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans <andi@zend.com> - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski <zeev@zend.com> - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha <sascha@pb1.pair.com> - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski <zeev@zend.com> - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha <sascha@pb1.pair.com> - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski <zeev@zend.com> - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans <andi@zend.com> - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans <andi@zend.com> - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen <thies@thieso.net> - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski <zeev@zend.com> - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha <sascha@pb1.pair.com> - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski <zeev@zend.com> - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans <andi@zend.com> - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski <zeev@zend.com> - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans <andi@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha <sascha@pb1.pair.com> - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha <sascha@pb1.pair.com> - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha <sascha@pb1.pair.com> - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski <andrei@ispi.net> - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha <sascha@pb1.pair.com> - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski <zeev@zend.com> - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha <sascha@pb1.pair.com> - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha <sascha@pb1.pair.com> - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski <zeev@zend.com> - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha <sascha@pb1.pair.com> - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski <andrei@ispi.net> - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski <zeev@zend.com> - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha <sascha@pb1.pair.com> - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski <andrei@ispi.net> - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans <andi@zend.com> - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby <rubys@us.ibm.com> - - * zend-scanner.l: build error - windows - -1999-12-04 stig <stig@pb1.pair.com> - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski <andrei@ispi.net> - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen <thies@thieso.net> - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans <andi@zend.com> - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans <andi@zend.com> - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski <zeev@zend.com> - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen <thies@thieso.net> - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig <stig@pb1.pair.com> - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski <zeev@zend.com> - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans <andi@zend.com> - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha <sascha@pb1.pair.com> - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans <andi@zend.com> - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski <andrei@ispi.net> - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans <andi@zend.com> - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski <zeev@zend.com> - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby <rubys@us.ibm.com> - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen <thies@thieso.net> - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans <andi@zend.com> - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski <andrei@ispi.net> - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski <andrei@ispi.net> - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans <andi@zend.com> - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha <sascha@pb1.pair.com> - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha <sascha@pb1.pair.com> - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen <thies@thieso.net> - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha <sascha@pb1.pair.com> - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen <thies@thieso.net> - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha <sascha@pb1.pair.com> - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski <andrei@ispi.net> - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen <thies@thieso.net> - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha <sascha@pb1.pair.com> - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha <sascha@pb1.pair.com> - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen <thies@thieso.net> - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen <thies@thieso.net> - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha <sascha@pb1.pair.com> - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha <sascha@pb1.pair.com> - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen <thies@thieso.net> - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans <andi@zend.com> - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha <sascha@pb1.pair.com> - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans <andi@zend.com> - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski <zeev@zend.com> - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans <andi@zend.com> - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen <thies@thieso.net> - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans <andi@zend.com> - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha <sascha@pb1.pair.com> - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha <sascha@pb1.pair.com> - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha <sascha@pb1.pair.com> - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski <zeev@zend.com> - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans <andi@zend.com> - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha <sascha@pb1.pair.com> - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen <thies@thieso.net> - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski <zeev@zend.com> - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans <andi@zend.com> - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski <zeev@zend.com> - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski <zeev@zend.com> - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen <thies@thieso.net> - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski <zeev@zend.com> - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha <sascha@pb1.pair.com> - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig <stig@pb1.pair.com> - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski <zeev@zend.com> - - * zend.c: Make this class instanciatable - -1999-09-12 sascha <sascha@pb1.pair.com> - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig <stig@pb1.pair.com> - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans <andi@zend.com> - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig <stig@pb1.pair.com> - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans <andi@zend.com> - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski <zeev@zend.com> - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski <zeev@zend.com> - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha <sascha@pb1.pair.com> - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha <sascha@pb1.pair.com> - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans <andi@zend.com> - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha <sascha@pb1.pair.com> - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski <zeev@zend.com> - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen <thies@thieso.net> - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans <andi@zend.com> - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski <zeev@zend.com> - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski <zeev@zend.com> - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski <zeev@zend.com> - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans <andi@zend.com> - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski <zeev@zend.com> - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski <zeev@zend.com> - - * zend_constants.c: New constants - -1999-07-22 stig <stig@pb1.pair.com> - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski <zeev@zend.com> - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans <andi@zend.com> - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans <andi@zend.com> - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski <zeev@zend.com> - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans <andi@zend.com> - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha <sascha@pb1.pair.com> - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans <andi@zend.com> - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans <andi@zend.com> - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski <zeev@zend.com> - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha <sascha@pb1.pair.com> - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha <sascha@pb1.pair.com> - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha <sascha@pb1.pair.com> - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha <sascha@pb1.pair.com> - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha <sascha@pb1.pair.com> - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski <zeev@zend.com> - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski <zeev@zend.com> - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski <zeev@zend.com> - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski <zeev@zend.com> - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig <stig@pb1.pair.com> - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig <stig@pb1.pair.com> - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski <zeev@zend.com> - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support <?= - - * zend_compile.c: E_ERROR -> E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans <andi@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski <zeev@zend.com> - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans <andi@zend.com> - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen <thies@thieso.net> - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski <zeev@zend.com> - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha <sascha@pb1.pair.com> - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha <sascha@pb1.pair.com> - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski <zeev@zend.com> - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha <sascha@pb1.pair.com> - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski <zeev@zend.com> - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski <zeev@zend.com> - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans <andi@zend.com> - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski <zeev@zend.com> - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski <zeev@zend.com> - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig <stig@pb1.pair.com> - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski <zeev@zend.com> - - * zend.h: *** empty log message *** - -1999-05-12 stig <stig@pb1.pair.com> - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski <zeev@zend.com> - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski <zeev@zend.com> - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski <zeev@zend.com> - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans <andi@zend.com> - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans <andi@zend.com> - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans <andi@zend.com> - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski <zeev@zend.com> - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans <andi@zend.com> - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski <zeev@zend.com> - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread <zeevread@pb1.pair.com> - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski <zeev@zend.com> - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski <zeev@zend.com> - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski <zeev@zend.com> - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski <zeev@zend.com> - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig <stig@pb1.pair.com> - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski <zeev@zend.com> - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig <stig@pb1.pair.com> - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski <zeev@zend.com> - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig <stig@pb1.pair.com> - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski <zeev@zend.com> - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig <stig@pb1.pair.com> - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans <andi@zend.com> - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig <stig@pb1.pair.com> - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans <andi@zend.com> - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski <zeev@zend.com> - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans <andi@zend.com> - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski <zeev@zend.com> - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski <zeev@zend.com> - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans <andi@zend.com> - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig <stig@pb1.pair.com> - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans <andi@zend.com> - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski <zeev@zend.com> - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski <zeev@zend.com> - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans <andi@zend.com> - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski <zeev@zend.com> - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski <zeev@zend.com> - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf <rasmus@php.net> - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans <andi@zend.com> - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index 97d5d647bb..a7358fa85d 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -4,7 +4,7 @@ dnl This file contains local autoconf functions. AC_DEFUN([LIBZEND_BISON_CHECK],[ # we only support certain bison versions - bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5" + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1" # for standalone build of Zend Engine test -z "$SED" && SED=sed diff --git a/Zend/tests/bug39018.phpt b/Zend/tests/bug39018.phpt index e1968ad041..32566ba864 100644 --- a/Zend/tests/bug39018.phpt +++ b/Zend/tests/bug39018.phpt @@ -62,17 +62,17 @@ print "\nDone\n"; ?> --EXPECTF-- -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 0 in %s on line %d Notice: Uninitialized string offset: 0 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: %i in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: %i in %s on line %d @@ -88,16 +88,16 @@ Notice: Uninitialized string offset: 4 in %s on line %d Notice: Uninitialized string offset: 4 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 12 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 12 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d b Done diff --git a/Zend/tests/bug51394.phpt b/Zend/tests/bug51394.phpt index 537574c9d5..406de13a9b 100644 --- a/Zend/tests/bug51394.phpt +++ b/Zend/tests/bug51394.phpt @@ -13,4 +13,10 @@ function eh() set_error_handler("eh"); $a = $empty($b); --EXPECTF-- +Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4 +Stack trace: +#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array) +#1 {main} + thrown in %sbug51394.php on line 4 + Fatal error: Function name must be a string in %sbug51394.php on line 9
\ No newline at end of file diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt index b78fceb0da..5268789df6 100644 --- a/Zend/tests/bug55509.phpt +++ b/Zend/tests/bug55509.phpt @@ -5,6 +5,12 @@ Bug #55509 (segfault on x86_64 using more than 2G memory) if (PHP_INT_SIZE == 4) {
die('skip Not for 32-bits OS');
}
+
+$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
+if ($zend_mm_enabled === "0") {
+ die("skip Zend MM disabled");
+}
+
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
// check the available memory
if (PHP_OS == 'Linux') {
diff --git a/Zend/tests/bug60909_1.phpt b/Zend/tests/bug60909_1.phpt new file mode 100644 index 0000000000..5150dfc025 --- /dev/null +++ b/Zend/tests/bug60909_1.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function). +--FILE-- +<?php +register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");}); +set_error_handler(function($errno, $errstr, $errfile, $errline){ + echo "error($errstr)"; + throw new Exception("Foo"); +}); + +require 'notfound.php'; +--EXPECTF-- +error(require(notfound.php): failed to open stream: No such file or directory) +Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5 +Stack trace: +#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array) +#1 %sbug60909_1.php(8): require() +#2 {main} + thrown in %sbug60909_1.php on line 5 + +Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8 + + +!!!shutdown!!! diff --git a/Zend/tests/bug60909_2.phpt b/Zend/tests/bug60909_2.phpt new file mode 100644 index 0000000000..d08d9f90fa --- /dev/null +++ b/Zend/tests/bug60909_2.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function). +--FILE-- +<?php +register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");}); +set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");}); + +class Bad { + public function __toString() { + throw new Exception('Oops, I cannot do this'); + } +} + +$bad = new Bad(); +echo "$bad"; +--EXPECTF-- +Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0 + + +!!!shutdown!!! diff --git a/Zend/tests/bug61761.phpt b/Zend/tests/bug61761.phpt index 631f566eaa..24c69ae792 100755 --- a/Zend/tests/bug61761.phpt +++ b/Zend/tests/bug61761.phpt @@ -14,5 +14,6 @@ class B extends A } ?> +==DONE== --EXPECTF-- -Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d +==DONE== diff --git a/Zend/tests/bug61767.phpt b/Zend/tests/bug61767.phpt new file mode 100644 index 0000000000..5270872e5d --- /dev/null +++ b/Zend/tests/bug61767.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #61767 (Shutdown functions not called in certain error situation) +--FILE-- +<?php +set_error_handler(function($code, $msg, $file = null, $line = null) { + echo "Error handler called ($msg)\n"; + throw new \ErrorException($msg, $code, 0, $file, $line); +}); + +register_shutdown_function(function(){ + echo "Shutting down\n"; + print_r(error_get_last()); +}); + +//$undefined = null; // defined variable does not cause problems +$undefined->foo(); +--EXPECTF-- +Error handler called (Undefined variable: undefined) + +Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13 +Stack trace: +#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array) +#1 {main} + thrown in %sbug61767.php on line 13 + +Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13 +Shutting down +Array +( + [type] => 1 + [message] => Call to a member function foo() on a non-object + [file] => %sbug61767.php + [line] => 13 +) diff --git a/Zend/tests/bug62358.phpt b/Zend/tests/bug62358.phpt new file mode 100644 index 0000000000..35d8b483d9 --- /dev/null +++ b/Zend/tests/bug62358.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #62358 (Segfault when using traits a lot) +--SKIPIF-- +<?php +if (getenv("USE_ZEND_ALLOC") !== "0") { + die("skip Need Zend MM enabled"); +} +?> +--FILE-- +<?php + +trait T { + public function foo() { + echo "from T"; + } +} + +interface I { + public function foo(); +} + +abstract class A implements I{ + use T; +} + +class B extends A { + public function foo($var) { + } +} +?> +--EXPECTF-- +Strict Standards: Declaration of B::foo() should be compatible with A::foo() in %sbug62358.php on line %d diff --git a/Zend/tests/bug62653.phpt b/Zend/tests/bug62653.phpt new file mode 100644 index 0000000000..96299f16ea --- /dev/null +++ b/Zend/tests/bug62653.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #62653: unset($array[$float]) causes a crash +--FILE-- +<?php +$array = array("5"=>"bar"); +$foo = "10.0000"; // gettype($foo) = "string" +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double" +unset($array[$foo]); +print_r($array); + +$array = array("5"=>"bar"); +$foo = "5"; +unset($array[(float)$foo]); +print_r($array); + +$array = array("5"=>"bar"); +$foo = "10.0000"; +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double" +$name = "foo"; +unset($array[$$name]); +print_r($array); + +?> +--EXPECT-- +Array +( +) +Array +( +) +Array +( +) diff --git a/Zend/tests/bug62680.phpt b/Zend/tests/bug62680.phpt new file mode 100644 index 0000000000..e2a2366e7a --- /dev/null +++ b/Zend/tests/bug62680.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3) +--FILE-- +<?php +$array = array(""); +var_dump(isset($array[0]["a"]["b"])); +var_dump(isset($array[0]["a"]["b"]["c"])); +?> +--EXPECT-- +bool(false) +bool(false) diff --git a/Zend/tests/bug62763.phpt b/Zend/tests/bug62763.phpt new file mode 100644 index 0000000000..50c27bdf35 --- /dev/null +++ b/Zend/tests/bug62763.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #62763 (register_shutdown_function and extending class) +--FILE-- +<?php +class test1 { + public function __construct() { + register_shutdown_function(array($this, 'shutdown')); + } + public function shutdown() { + exit(__METHOD__); + } +} + +class test2 extends test1 { + public function __destruct() { + exit (__METHOD__); + } +} +new test1; +new test2; +?> +--EXPECT-- +test1::shutdowntest2::__destruct diff --git a/Zend/tests/bug62892.phpt b/Zend/tests/bug62892.phpt new file mode 100644 index 0000000000..e6b0e60ff3 --- /dev/null +++ b/Zend/tests/bug62892.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private) +--FILE-- +<?php + +trait myTrait { + public function run() {} +} + +class myClass { + use myTrait { + MyTrait::run as private; + } +} +$class = new \ReflectionClass('myClass'); +var_dump($class->getTraitAliases()); + +?> +--EXPECTF-- +array(0) { +} diff --git a/Zend/tests/bug62907.phpt b/Zend/tests/bug62907.phpt new file mode 100644 index 0000000000..53ab17cb32 --- /dev/null +++ b/Zend/tests/bug62907.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #62907 (Double free when use traits) +--FILE-- +<?php +function __autoload($name) { + if ($name == "B") { + eval ("abstract class B extends A { }"); + } else if ($name == "A") { + eval ("abstract class A { use T { T::__construct as __asconstruct; }}"); + } else if ($name == "T") { + eval ("trait T { public function __construct() { } }"); + } + return TRUE; +} + +class C extends B { + public function __construct() { + } +} +echo "okey"; +--EXPECT-- +okey diff --git a/Zend/tests/bug62956.phpt b/Zend/tests/bug62956.phpt new file mode 100644 index 0000000000..c8694d5bea --- /dev/null +++ b/Zend/tests/bug62956.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT +--FILE-- +<?php +class Base +{ + private function test() + {} +} + +class Extension extends Base +{ + private function test($arg) + {} +} + +?> +==DONE== +--EXPECT-- +==DONE== diff --git a/Zend/tests/bug63111.phpt b/Zend/tests/bug63111.phpt new file mode 100644 index 0000000000..3f19068668 --- /dev/null +++ b/Zend/tests/bug63111.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #63111 (is_callable() lies for abstract static method) +--FILE-- +<?php +abstract class Foo { + abstract static function bar(); +} +interface MyInterface { + static function bar(); +} +abstract class Bar { + static function foo() { + echo "ok\n"; + } +} +var_dump(is_callable(array("Foo", "bar"))); +var_dump(is_callable("Foo::bar")); +var_dump(is_callable(array("MyInterface", "bar"))); +var_dump(is_callable("MyInterface::bar")); +var_dump(is_callable(array("Bar", "foo"))); +var_dump(is_callable("Bar::foo")); +Bar::foo(); +Foo::bar(); +?> +--EXPECTF-- +Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3 +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +ok + +Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20 + diff --git a/Zend/tests/bug63173.phpt b/Zend/tests/bug63173.phpt new file mode 100644 index 0000000000..36ebf203d2 --- /dev/null +++ b/Zend/tests/bug63173.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #63173: Crash when invoking invalid array callback +--FILE-- +<?php + +// the important part here are the indexes 1 and 2 +$callback = [1 => 0, 2 => 0]; +$callback(); + +?> +--EXPECTF-- +Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt index 34604d6347..f7cb81bb20 100644 --- a/Zend/tests/offset_string.phpt +++ b/Zend/tests/offset_string.phpt @@ -30,10 +30,10 @@ echo "Done\n"; --EXPECTF-- string(1) "i" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" Warning: Illegal string offset 'run away' in %s on line %d @@ -46,10 +46,10 @@ string(1) "o" Notice: A non well formed numeric value encountered in %s on line %d string(1) "r" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "i" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" Warning: Illegal offset type in %s on line %d diff --git a/Zend/zend.c b/Zend/zend.c index 37a1a27c7d..9ab879a2a4 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -258,6 +258,9 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop { TSRMLS_FETCH(); + if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { + break; + } if (Z_OBJ_HANDLER_P(expr, cast_object)) { zval *val; @@ -270,12 +273,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop } zval_ptr_dtor(&val); } - /* Standard PHP objects */ - if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) { - if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - break; - } - } if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) { zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC); @@ -1031,6 +1028,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ zend_stack context_stack; TSRMLS_FETCH(); + /* Report about uncaught exception in case of fatal errors */ + if (EG(exception)) { + switch (type) { + case E_CORE_ERROR: + case E_ERROR: + case E_RECOVERABLE_ERROR: + case E_PARSE: + case E_COMPILE_ERROR: + case E_USER_ERROR: + if (zend_is_executing(TSRMLS_C)) { + error_lineno = zend_get_executed_lineno(TSRMLS_C); + } + zend_exception_error(EG(exception), E_WARNING TSRMLS_CC); + EG(exception) = NULL; + if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) { + active_opline->lineno = error_lineno; + } + break; + default: + break; + } + } + /* Obtain relevant filename and lineno */ switch (type) { case E_CORE_ERROR: @@ -1261,6 +1281,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co zend_file_handle *file_handle; zend_op_array *orig_op_array = EG(active_op_array); zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr); + long orig_interactive = CG(interactive); va_start(files, file_count); for (i = 0; i < file_count; i++) { @@ -1268,6 +1289,15 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co if (!file_handle) { continue; } + + if (orig_interactive) { + if (file_handle->filename[0] != '-' || file_handle->filename[1]) { + CG(interactive) = 0; + } else { + CG(interactive) = 1; + } + } + EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC); if (file_handle->opened_path) { int dummy = 1; @@ -1309,12 +1339,14 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; + CG(interactive) = orig_interactive; return FAILURE; } } va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; + CG(interactive) = orig_interactive; return SUCCESS; } diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 98a33e5445..45abcf61e8 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2265,7 +2265,9 @@ void module_destructor(zend_module_entry *module) /* {{{ */ /* Deinitilaise module globals */ if (module->globals_size) { #ifdef ZTS - ts_free_id(*module->globals_id_ptr); + if (*module->globals_id_ptr) { + ts_free_id(*module->globals_id_ptr); + } #else if (module->globals_dtor) { module->globals_dtor(module->globals_ptr TSRMLS_CC); @@ -2531,6 +2533,9 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt } /* }}} */ +#ifdef ZEND_WIN32 +#pragma optimize("", off) +#endif static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { zend_object_value retval; @@ -2539,6 +2544,9 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name); return retval; } +#ifdef ZEND_WIN32 +#pragma optimize("", on) +#endif /* }}} */ static const zend_function_entry disabled_class_new[] = { @@ -2547,16 +2555,15 @@ static const zend_function_entry disabled_class_new[] = { ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */ { - zend_class_entry disabled_class; + zend_class_entry **disabled_class; zend_str_tolower(class_name, class_name_length); - if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { + if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) { return FAILURE; } - INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL); - disabled_class.create_object = display_disabled_class; - disabled_class.name_length = class_name_length; - zend_register_internal_class(&disabled_class TSRMLS_CC); + INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL); + (*disabled_class)->create_object = display_disabled_class; + zend_hash_clean(&((*disabled_class)->function_table)); return SUCCESS; } /* }}} */ @@ -2630,7 +2637,6 @@ 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) /* {{{ */ { zend_class_entry *ce_org = fcc->calling_scope; @@ -2653,11 +2659,9 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca /* Skip leading \ */ if (Z_STRVAL_P(callable)[0] == '\\') { mlen = Z_STRLEN_P(callable) - 1; - mname = Z_STRVAL_P(callable) + 1; lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen); } else { mlen = Z_STRLEN_P(callable); - mname = Z_STRVAL_P(callable); lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen); } /* Check if function with given name exists. @@ -2809,7 +2813,14 @@ get_function_via_handler: if (retval) { if (fcc->calling_scope && !call_via_handler) { - if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { + if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) { + if (error) { + zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); + retval = 0; + } else { + zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); + } + } else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { int severity; char *verb; if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index f54db7f2e8..d7fbc3c3af 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -175,6 +175,11 @@ typedef struct _zend_fcall_info_cache { class_container.name = zend_strndup(cl_name, _len); \ } \ class_container.name_length = _len; \ + INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + } + +#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + { \ class_container.constructor = NULL; \ class_container.destructor = NULL; \ class_container.clone = NULL; \ diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 66cd23c7cb..0b0e8632c1 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -664,7 +664,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_ static inline unsigned int zend_mm_high_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -690,7 +690,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size) static inline unsigned int zend_mm_low_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -2454,7 +2454,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_ return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) { diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 6f2ded3753..c7527b4ff9 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -78,7 +78,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ /* {{{ proto Closure Closure::bind(Closure $old, object $to [, mixed $scope = "static" ] ) Create a closure from another one and bind to another object and scope */ -ZEND_METHOD(Closure, bind) /* {{{ */ +ZEND_METHOD(Closure, bind) { zval *newthis, *zclosure, *scope_arg = NULL; zend_closure *closure; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 28f98249d2..c39d8eaa1e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n zval key; if (CG(current_namespace)) { - /* Prefix function name with current namespcae name */ + /* Prefix function name with current namespace name */ znode tmp; tmp.u.constant = *CG(current_namespace); @@ -2935,6 +2935,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 1; } + /* If both methods are private do not enforce a signature */ + if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) { + return 1; + } + /* check number of arguments */ if (proto->common.required_num_args < fe->common.required_num_args || proto->common.num_args > fe->common.num_args) { @@ -3712,7 +3717,7 @@ static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args } else { /* Add it to result function table */ if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating resulting trait method table", fn->common.function_name); + zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name); } } @@ -3801,9 +3806,12 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int if (prototype) { do_inheritance_check_on_method(fn, prototype TSRMLS_CC); } + /* one more thing: make sure we properly implement an abstract method */ if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + prototype = fn->common.prototype; do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); + fn->common.prototype = prototype; } /* delete inherited fn if the function to be added is not abstract */ @@ -3829,11 +3837,11 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int function_add_ref(&fn_copy); if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey); + zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey); } - + zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC); - + zend_function_dtor(fn); } else { zend_function_dtor(fn); @@ -3870,10 +3878,10 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { fn_copy = *fn; function_add_ref(&fn_copy); - /* this function_name is never destroyed, because its refcount - greater than 1 and classes are always destoyed before the - traits they use */ + /* this function_name is never destroyed, because ZEND_ACC_ALIAS + flag is set */ fn_copy.common.function_name = aliases[i]->alias; + fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; /* if it is 0, no modifieres has been changed */ if (aliases[i]->modifiers) { @@ -3906,6 +3914,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, /* is not in hashtable, thus, function is not to be excluded */ fn_copy = *fn; function_add_ref(&fn_copy); + fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; /* apply aliases which are not qualified by a class name, or which have not * alias name, just setting visibility */ @@ -4025,9 +4034,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* /** And, ensure that the referenced method is resolvable, too. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, - cur_method_ref->mname_len); + cur_method_ref->mname_len); method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, - lcname, cur_method_ref->mname_len + 1); + lcname, cur_method_ref->mname_len + 1); efree(lcname); if (!method_exists) { @@ -5009,11 +5018,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name opline->op2_type = IS_CONST; if (doing_inheritance) { - /* Make sure a trait does not try to extend a class */ - if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); - } - + /* Make sure a trait does not try to extend a class */ + if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); + } + opline->extended_value = parent_class_name->u.op.var; opline->opcode = ZEND_DECLARE_INHERITED_CLASS; } else { @@ -6958,9 +6967,9 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name)); if (((Z_STRLEN_P(name) == sizeof("self")-1) && - !memcmp(lcname, "self", sizeof("self")-1)) || - ((Z_STRLEN_P(name) == sizeof("parent")-1) && - !memcmp(lcname, "parent", sizeof("parent")-1))) { + !memcmp(lcname, "self", sizeof("self")-1)) || + ((Z_STRLEN_P(name) == sizeof("parent")-1) && + !memcmp(lcname, "parent", sizeof("parent")-1))) { zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); } diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index f164122785..79ace0c3c3 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -207,6 +207,8 @@ typedef struct _zend_try_catch_element { #define ZEND_ACC_RETURN_REFERENCE 0x4000000 #define ZEND_ACC_DONE_PASS_TWO 0x8000000 +#define ZEND_ACC_ALIAS 0x10000000 + char *zend_visibility_string(zend_uint fn_flags); diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 7bb7792a4c..787e66bfe9 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -29,8 +29,8 @@ #include "zend_vm.h" #include "zend_dtrace.h" -zend_class_entry *default_exception_ce; -zend_class_entry *error_exception_ce; +static zend_class_entry *default_exception_ce; +static zend_class_entry *error_exception_ce; static zend_object_handlers default_exception_handlers; ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 205531fd28..fbc73258c7 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1161,7 +1161,7 @@ convert_to_array: case IS_DOUBLE: case IS_NULL: case IS_BOOL: - zend_error(E_NOTICE, "String offset cast occured"); + zend_error(E_NOTICE, "String offset cast occurred"); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -1284,7 +1284,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont case IS_NULL: case IS_BOOL: if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "String offset cast occured"); + zend_error(E_NOTICE, "String offset cast occurred"); } break; default: diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 84ca1de345..1bd64394ac 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -330,7 +330,7 @@ END_EXTERN_C() if (idx-1 > LONG_MAX) { /* overflow */ \ break; \ } \ - idx = (ulong)(-(long)idx); \ + idx = 0 - idx; \ } else if (idx > LONG_MAX) { /* overflow */ \ break; \ } \ diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index 9d0265e901..94c48c8977 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */ +/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ @@ -481,7 +481,7 @@ yy4: yy5: YYDEBUG(5, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 547 "Zend/zend_ini_scanner.l" +#line 568 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; @@ -493,7 +493,7 @@ yy6: yy7: YYDEBUG(7, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 552 "Zend/zend_ini_scanner.l" +#line 573 "Zend/zend_ini_scanner.l" { SCNG(lineno)++; return END_OF_LINE; @@ -533,7 +533,7 @@ yy10: ++YYCURSOR; YYDEBUG(11, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 475 "Zend/zend_ini_scanner.l" +#line 496 "Zend/zend_ini_scanner.l" { /* Disallow these chars outside option values */ return yytext[0]; } @@ -554,7 +554,7 @@ yy14: goto yy54; YYDEBUG(15, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } @@ -926,7 +926,7 @@ yy55: yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; @@ -1012,7 +1012,7 @@ yy64: yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 563 "Zend/zend_ini_scanner.l" +#line 584 "Zend/zend_ini_scanner.l" { /* #Comment */ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno)); BEGIN(INITIAL); @@ -1159,7 +1159,7 @@ yyc_ST_DOUBLE_QUOTES: yy76: YYDEBUG(76, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 507 "Zend/zend_ini_scanner.l" +#line 528 "Zend/zend_ini_scanner.l" { /* Escape double quoted string contents */ if (YYCURSOR > YYLIMIT) { return 0; @@ -1204,7 +1204,7 @@ yy77: yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 502 "Zend/zend_ini_scanner.l" +#line 523 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string ends */ yy_pop_state(TSRMLS_C); return '"'; @@ -1323,7 +1323,7 @@ yy86: yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 493 "Zend/zend_ini_scanner.l" +#line 514 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } @@ -1344,7 +1344,7 @@ yy89: yy90: YYDEBUG(90, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } @@ -1355,7 +1355,7 @@ yy91: yy92: YYDEBUG(92, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; @@ -1422,7 +1422,7 @@ yy97: yy98: YYDEBUG(98, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } @@ -1452,7 +1452,7 @@ yy99: yy100: YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } @@ -1833,7 +1833,7 @@ yyc_ST_RAW: 160, 224, 0, 160, 160, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 224, 160, 160, 160, 160, 160, 160, 160, + 224, 160, 32, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 32, 160, 160, 160, 160, @@ -1865,66 +1865,64 @@ yyc_ST_RAW: YYDEBUG(135, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy139; + if (yych <= '\r') { + if (yych <= '\t') { + if (yych <= 0x00) goto yy137; + if (yych <= 0x08) goto yy139; + goto yy141; } else { - if (yych <= '\t') goto yy141; if (yych <= '\n') goto yy142; - goto yy139; + if (yych <= '\f') goto yy139; + goto yy144; } } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy144; - if (yych <= 0x1F) goto yy139; - goto yy141; + if (yych <= '!') { + if (yych == ' ') goto yy141; + goto yy139; } else { - if (yych == ';') goto yy145; + if (yych <= '"') goto yy145; + if (yych == ';') goto yy147; goto yy139; } } +yy137: YYDEBUG(137, *YYCURSOR); ++YYCURSOR; YYDEBUG(138, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 570 "Zend/zend_ini_scanner.l" +#line 591 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 1896 "Zend/zend_ini_scanner.c" +#line 1899 "Zend/zend_ini_scanner.c" yy139: YYDEBUG(139, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy156; + goto yy158; yy140: YYDEBUG(140, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 448 "Zend/zend_ini_scanner.l" +#line 474 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - /* Eat leading and trailing double quotes */ - if (yytext[0] == '"' && yytext[yyleng - 1] == '"') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 1914 "Zend/zend_ini_scanner.c" +#line 1912 "Zend/zend_ini_scanner.c" yy141: YYDEBUG(141, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { - goto yy152; + goto yy154; } if (yych <= '\f') { - if (yych == '\n') goto yy151; - goto yy156; + if (yych == '\n') goto yy153; + goto yy158; } else { - if (yych <= '\r') goto yy154; - if (yych == ';') goto yy146; - goto yy156; + if (yych <= '\r') goto yy156; + if (yych == ';') goto yy148; + goto yy158; } yy142: YYDEBUG(142, *YYCURSOR); @@ -1932,89 +1930,129 @@ yy142: yy143: YYDEBUG(143, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 461 "Zend/zend_ini_scanner.l" +#line 482 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 1942 "Zend/zend_ini_scanner.c" +#line 1940 "Zend/zend_ini_scanner.c" yy144: YYDEBUG(144, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy151; + if (yych == '\n') goto yy153; goto yy143; yy145: YYDEBUG(145, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy147; -yy146: - YYDEBUG(146, *YYCURSOR); ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; + YYDEBUG(146, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 448 "Zend/zend_ini_scanner.l" + { + while (YYCURSOR < YYLIMIT) { + switch (*YYCURSOR++) { + case '\n': + SCNG(lineno)++; + break; + case '\r': + if (*YYCURSOR != '\n') { + SCNG(lineno)++; + } + break; + case '"': + yyleng = YYCURSOR - SCNG(yy_text) - 2; + SCNG(yy_text)++; + RETURN_TOKEN(TC_RAW, yytext, yyleng); + case '\\': + if (YYCURSOR < YYLIMIT) { + YYCURSOR++; + } + break; + } + } + yyleng = YYCURSOR - SCNG(yy_text); + RETURN_TOKEN(TC_RAW, yytext, yyleng); +} +#line 1977 "Zend/zend_ini_scanner.c" yy147: YYDEBUG(147, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy146; - } - if (yych >= '\r') goto yy150; + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + goto yy149; yy148: YYDEBUG(148, *YYCURSOR); ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; yy149: YYDEBUG(149, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy148; + } + if (yych >= '\r') goto yy152; +yy150: + YYDEBUG(150, *YYCURSOR); + ++YYCURSOR; +yy151: + YYDEBUG(151, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 1976 "Zend/zend_ini_scanner.c" -yy150: - YYDEBUG(150, *YYCURSOR); +#line 2006 "Zend/zend_ini_scanner.c" +yy152: + YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy148; - goto yy149; -yy151: - YYDEBUG(151, *YYCURSOR); + if (yych == '\n') goto yy150; + goto yy151; +yy153: + YYDEBUG(153, *YYCURSOR); yych = *++YYCURSOR; goto yy143; -yy152: - YYDEBUG(152, *YYCURSOR); +yy154: + YYDEBUG(154, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(153, *YYCURSOR); + YYDEBUG(155, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy152; + goto yy154; } - if (yych <= '\f') { - if (yych <= 0x00) goto yy140; - if (yych == '\n') goto yy151; - goto yy155; + if (yych <= '\r') { + if (yych <= '\t') { + if (yych <= 0x00) goto yy140; + goto yy157; + } else { + if (yych <= '\n') goto yy153; + if (yych <= '\f') goto yy157; + } } else { - if (yych <= '\r') goto yy154; - if (yych == ';') goto yy146; - goto yy155; + if (yych <= '"') { + if (yych <= '!') goto yy157; + goto yy140; + } else { + if (yych == ';') goto yy148; + goto yy157; + } } -yy154: - YYDEBUG(154, *YYCURSOR); +yy156: + YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy151; + if (yych == '\n') goto yy153; goto yy143; -yy155: - YYDEBUG(155, *YYCURSOR); +yy157: + YYDEBUG(157, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy156: - YYDEBUG(156, *YYCURSOR); +yy158: + YYDEBUG(158, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy155; + goto yy157; } goto yy140; } @@ -2055,44 +2093,44 @@ yyc_ST_SECTION_RAW: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(157, *YYCURSOR); + YYDEBUG(159, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { - if (yych == '\n') goto yy161; + if (yych == '\n') goto yy163; } else { - if (yych <= '\r') goto yy161; - if (yych == ']') goto yy163; + if (yych <= '\r') goto yy163; + if (yych == ']') goto yy165; } - YYDEBUG(159, *YYCURSOR); + YYDEBUG(161, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy170; -yy160: - YYDEBUG(160, *YYCURSOR); + goto yy172; +yy162: + YYDEBUG(162, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 457 "Zend/zend_ini_scanner.l" +#line 478 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2079 "Zend/zend_ini_scanner.c" -yy161: - YYDEBUG(161, *YYCURSOR); +#line 2117 "Zend/zend_ini_scanner.c" +yy163: + YYDEBUG(163, *YYCURSOR); ++YYCURSOR; - YYDEBUG(162, *YYCURSOR); + YYDEBUG(164, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 2089 "Zend/zend_ini_scanner.c" -yy163: - YYDEBUG(163, *YYCURSOR); +#line 2127 "Zend/zend_ini_scanner.c" +yy165: + YYDEBUG(165, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy166; -yy164: - YYDEBUG(164, *YYCURSOR); + goto yy168; +yy166: + YYDEBUG(166, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2100,40 +2138,40 @@ yy164: SCNG(lineno)++; return ']'; } -#line 2104 "Zend/zend_ini_scanner.c" -yy165: - YYDEBUG(165, *YYCURSOR); +#line 2142 "Zend/zend_ini_scanner.c" +yy167: + YYDEBUG(167, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy166: - YYDEBUG(166, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy165; - } - if (yych == '\n') goto yy167; - if (yych == '\r') goto yy168; - goto yy164; -yy167: - YYDEBUG(167, *YYCURSOR); - yych = *++YYCURSOR; - goto yy164; yy168: YYDEBUG(168, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy167; - goto yy164; + if (yybm[0+yych] & 64) { + goto yy167; + } + if (yych == '\n') goto yy169; + if (yych == '\r') goto yy170; + goto yy166; yy169: YYDEBUG(169, *YYCURSOR); + yych = *++YYCURSOR; + goto yy166; +yy170: + YYDEBUG(170, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy169; + goto yy166; +yy171: + YYDEBUG(171, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy170: - YYDEBUG(170, *YYCURSOR); +yy172: + YYDEBUG(172, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy169; + goto yy171; } - goto yy160; + goto yy162; } /* *********************************** */ yyc_ST_SECTION_VALUE: @@ -2172,203 +2210,203 @@ yyc_ST_SECTION_VALUE: 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, }; - YYDEBUG(171, *YYCURSOR); + YYDEBUG(173, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '-') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x08) goto yy173; - if (yych <= '\t') goto yy175; - goto yy176; + if (yych <= 0x08) goto yy175; + if (yych <= '\t') goto yy177; + goto yy178; } else { - if (yych == '\r') goto yy176; - if (yych >= ' ') goto yy175; + if (yych == '\r') goto yy178; + if (yych >= ' ') goto yy177; } } else { if (yych <= '$') { - if (yych == '"') goto yy178; - if (yych >= '$') goto yy180; + if (yych == '"') goto yy180; + if (yych >= '$') goto yy182; } else { - if (yych == '\'') goto yy181; - if (yych >= '-') goto yy182; + if (yych == '\'') goto yy183; + if (yych >= '-') goto yy184; } } } else { if (yych <= 'Z') { if (yych <= '9') { - if (yych <= '.') goto yy183; - if (yych >= '0') goto yy184; + if (yych <= '.') goto yy185; + if (yych >= '0') goto yy186; } else { - if (yych == ';') goto yy176; - if (yych >= 'A') goto yy186; + if (yych == ';') goto yy178; + if (yych >= 'A') goto yy188; } } else { if (yych <= '^') { - if (yych <= '[') goto yy173; - if (yych <= '\\') goto yy188; - if (yych <= ']') goto yy189; + if (yych <= '[') goto yy175; + if (yych <= '\\') goto yy190; + if (yych <= ']') goto yy191; } else { - if (yych == '`') goto yy173; - if (yych <= 'z') goto yy186; + if (yych == '`') goto yy175; + if (yych <= 'z') goto yy188; } } } -yy173: - YYDEBUG(173, *YYCURSOR); +yy175: + YYDEBUG(175, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy196; -yy174: - YYDEBUG(174, *YYCURSOR); + goto yy198; +yy176: + YYDEBUG(176, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 493 "Zend/zend_ini_scanner.l" +#line 514 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2230 "Zend/zend_ini_scanner.c" -yy175: - YYDEBUG(175, *YYCURSOR); +#line 2268 "Zend/zend_ini_scanner.c" +yy177: + YYDEBUG(177, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy222; - goto yy196; + if (yych == '\t') goto yy224; + goto yy198; } else { - if (yych <= ' ') goto yy222; - if (yych == '"') goto yy224; - goto yy196; + if (yych <= ' ') goto yy224; + if (yych == '"') goto yy226; + goto yy198; } -yy176: - YYDEBUG(176, *YYCURSOR); +yy178: + YYDEBUG(178, *YYCURSOR); ++YYCURSOR; -yy177: - YYDEBUG(177, *YYCURSOR); +yy179: + YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 2253 "Zend/zend_ini_scanner.c" -yy178: - YYDEBUG(178, *YYCURSOR); +#line 2291 "Zend/zend_ini_scanner.c" +yy180: + YYDEBUG(180, *YYCURSOR); ++YYCURSOR; -yy179: - YYDEBUG(179, *YYCURSOR); +yy181: + YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 2265 "Zend/zend_ini_scanner.c" -yy180: - YYDEBUG(180, *YYCURSOR); +#line 2303 "Zend/zend_ini_scanner.c" +yy182: + YYDEBUG(182, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy177; - if (yych <= '[') goto yy195; - goto yy200; + if (yych <= 0x00) goto yy179; + if (yych <= '[') goto yy197; + goto yy202; } else { - if (yych == '{') goto yy220; - goto yy195; + if (yych == '{') goto yy222; + goto yy197; } -yy181: - YYDEBUG(181, *YYCURSOR); +yy183: + YYDEBUG(183, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy216; + goto yy218; } - goto yy177; -yy182: - YYDEBUG(182, *YYCURSOR); + goto yy179; +yy184: + YYDEBUG(184, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy196; - if (yych <= '9') goto yy214; - goto yy196; -yy183: - YYDEBUG(183, *YYCURSOR); + if (yych <= '/') goto yy198; + if (yych <= '9') goto yy216; + goto yy198; +yy185: + YYDEBUG(185, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy196; - if (yych <= '9') goto yy212; - goto yy196; -yy184: - YYDEBUG(184, *YYCURSOR); + if (yych <= '/') goto yy198; + if (yych <= '9') goto yy214; + goto yy198; +yy186: + YYDEBUG(186, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\'') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy196; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy198; } else { - if (yych == '"') goto yy185; - if (yych <= '&') goto yy196; + if (yych == '"') goto yy187; + if (yych <= '&') goto yy198; } } else { if (yych <= '9') { - if (yych == '.') goto yy208; - if (yych <= '/') goto yy196; - goto yy210; + if (yych == '.') goto yy210; + if (yych <= '/') goto yy198; + goto yy212; } else { if (yych <= ';') { - if (yych <= ':') goto yy196; + if (yych <= ':') goto yy198; } else { - if (yych != ']') goto yy196; + if (yych != ']') goto yy198; } } } -yy185: - YYDEBUG(185, *YYCURSOR); +yy187: + YYDEBUG(187, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 2331 "Zend/zend_ini_scanner.c" -yy186: - YYDEBUG(186, *YYCURSOR); +#line 2369 "Zend/zend_ini_scanner.c" +yy188: + YYDEBUG(188, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy206; + goto yy208; } if (yych <= '"') { if (yych <= '\f') { - if (yych != '\n') goto yy196; + if (yych != '\n') goto yy198; } else { - if (yych <= '\r') goto yy187; - if (yych <= '!') goto yy196; + if (yych <= '\r') goto yy189; + if (yych <= '!') goto yy198; } } else { if (yych <= ':') { - if (yych != '\'') goto yy196; + if (yych != '\'') goto yy198; } else { - if (yych <= ';') goto yy187; - if (yych != ']') goto yy196; + if (yych <= ';') goto yy189; + if (yych != ']') goto yy198; } } -yy187: - YYDEBUG(187, *YYCURSOR); +yy189: + YYDEBUG(189, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 2361 "Zend/zend_ini_scanner.c" -yy188: - YYDEBUG(188, *YYCURSOR); +#line 2399 "Zend/zend_ini_scanner.c" +yy190: + YYDEBUG(190, *YYCURSOR); yych = *++YYCURSOR; - goto yy195; -yy189: - YYDEBUG(189, *YYCURSOR); + goto yy197; +yy191: + YYDEBUG(191, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy192; -yy190: - YYDEBUG(190, *YYCURSOR); + goto yy194; +yy192: + YYDEBUG(192, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2376,97 +2414,86 @@ yy190: SCNG(lineno)++; return ']'; } -#line 2380 "Zend/zend_ini_scanner.c" -yy191: - YYDEBUG(191, *YYCURSOR); +#line 2418 "Zend/zend_ini_scanner.c" +yy193: + YYDEBUG(193, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy192: - YYDEBUG(192, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy191; - } - if (yych == '\n') goto yy193; - if (yych == '\r') goto yy194; - goto yy190; -yy193: - YYDEBUG(193, *YYCURSOR); - yych = *++YYCURSOR; - goto yy190; yy194: YYDEBUG(194, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy193; - goto yy190; + if (yybm[0+yych] & 2) { + goto yy193; + } + if (yych == '\n') goto yy195; + if (yych == '\r') goto yy196; + goto yy192; yy195: YYDEBUG(195, *YYCURSOR); + yych = *++YYCURSOR; + goto yy192; +yy196: + YYDEBUG(196, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy195; + goto yy192; +yy197: + YYDEBUG(197, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy196: - YYDEBUG(196, *YYCURSOR); +yy198: + YYDEBUG(198, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy195; + goto yy197; } - if (yych == '$') goto yy198; - if (yych != '\\') goto yy174; -yy197: - YYDEBUG(197, *YYCURSOR); + if (yych == '$') goto yy200; + if (yych != '\\') goto yy176; +yy199: + YYDEBUG(199, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - goto yy195; -yy198: - YYDEBUG(198, *YYCURSOR); + goto yy197; +yy200: + YYDEBUG(200, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy199; - if (yych <= '[') goto yy195; - goto yy200; + if (yych <= 0x00) goto yy201; + if (yych <= '[') goto yy197; + goto yy202; } else { - if (yych != '{') goto yy195; + if (yych != '{') goto yy197; } -yy199: - YYDEBUG(199, *YYCURSOR); +yy201: + YYDEBUG(201, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy174; + goto yy176; } else { - goto yy177; + goto yy179; } } else { if (yyaccept <= 2) { - goto yy185; - } else { goto yy187; + } else { + goto yy189; } } -yy200: - YYDEBUG(200, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy201; - } - if (yych == '\\') goto yy203; - goto yy195; -yy201: - YYDEBUG(201, *YYCURSOR); +yy202: + YYDEBUG(202, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(202, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } if (yych == '\\') goto yy205; - goto yy195; + goto yy197; yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -2474,219 +2501,230 @@ yy203: yych = *YYCURSOR; YYDEBUG(204, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } - if (yych == '\\') goto yy203; - goto yy195; + if (yych == '\\') goto yy207; + goto yy197; yy205: YYDEBUG(205, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; + YYDEBUG(206, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } - if (yych == '\\') goto yy203; - goto yy195; -yy206: - YYDEBUG(206, *YYCURSOR); + if (yych == '\\') goto yy205; + goto yy197; +yy207: + YYDEBUG(207, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 8) { + goto yy203; + } + if (yych == '\\') goto yy205; + goto yy197; +yy208: + YYDEBUG(208, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(207, *YYCURSOR); + YYDEBUG(209, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy206; + goto yy208; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy187; - if (yych <= '\f') goto yy195; - goto yy187; + if (yych == '\n') goto yy189; + if (yych <= '\f') goto yy197; + goto yy189; } else { - if (yych == '"') goto yy187; - if (yych <= '#') goto yy195; - goto yy198; + if (yych == '"') goto yy189; + if (yych <= '#') goto yy197; + goto yy200; } } else { if (yych <= ';') { - if (yych == '\'') goto yy187; - if (yych <= ':') goto yy195; - goto yy187; + if (yych == '\'') goto yy189; + if (yych <= ':') goto yy197; + goto yy189; } else { - if (yych <= '[') goto yy195; - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy187; - goto yy195; + if (yych <= '[') goto yy197; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy189; + goto yy197; } } -yy208: - YYDEBUG(208, *YYCURSOR); +yy210: + YYDEBUG(210, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(209, *YYCURSOR); + YYDEBUG(211, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy208; + goto yy210; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; } else { - if (yych == '"') goto yy185; - if (yych <= '#') goto yy195; - goto yy198; + if (yych == '"') goto yy187; + if (yych <= '#') goto yy197; + goto yy200; } } else { if (yych <= ';') { - if (yych == '\'') goto yy185; - if (yych <= ':') goto yy195; - goto yy185; + if (yych == '\'') goto yy187; + if (yych <= ':') goto yy197; + goto yy187; } else { - if (yych <= '[') goto yy195; - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '[') goto yy197; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } -yy210: - YYDEBUG(210, *YYCURSOR); +yy212: + YYDEBUG(212, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(211, *YYCURSOR); + YYDEBUG(213, *YYCURSOR); if (yych <= '\'') { if (yych <= '!') { if (yych <= '\n') { - if (yych <= '\t') goto yy195; - goto yy185; + if (yych <= '\t') goto yy197; + goto yy187; } else { - if (yych == '\r') goto yy185; - goto yy195; + if (yych == '\r') goto yy187; + goto yy197; } } else { if (yych <= '#') { - if (yych <= '"') goto yy185; - goto yy195; + if (yych <= '"') goto yy187; + goto yy197; } else { - if (yych <= '$') goto yy198; - if (yych <= '&') goto yy195; - goto yy185; + if (yych <= '$') goto yy200; + if (yych <= '&') goto yy197; + goto yy187; } } } else { if (yych <= ':') { if (yych <= '.') { - if (yych <= '-') goto yy195; - goto yy208; + if (yych <= '-') goto yy197; + goto yy210; } else { - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy210; - goto yy195; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy212; + goto yy197; } } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy212: - YYDEBUG(212, *YYCURSOR); +yy214: + YYDEBUG(214, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(213, *YYCURSOR); + YYDEBUG(215, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; } else { if (yych <= '"') { - if (yych <= '!') goto yy195; - goto yy185; + if (yych <= '!') goto yy197; + goto yy187; } else { - if (yych == '$') goto yy198; - goto yy195; + if (yych == '$') goto yy200; + goto yy197; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy185; - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy212; - goto yy195; + if (yych <= '\'') goto yy187; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy214; + goto yy197; } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy214: - YYDEBUG(214, *YYCURSOR); +yy216: + YYDEBUG(216, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(215, *YYCURSOR); + YYDEBUG(217, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; } else { if (yych <= '"') { - if (yych <= '!') goto yy195; - goto yy185; + if (yych <= '!') goto yy197; + goto yy187; } else { - if (yych == '$') goto yy198; - goto yy195; + if (yych == '$') goto yy200; + goto yy197; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy185; - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy214; - goto yy195; + if (yych <= '\'') goto yy187; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy216; + goto yy197; } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy216: - YYDEBUG(216, *YYCURSOR); +yy218: + YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(217, *YYCURSOR); + YYDEBUG(219, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy216; + goto yy218; } - YYDEBUG(218, *YYCURSOR); + YYDEBUG(220, *YYCURSOR); ++YYCURSOR; - YYDEBUG(219, *YYCURSOR); + YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -2697,65 +2735,65 @@ yy216: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2701 "Zend/zend_ini_scanner.c" -yy220: - YYDEBUG(220, *YYCURSOR); +#line 2739 "Zend/zend_ini_scanner.c" +yy222: + YYDEBUG(222, *YYCURSOR); ++YYCURSOR; - YYDEBUG(221, *YYCURSOR); + YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 401 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } -#line 2712 "Zend/zend_ini_scanner.c" -yy222: - YYDEBUG(222, *YYCURSOR); +#line 2750 "Zend/zend_ini_scanner.c" +yy224: + YYDEBUG(224, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(223, *YYCURSOR); + YYDEBUG(225, *YYCURSOR); if (yych <= '"') { if (yych <= '\f') { - if (yych <= 0x08) goto yy195; - if (yych <= '\t') goto yy222; - if (yych <= '\n') goto yy174; - goto yy195; + if (yych <= 0x08) goto yy197; + if (yych <= '\t') goto yy224; + if (yych <= '\n') goto yy176; + goto yy197; } else { if (yych <= 0x1F) { - if (yych <= '\r') goto yy174; - goto yy195; + if (yych <= '\r') goto yy176; + goto yy197; } else { - if (yych <= ' ') goto yy222; - if (yych <= '!') goto yy195; + if (yych <= ' ') goto yy224; + if (yych <= '!') goto yy197; } } } else { if (yych <= ':') { if (yych <= '$') { - if (yych <= '#') goto yy195; - goto yy198; + if (yych <= '#') goto yy197; + goto yy200; } else { - if (yych == '\'') goto yy174; - goto yy195; + if (yych == '\'') goto yy176; + goto yy197; } } else { if (yych <= '[') { - if (yych <= ';') goto yy174; - goto yy195; + if (yych <= ';') goto yy176; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy174; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy176; + goto yy197; } } } -yy224: - YYDEBUG(224, *YYCURSOR); +yy226: + YYDEBUG(226, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy179; + goto yy181; } /* *********************************** */ yyc_ST_VALUE: @@ -2794,27 +2832,27 @@ yyc_ST_VALUE: 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, }; - YYDEBUG(225, *YYCURSOR); + YYDEBUG(227, *YYCURSOR); YYFILL(6); yych = *YYCURSOR; YYDEBUG(-1, yych); switch (yych) { - case 0x00: goto yy227; + case 0x00: goto yy229; case '\t': - case ' ': goto yy231; - case '\n': goto yy233; - case '\r': goto yy235; + case ' ': goto yy233; + case '\n': goto yy235; + case '\r': goto yy237; case '!': case '&': case '(': case ')': case '|': - case '~': goto yy236; - case '"': goto yy238; - case '$': goto yy240; - case '\'': goto yy241; - case '-': goto yy242; - case '.': goto yy243; + case '~': goto yy238; + case '"': goto yy240; + case '$': goto yy242; + case '\'': goto yy243; + case '-': goto yy244; + case '.': goto yy245; case '0': case '1': case '2': @@ -2824,9 +2862,9 @@ yyc_ST_VALUE: case '6': case '7': case '8': - case '9': goto yy244; - case ';': goto yy246; - case '=': goto yy247; + case '9': goto yy246; + case ';': goto yy248; + case '=': goto yy249; case 'A': case 'B': case 'C': @@ -2869,1529 +2907,1529 @@ yyc_ST_VALUE: case 'v': case 'w': case 'x': - case 'z': goto yy249; + case 'z': goto yy251; case 'F': - case 'f': goto yy251; + case 'f': goto yy253; case 'N': - case 'n': goto yy252; + case 'n': goto yy254; case 'O': - case 'o': goto yy253; + case 'o': goto yy255; case 'T': - case 't': goto yy254; + case 't': goto yy256; case 'Y': - case 'y': goto yy255; - default: goto yy229; + case 'y': goto yy257; + default: goto yy231; } -yy227: - YYDEBUG(227, *YYCURSOR); +yy229: + YYDEBUG(229, *YYCURSOR); ++YYCURSOR; -yy228: - YYDEBUG(228, *YYCURSOR); +yy230: + YYDEBUG(230, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 570 "Zend/zend_ini_scanner.l" +#line 591 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 2897 "Zend/zend_ini_scanner.c" -yy229: - YYDEBUG(229, *YYCURSOR); +#line 2935 "Zend/zend_ini_scanner.c" +yy231: + YYDEBUG(231, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy257; -yy230: - YYDEBUG(230, *YYCURSOR); + goto yy259; +yy232: + YYDEBUG(232, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 489 "Zend/zend_ini_scanner.l" +#line 510 "Zend/zend_ini_scanner.l" { /* Get everything else as option/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2910 "Zend/zend_ini_scanner.c" -yy231: - YYDEBUG(231, *YYCURSOR); +#line 2948 "Zend/zend_ini_scanner.c" +yy233: + YYDEBUG(233, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - goto yy307; -yy232: - YYDEBUG(232, *YYCURSOR); + goto yy309; +yy234: + YYDEBUG(234, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 543 "Zend/zend_ini_scanner.l" +#line 564 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); } -#line 2923 "Zend/zend_ini_scanner.c" -yy233: - YYDEBUG(233, *YYCURSOR); +#line 2961 "Zend/zend_ini_scanner.c" +yy235: + YYDEBUG(235, *YYCURSOR); ++YYCURSOR; -yy234: - YYDEBUG(234, *YYCURSOR); +yy236: + YYDEBUG(236, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 461 "Zend/zend_ini_scanner.l" +#line 482 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 2936 "Zend/zend_ini_scanner.c" -yy235: - YYDEBUG(235, *YYCURSOR); +#line 2974 "Zend/zend_ini_scanner.c" +yy237: + YYDEBUG(237, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy305; - goto yy234; -yy236: - YYDEBUG(236, *YYCURSOR); + if (yych == '\n') goto yy307; + goto yy236; +yy238: + YYDEBUG(238, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy304; -yy237: - YYDEBUG(237, *YYCURSOR); + goto yy306; +yy239: + YYDEBUG(239, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 479 "Zend/zend_ini_scanner.l" +#line 500 "Zend/zend_ini_scanner.l" { /* Boolean operators */ return yytext[0]; } -#line 2954 "Zend/zend_ini_scanner.c" -yy238: - YYDEBUG(238, *YYCURSOR); +#line 2992 "Zend/zend_ini_scanner.c" +yy240: + YYDEBUG(240, *YYCURSOR); ++YYCURSOR; -yy239: - YYDEBUG(239, *YYCURSOR); +yy241: + YYDEBUG(241, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 2966 "Zend/zend_ini_scanner.c" -yy240: - YYDEBUG(240, *YYCURSOR); +#line 3004 "Zend/zend_ini_scanner.c" +yy242: + YYDEBUG(242, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy228; - if (yych <= '[') goto yy256; - goto yy263; + if (yych <= 0x00) goto yy230; + if (yych <= '[') goto yy258; + goto yy265; } else { - if (yych == '{') goto yy301; - goto yy256; + if (yych == '{') goto yy303; + goto yy258; } -yy241: - YYDEBUG(241, *YYCURSOR); +yy243: + YYDEBUG(243, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy297; + goto yy299; } - goto yy228; -yy242: - YYDEBUG(242, *YYCURSOR); + goto yy230; +yy244: + YYDEBUG(244, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy295; - goto yy257; -yy243: - YYDEBUG(243, *YYCURSOR); + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy297; + goto yy259; +yy245: + YYDEBUG(245, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy293; - goto yy257; -yy244: - YYDEBUG(244, *YYCURSOR); + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy295; + goto yy259; +yy246: + YYDEBUG(246, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy257; + if (yych >= 0x01) goto yy259; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy257; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy259; } } else { if (yych <= '%') { - if (yych <= 0x1F) goto yy257; - if (yych >= '#') goto yy257; + if (yych <= 0x1F) goto yy259; + if (yych >= '#') goto yy259; } else { - if (yych <= ')') goto yy245; - if (yych <= '-') goto yy257; - goto yy289; + if (yych <= ')') goto yy247; + if (yych <= '-') goto yy259; + goto yy291; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy257; - goto yy291; + if (yych <= '/') goto yy259; + goto yy293; } else { - if (yych != ';') goto yy257; + if (yych != ';') goto yy259; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy257; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy245: - YYDEBUG(245, *YYCURSOR); +yy247: + YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 3046 "Zend/zend_ini_scanner.c" -yy246: - YYDEBUG(246, *YYCURSOR); +#line 3084 "Zend/zend_ini_scanner.c" +yy248: + YYDEBUG(248, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - goto yy285; -yy247: - YYDEBUG(247, *YYCURSOR); + goto yy287; +yy249: + YYDEBUG(249, *YYCURSOR); ++YYCURSOR; - YYDEBUG(248, *YYCURSOR); + YYDEBUG(250, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 483 "Zend/zend_ini_scanner.l" +#line 504 "Zend/zend_ini_scanner.l" { /* Make = used in option value to trigger error */ yyless(0); BEGIN(INITIAL); return END_OF_LINE; } -#line 3063 "Zend/zend_ini_scanner.c" -yy249: - YYDEBUG(249, *YYCURSOR); +#line 3101 "Zend/zend_ini_scanner.c" +yy251: + YYDEBUG(251, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= ')') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych >= '\v') goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych >= '\v') goto yy259; } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy257; + if (yych >= 0x0E) goto yy259; } else { - if (yych <= '"') goto yy250; - if (yych <= '%') goto yy257; + if (yych <= '"') goto yy252; + if (yych <= '%') goto yy259; } } } else { if (yych <= '=') { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy250: - YYDEBUG(250, *YYCURSOR); +yy252: + YYDEBUG(252, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 3103 "Zend/zend_ini_scanner.c" -yy251: - YYDEBUG(251, *YYCURSOR); +#line 3141 "Zend/zend_ini_scanner.c" +yy253: + YYDEBUG(253, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '/') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - goto yy257; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + goto yy259; } else { - if (yych <= '9') goto yy258; - if (yych == ';') goto yy250; - goto yy257; + if (yych <= '9') goto yy260; + if (yych == ';') goto yy252; + goto yy259; } } } else { if (yych <= '`') { if (yych <= 'A') { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy281; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy283; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych <= 'a') goto yy281; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych <= 'a') goto yy283; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy252: - YYDEBUG(252, *YYCURSOR); +yy254: + YYDEBUG(254, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych <= '\n') goto yy250; - goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych <= '\n') goto yy252; + goto yy259; } else { - if (yych <= '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - if (yych <= '"') goto yy250; - goto yy257; + if (yych <= '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + if (yych <= '"') goto yy252; + goto yy259; } } else { if (yych <= ':') { - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - goto yy257; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + goto yy259; } else { if (yych <= '<') { - if (yych <= ';') goto yy250; - goto yy257; + if (yych <= ';') goto yy252; + goto yy259; } else { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy258; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy260; } } } } else { if (yych <= 'n') { if (yych <= 'Z') { - if (yych <= 'O') goto yy277; - if (yych == 'U') goto yy278; - goto yy258; + if (yych <= 'O') goto yy279; + if (yych == 'U') goto yy280; + goto yy260; } else { - if (yych == '_') goto yy258; - if (yych <= '`') goto yy257; - goto yy258; + if (yych == '_') goto yy260; + if (yych <= '`') goto yy259; + goto yy260; } } else { if (yych <= 'z') { - if (yych <= 'o') goto yy277; - if (yych == 'u') goto yy278; - goto yy258; + if (yych <= 'o') goto yy279; + if (yych == 'u') goto yy280; + goto yy260; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; - goto yy250; + if (yych <= '{') goto yy259; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy257; + if (yych == '~') goto yy252; + goto yy259; } } } } -yy253: - YYDEBUG(253, *YYCURSOR); +yy255: + YYDEBUG(255, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych <= '\n') goto yy250; - goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych <= '\n') goto yy252; + goto yy259; } else { - if (yych <= '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - if (yych <= '"') goto yy250; - goto yy257; + if (yych <= '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + if (yych <= '"') goto yy252; + goto yy259; } } else { if (yych <= ':') { - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - goto yy257; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + goto yy259; } else { if (yych <= '<') { - if (yych <= ';') goto yy250; - goto yy257; + if (yych <= ';') goto yy252; + goto yy259; } else { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy258; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy260; } } } } else { if (yych <= 'e') { if (yych <= 'Z') { - if (yych <= 'F') goto yy272; - if (yych == 'N') goto yy266; - goto yy258; + if (yych <= 'F') goto yy274; + if (yych == 'N') goto yy268; + goto yy260; } else { - if (yych == '_') goto yy258; - if (yych <= '`') goto yy257; - goto yy258; + if (yych == '_') goto yy260; + if (yych <= '`') goto yy259; + goto yy260; } } else { if (yych <= 'z') { - if (yych <= 'f') goto yy272; - if (yych == 'n') goto yy266; - goto yy258; + if (yych <= 'f') goto yy274; + if (yych == 'n') goto yy268; + goto yy260; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; - goto yy250; + if (yych <= '{') goto yy259; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy257; + if (yych == '~') goto yy252; + goto yy259; } } } } -yy254: - YYDEBUG(254, *YYCURSOR); +yy256: + YYDEBUG(256, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'R') { - if (yych <= '@') goto yy257; - if (yych <= 'Q') goto yy258; - goto yy270; + if (yych <= '@') goto yy259; + if (yych <= 'Q') goto yy260; + goto yy272; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'r') goto yy270; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'r') goto yy272; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy255: - YYDEBUG(255, *YYCURSOR); +yy257: + YYDEBUG(257, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy260; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy262; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy260; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'e') goto yy262; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy256: - YYDEBUG(256, *YYCURSOR); +yy258: + YYDEBUG(258, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy257: - YYDEBUG(257, *YYCURSOR); +yy259: + YYDEBUG(259, *YYCURSOR); if (yybm[0+yych] & 2) { - goto yy256; + goto yy258; } - if (yych == '$') goto yy261; - goto yy230; -yy258: - YYDEBUG(258, *YYCURSOR); + if (yych == '$') goto yy263; + goto yy232; +yy260: + YYDEBUG(260, *YYCURSOR); yyaccept = 4; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(259, *YYCURSOR); + YYDEBUG(261, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy250; - goto yy256; + if (yych <= 0x00) goto yy252; + goto yy258; } else { - if (yych <= '\n') goto yy250; - if (yych <= '\f') goto yy256; - goto yy250; + if (yych <= '\n') goto yy252; + if (yych <= '\f') goto yy258; + goto yy252; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy256; - goto yy250; + if (yych <= 0x1F) goto yy258; + goto yy252; } else { - if (yych == '$') goto yy261; - goto yy256; + if (yych == '$') goto yy263; + goto yy258; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy250; - goto yy256; + if (yych <= ')') goto yy252; + goto yy258; } else { - if (yych == '<') goto yy256; - goto yy250; + if (yych == '<') goto yy258; + goto yy252; } } else { if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy250; + if (yych <= '{') goto yy258; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy256; + if (yych == '~') goto yy252; + goto yy258; } } } -yy260: - YYDEBUG(260, *YYCURSOR); +yy262: + YYDEBUG(262, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy257; - if (yych <= 'R') goto yy258; - goto yy266; + if (yych <= '@') goto yy259; + if (yych <= 'R') goto yy260; + goto yy268; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 's') goto yy266; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 's') goto yy268; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy261: - YYDEBUG(261, *YYCURSOR); +yy263: + YYDEBUG(263, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy262; - if (yych <= '[') goto yy256; - goto yy263; + if (yych <= 0x00) goto yy264; + if (yych <= '[') goto yy258; + goto yy265; } else { - if (yych != '{') goto yy256; + if (yych != '{') goto yy258; } -yy262: - YYDEBUG(262, *YYCURSOR); +yy264: + YYDEBUG(264, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy230; - } else { goto yy232; + } else { + goto yy234; } } else { if (yyaccept <= 2) { - goto yy228; + goto yy230; } else { - goto yy245; + goto yy247; } } } else { if (yyaccept <= 5) { if (yyaccept <= 4) { - goto yy250; + goto yy252; } else { - goto yy267; + goto yy269; } } else { - goto yy274; + goto yy276; } } -yy263: - YYDEBUG(263, *YYCURSOR); +yy265: + YYDEBUG(265, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy264; + goto yy266; } - goto yy256; -yy264: - YYDEBUG(264, *YYCURSOR); + goto yy258; +yy266: + YYDEBUG(266, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(265, *YYCURSOR); + YYDEBUG(267, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy264; + goto yy266; } - if (yych <= 0x00) goto yy230; - if (yych == '\\') goto yy263; - goto yy256; -yy266: - YYDEBUG(266, *YYCURSOR); + if (yych <= 0x00) goto yy232; + if (yych == '\\') goto yy265; + goto yy258; +yy268: + YYDEBUG(268, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { - goto yy268; + goto yy270; } if (yych <= ';') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy267; - if (yych <= '\t') goto yy257; + if (yych <= 0x00) goto yy269; + if (yych <= '\t') goto yy259; } else { - if (yych != '\r') goto yy257; + if (yych != '\r') goto yy259; } } else { if (yych <= ')') { - if (yych <= '"') goto yy267; - if (yych <= '%') goto yy257; + if (yych <= '"') goto yy269; + if (yych <= '%') goto yy259; } else { - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - if (yych <= ':') goto yy257; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + if (yych <= ':') goto yy259; } } } else { if (yych <= '_') { if (yych <= '@') { - if (yych != '=') goto yy257; + if (yych != '=') goto yy259; } else { - if (yych <= 'Z') goto yy258; - if (yych <= '^') goto yy257; - goto yy258; + if (yych <= 'Z') goto yy260; + if (yych <= '^') goto yy259; + goto yy260; } } else { if (yych <= '{') { - if (yych <= '`') goto yy257; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych <= '`') goto yy259; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych >= 0x7F) goto yy257; + if (yych == '}') goto yy259; + if (yych >= 0x7F) goto yy259; } } } -yy267: - YYDEBUG(267, *YYCURSOR); +yy269: + YYDEBUG(269, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 421 "Zend/zend_ini_scanner.l" { /* TRUE value (when used outside option value/offset this causes parse error!) */ RETURN_TOKEN(BOOL_TRUE, "1", 1); } -#line 3599 "Zend/zend_ini_scanner.c" -yy268: - YYDEBUG(268, *YYCURSOR); +#line 3637 "Zend/zend_ini_scanner.c" +yy270: + YYDEBUG(270, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(269, *YYCURSOR); + YYDEBUG(271, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy268; + goto yy270; } - goto yy267; -yy270: - YYDEBUG(270, *YYCURSOR); + goto yy269; +yy272: + YYDEBUG(272, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'U') { - if (yych <= '@') goto yy257; - if (yych <= 'T') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'T') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'u') goto yy271; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'u') goto yy273; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy271: - YYDEBUG(271, *YYCURSOR); +yy273: + YYDEBUG(273, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy266; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy268; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy266; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'e') goto yy268; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy272: - YYDEBUG(272, *YYCURSOR); +yy274: + YYDEBUG(274, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'F') { - if (yych <= '@') goto yy257; - if (yych <= 'E') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'E') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'f') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'f') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy273: - YYDEBUG(273, *YYCURSOR); +yy275: + YYDEBUG(275, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= '%') { if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy257; + if (yych >= 0x01) goto yy259; } else { - if (yych <= '\t') goto yy275; - if (yych >= '\v') goto yy257; + if (yych <= '\t') goto yy277; + if (yych >= '\v') goto yy259; } } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy257; + if (yych >= 0x0E) goto yy259; } else { - if (yych <= ' ') goto yy275; - if (yych >= '#') goto yy257; + if (yych <= ' ') goto yy277; + if (yych >= '#') goto yy259; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych >= '*') goto yy257; + if (yych >= '*') goto yy259; } else { - if (yych == '<') goto yy257; + if (yych == '<') goto yy259; } } else { if (yych <= '|') { - if (yych <= '{') goto yy257; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy276: + YYDEBUG(276, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 425 "Zend/zend_ini_scanner.l" { /* FALSE value (when used outside option value/offset this causes parse error!)*/ RETURN_TOKEN(BOOL_FALSE, "", 0); } -#line 3803 "Zend/zend_ini_scanner.c" -yy275: - YYDEBUG(275, *YYCURSOR); +#line 3841 "Zend/zend_ini_scanner.c" +yy277: + YYDEBUG(277, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(276, *YYCURSOR); - if (yych == '\t') goto yy275; - if (yych == ' ') goto yy275; - goto yy274; -yy277: - YYDEBUG(277, *YYCURSOR); + YYDEBUG(278, *YYCURSOR); + if (yych == '\t') goto yy277; + if (yych == ' ') goto yy277; + goto yy276; +yy279: + YYDEBUG(279, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy274; - if (yych <= 0x08) goto yy257; - if (yych <= '\t') goto yy275; - goto yy274; + if (yych <= 0x00) goto yy276; + if (yych <= 0x08) goto yy259; + if (yych <= '\t') goto yy277; + goto yy276; } else { - if (yych == '\r') goto yy274; - if (yych <= 0x1F) goto yy257; - goto yy275; + if (yych == '\r') goto yy276; + if (yych <= 0x1F) goto yy259; + goto yy277; } } else { if (yych <= '/') { - if (yych <= '"') goto yy274; - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy274; - goto yy257; + if (yych <= '"') goto yy276; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy276; + goto yy259; } else { - if (yych <= '9') goto yy258; - if (yych == ';') goto yy274; - goto yy257; + if (yych <= '9') goto yy260; + if (yych == ';') goto yy276; + goto yy259; } } } else { if (yych <= '`') { if (yych <= 'N') { - if (yych <= '=') goto yy274; - if (yych <= '@') goto yy257; - if (yych <= 'M') goto yy258; - goto yy280; + if (yych <= '=') goto yy276; + if (yych <= '@') goto yy259; + if (yych <= 'M') goto yy260; + goto yy282; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'n') goto yy280; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'n') goto yy282; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy274; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy276; + goto yy259; } } } -yy278: - YYDEBUG(278, *YYCURSOR); +yy280: + YYDEBUG(280, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy279; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'l') goto yy281; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy279: - YYDEBUG(279, *YYCURSOR); +yy281: + YYDEBUG(281, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; - goto yy273; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; + goto yy275; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'l') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy280: - YYDEBUG(280, *YYCURSOR); +yy282: + YYDEBUG(282, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy273; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy275; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'e') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy281: - YYDEBUG(281, *YYCURSOR); +yy283: + YYDEBUG(283, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy282; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'l') goto yy284; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy282: - YYDEBUG(282, *YYCURSOR); +yy284: + YYDEBUG(284, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy257; - if (yych <= 'R') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'R') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 's') goto yy283; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 's') goto yy285; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy283: - YYDEBUG(283, *YYCURSOR); +yy285: + YYDEBUG(285, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy273; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy275; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych == 'e') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy284: - YYDEBUG(284, *YYCURSOR); +yy286: + YYDEBUG(286, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy285: - YYDEBUG(285, *YYCURSOR); +yy287: + YYDEBUG(287, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy284; + goto yy286; } - if (yych >= '\r') goto yy288; -yy286: - YYDEBUG(286, *YYCURSOR); + if (yych >= '\r') goto yy290; +yy288: + YYDEBUG(288, *YYCURSOR); ++YYCURSOR; -yy287: - YYDEBUG(287, *YYCURSOR); +yy289: + YYDEBUG(289, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 4185 "Zend/zend_ini_scanner.c" -yy288: - YYDEBUG(288, *YYCURSOR); +#line 4223 "Zend/zend_ini_scanner.c" +yy290: + YYDEBUG(290, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy286; - goto yy287; -yy289: - YYDEBUG(289, *YYCURSOR); + if (yych == '\n') goto yy288; + goto yy289; +yy291: + YYDEBUG(291, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(290, *YYCURSOR); + YYDEBUG(292, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy289; + goto yy291; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy256; - goto yy245; + if (yych <= 0x1F) goto yy258; + goto yy247; } else { - if (yych == '$') goto yy261; - goto yy256; + if (yych == '$') goto yy263; + goto yy258; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy245; - goto yy256; + if (yych <= ')') goto yy247; + goto yy258; } else { - if (yych == '<') goto yy256; - goto yy245; + if (yych == '<') goto yy258; + goto yy247; } } else { if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy291: - YYDEBUG(291, *YYCURSOR); +yy293: + YYDEBUG(293, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(292, *YYCURSOR); + YYDEBUG(294, *YYCURSOR); if (yych <= '-') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy256; - goto yy245; + if (yych <= 0x00) goto yy247; + if (yych <= 0x08) goto yy258; + goto yy247; } else { - if (yych == '\r') goto yy245; - goto yy256; + if (yych == '\r') goto yy247; + goto yy258; } } else { if (yych <= '$') { - if (yych <= '"') goto yy245; - if (yych <= '#') goto yy256; - goto yy261; + if (yych <= '"') goto yy247; + if (yych <= '#') goto yy258; + goto yy263; } else { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy245; - goto yy256; + if (yych <= '%') goto yy258; + if (yych <= ')') goto yy247; + goto yy258; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '.') goto yy289; - if (yych <= '/') goto yy256; - goto yy291; + if (yych <= '.') goto yy291; + if (yych <= '/') goto yy258; + goto yy293; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy293: - YYDEBUG(293, *YYCURSOR); +yy295: + YYDEBUG(295, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(294, *YYCURSOR); + YYDEBUG(296, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy245; - goto yy256; + if (yych <= 0x1F) goto yy258; + if (yych <= '"') goto yy247; + goto yy258; } else { - if (yych <= '$') goto yy261; - if (yych <= '%') goto yy256; - goto yy245; + if (yych <= '$') goto yy263; + if (yych <= '%') goto yy258; + goto yy247; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy256; - goto yy293; + if (yych <= '/') goto yy258; + goto yy295; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy295: - YYDEBUG(295, *YYCURSOR); +yy297: + YYDEBUG(297, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(296, *YYCURSOR); + YYDEBUG(298, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy245; - goto yy256; + if (yych <= 0x1F) goto yy258; + if (yych <= '"') goto yy247; + goto yy258; } else { - if (yych <= '$') goto yy261; - if (yych <= '%') goto yy256; - goto yy245; + if (yych <= '$') goto yy263; + if (yych <= '%') goto yy258; + goto yy247; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy256; - goto yy295; + if (yych <= '/') goto yy258; + goto yy297; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy297: - YYDEBUG(297, *YYCURSOR); +yy299: + YYDEBUG(299, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(298, *YYCURSOR); + YYDEBUG(300, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy297; + goto yy299; } - YYDEBUG(299, *YYCURSOR); + YYDEBUG(301, *YYCURSOR); ++YYCURSOR; - YYDEBUG(300, *YYCURSOR); + YYDEBUG(302, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -4402,66 +4440,66 @@ yy297: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 4406 "Zend/zend_ini_scanner.c" -yy301: - YYDEBUG(301, *YYCURSOR); +#line 4444 "Zend/zend_ini_scanner.c" +yy303: + YYDEBUG(303, *YYCURSOR); ++YYCURSOR; - YYDEBUG(302, *YYCURSOR); + YYDEBUG(304, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 401 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } -#line 4417 "Zend/zend_ini_scanner.c" -yy303: - YYDEBUG(303, *YYCURSOR); +#line 4455 "Zend/zend_ini_scanner.c" +yy305: + YYDEBUG(305, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy304: - YYDEBUG(304, *YYCURSOR); - if (yych == '\t') goto yy303; - if (yych == ' ') goto yy303; - goto yy237; -yy305: - YYDEBUG(305, *YYCURSOR); - yych = *++YYCURSOR; - goto yy234; yy306: YYDEBUG(306, *YYCURSOR); + if (yych == '\t') goto yy305; + if (yych == ' ') goto yy305; + goto yy239; +yy307: + YYDEBUG(307, *YYCURSOR); + yych = *++YYCURSOR; + goto yy236; +yy308: + YYDEBUG(308, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy307: - YYDEBUG(307, *YYCURSOR); +yy309: + YYDEBUG(309, *YYCURSOR); if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy232; - if (yych <= '\t') goto yy306; - goto yy305; + if (yych <= 0x08) goto yy234; + if (yych <= '\t') goto yy308; + goto yy307; } else { - if (yych == '\r') goto yy309; - goto yy232; + if (yych == '\r') goto yy311; + goto yy234; } } else { if (yych <= '"') { - if (yych <= ' ') goto yy306; - if (yych <= '!') goto yy232; + if (yych <= ' ') goto yy308; + if (yych <= '!') goto yy234; } else { - if (yych == ';') goto yy284; - goto yy232; + if (yych == ';') goto yy286; + goto yy234; } } - YYDEBUG(308, *YYCURSOR); + YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; - goto yy239; -yy309: - YYDEBUG(309, *YYCURSOR); + goto yy241; +yy311: + YYDEBUG(311, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy305; - goto yy234; + if ((yych = *YYCURSOR) == '\n') goto yy307; + goto yy236; } /* *********************************** */ yyc_ST_VARNAME: @@ -4500,47 +4538,47 @@ yyc_ST_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(310, *YYCURSOR); + YYDEBUG(312, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '\'') { if (yych <= ' ') { if (yych <= '\n') { - if (yych >= '\t') goto yy314; + if (yych >= '\t') goto yy316; } else { - if (yych == '\r') goto yy314; + if (yych == '\r') goto yy316; } } else { if (yych <= '$') { - if (yych != '#') goto yy314; + if (yych != '#') goto yy316; } else { - if (yych == '&') goto yy314; + if (yych == '&') goto yy316; } } } else { if (yych <= 'Z') { if (yych <= ';') { - if (yych <= ')') goto yy314; - if (yych >= ';') goto yy314; + if (yych <= ')') goto yy316; + if (yych >= ';') goto yy316; } else { - if (yych == '=') goto yy314; + if (yych == '=') goto yy316; } } else { if (yych <= '|') { - if (yych <= '[') goto yy314; - if (yych >= '{') goto yy314; + if (yych <= '[') goto yy316; + if (yych >= '{') goto yy316; } else { - if (yych <= '}') goto yy316; - if (yych <= '~') goto yy314; + if (yych <= '}') goto yy318; + if (yych <= '~') goto yy316; } } } - YYDEBUG(312, *YYCURSOR); + YYDEBUG(314, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy319; -yy313: - YYDEBUG(313, *YYCURSOR); + goto yy321; +yy315: + YYDEBUG(315, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 406 "Zend/zend_ini_scanner.l" { /* Variable name */ @@ -4552,41 +4590,41 @@ yy313: RETURN_TOKEN(TC_VARNAME, yytext, yyleng); } -#line 4556 "Zend/zend_ini_scanner.c" -yy314: - YYDEBUG(314, *YYCURSOR); +#line 4594 "Zend/zend_ini_scanner.c" +yy316: + YYDEBUG(316, *YYCURSOR); ++YYCURSOR; - YYDEBUG(315, *YYCURSOR); + YYDEBUG(317, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 4566 "Zend/zend_ini_scanner.c" -yy316: - YYDEBUG(316, *YYCURSOR); +#line 4604 "Zend/zend_ini_scanner.c" +yy318: + YYDEBUG(318, *YYCURSOR); ++YYCURSOR; - YYDEBUG(317, *YYCURSOR); + YYDEBUG(319, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 416 "Zend/zend_ini_scanner.l" { /* Variable end */ yy_pop_state(TSRMLS_C); return '}'; } -#line 4577 "Zend/zend_ini_scanner.c" -yy318: - YYDEBUG(318, *YYCURSOR); +#line 4615 "Zend/zend_ini_scanner.c" +yy320: + YYDEBUG(320, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy319: - YYDEBUG(319, *YYCURSOR); +yy321: + YYDEBUG(321, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy318; + goto yy320; } - goto yy313; + goto yy315; } } -#line 579 "Zend/zend_ini_scanner.l" +#line 600 "Zend/zend_ini_scanner.l" } diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 0c452e659b..8aeb076eab 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -347,7 +347,7 @@ DOLLAR_CURLY "${" SECTION_RAW_CHARS [^\]\n\r] SINGLE_QUOTED_CHARS [^'] -RAW_VALUE_CHARS [^\n\r;\000] +RAW_VALUE_CHARS [^"\n\r;\000] LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR}))) VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR}) @@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR}) return '='; } -<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - /* Eat leading and trailing double quotes */ - if (yytext[0] == '"' && yytext[yyleng - 1] == '"') { - SCNG(yy_text)++; - yyleng = yyleng - 2; +<ST_RAW>["] { + while (YYCURSOR < YYLIMIT) { + switch (*YYCURSOR++) { + case '\n': + SCNG(lineno)++; + break; + case '\r': + if (*YYCURSOR != '\n') { + SCNG(lineno)++; + } + break; + case '"': + yyleng = YYCURSOR - SCNG(yy_text) - 2; + SCNG(yy_text)++; + RETURN_TOKEN(TC_RAW, yytext, yyleng); + case '\\': + if (YYCURSOR < YYLIMIT) { + YYCURSOR++; + } + break; + } } + yyleng = YYCURSOR - SCNG(yy_text); + RETURN_TOKEN(TC_RAW, yytext, yyleng); +} + +<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h index f7b9e1ffb2..0c0471373c 100644 --- a/Zend/zend_ini_scanner_defs.h +++ b/Zend/zend_ini_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */ +/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */ #line 3 "Zend/zend_ini_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index d0730b75d6..9a0b3209e5 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -1191,7 +1191,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr) if (LANG_SCNG(yy_text)[0] == 0 && LANG_SCNG(yy_leng) == 1 && - memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) { + memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) { yystpcpy(yyres, "end of file"); return sizeof("end of file")-1; } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 60095f7062..d82493aeaf 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1490,6 +1490,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty if (retval) { zval_ptr_dtor(&retval); } + EG(exception) = NULL; zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name); return FAILURE; } diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 19fd71e763..4c6a784a88 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -267,6 +267,15 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce) } } +static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC) +{ + if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { + efree(op_array->function_name); + op_array->function_name = NULL; + } + return 0; +} + ZEND_API void destroy_zend_class(zend_class_entry **pce) { zend_class_entry *ce = *pce; @@ -298,6 +307,10 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce) } zend_hash_destroy(&ce->properties_info); str_efree(ce->name); + if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + TSRMLS_FETCH(); + zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC); + } zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->constants_table); if (ce->num_interfaces > 0 && ce->interfaces) { @@ -387,7 +400,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC) } efree(op_array->opcodes); - if (op_array->function_name) { + if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { efree((char*)op_array->function_name); } if (op_array->doc_comment) { diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index dd3ee2d8cb..9b01e5fbcb 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1519,6 +1519,9 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* { ret = compare_function(result, op1, op_free TSRMLS_CC); zend_free_obj_get_result(op_free TSRMLS_CC); return ret; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_LONG(result, 1); + return SUCCESS; } } if (!converted) { @@ -1605,7 +1608,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); break; case IS_ARRAY: - Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0; + Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || + zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0); break; case IS_OBJECT: if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { @@ -2097,13 +2101,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */ { - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); + return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); } /* }}} */ ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */ { - ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC)); + ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC)); } /* }}} */ diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 27df9537af..30cc3a5ba4 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -79,7 +79,7 @@ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */ static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */ #if HAVE_MMAP if (stream->mmap.map) { - munmap(stream->mmap.map, stream->mmap.len); + munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD); } else #endif if (stream->mmap.buf) { diff --git a/Zend/zend_string.h b/Zend/zend_string.h index a61d2fb30d..0a4738466d 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -23,12 +23,14 @@ #include "zend.h" +BEGIN_EXTERN_C() ZEND_API extern const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC); ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D); ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D); void zend_interned_strings_init(TSRMLS_D); void zend_interned_strings_dtor(TSRMLS_D); +END_EXTERN_C() #ifndef ZTS diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 5a3ae49545..9d475a688c 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2412,6 +2412,10 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -3947,7 +3951,8 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - ZEND_VM_C_GOTO(num_index_dim); + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 1fb6e76cea..4abe6503cd 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1256,6 +1256,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1558,6 +1562,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1722,6 +1730,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1919,6 +1931,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -13917,7 +13933,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -15919,7 +15936,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -18131,7 +18149,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -21166,7 +21185,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -22504,7 +22524,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -23662,7 +23683,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -24820,7 +24842,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -26244,7 +26267,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -29498,7 +29522,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -31371,7 +31396,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -33453,7 +33479,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -36219,7 +36246,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 426f689795..6d1b2e70e7 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -5,8 +5,8 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) DCL_OPLINE zend_execute_data *execute_data; zend_bool nested = 0; - zend_bool original_in_execution = EG(in_execution); {%HELPER_VARS%} + {%EXECUTION_STATUS%} {%INTERNAL_LABELS%} diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 3163000e47..fde1baf90b 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -927,6 +927,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, skip_blanks($f, $m[1], $m[3]."\n"); } break; + case "EXECUTION_STATUS": + if ($kind != ZEND_VM_KIND_GOTO) { + out($f, $m[1] . "zend_bool original_in_execution = EG(in_execution);\n"); + } else { + out($f, $m[1] . "zend_bool original_in_execution = op_array? EG(in_execution) : 0;\n"); + } + break; case "INTERNAL_LABELS": if ($kind == ZEND_VM_KIND_GOTO) { // Emit array of labels of opcode handlers and code for diff --git a/configure.in b/configure.in index 1e80689922..b03f6cc8c0 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 -PHP_RELEASE_VERSION=5 +PHP_RELEASE_VERSION=8 PHP_EXTRA_VERSION="-dev" 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` diff --git a/ext/curl/interface.c b/ext/curl/interface.c index b03f346b59..d75e5c058b 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -713,6 +713,14 @@ PHP_MINIT_FUNCTION(curl) #if LIBCURL_VERSION_NUM >= 0x071202 REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL); #endif +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ + REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP); +#endif +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ + REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT); + REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP); + REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT); +#endif /* cURL protocol constants (curl_version) */ @@ -1606,9 +1614,9 @@ PHP_FUNCTION(curl_copy_handle) dupch->uses = 0; ch->uses++; if (ch->handlers->write->stream) { - Z_ADDREF_P(dupch->handlers->write->stream); - dupch->handlers->write->stream = ch->handlers->write->stream; + Z_ADDREF_P(ch->handlers->write->stream); } + dupch->handlers->write->stream = ch->handlers->write->stream; dupch->handlers->write->method = ch->handlers->write->method; dupch->handlers->write->type = ch->handlers->write->type; if (ch->handlers->read->stream) { @@ -2177,7 +2185,7 @@ string_copy: convert_to_string_ex(zvalue); - if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { + if (Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { RETVAL_FALSE; return 1; } @@ -2447,6 +2455,8 @@ PHP_FUNCTION(curl_getinfo) create_certinfo(ci, listcode TSRMLS_CC); CAAZ("certinfo", listcode); } +#endif +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) { CAAS("primary_ip", s_code); } @@ -2473,10 +2483,10 @@ PHP_FUNCTION(curl_getinfo) } else { switch (option) { /* string variable types */ -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ case CURLINFO_PRIMARY_IP: #endif -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ case CURLINFO_LOCAL_IP: #endif case CURLINFO_PRIVATE: @@ -2496,7 +2506,7 @@ PHP_FUNCTION(curl_getinfo) break; } /* Long variable types */ -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ case CURLINFO_PRIMARY_PORT: case CURLINFO_LOCAL_PORT: #endif diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 034aa65c28..53e97b80f8 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -191,6 +191,9 @@ PHP_FUNCTION(curl_multi_select) FD_ZERO(&exceptfds); curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); + if (maxfd == -1) { + RETURN_LONG(-1); + } RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); } /* }}} */ diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt index 23bbda7d5f..00df07d73e 100644 --- a/ext/curl/tests/bug61948.phpt +++ b/ext/curl/tests/bug61948.phpt @@ -16,7 +16,7 @@ open_basedir="/tmp" curl_close($ch); ?> --EXPECTF-- -bool(false) +bool(true) bool(true) Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d diff --git a/ext/curl/tests/bug62839.phpt b/ext/curl/tests/bug62839.phpt new file mode 100644 index 0000000000..e6988d6de1 --- /dev/null +++ b/ext/curl/tests/bug62839.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE) +--SKIPIF-- +<?php if (!extension_loaded("curl")) print "skip"; +?> +--FILE-- +<?php +$curl = curl_init(); + +$fd = tmpfile(); +curl_setopt($curl, CURLOPT_FILE, $fd); + +curl_copy_handle($curl); + +echo 'DONE!'; +?> +--EXPECTF-- +DONE! diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c index 0438f98904..064700f912 100644 --- a/ext/date/lib/astro.c +++ b/ext/date/lib/astro.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index b33e8eab72..9cb9c9cd28 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index af150fc802..451b463191 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index fbe330700b..964f10d912 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 16c45a2119..cca88580eb 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index 34de3b409c..d52c24d38f 100644 --- a/ext/date/lib/parse_iso_intervals.c +++ b/ext/date/lib/parse_iso_intervals.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 8610803e39..e52868865b 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index b8d8448c94..009a2ad4e6 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 5e65a6e4cf..43eedf780c 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 9667fa2dae..671d37fd9e 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h index 4f67b7a6cb..6662d91b1b 100644 --- a/ext/date/lib/timelib_structs.h +++ b/ext/date/lib/timelib_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index c4830bbef0..6085bb14da 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index a76fa80991..48709f42fc 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/date/php_date.c b/ext/date/php_date.c index cd48de2731..13e7b753d3 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -3430,10 +3430,19 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; + key = NULL; } obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj->initialized) { + retval = (zend_get_std_object_handlers())->read_property(object, member, type, key TSRMLS_CC); + if (member == &tmp_member) { + zval_dtor(member); + } + return retval; + } + #define GET_VALUE_FROM_STRUCT(n,m) \ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ value = obj->diff->n; \ @@ -3482,9 +3491,19 @@ void date_interval_write_property(zval *object, zval *member, zval *value, const zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; + key = NULL; } + obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj->initialized) { + (zend_get_std_object_handlers())->write_property(object, member, value, key TSRMLS_CC); + if (member == &tmp_member) { + zval_dtor(member); + } + return; + } + #define SET_VALUE_FROM_STRUCT(n,m) \ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ if (value->type != IS_LONG) { \ diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt new file mode 100644 index 0000000000..6952332014 --- /dev/null +++ b/ext/date/tests/bug62500.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #62500 (Segfault in DateInterval class when extended) +--INI-- +date.timezone=GMT +--FILE-- +<?php +class Crasher extends DateInterval { + public $foo; + public function __construct($time_spec) { + var_dump($this->foo); + $this->foo = 3; + var_dump($this->foo); + var_dump($this->{2}); + parent::__construct($time_spec); + } +} +try { + $c = new Crasher('blah'); +} catch (Exception $e) { + var_dump($e->getMessage()); +} +--EXPECTF-- +NULL +int(3) + +Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d +NULL +string(%s) "DateInterval::__construct(): Unknown or bad format (blah)" diff --git a/ext/date/tests/bug62852.phpt b/ext/date/tests/bug62852.phpt new file mode 100644 index 0000000000..26de510215 --- /dev/null +++ b/ext/date/tests/bug62852.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #62852 (Unserialize invalid DateTime causes crash) +--INI-- +date.timezone=GMT +--XFAIL-- +bug is not fixed yet +--FILE-- +<?php +$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; +$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; + +global $foo; + +class Foo extends DateTime { + function __wakeup() { + global $foo; + $foo = $this; + parent::__wakeup(); + } +} + +// Old test case +try { + unserialize( $s1 ); +} catch ( Exception $e ) {} + +// My test case +try { + unserialize( $s2 ); +} catch ( Exception $e ) {} +var_dump( $foo ); + +echo "okey"; +?> +--EXPECTF-- +okey diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index 5c26b4fd9f..cfce91e080 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h index 3530cb493c..7cdca00498 100644 --- a/ext/dba/libcdb/cdb.h +++ b/ext/dba/libcdb/cdb.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c index 600b8dd0f9..014db032eb 100644 --- a/ext/dba/libcdb/cdb_make.c +++ b/ext/dba/libcdb/cdb_make.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h index 828abe0315..062cffb05c 100644 --- a/ext/dba/libcdb/cdb_make.h +++ b/ext/dba/libcdb/cdb_make.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c index e869d512fb..b56cbf26f8 100644 --- a/ext/dba/libcdb/uint32.c +++ b/ext/dba/libcdb/uint32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h index 692590e227..68ea1c0cd8 100644 --- a/ext/dba/libcdb/uint32.h +++ b/ext/dba/libcdb/uint32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index bf851847d5..c17a295438 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index e7ce3a7640..65d099fbc7 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 35930d1028..cd53f4adf0 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index e69fd08b06..5b7e377d86 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index d61ba796ab..eee3b5f887 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_ if (buff != NULL) { xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); xmlOutputBufferFlush(buff); +#ifdef LIBXML2_NEW_BUFFER + ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1); +#else ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1); +#endif (void)xmlOutputBufferClose(buff); return SUCCESS; } diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c index f1ab2871a8..e282f30146 100644 --- a/ext/dom/domerrorhandler.c +++ b/ext/dom/domerrorhandler.c @@ -29,7 +29,7 @@ /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, error, DOMError, 0) + ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0) ZEND_END_ARG_INFO(); /* }}} */ diff --git a/ext/dom/element.c b/ext/dom/element.c index c6a1902129..02fded9f1a 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -832,7 +832,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns) } if (errorcode == 0 && is_xmlns == 0) { - attr = xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); + xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); } } else { name_valid = xmlValidateName((xmlChar *) localname, 0); @@ -844,7 +844,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns) if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { node_list_unlink(attr->children TSRMLS_CC); } - attr = xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); + xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); } } } diff --git a/ext/dom/node.c b/ext/dom/node.c index 4e58421e4a..4dbce4d790 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ RETVAL_FALSE; } else { if (mode == 0) { +#ifdef LIBXML2_NEW_BUFFER + ret = xmlOutputBufferGetSize(buf); +#else ret = buf->buffer->use; +#endif if (ret > 0) { +#ifdef LIBXML2_NEW_BUFFER + RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1); +#else RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); +#endif } else { RETVAL_EMPTY_STRING(); } diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index dd98511e9c..342854654e 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -216,7 +216,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, if (Z_TYPE(handler) == IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler)); } - /* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */ + /* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */ } else if (retval == NULL) { } else { if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { @@ -321,6 +321,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC) xmlDoc *docp = NULL; xmlXPathContextPtr ctx; int ret; + zval *tmp; ctx = (xmlXPathContextPtr) obj->ptr; @@ -329,10 +330,16 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC) } ALLOC_ZVAL(*retval); + tmp = *retval; + if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) { + FREE_ZVAL(tmp); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); return FAILURE; } + if (tmp != *retval) { + FREE_ZVAL(tmp); + } return SUCCESS; } /* }}} */ diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 2d784ebbef..357f3cb034 100755 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -730,6 +730,7 @@ PHP_FUNCTION(enchant_dict_quick_check) if (sugg) { zval_dtor(sugg); + array_init(sugg); } PHP_ENCHANT_GET_DICT; @@ -743,8 +744,6 @@ PHP_FUNCTION(enchant_dict_quick_check) RETURN_FALSE; } - array_init(sugg); - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st); memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg)); if (suggs && n_sugg) { diff --git a/ext/exif/exif.c b/ext/exif/exif.c index b490ded55e..9db6674742 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); + l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1); exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); } } @@ -3404,6 +3404,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC) case M_SOF13: case M_SOF14: case M_SOF15: + if ((itemlen - 2) < 6) { + return FALSE; + } + exif_process_SOFn(Data, marker, &sof_info); ImageInfo->Width = sof_info.width; ImageInfo->Height = sof_info.height; diff --git a/ext/exif/tests/bug60150.phpt b/ext/exif/tests/bug60150.phpt index 63cf0a9daf..be01998fd8 100755 --- a/ext/exif/tests/bug60150.phpt +++ b/ext/exif/tests/bug60150.phpt @@ -12,7 +12,7 @@ var_dump(exif_read_data($infile)); ?> ===DONE=== --EXPECTF-- -Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(x%x + x%x = x%x > x%x) in %s on line %d +Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(%s) in %s on line %d Warning: exif_read_data(bug60150.jpg): Error reading from file: got=x%x(=%d) != itemlen-%d=x%x(=%d) in %s on line %d diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 757ba04ac1..e5e52f0995 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -270,7 +270,7 @@ ZEND_GET_MODULE(fileinfo) PHP_MINFO_FUNCTION(fileinfo) { php_info_print_table_start(); - php_info_print_table_header(2, "fileinfo support", "enabled"); + php_info_print_table_row(2, "fileinfo support", "enabled"); php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION); php_info_print_table_end(); } diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 48a02360b0..15f6a6dadd 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ -diff -u libmagic.orig/apprentice.c libmagic/apprentice.c ---- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200 +diff -u libmagic.origin/apprentice.c libmagic/apprentice.c +--- libmagic.origin/apprentice.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/apprentice.c 2012-09-11 11:36:51.000000000 +0800 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -271,7 +271,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + size_t lineno = 0; + + php_stream *stream; -+ + +- FILE *f = fopen(ms->file = fn, "r"); +- if (f == NULL) { + TSRMLS_FETCH(); + +#if PHP_API_VERSION < 20100412 @@ -279,9 +281,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c +#else + stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); +#endif - -- FILE *f = fopen(ms->file = fn, "r"); -- if (f == NULL) { ++ + if (stream == NULL) { if (errno != ENOENT) file_error(ms, errno, "cannot read magic file `%s'", @@ -312,14 +312,18 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } /* -@@ -757,20 +756,16 @@ - int errs = 0; +@@ -754,23 +753,19 @@ + apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, + const char *fn, int action) + { +- int errs = 0; ++ int errs = 0; struct magic_entry *marray; uint32_t marraycount, i, mentrycount = 0, starttest; - size_t slen, files = 0, maxfiles = 0; - char **filearr = NULL, *mfn; + size_t files = 0, maxfiles = 0; -+ char **filearr = NULL, mfn[MAXPATHLEN]; ++ char **filearr = NULL; struct stat st; DIR *dir; struct dirent *d; @@ -337,7 +341,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c marraycount = 0; /* print silly verbose header for USG compat. */ -@@ -778,14 +773,16 @@ +@@ -778,14 +773,18 @@ (void)fprintf(stderr, "%s\n", usg_hdr); /* load directory or file */ @@ -345,6 +349,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + /* FIXME: Read file names and sort them to prevent + non-determinism. See Debian bug #488562. */ + if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { ++ int mflen; ++ char mfn[MAXPATHLEN]; dir = opendir(fn); if (!dir) { errs++; @@ -352,11 +358,11 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } while ((d = readdir(dir)) != NULL) { - if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) { -+ if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) { ++ if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name)) < 0) { file_oomem(ms, strlen(fn) + strlen(d->d_name) + 2); errs++; -@@ -793,7 +790,6 @@ +@@ -793,7 +792,6 @@ goto out; } if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { @@ -364,7 +370,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c continue; } if (files >= maxfiles) { -@@ -803,7 +799,6 @@ +@@ -803,20 +801,19 @@ if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); @@ -372,7 +378,22 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c closedir(dir); errs++; goto out; -@@ -882,12 +877,7 @@ + } + } +- filearr[files++] = mfn; ++ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen); + } + closedir(dir); + qsort(filearr, files, sizeof(*filearr), cmpstrp); + for (i = 0; i < files; i++) { + load_1(ms, action, filearr[i], &errs, &marray, + &marraycount); +- free(filearr[i]); ++ efree(filearr[i]); + } + free(filearr); + } else +@@ -882,12 +879,7 @@ for (i = 0; i < marraycount; i++) mentrycount += marray[i].cont_count; @@ -386,18 +407,31 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c mentrycount = 0; for (i = 0; i < marraycount; i++) { -@@ -897,8 +887,8 @@ +@@ -896,9 +888,14 @@ + mentrycount += marray[i].cont_count; } out: - for (i = 0; i < marraycount; i++) +- for (i = 0; i < marraycount; i++) - free(marray[i].mp); - free(marray); -+ efree(marray[i].mp); -+ efree(marray); ++ for (i = 0; i < marraycount; i++) { ++ if (marray[i].mp) { ++ efree(marray[i].mp); ++ } ++ } ++ if (marray) { ++ efree(marray); ++ } if (errs) { *magicp = NULL; *nmagicp = 0; -@@ -1178,11 +1168,7 @@ +@@ -1175,14 +1172,13 @@ + return -1; + } + me = &(*mentryp)[*nmentryp - 1]; ++ if (me->mp == NULL) { ++ return -1; ++ } if (me->cont_count == me->max_count) { struct magic *nm; size_t cnt = me->max_count + ALLOC_CHUNK; @@ -410,7 +444,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c me->mp = m = nm; me->max_count = CAST(uint32_t, cnt); } -@@ -1194,23 +1180,13 @@ +@@ -1194,23 +1190,13 @@ struct magic_entry *mp; maxmagic += ALLOC_INCR; @@ -437,7 +471,18 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c me->mp = m; me->max_count = ALLOC_CHUNK; } else -@@ -1361,7 +1337,7 @@ +@@ -1353,6 +1339,10 @@ + if (m->type == FILE_INVALID) { + if (ms->flags & MAGIC_CHECK) + file_magwarn(ms, "type `%s' invalid", l); ++ if (me->mp) { ++ efree(me->mp); ++ me->mp = NULL; ++ } + return -1; + } + +@@ -1361,7 +1351,7 @@ m->mask_op = 0; if (*l == '~') { @@ -446,7 +491,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c m->mask_op |= FILE_OPINVERSE; else if (ms->flags & MAGIC_CHECK) file_magwarn(ms, "'~' invalid for string types"); -@@ -1370,7 +1346,7 @@ +@@ -1370,7 +1360,7 @@ m->str_range = 0; m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0; if ((op = get_op(*l)) != -1) { @@ -455,7 +500,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c uint64_t val; ++l; m->mask_op |= op; -@@ -1558,11 +1534,6 @@ +@@ -1558,11 +1548,6 @@ if (check_format(ms, m) == -1) return -1; } @@ -467,7 +512,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c m->mimetype[0] = '\0'; /* initialise MIME type to none */ if (m->cont_level == 0) ++(*nmentryp); /* make room for next */ -@@ -2195,56 +2166,68 @@ +@@ -2195,56 +2180,69 @@ /* * handle a compiled file. @@ -542,6 +587,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + mm = emalloc((size_t)st.sb.st_size); + if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { file_badread(ms); ++ ret = 1; goto error1; } -#define RET 1 @@ -559,7 +605,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c ptr = (uint32_t *)(void *)*magicp; if (*ptr != MAGICNO) { if (swap4(*ptr) != MAGICNO) { -@@ -2259,35 +2242,55 @@ +@@ -2259,35 +2257,55 @@ else version = ptr[1]; if (version != VERSIONNO) { @@ -631,7 +677,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return -1; } -@@ -2301,42 +2304,49 @@ +@@ -2301,42 +2319,49 @@ apprentice_compile(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, const char *fn) { @@ -639,10 +685,10 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c char *dbname; int rv = -1; + php_stream *stream; ++ ++ TSRMLS_FETCH(); - dbname = mkdbname(ms, fn, 1); -+ TSRMLS_FETCH(); -+ + dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -692,7 +738,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return rv; } -@@ -2349,6 +2359,7 @@ +@@ -2349,6 +2374,7 @@ { const char *p, *q; char *buf; @@ -700,7 +746,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c if (strip) { if ((p = strrchr(fn, '/')) != NULL) -@@ -2370,14 +2381,14 @@ +@@ -2370,14 +2396,14 @@ q++; /* Compatibility with old code that looked in .mime */ if (ms->flags & MAGIC_MIME) { @@ -719,7 +765,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c /* Compatibility with old code that looked in .mime */ if (strstr(p, ".mime") != NULL) -@@ -2467,7 +2478,7 @@ +@@ -2467,7 +2493,7 @@ m->offset = swap4((uint32_t)m->offset); m->in_offset = swap4((uint32_t)m->in_offset); m->lineno = swap4((uint32_t)m->lineno); @@ -728,9 +774,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c m->str_range = swap4(m->str_range); m->str_flags = swap4(m->str_flags); } -diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c ---- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200 +diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c +--- libmagic.origin/ascmagic.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/ascmagic.c 2012-09-11 11:33:55.000000000 +0800 @@ -139,10 +139,8 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -754,9 +800,9 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c return rv; } -diff -u libmagic.orig/cdf.c libmagic/cdf.c ---- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/cdf.c libmagic/cdf.c +--- libmagic.origin/cdf.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/cdf.c 2012-09-11 11:33:55.000000000 +0800 @@ -43,7 +43,17 @@ #include <err.h> #endif @@ -818,9 +864,9 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c cdf_print_elapsed_time(buf, sizeof(buf), tp); (void)fprintf(stderr, "timestamp %s\n", buf); } else { -diff -u libmagic.orig/cdf.h libmagic/cdf.h ---- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/cdf.h libmagic/cdf.h +--- libmagic.origin/cdf.h 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/cdf.h 2012-09-11 11:33:55.000000000 +0800 @@ -35,7 +35,7 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -856,9 +902,9 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h int cdf_read_header(const cdf_info_t *, cdf_header_t *); void cdf_swap_header(cdf_header_t *); void cdf_unpack_header(cdf_header_t *, char *); -diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c ---- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c +--- libmagic.origin/cdf_time.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/cdf_time.c 2012-09-11 11:33:55.000000000 +0800 @@ -96,7 +96,7 @@ } @@ -915,9 +961,9 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL; static const char *ref = "Sat Apr 23 01:30:00 1977"; char *p, *q; -diff -u libmagic.orig/compress.c libmagic/compress.c ---- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/compress.c libmagic/compress.c +--- libmagic.origin/compress.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/compress.c 2012-09-11 11:33:55.000000000 +0800 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1078,9 +1124,10 @@ diff -u libmagic.orig/compress.c libmagic/compress.c } -#endif +#endif /* if PHP_FILEINFO_UNCOMPRESS */ -diff -u libmagic.orig/file.h libmagic/file.h ---- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200 +Only in libmagic: diff +diff -u libmagic.origin/file.h libmagic/file.h +--- libmagic.origin/file.h 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/file.h 2012-09-11 11:33:55.000000000 +0800 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1251,9 +1298,9 @@ diff -u libmagic.orig/file.h libmagic/file.h +#endif + #endif /* __file_h__ */ -diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c ---- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c +--- libmagic.origin/fsmagic.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/fsmagic.c 2012-09-11 11:33:55.000000000 +0800 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1464,10 +1511,10 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c -#else - if (file_printf(ms, "block special") == -1) - return -1; - #endif +-#endif - } - return 1; --#endif + #endif - /* TODO add code to handle V7 MUX and Blit MUX files */ + #ifdef S_IFIFO @@ -1576,9 +1623,9 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } /* -diff -u libmagic.orig/funcs.c libmagic/funcs.c ---- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/funcs.c libmagic/funcs.c +--- libmagic.origin/funcs.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/funcs.c 2012-09-11 11:33:55.000000000 +0800 @@ -41,52 +41,42 @@ #if defined(HAVE_WCTYPE_H) #include <wctype.h> @@ -1872,9 +1919,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c + return rep_cnt; } + -diff -u libmagic.orig/magic.c libmagic/magic.c ---- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/magic.c libmagic/magic.c +--- libmagic.origin/magic.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/magic.c 2012-09-11 11:33:55.000000000 +0800 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2250,9 +2297,9 @@ diff -u libmagic.orig/magic.c libmagic/magic.c public const char * magic_error(struct magic_set *ms) -diff -u libmagic.orig/magic.h libmagic/magic.h ---- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/magic.h libmagic/magic.h +--- libmagic.origin/magic.h 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/magic.h 2012-09-11 11:33:55.000000000 +0800 @@ -85,6 +85,7 @@ const char *magic_getpath(const char *, int); @@ -2269,20 +2316,20 @@ diff -u libmagic.orig/magic.h libmagic/magic.h int magic_list(magic_t, const char *); int magic_errno(magic_t); -diff -u libmagic.orig/print.c libmagic/print.c ---- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200 +diff -u libmagic.origin/print.c libmagic/print.c +--- libmagic.origin/print.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/print.c 2012-09-11 11:33:55.000000000 +0800 @@ -29,6 +29,9 @@ * print.c - debugging printout routines */ ++#define _GNU_SOURCE +#include "php.h" -+#include "main/snprintf.h" + #include "file.h" #ifndef lint -@@ -45,174 +48,21 @@ +@@ -46,174 +49,21 @@ #define SZOF(a) (sizeof(a) / sizeof(a[0])) @@ -2464,9 +2511,9 @@ diff -u libmagic.orig/print.c libmagic/print.c } protected const char * -diff -u libmagic.orig/readcdf.c libmagic/readcdf.c ---- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/readcdf.c libmagic/readcdf.c +--- libmagic.origin/readcdf.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/readcdf.c 2012-09-11 11:33:55.000000000 +0800 @@ -30,7 +30,11 @@ #endif @@ -2512,9 +2559,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c c = cdf_ctime(&ts.tv_sec); if ((ec = strchr(c, '\n')) != NULL) *ec = '\0'; -diff -u libmagic.orig/readelf.c libmagic/readelf.c ---- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200 +diff -u libmagic.origin/readelf.c libmagic/readelf.c +--- libmagic.origin/readelf.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/readelf.c 2012-09-11 11:33:55.000000000 +0800 @@ -49,7 +49,7 @@ off_t, int *, int); private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, @@ -2669,9 +2716,9 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c fd = file_pipe2file(ms, fd, buf, nbytes); if (fstat(fd, &st) == -1) { -diff -u libmagic.orig/softmagic.c libmagic/softmagic.c ---- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200 +diff -u libmagic.origin/softmagic.c libmagic/softmagic.c +--- libmagic.origin/softmagic.c 2012-09-11 11:09:26.000000000 +0800 ++++ libmagic/softmagic.c 2012-09-11 11:33:55.000000000 +0800 @@ -41,6 +41,11 @@ #include <stdlib.h> #include <time.h> diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 4a54849e07..d11bd159a8 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -753,11 +753,11 @@ private int apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, const char *fn, int action) { - int errs = 0; + int errs = 0; struct magic_entry *marray; uint32_t marraycount, i, mentrycount = 0, starttest; size_t files = 0, maxfiles = 0; - char **filearr = NULL, mfn[MAXPATHLEN]; + char **filearr = NULL; struct stat st; DIR *dir; struct dirent *d; @@ -776,13 +776,15 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, /* FIXME: Read file names and sort them to prevent non-determinism. See Debian bug #488562. */ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { + int mflen; + char mfn[MAXPATHLEN]; dir = opendir(fn); if (!dir) { errs++; goto out; } while ((d = readdir(dir)) != NULL) { - if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) { + if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name)) < 0) { file_oomem(ms, strlen(fn) + strlen(d->d_name) + 2); errs++; @@ -804,14 +806,14 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, goto out; } } - filearr[files++] = mfn; + filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen); } closedir(dir); qsort(filearr, files, sizeof(*filearr), cmpstrp); for (i = 0; i < files; i++) { load_1(ms, action, filearr[i], &errs, &marray, &marraycount); - free(filearr[i]); + efree(filearr[i]); } free(filearr); } else @@ -886,9 +888,14 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, mentrycount += marray[i].cont_count; } out: - for (i = 0; i < marraycount; i++) - efree(marray[i].mp); - efree(marray); + for (i = 0; i < marraycount; i++) { + if (marray[i].mp) { + efree(marray[i].mp); + } + } + if (marray) { + efree(marray); + } if (errs) { *magicp = NULL; *nmagicp = 0; @@ -1165,6 +1172,9 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp, return -1; } me = &(*mentryp)[*nmentryp - 1]; + if (me->mp == NULL) { + return -1; + } if (me->cont_count == me->max_count) { struct magic *nm; size_t cnt = me->max_count + ALLOC_CHUNK; @@ -1329,6 +1339,10 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp, if (m->type == FILE_INVALID) { if (ms->flags & MAGIC_CHECK) file_magwarn(ms, "type `%s' invalid", l); + if (me->mp) { + efree(me->mp); + me->mp = NULL; + } return -1; } @@ -2219,6 +2233,7 @@ apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, mm = emalloc((size_t)st.sb.st_size); if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { file_badread(ms); + ret = 1; goto error1; } ret = 1; diff --git a/ext/fileinfo/tests/bug61964.phpt b/ext/fileinfo/tests/bug61964.phpt new file mode 100644 index 0000000000..99c8fd2ae3 --- /dev/null +++ b/ext/fileinfo/tests/bug61964.phpt @@ -0,0 +1,69 @@ +--TEST-- +Bug #61964 (finfo_open with directory cause invalid free) +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$magic_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic'; + +$ret = @finfo_open(FILEINFO_NONE, $magic_file . ".non-exits"); +var_dump($ret); + +$dir = __DIR__ . "/test-folder"; +@mkdir($dir); + +$magic_file_copy = $dir . "/magic.copy"; +$magic_file_copy2 = $magic_file_copy . "2"; +copy($magic_file, $magic_file_copy); +copy($magic_file, $magic_file_copy2); + +$ret = finfo_open(FILEINFO_NONE, $dir); +var_dump($ret); + +$ret = @finfo_open(FILEINFO_NONE, $dir); +var_dump($ret); + +$ret = @finfo_open(FILEINFO_NONE, $dir. "/non-exits-dir"); +var_dump($ret); + +// write some test files to test folder +file_put_contents($dir . "/test1.txt", "string\n> Core\n> Me"); +file_put_contents($dir . "/test2.txt", "a\nb\n"); +@mkdir($dir . "/test-inner-folder"); + +finfo_open(FILEINFO_NONE, $dir); +echo "DONE: testing dir with files\n"; + +rmdir($dir . "/test-inner-folder"); +unlink($dir . "/test1.txt"); +unlink($dir . "/test2.txt"); + +unlink($magic_file_copy); +unlink($magic_file_copy2); +rmdir($dir); +?> +===DONE=== +--EXPECTF-- +bool(false) +resource(%d) of type (file_info) +resource(%d) of type (file_info) +bool(false) + +Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `Core' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset `a' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `a' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset `b' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `b' invalid in %sbug61964.php on line %d + +Warning: finfo_open(): Failed to load magic database at '%stest-folder'. in %sbug61964.php on line %d +DONE: testing dir with files +===DONE=== diff --git a/ext/fileinfo/tests/finfo_open_error-win32.phpt b/ext/fileinfo/tests/finfo_open_error-win32.phpt index bd50327b2d..0260ca5708 100644 --- a/ext/fileinfo/tests/finfo_open_error-win32.phpt +++ b/ext/fileinfo/tests/finfo_open_error-win32.phpt @@ -17,6 +17,7 @@ $magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic'; echo "*** Testing finfo_open() : error functionality ***\n"; +// on 5_4, this line generates additional warning messages that 5_3 does not. functionally, it should be fine (should pass) var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) ); var_dump( finfo_open( array(), $magicFile ) ); var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) ); @@ -29,18 +30,24 @@ var_dump( new finfo('foobar') ); ===DONE=== --EXPECTF-- *** Testing finfo_open() : error functionality *** + +Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d + +Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d + +Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error-win32.php on line %d bool(false) -Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d +Warning: finfo_open() expects parameter 1 to be long, array given in %sfinfo_open_error-win32.php on line %d bool(false) -Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d +Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error-win32.php on line %d bool(false) -resource(%d) of type (file_info) +resource(6) of type (file_info) -Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d +Warning: finfo_open() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d bool(false) -Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d +Warning: finfo::finfo() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d NULL ===DONE=== diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index daa688b4ac..2ec2f62fae 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -99,12 +99,14 @@ } \ return; \ -#define PHP_FILTER_TRIM_DEFAULT(p, len) { \ +#define PHP_FILTER_TRIM_DEFAULT(p, len) PHP_FILTER_TRIM_DEFAULT_EX(p, len, 1); + +#define PHP_FILTER_TRIM_DEFAULT_EX(p, len, return_if_empty) { \ while ((len > 0) && (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v' || *p == '\n')) { \ p++; \ len--; \ } \ - if (len < 1) { \ + if (len < 1 && return_if_empty) { \ RETURN_VALIDATION_FAILED \ } \ while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \ diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 5c3811ab25..4de6b83e00 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -235,12 +235,15 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ int len = Z_STRLEN_P(value); int ret; - PHP_FILTER_TRIM_DEFAULT(str, len); + PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0); /* returns true for "1", "true", "on" and "yes" * returns false for "0", "false", "off", "no", and "" * null otherwise. */ switch (len) { + case 0: + ret = 0; + break; case 1: if (*str == '1') { ret = 1; @@ -286,7 +289,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ ret = -1; } - if (ret == -1) { + if (ret == -1) { RETURN_VALIDATION_FAILED } else { zval_dtor(value); diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt new file mode 100644 index 0000000000..3f365cc431 --- /dev/null +++ b/ext/filter/tests/bug49510.phpt @@ -0,0 +1,36 @@ +--TEST-- +#49510 boolean validation fails with FILTER_NULL_ON_FAILURE +--FILE-- +<?php +var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); + +var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); + +var_dump(filter_var("invalid", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); +?> +==DONE== +--EXPECT-- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +NULL +==DONE== diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c index c83b0ad13e..f4165d52b7 100644 --- a/ext/gd/libgd/xbm.c +++ b/ext/gd/libgd/xbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/gmp/tests/022-win32.phpt b/ext/gmp/tests/022-win32.phpt deleted file mode 100644 index 7abb0e82bd..0000000000 --- a/ext/gmp/tests/022-win32.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -gmp_gcdext() basic tests ---SKIPIF-- -<?php if (!extension_loaded("gmp")) print "skip"; -if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); -} -?> ---FILE-- -<?php - -$n = gmp_init("34293864345"); -$n1 = gmp_init("23434293864345"); - -$a = array( - array(123,45), - array(4341,9734), - array(23487,333), - array(-234234,-123123), - array(-100,-2234), - array(345,"34587345"), - array(345,"0"), - array("345556456",345873), - array("34545345556456","323432445873"), - array($n, $n1), - ); - -foreach ($a as $val) { - $r = gmp_gcdext($val[0],$val[1]); - var_dump(gmp_strval($r['g'])); - var_dump(gmp_strval($r['s'])); - var_dump(gmp_strval($r['t'])); -} - -var_dump(gmp_gcdext($val[0],array())); -var_dump(gmp_gcdext(array(),array())); -var_dump(gmp_gcdext(array(),array(),1)); -var_dump(gmp_gcdext(array())); -var_dump(gmp_gcdext()); - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "3" -string(2) "41" -string(4) "-112" -string(1) "1" -string(4) "-805" -string(3) "359" -string(1) "3" -string(2) "32" -string(5) "-2257" -string(4) "3003" -string(3) "-10" -string(2) "19" -string(1) "2" -string(2) "67" -string(2) "-3" -string(2) "15" -string(7) "-601519" -string(1) "6" -string(3) "345" -string(1) "1" -string(1) "0" -string(1) "1" -string(5) "84319" -string(9) "-84241831" -string(1) "1" -string(12) "167180205823" -string(15) "-17856272782919" -string(3) "195" -string(15) "-23387298979862" -string(11) "34225091793" - -Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d -bool(false) - -Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d -bool(false) - -Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d -NULL -Done - diff --git a/ext/gmp/tests/022.phpt b/ext/gmp/tests/022.phpt index f699e8283d..469aa3013d 100644 --- a/ext/gmp/tests/022.phpt +++ b/ext/gmp/tests/022.phpt @@ -2,9 +2,6 @@ gmp_gcdext() basic tests --SKIPIF-- <?php if (!extension_loaded("gmp")) print "skip"; -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. only for Non Windows Systems'); -} ?> --FILE-- <?php diff --git a/ext/gmp/tests/gmp_nextprime-win32.phpt b/ext/gmp/tests/gmp_nextprime-win32.phpt deleted file mode 100644 index e725315a13..0000000000 --- a/ext/gmp/tests/gmp_nextprime-win32.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -gmp_nextprime() ---SKIPIF-- -<?php if (!extension_loaded("gmp")) print "skip"; -if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); -} -?> ---FILE-- -<?php - -$n = gmp_nextprime(-1); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(0); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(-1000); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(1000); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(100000); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(array()); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(""); -var_dump(gmp_strval($n)); -$n = gmp_nextprime(new stdclass()); -var_dump(gmp_strval($n)); - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "2" -string(1) "2" -string(4) "-997" -string(4) "1009" -string(6) "100003" - -Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d -string(1) "0" -string(1) "0" - -Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d -string(1) "0" -Done - diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt index 623ccbed07..5683c8c31f 100644 --- a/ext/gmp/tests/gmp_nextprime.phpt +++ b/ext/gmp/tests/gmp_nextprime.phpt @@ -2,9 +2,6 @@ gmp_nextprime() --SKIPIF-- <?php if (!extension_loaded("gmp")) print "skip"; -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. only for Non Windows Systems'); -} ?> --FILE-- <?php diff --git a/ext/imap/tests/imap_errors_basic.phpt b/ext/imap/tests/imap_errors_basic.phpt index 9d2ca30ece..91be3286aa 100644 --- a/ext/imap/tests/imap_errors_basic.phpt +++ b/ext/imap/tests/imap_errors_basic.phpt @@ -7,7 +7,7 @@ require_once(dirname(__FILE__).'/skipif.inc'); --FILE-- <?php /* Prototype : array imap_errors ( void ) - * Description: Returns all of the IMAP errors that have occured. + * Description: Returns all of the IMAP errors that have occurred. * Source code: ext/imap/php_imap.c */ diff --git a/ext/intl/CREDITS b/ext/intl/CREDITS index 0e7fd55dc1..0e7fd55dc1 100755..100644 --- a/ext/intl/CREDITS +++ b/ext/intl/CREDITS diff --git a/ext/intl/TODO b/ext/intl/TODO index 6fd1b27814..6fd1b27814 100755..100644 --- a/ext/intl/TODO +++ b/ext/intl/TODO diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c index 047a738028..047a738028 100755..100644 --- a/ext/intl/collator/collator.c +++ b/ext/intl/collator/collator.c diff --git a/ext/intl/collator/collator.h b/ext/intl/collator/collator.h index 96e7aa097b..96e7aa097b 100755..100644 --- a/ext/intl/collator/collator.h +++ b/ext/intl/collator/collator.h diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c index 684e72cc58..684e72cc58 100755..100644 --- a/ext/intl/collator/collator_attr.c +++ b/ext/intl/collator/collator_attr.c diff --git a/ext/intl/collator/collator_attr.h b/ext/intl/collator/collator_attr.h index 85636cc486..85636cc486 100755..100644 --- a/ext/intl/collator/collator_attr.h +++ b/ext/intl/collator/collator_attr.h diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c index de744dcefe..d1fa10ef2c 100755..100644 --- a/ext/intl/collator/collator_class.c +++ b/ext/intl/collator/collator_class.c @@ -67,6 +67,7 @@ zend_object_value Collator_object_create( intern = ecalloc( 1, sizeof(Collator_object) ); intl_error_init( COLLATOR_ERROR_P( intern ) TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h index 835abd66c8..7a56dfce50 100755..100644 --- a/ext/intl/collator/collator_class.h +++ b/ext/intl/collator/collator_class.h @@ -20,8 +20,9 @@ #include <php.h> -#include "intl_common.h" -#include "intl_error.h" +#include "../intl_common.h" +#include "../intl_error.h" +#include "../intl_data.h" #include <unicode/ucol.h> @@ -54,9 +55,7 @@ extern zend_class_entry *Collator_ce_ptr; Collator_object* co = NULL; \ intl_error_reset( NULL TSRMLS_CC ); \ -#define COLLATOR_METHOD_FETCH_OBJECT \ - co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC ); \ - intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC ); \ +#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(Collator, co) // Macro to check return value of a ucol_* function call. #define COLLATOR_CHECK_STATUS( co, msg ) \ diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c index 4384558ac6..4384558ac6 100755..100644 --- a/ext/intl/collator/collator_compare.c +++ b/ext/intl/collator/collator_compare.c diff --git a/ext/intl/collator/collator_compare.h b/ext/intl/collator/collator_compare.h index 4e38b79309..4e38b79309 100755..100644 --- a/ext/intl/collator/collator_compare.h +++ b/ext/intl/collator/collator_compare.h diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index e989d4c65a..e989d4c65a 100755..100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h index 8322ea998b..8322ea998b 100755..100644 --- a/ext/intl/collator/collator_convert.h +++ b/ext/intl/collator/collator_convert.h diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c index 0f0cc193e4..b2a9968af4 100755..100644 --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.c @@ -45,7 +45,7 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS) } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); - co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC ); + COLLATOR_METHOD_FETCH_OBJECT; if(locale_len == 0) { locale = INTL_G(default_locale); diff --git a/ext/intl/collator/collator_create.h b/ext/intl/collator/collator_create.h index b740e82d68..b740e82d68 100755..100644 --- a/ext/intl/collator/collator_create.h +++ b/ext/intl/collator/collator_create.h diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c index c4e41250a2..c4e41250a2 100755..100644 --- a/ext/intl/collator/collator_error.c +++ b/ext/intl/collator/collator_error.c diff --git a/ext/intl/collator/collator_error.h b/ext/intl/collator/collator_error.h index b2f44ea2a3..b2f44ea2a3 100755..100644 --- a/ext/intl/collator/collator_error.h +++ b/ext/intl/collator/collator_error.h diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index a8abfac12b..a8abfac12b 100755..100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c diff --git a/ext/intl/collator/collator_is_numeric.h b/ext/intl/collator/collator_is_numeric.h index 585d58917a..585d58917a 100755..100644 --- a/ext/intl/collator/collator_is_numeric.h +++ b/ext/intl/collator/collator_is_numeric.h diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c index b30b021ee8..b30b021ee8 100755..100644 --- a/ext/intl/collator/collator_locale.c +++ b/ext/intl/collator/collator_locale.c diff --git a/ext/intl/collator/collator_locale.h b/ext/intl/collator/collator_locale.h index bda90cd3b9..bda90cd3b9 100755..100644 --- a/ext/intl/collator/collator_locale.h +++ b/ext/intl/collator/collator_locale.h diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 0785111c96..0785111c96 100755..100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h index a990cdf089..a990cdf089 100755..100644 --- a/ext/intl/collator/collator_sort.h +++ b/ext/intl/collator/collator_sort.h diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index 24ded0c9fb..282172224c 100755..100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -24,7 +24,7 @@ #include "common_error.h" /* {{{ proto int intl_get_error_code() - * Get code of the last occured error. + * Get code of the last occurred error. */ PHP_FUNCTION( intl_get_error_code ) { @@ -33,7 +33,7 @@ PHP_FUNCTION( intl_get_error_code ) /* }}} */ /* {{{ proto string intl_get_error_message() - * Get text description of the last occured error. + * Get text description of the last occurred error. */ PHP_FUNCTION( intl_get_error_message ) { @@ -240,7 +240,9 @@ void intl_expose_icu_error_codes( INIT_FUNC_ARGS ) INTL_EXPOSE_CONST( U_IDNA_ACE_PREFIX_ERROR ); INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR ); INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR ); +#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 6 INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR ); +#endif #if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 8 INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR ); #endif diff --git a/ext/intl/common/common_error.h b/ext/intl/common/common_error.h index 8716222124..8716222124 100755..100644 --- a/ext/intl/common/common_error.h +++ b/ext/intl/common/common_error.h diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index 0477c7f59d..0477c7f59d 100755..100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index 437fedb7d3..437fedb7d3 100755..100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index b399a39fcb..8aded18bd6 100755..100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -108,7 +108,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS) goto error; } - DATE_FORMAT_METHOD_FETCH_OBJECT; + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; if (DATE_FORMAT_OBJECT(dfo) != NULL) { intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR, diff --git a/ext/intl/dateformat/dateformat.h b/ext/intl/dateformat/dateformat.h index f11918b79f..f11918b79f 100755..100644 --- a/ext/intl/dateformat/dateformat.h +++ b/ext/intl/dateformat/dateformat.h diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index 6131cedc95..b8c5f25e3a 100755..100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -17,8 +17,9 @@ #include "config.h" #endif -#include "php_intl.h" -#include "intl_convert.h" +#include "../php_intl.h" +#include "dateformat_class.h" +#include "../intl_convert.h" #include "dateformat_class.h" #include "dateformat_attr.h" diff --git a/ext/intl/dateformat/dateformat_attr.h b/ext/intl/dateformat/dateformat_attr.h index bf28824d63..bf28824d63 100755..100644 --- a/ext/intl/dateformat/dateformat_attr.h +++ b/ext/intl/dateformat/dateformat_attr.h diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index c66610f23b..49f316f787 100755..100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -23,6 +23,8 @@ #include "dateformat.h" #include "dateformat_attr.h" +#include <zend_exceptions.h> + zend_class_entry *IntlDateFormatter_ce_ptr = NULL; static zend_object_handlers IntlDateFormatter_handlers; @@ -63,6 +65,7 @@ zend_object_value IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC intern = ecalloc( 1, sizeof(IntlDateFormatter_object) ); dateformat_data_init( &intern->datef_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); intern->date_type = 0; intern->time_type = 0; intern->calendar = 1; /* Gregorian calendar */ @@ -87,18 +90,23 @@ zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC) zend_object_handle handle = Z_OBJ_HANDLE_P(object); IntlDateFormatter_object *dfo, *new_dfo; - DATE_FORMAT_METHOD_FETCH_OBJECT; - new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC); + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + + new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC); /* clone formatter object */ - DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(new_dfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_dfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_dfo), "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC ); - IntlDateFormatter_object_dtor(new_dfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone IntlDateFormatter object"); + if (dfo->datef_data.udatf != NULL) { + DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + /* set up error in case error handler is interested */ + intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo), + "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC ); + zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC); + } + } else { + zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC); } return new_obj_val; } diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index 9ad83ee3d6..d58abe42f5 100755..100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -38,7 +38,15 @@ extern zend_class_entry *IntlDateFormatter_ce_ptr; /* Auxiliary macros */ #define DATE_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlDateFormatter, dfo) -#define DATE_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo) +#define DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo) +#define DATE_FORMAT_METHOD_FETCH_OBJECT \ + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (dfo->datef_data.udatf == NULL) \ + { \ + intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #define DATE_FORMAT_OBJECT(dfo) (dfo)->datef_data.udatf #endif // #ifndef DATE_FORMAT_CLASS_H diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c index 33451e1c51..33451e1c51 100755..100644 --- a/ext/intl/dateformat/dateformat_data.c +++ b/ext/intl/dateformat/dateformat_data.c diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h index cde9e363c9..cde9e363c9 100755..100644 --- a/ext/intl/dateformat/dateformat_data.h +++ b/ext/intl/dateformat/dateformat_data.h diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c index 4d03d924c8..4d03d924c8 100755..100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.c diff --git a/ext/intl/dateformat/dateformat_format.h b/ext/intl/dateformat/dateformat_format.h index 49f34c6892..49f34c6892 100755..100644 --- a/ext/intl/dateformat/dateformat_format.h +++ b/ext/intl/dateformat/dateformat_format.h diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 4193e89017..4193e89017 100755..100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c diff --git a/ext/intl/dateformat/dateformat_parse.h b/ext/intl/dateformat/dateformat_parse.h index c74a3d5f15..c74a3d5f15 100755..100644 --- a/ext/intl/dateformat/dateformat_parse.h +++ b/ext/intl/dateformat/dateformat_parse.h diff --git a/ext/intl/doc/Tutorial.txt b/ext/intl/doc/Tutorial.txt index 4a66dc1844..4a66dc1844 100755..100644 --- a/ext/intl/doc/Tutorial.txt +++ b/ext/intl/doc/Tutorial.txt diff --git a/ext/intl/doc/collator_api.php b/ext/intl/doc/collator_api.php index 5428783750..ef7250243b 100755..100644 --- a/ext/intl/doc/collator_api.php +++ b/ext/intl/doc/collator_api.php @@ -116,7 +116,7 @@ class Collator { /** * Return error text for the last ICU operation. * - * @return string Description of an error occured in the last + * @return string Description of an error occurred in the last * Collator method call. */ public function getErrorMessage() {} @@ -236,7 +236,7 @@ class Collator { * * @return string Real locale name from which the * collation data comes. If the collator - * was instantiated from rules or an error occured, + * was instantiated from rules or an error occurred, * returns false. */ public function getLocale( $type ) {} @@ -331,7 +331,7 @@ function collator_sort_with_sort_keys( $coll, $arr ) {} * * @return string Real locale name from which the * collation data comes. If the collator - * was instantiated from rules or an error occured, + * was instantiated from rules or an error occurred, * returns false. */ function collator_get_locale( $coll, $type ) {} @@ -391,7 +391,7 @@ function collator_get_error_code( $coll ) {} * * @param Collator $coll Collator object. * - * @return string Description of an error occured in the last + * @return string Description of an error occurred in the last * Collator API function call. */ function collator_get_error_message( $coll ) {} diff --git a/ext/intl/doc/common_api.php b/ext/intl/doc/common_api.php index ce2329fe3b..993dab180b 100755..100644 --- a/ext/intl/doc/common_api.php +++ b/ext/intl/doc/common_api.php @@ -1,7 +1,7 @@ <?php /** - * Handling of errors occured in static methods + * Handling of errors occurred in static methods * when there's no object to get error code/message from. * * Example #1: @@ -29,7 +29,7 @@ function intl_get_error_code() {} /** * Get description of the last error. * - * @return string Description of an error occured in the last + * @return string Description of an error occurred in the last * API function call. */ function intl_get_error_message() {} diff --git a/ext/intl/doc/datefmt_api.php b/ext/intl/doc/datefmt_api.php index 0c5002e281..272abdb57c 100755..100644 --- a/ext/intl/doc/datefmt_api.php +++ b/ext/intl/doc/datefmt_api.php @@ -215,7 +215,7 @@ class DateFormatter { /** * Sets the pattern to use * @param string $pattern new pattern string to use - * @return boolean 'true' if successful, 'false' if an error occured. Bad format + * @return boolean 'true' if successful, 'false' if an error occurred. Bad format * strings are usually the cause of the latter. */ public function setPattern($pattern) {} @@ -410,7 +410,7 @@ class DateFormatter { * Sets the pattern to use * @param DateFormatter $fmt The date formatter resource * @param string $pattern new pattern string to use - * @return boolean 'true' if successful, 'false' if an error occured. Bad format + * @return boolean 'true' if successful, 'false' if an error occurred. Bad format * strings are usually the cause of the latter. */ function datefmt_set_pattern($fmt , $pattern) {} diff --git a/ext/intl/doc/formatter_api.php b/ext/intl/doc/formatter_api.php index 754b16c62f..14d98db66a 100755..100644 --- a/ext/intl/doc/formatter_api.php +++ b/ext/intl/doc/formatter_api.php @@ -317,7 +317,7 @@ class NumberFormatter { /** * Get the error text from the last operation. * - * @return string Description of the last occured error. + * @return string Description of the last occurred error. */ public public function getErrorMessage() {} @@ -495,6 +495,6 @@ function numfmt_get_error_code($formatter) {} * Get the error text from the last operation. * * @param NumberFormatter $formatter The formatter resource - * @return string Description of the last occured error. + * @return string Description of the last occurred error. */ function numfmt_get_error_message($formatter) {} diff --git a/ext/intl/doc/grapheme_api.php b/ext/intl/doc/grapheme_api.php index 465453fd32..465453fd32 100755..100644 --- a/ext/intl/doc/grapheme_api.php +++ b/ext/intl/doc/grapheme_api.php diff --git a/ext/intl/doc/locale_api.php b/ext/intl/doc/locale_api.php index c6c41ede0a..c6c41ede0a 100755..100644 --- a/ext/intl/doc/locale_api.php +++ b/ext/intl/doc/locale_api.php diff --git a/ext/intl/doc/msgfmt_api.php b/ext/intl/doc/msgfmt_api.php index 5d178f1273..e4d047b979 100755..100644 --- a/ext/intl/doc/msgfmt_api.php +++ b/ext/intl/doc/msgfmt_api.php @@ -54,7 +54,7 @@ class MessageFormatter { * @param string $locale the locale to use when formatting numbers and dates and suchlike * @param string $pattern the pattern string to insert things into * @param array $args the array of values to insert into $pattern - * @return string the formatted pattern string or false if an error occured + * @return string the formatted pattern string or false if an error occurred */ public static function formatMessage($locale, $pattern, $args) {} @@ -148,7 +148,7 @@ class MessageFormatter { * @param string $locale the locale to use when formatting numbers and dates and suchlike * @param string $pattern the pattern string to insert things into * @param array $args the array of values to insert into $pattern - * @return string the formatted pattern string or false if an error occured + * @return string the formatted pattern string or false if an error occurred */ function msgfmt_format_message($locale, $pattern, $args) {} diff --git a/ext/intl/doc/normalizer_api.php b/ext/intl/doc/normalizer_api.php index a9bb566e67..a9bb566e67 100755..100644 --- a/ext/intl/doc/normalizer_api.php +++ b/ext/intl/doc/normalizer_api.php diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c index 1b7922ce03..1b7922ce03 100755..100644 --- a/ext/intl/formatter/formatter.c +++ b/ext/intl/formatter/formatter.c diff --git a/ext/intl/formatter/formatter.h b/ext/intl/formatter/formatter.h index 1f9ebead8e..1f9ebead8e 100755..100644 --- a/ext/intl/formatter/formatter.h +++ b/ext/intl/formatter/formatter.h diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 448a9db721..448a9db721 100755..100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c diff --git a/ext/intl/formatter/formatter_attr.h b/ext/intl/formatter/formatter_attr.h index c4bc94ce5f..c4bc94ce5f 100755..100644 --- a/ext/intl/formatter/formatter_attr.h +++ b/ext/intl/formatter/formatter_attr.h diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index 8fcda643bf..2246cd29a5 100755..100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -24,6 +24,8 @@ #include "formatter_main.h" #include "formatter_attr.h" +#include <zend_exceptions.h> + zend_class_entry *NumberFormatter_ce_ptr = NULL; static zend_object_handlers NumberFormatter_handlers; @@ -62,6 +64,7 @@ zend_object_value NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC) intern = ecalloc( 1, sizeof(NumberFormatter_object) ); formatter_data_init( &intern->nf_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -82,18 +85,23 @@ zend_object_value NumberFormatter_object_clone(zval *object TSRMLS_DC) zend_object_handle handle = Z_OBJ_HANDLE_P(object); NumberFormatter_object *nfo, *new_nfo; - FORMATTER_METHOD_FETCH_OBJECT; - new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC); + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; + new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC); - /* clone formatter object */ - FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), &INTL_DATA_ERROR_CODE(new_nfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_nfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_nfo), "Failed to clone NumberFormatter object", 0 TSRMLS_CC ); - NumberFormatter_object_dtor(new_nfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone NumberFormatter object"); + /* clone formatter object. It may fail, the destruction code must handle this case */ + if (FORMATTER_OBJECT(nfo) != NULL) { + FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), + &INTL_DATA_ERROR_CODE(nfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) { + /* set up error in case error handler is interested */ + intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo), + "Failed to clone NumberFormatter object", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC); + } + } else { + zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC); } return new_obj_val; } diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index cf1cb060c6..9582866664 100755..100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -34,8 +34,17 @@ extern zend_class_entry *NumberFormatter_ce_ptr; /* Auxiliary macros */ -#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo) -#define FORMATTER_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo) -#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum +#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo) +#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum +#define FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo) +#define FORMATTER_METHOD_FETCH_OBJECT \ + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (FORMATTER_OBJECT(nfo) == NULL) \ + { \ + intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #endif // #ifndef FORMATTER_CLASS_H diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c index 88f122f7c9..88f122f7c9 100755..100644 --- a/ext/intl/formatter/formatter_data.c +++ b/ext/intl/formatter/formatter_data.c diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h index adc4818afc..adc4818afc 100755..100644 --- a/ext/intl/formatter/formatter_data.h +++ b/ext/intl/formatter/formatter_data.h diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index ce1c941e19..ce1c941e19 100755..100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c diff --git a/ext/intl/formatter/formatter_format.h b/ext/intl/formatter/formatter_format.h index 35fafd1ede..35fafd1ede 100755..100644 --- a/ext/intl/formatter/formatter_format.h +++ b/ext/intl/formatter/formatter_format.h diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 8fa17560b8..5cb6483326 100755..100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -47,7 +47,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); object = return_value; - FORMATTER_METHOD_FETCH_OBJECT; + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; /* Convert pattern (if specified) to UTF-16. */ if(pattern && pattern_len) { diff --git a/ext/intl/formatter/formatter_main.h b/ext/intl/formatter/formatter_main.h index 7669e684ae..7669e684ae 100755..100644 --- a/ext/intl/formatter/formatter_main.h +++ b/ext/intl/formatter/formatter_main.h diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 6f3a3a12b5..6f3a3a12b5 100755..100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c diff --git a/ext/intl/formatter/formatter_parse.h b/ext/intl/formatter/formatter_parse.h index cb96c72b5d..cb96c72b5d 100755..100644 --- a/ext/intl/formatter/formatter_parse.h +++ b/ext/intl/formatter/formatter_parse.h diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h index c0e697ac1e..c0e697ac1e 100755..100644 --- a/ext/intl/grapheme/grapheme.h +++ b/ext/intl/grapheme/grapheme.h diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 475bbe4184..475bbe4184 100755..100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 92008554d4..92008554d4 100755..100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index c91aeaff7d..c91aeaff7d 100755..100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index 9424571d02..9424571d02 100755..100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h diff --git a/ext/intl/intl_convert.c b/ext/intl/intl_convert.c index 33f1730625..92cdc4cef4 100755..100644 --- a/ext/intl/intl_convert.c +++ b/ext/intl/intl_convert.c @@ -67,7 +67,7 @@ void intl_convert_utf8_to_utf16( return; } - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ @@ -119,7 +119,7 @@ void intl_convert_utf16_to_utf8( *status = U_ZERO_ERROR; u_strToUTF8( NULL, 0, &dst_len, src, src_len, status ); - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ diff --git a/ext/intl/intl_convert.h b/ext/intl/intl_convert.h index 3fc03f4bb7..3fc03f4bb7 100755..100644 --- a/ext/intl/intl_convert.h +++ b/ext/intl/intl_convert.h diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index 66ca27ae79..66ca27ae79 100755..100644 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index 9c2e13dfd5..9c2e13dfd5 100755..100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index 3adae85474..3adae85474 100755..100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c index ffc463f399..ffc463f399 100755..100644 --- a/ext/intl/locale/locale.c +++ b/ext/intl/locale/locale.c diff --git a/ext/intl/locale/locale.h b/ext/intl/locale/locale.h index f3859c7a2a..f3859c7a2a 100755..100644 --- a/ext/intl/locale/locale.h +++ b/ext/intl/locale/locale.h diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c index 432cfb28fc..432cfb28fc 100755..100644 --- a/ext/intl/locale/locale_class.c +++ b/ext/intl/locale/locale_class.c diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h index cbddccbe17..cbddccbe17 100755..100644 --- a/ext/intl/locale/locale_class.h +++ b/ext/intl/locale/locale_class.h diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 1707c69f93..1707c69f93 100755..100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c diff --git a/ext/intl/locale/locale_methods.h b/ext/intl/locale/locale_methods.h index e88fac64b7..e88fac64b7 100755..100644 --- a/ext/intl/locale/locale_methods.h +++ b/ext/intl/locale/locale_methods.h diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index 84f14de1bd..e3fb9425a9 100755..100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -49,7 +49,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); - MSG_FORMAT_METHOD_FETCH_OBJECT; + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; /* Convert pattern (if specified) to UTF-16. */ if(pattern && pattern_len) { @@ -64,9 +64,11 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) locale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format"); } +#endif if ((mfo)->mf_data.orig_format) { msgformat_data_free(&mfo->mf_data TSRMLS_CC); diff --git a/ext/intl/msgformat/msgformat.h b/ext/intl/msgformat/msgformat.h index 205c7066fd..205c7066fd 100755..100644 --- a/ext/intl/msgformat/msgformat.h +++ b/ext/intl/msgformat/msgformat.h diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c index cf34665142..ed2dae27d1 100755..100644 --- a/ext/intl/msgformat/msgformat_attr.c +++ b/ext/intl/msgformat/msgformat_attr.c @@ -82,11 +82,13 @@ PHP_FUNCTION( msgfmt_set_pattern ) intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo)); INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" ); +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* TODO: add parse error information */ umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff --git a/ext/intl/msgformat/msgformat_attr.h b/ext/intl/msgformat/msgformat_attr.h index 898c4451e1..898c4451e1 100755..100644 --- a/ext/intl/msgformat/msgformat_attr.h +++ b/ext/intl/msgformat/msgformat_attr.h diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c index d0138854eb..bb3b55f39c 100755..100644 --- a/ext/intl/msgformat/msgformat_class.c +++ b/ext/intl/msgformat/msgformat_class.c @@ -24,6 +24,8 @@ #include "msgformat.h" #include "msgformat_attr.h" +#include <zend_exceptions.h> + zend_class_entry *MessageFormatter_ce_ptr = NULL; static zend_object_handlers MessageFormatter_handlers; @@ -60,6 +62,7 @@ zend_object_value MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC) intern = ecalloc( 1, sizeof(MessageFormatter_object) ); msgformat_data_init( &intern->mf_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -80,18 +83,24 @@ zend_object_value MessageFormatter_object_clone(zval *object TSRMLS_DC) zend_object_handle handle = Z_OBJ_HANDLE_P(object); MessageFormatter_object *mfo, *new_mfo; - MSG_FORMAT_METHOD_FETCH_OBJECT; - new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC); + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC); + /* clone formatter object */ - MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), &INTL_DATA_ERROR_CODE(new_mfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_mfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_mfo), "Failed to clone MessageFormatter object", 0 TSRMLS_CC ); - MessageFormatter_object_dtor(new_mfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone MessageFormatter object"); + if (MSG_FORMAT_OBJECT(mfo) != NULL) { + MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), + &INTL_DATA_ERROR_CODE(mfo)); + + if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) { + intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo), + "Failed to clone MessageFormatter object", 0 TSRMLS_CC); + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object"); + } + } else { + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter"); } return new_obj_val; } diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h index 0afa792ae3..337e04e647 100755..100644 --- a/ext/intl/msgformat/msgformat_class.h +++ b/ext/intl/msgformat/msgformat_class.h @@ -19,9 +19,11 @@ #include <php.h> -#include "intl_common.h" -#include "intl_error.h" -#include "intl_data.h" +#include <unicode/uconfig.h> + +#include "../intl_common.h" +#include "../intl_error.h" +#include "../intl_data.h" #include "msgformat_data.h" typedef struct { @@ -35,7 +37,19 @@ extern zend_class_entry *MessageFormatter_ce_ptr; /* Auxiliary macros */ #define MSG_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(MessageFormatter, mfo) -#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT \ + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (MSG_FORMAT_OBJECT(mfo) == NULL) { \ + intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf +#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48 +# define MSG_FORMAT_QUOTE_APOS 1 +#endif + #endif // #ifndef MSG_FORMAT_CLASS_H diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c index 95e81d3ea7..527c1d4d17 100755..100644 --- a/ext/intl/msgformat/msgformat_data.c +++ b/ext/intl/msgformat/msgformat_data.c @@ -21,6 +21,8 @@ #include <unicode/ustring.h> #include "msgformat_data.h" +#include "msgformat_class.h" + /* {{{ void msgformat_data_init( msgformat_data* mf_data ) * Initialize internals of msgformat_data. */ @@ -69,6 +71,7 @@ msgformat_data* msgformat_data_create( TSRMLS_D ) } /* }}} */ +#ifdef MSG_FORMAT_QUOTE_APOS int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec) { if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) { @@ -86,6 +89,7 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e } return SUCCESS; } +#endif /* diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h index 44001753b3..6479888f8f 100755..100644 --- a/ext/intl/msgformat/msgformat_data.h +++ b/ext/intl/msgformat/msgformat_data.h @@ -19,9 +19,9 @@ #include <php.h> -#include <unicode/umsg.h> +#include "../intl_error.h" -#include "intl_error.h" +#include <unicode/umsg.h> typedef struct { // error hangling @@ -36,6 +36,9 @@ typedef struct { msgformat_data* msgformat_data_create( TSRMLS_D ); void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC ); void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC ); + +#ifdef MSG_FORMAT_QUOTE_APOS int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec); +#endif #endif // MSG_FORMAT_DATA_H diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index b664c83ec1..9a18ac0a70 100755..100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -154,11 +154,13 @@ PHP_FUNCTION( msgfmt_format_message ) slocale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* Create an ICU message formatter. */ MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff --git a/ext/intl/msgformat/msgformat_format.h b/ext/intl/msgformat/msgformat_format.h index b74deab8ff..b74deab8ff 100755..100644 --- a/ext/intl/msgformat/msgformat_format.h +++ b/ext/intl/msgformat/msgformat_format.h diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 1895de2c86..1895de2c86 100755..100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h index 30c7e3930f..30c7e3930f 100755..100644 --- a/ext/intl/msgformat/msgformat_helpers.h +++ b/ext/intl/msgformat/msgformat_helpers.h diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index 8393d4c6e3..f540b1d0c4 100755..100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -129,11 +129,13 @@ PHP_FUNCTION( msgfmt_parse_message ) slocale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* Create an ICU message formatter. */ MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff --git a/ext/intl/msgformat/msgformat_parse.h b/ext/intl/msgformat/msgformat_parse.h index a937235839..a937235839 100755..100644 --- a/ext/intl/msgformat/msgformat_parse.h +++ b/ext/intl/msgformat/msgformat_parse.h diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c index 033b05cd32..033b05cd32 100755..100644 --- a/ext/intl/normalizer/normalizer.c +++ b/ext/intl/normalizer/normalizer.c diff --git a/ext/intl/normalizer/normalizer.h b/ext/intl/normalizer/normalizer.h index eca9abe05a..eca9abe05a 100755..100644 --- a/ext/intl/normalizer/normalizer.h +++ b/ext/intl/normalizer/normalizer.h diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c index 154d877e3f..154d877e3f 100755..100644 --- a/ext/intl/normalizer/normalizer_class.c +++ b/ext/intl/normalizer/normalizer_class.c diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h index 4d3f7d2341..4d3f7d2341 100755..100644 --- a/ext/intl/normalizer/normalizer_class.h +++ b/ext/intl/normalizer/normalizer_class.h diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c index 466ab97e12..f46285e9d9 100755..100644 --- a/ext/intl/normalizer/normalizer_normalize.c +++ b/ext/intl/normalizer/normalizer_normalize.c @@ -110,7 +110,7 @@ PHP_FUNCTION( normalizer_normalize ) /* normalize */ size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status); - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ @@ -133,7 +133,7 @@ PHP_FUNCTION( normalizer_normalize ) /* try normalize again */ size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status); - /* Bail out if an unexpected error occured. */ + /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC ); @@ -234,7 +234,7 @@ PHP_FUNCTION( normalizer_is_normalized ) efree( uinput ); - /* Bail out if an unexpected error occured. */ + /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC ); diff --git a/ext/intl/normalizer/normalizer_normalize.h b/ext/intl/normalizer/normalizer_normalize.h index 41c31f7949..41c31f7949 100755..100644 --- a/ext/intl/normalizer/normalizer_normalize.h +++ b/ext/intl/normalizer/normalizer_normalize.h diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index efe0ddd242..90e3573c1b 100755..100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -70,7 +70,7 @@ #include "idn/idn.h" -#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2 +#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002 # include "spoofchecker/spoofchecker_class.h" # include "spoofchecker/spoofchecker.h" # include "spoofchecker/spoofchecker_create.h" @@ -646,7 +646,7 @@ PHP_MINIT_FUNCTION( intl ) /* Expose IDN constants to PHP scripts. */ idn_register_constants(INIT_FUNC_ARGS_PASSTHRU); -#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2 +#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002 /* Register 'Spoofchecker' PHP class */ spoofchecker_register_Spoofchecker_class( TSRMLS_C ); diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h index 4ede069e2a..4ede069e2a 100755..100644 --- a/ext/intl/php_intl.h +++ b/ext/intl/php_intl.h diff --git a/ext/intl/resourcebundle/TODO b/ext/intl/resourcebundle/TODO index ace4ceb253..ace4ceb253 100755..100644 --- a/ext/intl/resourcebundle/TODO +++ b/ext/intl/resourcebundle/TODO diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 1205450c4c..a6a73f5f04 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -63,6 +63,7 @@ static zend_object_value ResourceBundle_object_create( zend_class_entry *ce TSRM rb = ecalloc( 1, sizeof(ResourceBundle_object) ); zend_object_std_init( (zend_object *) rb, ce TSRMLS_CC ); + object_properties_init((zend_object *) rb, ce); intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC ); rb->me = NULL; @@ -260,7 +261,14 @@ PHP_FUNCTION( resourcebundle_get ) /* {{{ resourcebundle_array_count */ int resourcebundle_array_count(zval *object, long *count TSRMLS_DC) { - ResourceBundle_object *rb = (ResourceBundle_object *) zend_object_store_get_object( object TSRMLS_CC); + ResourceBundle_object *rb; + RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK; + + if (rb->me == NULL) { + intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, + "Found unconstructed ResourceBundle", 0 TSRMLS_CC); + return 0; + } *count = ures_getSize( rb->me ); diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h index 4755d723b8..8da3ed9d47 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.h +++ b/ext/intl/resourcebundle/resourcebundle_class.h @@ -33,7 +33,16 @@ typedef struct { } ResourceBundle_object; #define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb) -#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb) +#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb) +#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \ + INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \ + if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \ + intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + + #define RESOURCEBUNDLE_OBJECT(rb) (rb)->me void resourcebundle_register_class( TSRMLS_D ); diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c index 42a014a90e..42a014a90e 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker.c +++ b/ext/intl/spoofchecker/spoofchecker.c diff --git a/ext/intl/spoofchecker/spoofchecker.h b/ext/intl/spoofchecker/spoofchecker.h index f976d639ac..f976d639ac 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker.h +++ b/ext/intl/spoofchecker/spoofchecker.h diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c index 6c19fbb0f6..6c2b79034d 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.c @@ -61,6 +61,7 @@ zend_object_value Spoofchecker_object_create( intern = ecalloc(1, sizeof(Spoofchecker_object)); intl_error_init(SPOOFCHECKER_ERROR_P(intern) TSRMLS_CC); zend_object_std_init(&intern->zo, ce TSRMLS_CC); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -126,7 +127,7 @@ static zend_object_value spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ * sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC); intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC); - new_obj_val = Spoofchecker_ce_ptr->create_object(Spoofchecker_ce_ptr TSRMLS_CC); + new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_sfo->zo, new_obj_val, &sfo->zo, handle TSRMLS_CC); diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h index 8db64680ef..ec043d9dc8 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_class.h +++ b/ext/intl/spoofchecker/spoofchecker_class.h @@ -22,6 +22,7 @@ #include "intl_common.h" #include "spoofchecker_create.h" #include "intl_error.h" +#include "intl_data.h" #include <unicode/uspoof.h> @@ -55,9 +56,14 @@ extern zend_class_entry *Spoofchecker_ce_ptr; Spoofchecker_object* co = NULL; \ intl_error_reset(NULL TSRMLS_CC); \ -#define SPOOFCHECKER_METHOD_FETCH_OBJECT \ - co = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC); \ - intl_error_reset(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC); \ +#define SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(Spoofchecker, co) +#define SPOOFCHECKER_METHOD_FETCH_OBJECT \ + SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (co->uspoof == NULL) { \ + intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed Spoofchecker", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } // Macro to check return value of a ucol_* function call. #define SPOOFCHECKER_CHECK_STATUS(co, msg) \ diff --git a/ext/intl/spoofchecker/spoofchecker_create.c b/ext/intl/spoofchecker/spoofchecker_create.c index 3659551ede..cf0173f997 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_create.c +++ b/ext/intl/spoofchecker/spoofchecker_create.c @@ -35,7 +35,7 @@ PHP_METHOD(Spoofchecker, __construct) return; } - SPOOFCHECKER_METHOD_FETCH_OBJECT; + SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; co->uspoof = uspoof_open(SPOOFCHECKER_ERROR_CODE_P(co)); INTL_CTOR_CHECK_STATUS(co, "spoofchecker: unable to open ICU Spoof Checker"); diff --git a/ext/intl/spoofchecker/spoofchecker_create.h b/ext/intl/spoofchecker/spoofchecker_create.h index 313faab8a3..313faab8a3 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_create.h +++ b/ext/intl/spoofchecker/spoofchecker_create.h diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index c37b9186a2..c37b9186a2 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c diff --git a/ext/intl/spoofchecker/spoofchecker_main.h b/ext/intl/spoofchecker/spoofchecker_main.h index fb920d7841..fb920d7841 100755..100644 --- a/ext/intl/spoofchecker/spoofchecker_main.h +++ b/ext/intl/spoofchecker/spoofchecker_main.h diff --git a/ext/intl/tests/_files/es-bundle.txt b/ext/intl/tests/_files/es-bundle.txt index 46399a7717..46399a7717 100755..100644 --- a/ext/intl/tests/_files/es-bundle.txt +++ b/ext/intl/tests/_files/es-bundle.txt diff --git a/ext/intl/tests/_files/res_index.txt b/ext/intl/tests/_files/res_index.txt index a39bea58e5..a39bea58e5 100755..100644 --- a/ext/intl/tests/_files/res_index.txt +++ b/ext/intl/tests/_files/res_index.txt diff --git a/ext/intl/tests/_files/resourcebundle.txt b/ext/intl/tests/_files/resourcebundle.txt index 5b081da6cc..5b081da6cc 100755..100644 --- a/ext/intl/tests/_files/resourcebundle.txt +++ b/ext/intl/tests/_files/resourcebundle.txt diff --git a/ext/intl/tests/_files/resourcebundle/es.res b/ext/intl/tests/_files/resourcebundle/es.res Binary files differindex f9d891d6ba..f9d891d6ba 100755..100644 --- a/ext/intl/tests/_files/resourcebundle/es.res +++ b/ext/intl/tests/_files/resourcebundle/es.res diff --git a/ext/intl/tests/_files/resourcebundle/res_index.res b/ext/intl/tests/_files/resourcebundle/res_index.res Binary files differindex 9dd3df2de3..9dd3df2de3 100755..100644 --- a/ext/intl/tests/_files/resourcebundle/res_index.res +++ b/ext/intl/tests/_files/resourcebundle/res_index.res diff --git a/ext/intl/tests/_files/resourcebundle/root.res b/ext/intl/tests/_files/resourcebundle/root.res Binary files differindex 62cb48c457..62cb48c457 100755..100644 --- a/ext/intl/tests/_files/resourcebundle/root.res +++ b/ext/intl/tests/_files/resourcebundle/root.res diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt index 9232bbf0c1..9232bbf0c1 100755..100644 --- a/ext/intl/tests/badargs.phpt +++ b/ext/intl/tests/badargs.phpt diff --git a/ext/intl/tests/bug12887.phpt b/ext/intl/tests/bug12887.phpt index e2fc194944..e2fc194944 100755..100644 --- a/ext/intl/tests/bug12887.phpt +++ b/ext/intl/tests/bug12887.phpt diff --git a/ext/intl/tests/bug14562.phpt b/ext/intl/tests/bug14562.phpt index 3256268405..3256268405 100755..100644 --- a/ext/intl/tests/bug14562.phpt +++ b/ext/intl/tests/bug14562.phpt diff --git a/ext/intl/tests/bug59597_64.phpt b/ext/intl/tests/bug59597_64.phpt index f96c72da54..eb70995a25 100644 --- a/ext/intl/tests/bug59597_64.phpt +++ b/ext/intl/tests/bug59597_64.phpt @@ -18,4 +18,3 @@ var_dump($value); --EXPECT-- int(2147483647) int(2147483650) - diff --git a/ext/intl/tests/bug62070.phpt b/ext/intl/tests/bug62070.phpt index a466b05c24..3ab0078d70 100644 --- a/ext/intl/tests/bug62070.phpt +++ b/ext/intl/tests/bug62070.phpt @@ -4,6 +4,8 @@ Bug #62070: Collator::getSortKey() returns garbage <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '49') < 0) + die('skip ICU >= 49 only'); --FILE-- <?php $s1 = 'Hello'; diff --git a/ext/intl/tests/bug62915-2.phpt b/ext/intl/tests/bug62915-2.phpt new file mode 100644 index 0000000000..bcb069cab6 --- /dev/null +++ b/ext/intl/tests/bug62915-2.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #62915: cloning of several classes is defective +--SKIPIF-- +<?php +if (!extension_loaded('intl')) + die('skip intl extension not enabled'); +--FILE-- +<?php +class A extends IntlDateFormatter { + static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, + 'America/Los_Angeles', IntlDateFormatter::GREGORIAN); +} +class B extends NumberFormatter { + static $ARGS = array('de_DE', NumberFormatter::DECIMAL); +} +class C extends MessageFormatter { + static $ARGS = array("en_US", "foo"); +} +class D extends Spoofchecker { + static $ARGS = array(); +} + +foreach (range('A', 'D') as $subclass) { + $rc = new ReflectionClass($subclass); + $obj = $rc->newInstanceArgs($subclass::$ARGS); + $clone = clone $obj; + var_dump(get_class($clone)); +} +--EXPECT-- +string(1) "A" +string(1) "B" +string(1) "C" +string(1) "D" diff --git a/ext/intl/tests/collation_customization.phpt b/ext/intl/tests/collation_customization.phpt index e380380639..e380380639 100755..100644 --- a/ext/intl/tests/collation_customization.phpt +++ b/ext/intl/tests/collation_customization.phpt diff --git a/ext/intl/tests/collator_asort.phpt b/ext/intl/tests/collator_asort.phpt index a614ddc3f8..a614ddc3f8 100755..100644 --- a/ext/intl/tests/collator_asort.phpt +++ b/ext/intl/tests/collator_asort.phpt diff --git a/ext/intl/tests/collator_compare.phpt b/ext/intl/tests/collator_compare.phpt index f10b5708f4..f10b5708f4 100755..100644 --- a/ext/intl/tests/collator_compare.phpt +++ b/ext/intl/tests/collator_compare.phpt diff --git a/ext/intl/tests/collator_create.phpt b/ext/intl/tests/collator_create.phpt index eed8cf1b23..eed8cf1b23 100755..100644 --- a/ext/intl/tests/collator_create.phpt +++ b/ext/intl/tests/collator_create.phpt diff --git a/ext/intl/tests/collator_get_error_code.phpt b/ext/intl/tests/collator_get_error_code.phpt index 45a8e710f4..45a8e710f4 100755..100644 --- a/ext/intl/tests/collator_get_error_code.phpt +++ b/ext/intl/tests/collator_get_error_code.phpt diff --git a/ext/intl/tests/collator_get_error_message.phpt b/ext/intl/tests/collator_get_error_message.phpt index af4b9c3821..af4b9c3821 100755..100644 --- a/ext/intl/tests/collator_get_error_message.phpt +++ b/ext/intl/tests/collator_get_error_message.phpt diff --git a/ext/intl/tests/collator_get_locale.phpt b/ext/intl/tests/collator_get_locale.phpt index 68440f3ee7..68440f3ee7 100755..100644 --- a/ext/intl/tests/collator_get_locale.phpt +++ b/ext/intl/tests/collator_get_locale.phpt diff --git a/ext/intl/tests/collator_get_set_attribute.phpt b/ext/intl/tests/collator_get_set_attribute.phpt index b234790f81..b234790f81 100755..100644 --- a/ext/intl/tests/collator_get_set_attribute.phpt +++ b/ext/intl/tests/collator_get_set_attribute.phpt diff --git a/ext/intl/tests/collator_get_set_strength.phpt b/ext/intl/tests/collator_get_set_strength.phpt index 1f779441fa..1f779441fa 100755..100644 --- a/ext/intl/tests/collator_get_set_strength.phpt +++ b/ext/intl/tests/collator_get_set_strength.phpt diff --git a/ext/intl/tests/collator_get_sort_key.phpt b/ext/intl/tests/collator_get_sort_key.phpt index 0fedde0fff..a9c4d71348 100755..100644 --- a/ext/intl/tests/collator_get_sort_key.phpt +++ b/ext/intl/tests/collator_get_sort_key.phpt @@ -2,8 +2,7 @@ collator_get_sort_key() --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---XFAIL-- -Sort keys are not fixed, comparing them to fixed strings doesn't work. +<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?> --FILE-- <?php @@ -18,8 +17,8 @@ function sort_arrays( $locale, $data ) foreach($data as $value) { $res_val = ut_coll_get_sort_key( $coll, $value ); - $res_str .= "source: ".urlencode($value)."\n". - "key: ".urlencode($res_val)."\n"; + $res_str .= "source: ".$value."\n". + "key: ".bin2hex($res_val)."\n"; } return $res_str; @@ -58,42 +57,42 @@ ut_run(); ?> --EXPECT-- source: abc -key: %29%2B-%01%07%01%07%00 +key: 27292b01070107 source: abd -key: %29%2B%2F%01%07%01%07%00 +key: 27292d01070107 source: aaa -key: %29%29%29%01%07%01%07%00 -source: %D0%B0%D0%B0 -key: _++%01%06%01%06%00 -source: %D0%B0 -key: _+%01%05%01%05%00 +key: 27272701070107 +source: аа +key: 5c0a0a01060106 +source: а +key: 5c0a01050105 source: z -key: %5B%01%05%01%05%00 -source: -key: %01%01%00 -source: -key: %01%01%00 +key: 5901050105 +source: +key: 0101 +source: +key: 0101 source: 3 -key: %26%80%01%05%01%05%00 +key: 1801050105 source: y -key: Y%01%05%01%05%00 +key: 5701050105 source: i -key: 9%01%05%01%05%00 +key: 3701050105 source: k -key: %3D%01%05%01%05%00 -source: %D0%B0%D0%B1%D0%B3 -key: _+%2C0%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B2 -key: _+%2C.%01%07%01%07%00 -source: %D0%B6%D0%B6%D0%B6 -key: _LLL%01%07%01%07%00 -source: %D1%8D%D1%8E%D1%8F -key: %60%05%09%0B%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B3 -key: _+%2C0%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B2 -key: _+%2C.%01%07%01%07%00 -source: %D0%B6%D0%B6%D0%B6 -key: _LLL%01%07%01%07%00 -source: %D1%8D%D1%8E%D1%8F -key: %60%05%09%0B%01%07%01%07%00
\ No newline at end of file +key: 3b01050105 +source: абг +key: 5c0a161a01070107 +source: абв +key: 5c0a161801070107 +source: жжж +key: 5c3a3a3a01070107 +source: ÑÑŽÑ +key: 5d3b3f4501070107 +source: абг +key: 5c0a161a01070107 +source: абв +key: 5c0a161801070107 +source: жжж +key: 5c3a3a3a01070107 +source: ÑÑŽÑ +key: 5d3b3f4501070107
\ No newline at end of file diff --git a/ext/intl/tests/collator_sort.phpt b/ext/intl/tests/collator_sort.phpt index 5cefe2fd7c..5cefe2fd7c 100755..100644 --- a/ext/intl/tests/collator_sort.phpt +++ b/ext/intl/tests/collator_sort.phpt diff --git a/ext/intl/tests/collator_sort_with_sort_keys.phpt b/ext/intl/tests/collator_sort_with_sort_keys.phpt index 2f489d745c..2f489d745c 100755..100644 --- a/ext/intl/tests/collator_sort_with_sort_keys.phpt +++ b/ext/intl/tests/collator_sort_with_sort_keys.phpt diff --git a/ext/intl/tests/dateformat_clone_bad_obj.phpt b/ext/intl/tests/dateformat_clone_bad_obj.phpt new file mode 100644 index 0000000000..5e12b96ae8 --- /dev/null +++ b/ext/intl/tests/dateformat_clone_bad_obj.phpt @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed IntlDateFormatter +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + +class A extends IntlDateFormatter { + function __construct() {} +} + +$a = new A; +try { + $b = clone $a; +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +--EXPECTF-- +string(%s) "Cannot clone unconstructed IntlDateFormatter" diff --git a/ext/intl/tests/dateformat_format.phpt b/ext/intl/tests/dateformat_format.phpt index e5548196d1..e5548196d1 100755..100644 --- a/ext/intl/tests/dateformat_format.phpt +++ b/ext/intl/tests/dateformat_format.phpt diff --git a/ext/intl/tests/dateformat_format_parse.phpt b/ext/intl/tests/dateformat_format_parse.phpt index bd41d715b9..bd41d715b9 100755..100644 --- a/ext/intl/tests/dateformat_format_parse.phpt +++ b/ext/intl/tests/dateformat_format_parse.phpt diff --git a/ext/intl/tests/dateformat_get_datetype.phpt b/ext/intl/tests/dateformat_get_datetype.phpt index 24d03898ea..24d03898ea 100755..100644 --- a/ext/intl/tests/dateformat_get_datetype.phpt +++ b/ext/intl/tests/dateformat_get_datetype.phpt diff --git a/ext/intl/tests/dateformat_get_locale.phpt b/ext/intl/tests/dateformat_get_locale.phpt index 17fcca3551..17fcca3551 100755..100644 --- a/ext/intl/tests/dateformat_get_locale.phpt +++ b/ext/intl/tests/dateformat_get_locale.phpt diff --git a/ext/intl/tests/dateformat_get_set_calendar.phpt b/ext/intl/tests/dateformat_get_set_calendar.phpt index bfd4e578e1..bfd4e578e1 100755..100644 --- a/ext/intl/tests/dateformat_get_set_calendar.phpt +++ b/ext/intl/tests/dateformat_get_set_calendar.phpt diff --git a/ext/intl/tests/dateformat_get_set_pattern.phpt b/ext/intl/tests/dateformat_get_set_pattern.phpt index bd541c1c93..bd541c1c93 100755..100644 --- a/ext/intl/tests/dateformat_get_set_pattern.phpt +++ b/ext/intl/tests/dateformat_get_set_pattern.phpt diff --git a/ext/intl/tests/dateformat_get_timetype.phpt b/ext/intl/tests/dateformat_get_timetype.phpt index 2ddc1172b1..2ddc1172b1 100755..100644 --- a/ext/intl/tests/dateformat_get_timetype.phpt +++ b/ext/intl/tests/dateformat_get_timetype.phpt diff --git a/ext/intl/tests/dateformat_get_timezone_id.phpt b/ext/intl/tests/dateformat_get_timezone_id.phpt index 80cbdbbf0f..80cbdbbf0f 100755..100644 --- a/ext/intl/tests/dateformat_get_timezone_id.phpt +++ b/ext/intl/tests/dateformat_get_timezone_id.phpt diff --git a/ext/intl/tests/dateformat_is_set_lenient.phpt b/ext/intl/tests/dateformat_is_set_lenient.phpt index 8492a2e2a8..8492a2e2a8 100755..100644 --- a/ext/intl/tests/dateformat_is_set_lenient.phpt +++ b/ext/intl/tests/dateformat_is_set_lenient.phpt diff --git a/ext/intl/tests/dateformat_localtime.phpt b/ext/intl/tests/dateformat_localtime.phpt index 79f297db74..79f297db74 100755..100644 --- a/ext/intl/tests/dateformat_localtime.phpt +++ b/ext/intl/tests/dateformat_localtime.phpt diff --git a/ext/intl/tests/dateformat_parse.phpt b/ext/intl/tests/dateformat_parse.phpt index ff59773488..ff59773488 100755..100644 --- a/ext/intl/tests/dateformat_parse.phpt +++ b/ext/intl/tests/dateformat_parse.phpt diff --git a/ext/intl/tests/dateformat_parse_localtime_parsepos.phpt b/ext/intl/tests/dateformat_parse_localtime_parsepos.phpt index 03f99f1d92..03f99f1d92 100755..100644 --- a/ext/intl/tests/dateformat_parse_localtime_parsepos.phpt +++ b/ext/intl/tests/dateformat_parse_localtime_parsepos.phpt diff --git a/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt b/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt index 0f26643163..0f26643163 100755..100644 --- a/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt +++ b/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt diff --git a/ext/intl/tests/dateformat_set_timezone_id.phpt b/ext/intl/tests/dateformat_set_timezone_id.phpt index 72a9230bdf..72a9230bdf 100755..100644 --- a/ext/intl/tests/dateformat_set_timezone_id.phpt +++ b/ext/intl/tests/dateformat_set_timezone_id.phpt diff --git a/ext/intl/tests/formatter_clone_bad_obj.phpt b/ext/intl/tests/formatter_clone_bad_obj.phpt new file mode 100644 index 0000000000..ef7b28a546 --- /dev/null +++ b/ext/intl/tests/formatter_clone_bad_obj.phpt @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed numfmt +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + +class A extends NumberFormatter { + function __construct() {} +} + +$a = new A; +try { + $b = clone $a; +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +--EXPECTF-- +string(42) "Cannot clone unconstructed NumberFormatter" diff --git a/ext/intl/tests/formatter_fail.phpt b/ext/intl/tests/formatter_fail.phpt index 295f011008..295f011008 100755..100644 --- a/ext/intl/tests/formatter_fail.phpt +++ b/ext/intl/tests/formatter_fail.phpt diff --git a/ext/intl/tests/formatter_format.phpt b/ext/intl/tests/formatter_format.phpt index 334ef49567..334ef49567 100755..100644 --- a/ext/intl/tests/formatter_format.phpt +++ b/ext/intl/tests/formatter_format.phpt diff --git a/ext/intl/tests/formatter_format_conv.phpt b/ext/intl/tests/formatter_format_conv.phpt index e1d25ef3d9..e1d25ef3d9 100755..100644 --- a/ext/intl/tests/formatter_format_conv.phpt +++ b/ext/intl/tests/formatter_format_conv.phpt diff --git a/ext/intl/tests/formatter_format_currency.phpt b/ext/intl/tests/formatter_format_currency.phpt index be219a5baa..be219a5baa 100755..100644 --- a/ext/intl/tests/formatter_format_currency.phpt +++ b/ext/intl/tests/formatter_format_currency.phpt diff --git a/ext/intl/tests/formatter_get_error.phpt b/ext/intl/tests/formatter_get_error.phpt index c7b3972709..acb683e894 100755..100644 --- a/ext/intl/tests/formatter_get_error.phpt +++ b/ext/intl/tests/formatter_get_error.phpt @@ -19,7 +19,7 @@ function ut_main() if( $num === false ) return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; else - return "Ooops, an error should have occured."; + return "Ooops, an error should have occurred."; } include_once( 'ut_common.inc' ); diff --git a/ext/intl/tests/formatter_get_locale.phpt b/ext/intl/tests/formatter_get_locale.phpt index 3d4fb2ae4e..3d4fb2ae4e 100755..100644 --- a/ext/intl/tests/formatter_get_locale.phpt +++ b/ext/intl/tests/formatter_get_locale.phpt diff --git a/ext/intl/tests/formatter_get_set_attribute.phpt b/ext/intl/tests/formatter_get_set_attribute.phpt index cb5e415755..51c7d3658a 100755..100644 --- a/ext/intl/tests/formatter_get_set_attribute.phpt +++ b/ext/intl/tests/formatter_get_set_attribute.phpt @@ -1,8 +1,8 @@ --TEST-- -numfmt_get/set_attribute() icu < 4.2 +numfmt_get/set_attribute() --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> -<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip'; ?> +<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip for ICU 4.4+'; ?> --FILE-- <?php @@ -29,7 +29,7 @@ function ut_main() 'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ), 'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ), 'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ), - 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ), + 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ), 'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ), 'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ), 'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ), @@ -159,7 +159,7 @@ Setting attribute: ok New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345 Attribute ROUNDING_INCREMENT -Old attribute value: 1.0E-5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 +Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 Setting attribute: ok New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346 @@ -171,7 +171,7 @@ New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse Attribute PADDING_POSITION Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 Setting attribute: ok -New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 +New attribute value: 2 ; Format result: '0,012,345.12346************' ; Parse result: 12345.12346 Attribute SECONDARY_GROUPING_SIZE Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 diff --git a/ext/intl/tests/formatter_get_set_attribute2.phpt b/ext/intl/tests/formatter_get_set_attribute2.phpt deleted file mode 100644 index 7d5fe69dca..0000000000 --- a/ext/intl/tests/formatter_get_set_attribute2.phpt +++ /dev/null @@ -1,194 +0,0 @@ ---TEST-- -numfmt_get/set_attribute() icu >= 4.8 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> -<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?> ---FILE-- -<?php - -/* - * Get/set various number formatting attributes. - */ - - -function ut_main() -{ - // attr_name => array( attr, value ) - $attributes = array( - 'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ), - 'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ), - 'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ), - 'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ), - 'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ), - 'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ), - 'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ), - 'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ), - 'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ), - 'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ), - 'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ), - 'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ), - 'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ), - 'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ), - 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ), - 'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ), - 'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ), - 'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ), - 'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ), - // 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 ) - ); - - $res_str = ''; - - $fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL ); - - foreach( $attributes as $attr_name => $args ) - { - list( $attr, $new_val, $number ) = $args; - $res_str .= "\nAttribute $attr_name\n"; - - // Get original value of the attribute. - $orig_val = ut_nfmt_get_attribute( $fmt, $attr ); - - // Format the number using the original attribute value. - $rc = ut_nfmt_format( $fmt, $number ); - - $ps = ut_nfmt_parse( $fmt, $rc ); - - $res_str .= sprintf( "Old attribute value: %s ; Format result: %s ; Parse result: %s\n", - dump( $orig_val ), - dump( $rc ), - dump( $ps ) ); - - // Set new attribute value. - $rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val ); - if( $rc ) - $res_str .= "Setting attribute: ok\n"; - else - $res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) ); - - // Format the number using the new value. - $rc = ut_nfmt_format( $fmt, $number ); - - // Get current value of the attribute and check if it equals $new_val. - $attr_val_check = ut_nfmt_get_attribute( $fmt, $attr ); - if( $attr_val_check !== $new_val ) - $res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n"; - - $ps = ut_nfmt_parse( $fmt, $rc ); - - $res_str .= sprintf( "New attribute value: %s ; Format result: %s ; Parse result: %s\n", - dump( $new_val ), - dump( $rc ), - dump( $ps ) ); - - - // Restore original attribute of the value - if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS - && $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED ) - ut_nfmt_set_attribute( $fmt, $attr, $orig_val ); - } - - return $res_str; -} - -include_once( 'ut_common.inc' ); - -// Run the test -ut_run(); - -?> ---EXPECT-- -Attribute PARSE_INT_ONLY -Old attribute value: 0 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345 - -Attribute GROUPING_USED -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 0 ; Format result: '12345.123' ; Parse result: 12345.123 - -Attribute DECIMAL_ALWAYS_SHOWN -Old attribute value: 0 ; Format result: '12,345' ; Parse result: 12345 -Setting attribute: ok -New attribute value: 1 ; Format result: '12,345.' ; Parse result: 12345 - -Attribute MAX_INTEGER_DIGITS -Old attribute value: 309 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 2 ; Format result: '45.123' ; Parse result: 45.123 - -Attribute MIN_INTEGER_DIGITS -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 20 ; Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123 - -Attribute INTEGER_DIGITS -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 7 ; Format result: '0,012,345.123' ; Parse result: 12345.123 - -Attribute MAX_FRACTION_DIGITS -Old attribute value: 3 ; Format result: '0,012,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,012,345.12' ; Parse result: 12345.12 - -Attribute MIN_FRACTION_DIGITS -Old attribute value: 0 ; Format result: '0,012,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 20 ; Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456 - -Attribute FRACTION_DIGITS -Old attribute value: 0 ; Format result: '0,012,345.123456' ; Parse result: 12345.123456 -Setting attribute: ok -New attribute value: 5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 - -Attribute MULTIPLIER -Old attribute value: 1 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,024,690.24691' ; Parse result: 12345.123455 - -Attribute GROUPING_SIZE -Old attribute value: 3 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,01,23,45.12346' ; Parse result: 12345.12346 - -Attribute ROUNDING_MODE -Old attribute value: 4 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345 - -Attribute ROUNDING_INCREMENT -Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346 - -Attribute FORMAT_WIDTH -Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 - -Attribute PADDING_POSITION -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 - -Attribute SECONDARY_GROUPING_SIZE -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '************00,12,345.12346' ; Parse result: 12345.12346 - -Attribute SIGNIFICANT_DIGITS_USED -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 1 ; Format result: '*******************12,345.1' ; Parse result: 12345.1 - -Attribute MIN_SIGNIFICANT_DIGITS -Old attribute value: 1 ; Format result: '**************************1' ; Parse result: 1 -Setting attribute: ok -New attribute value: 3 ; Format result: '***********************1.00' ; Parse result: 1 - -Attribute MAX_SIGNIFICANT_DIGITS -Old attribute value: 6 ; Format result: '*******************12,345.1' ; Parse result: 12345.1 -Setting attribute: ok -New attribute value: 4 ; Format result: '*********************12,350' ; Parse result: 12350 diff --git a/ext/intl/tests/formatter_get_set_pattern.phpt b/ext/intl/tests/formatter_get_set_pattern.phpt index 0ae5b308b2..0ae5b308b2 100755..100644 --- a/ext/intl/tests/formatter_get_set_pattern.phpt +++ b/ext/intl/tests/formatter_get_set_pattern.phpt diff --git a/ext/intl/tests/formatter_get_set_symbol.phpt b/ext/intl/tests/formatter_get_set_symbol.phpt index 050e8cf9e1..050e8cf9e1 100755..100644 --- a/ext/intl/tests/formatter_get_set_symbol.phpt +++ b/ext/intl/tests/formatter_get_set_symbol.phpt diff --git a/ext/intl/tests/formatter_get_set_text_attribute.phpt b/ext/intl/tests/formatter_get_set_text_attribute.phpt index 539ff52322..539ff52322 100755..100644 --- a/ext/intl/tests/formatter_get_set_text_attribute.phpt +++ b/ext/intl/tests/formatter_get_set_text_attribute.phpt diff --git a/ext/intl/tests/formatter_parse.phpt b/ext/intl/tests/formatter_parse.phpt index 2ab9cce3b6..2ab9cce3b6 100755..100644 --- a/ext/intl/tests/formatter_parse.phpt +++ b/ext/intl/tests/formatter_parse.phpt diff --git a/ext/intl/tests/formatter_parse_currency.phpt b/ext/intl/tests/formatter_parse_currency.phpt index 4ebd1a4174..4ebd1a4174 100755..100644 --- a/ext/intl/tests/formatter_parse_currency.phpt +++ b/ext/intl/tests/formatter_parse_currency.phpt diff --git a/ext/intl/tests/grapheme.phpt b/ext/intl/tests/grapheme.phpt index def9110d0d..def9110d0d 100755..100644 --- a/ext/intl/tests/grapheme.phpt +++ b/ext/intl/tests/grapheme.phpt diff --git a/ext/intl/tests/idn.phpt b/ext/intl/tests/idn.phpt index fde822a560..fde822a560 100755..100644 --- a/ext/intl/tests/idn.phpt +++ b/ext/intl/tests/idn.phpt diff --git a/ext/intl/tests/intl_error_name.phpt b/ext/intl/tests/intl_error_name.phpt index 8f5b2dc198..8f5b2dc198 100755..100644 --- a/ext/intl/tests/intl_error_name.phpt +++ b/ext/intl/tests/intl_error_name.phpt diff --git a/ext/intl/tests/intl_get_error_code.phpt b/ext/intl/tests/intl_get_error_code.phpt index 6cd361ba71..6cd361ba71 100755..100644 --- a/ext/intl/tests/intl_get_error_code.phpt +++ b/ext/intl/tests/intl_get_error_code.phpt diff --git a/ext/intl/tests/intl_get_error_message.phpt b/ext/intl/tests/intl_get_error_message.phpt index f81b5c03d5..f81b5c03d5 100755..100644 --- a/ext/intl/tests/intl_get_error_message.phpt +++ b/ext/intl/tests/intl_get_error_message.phpt diff --git a/ext/intl/tests/intl_is_failure.phpt b/ext/intl/tests/intl_is_failure.phpt index e07df8f2c9..e07df8f2c9 100755..100644 --- a/ext/intl/tests/intl_is_failure.phpt +++ b/ext/intl/tests/intl_is_failure.phpt diff --git a/ext/intl/tests/locale_accept.phpt b/ext/intl/tests/locale_accept.phpt index cf1dc6e675..cf1dc6e675 100755..100644 --- a/ext/intl/tests/locale_accept.phpt +++ b/ext/intl/tests/locale_accept.phpt diff --git a/ext/intl/tests/locale_compose_locale.phpt b/ext/intl/tests/locale_compose_locale.phpt index 2d0ca54e74..2d0ca54e74 100755..100644 --- a/ext/intl/tests/locale_compose_locale.phpt +++ b/ext/intl/tests/locale_compose_locale.phpt diff --git a/ext/intl/tests/locale_filter_matches.phpt b/ext/intl/tests/locale_filter_matches.phpt index cada499b9a..cada499b9a 100755..100644 --- a/ext/intl/tests/locale_filter_matches.phpt +++ b/ext/intl/tests/locale_filter_matches.phpt diff --git a/ext/intl/tests/locale_get_all_variants.phpt b/ext/intl/tests/locale_get_all_variants.phpt index 864b8a2e1a..864b8a2e1a 100755..100644 --- a/ext/intl/tests/locale_get_all_variants.phpt +++ b/ext/intl/tests/locale_get_all_variants.phpt diff --git a/ext/intl/tests/locale_get_default.phpt b/ext/intl/tests/locale_get_default.phpt index 57c46ccd2b..57c46ccd2b 100755..100644 --- a/ext/intl/tests/locale_get_default.phpt +++ b/ext/intl/tests/locale_get_default.phpt diff --git a/ext/intl/tests/locale_get_display_language.phpt b/ext/intl/tests/locale_get_display_language.phpt index 2e00056284..2e00056284 100755..100644 --- a/ext/intl/tests/locale_get_display_language.phpt +++ b/ext/intl/tests/locale_get_display_language.phpt diff --git a/ext/intl/tests/locale_get_display_name.phpt b/ext/intl/tests/locale_get_display_name.phpt index b128734277..b128734277 100755..100644 --- a/ext/intl/tests/locale_get_display_name.phpt +++ b/ext/intl/tests/locale_get_display_name.phpt diff --git a/ext/intl/tests/locale_get_display_region.phpt b/ext/intl/tests/locale_get_display_region.phpt index 9a6e75d94a..9a6e75d94a 100755..100644 --- a/ext/intl/tests/locale_get_display_region.phpt +++ b/ext/intl/tests/locale_get_display_region.phpt diff --git a/ext/intl/tests/locale_get_display_script.phpt b/ext/intl/tests/locale_get_display_script.phpt index 0440dfb204..0440dfb204 100755..100644 --- a/ext/intl/tests/locale_get_display_script.phpt +++ b/ext/intl/tests/locale_get_display_script.phpt diff --git a/ext/intl/tests/locale_get_display_script2.phpt b/ext/intl/tests/locale_get_display_script2.phpt index 92652bde90..2b9e037b78 100644 --- a/ext/intl/tests/locale_get_display_script2.phpt +++ b/ext/intl/tests/locale_get_display_script2.phpt @@ -1,8 +1,8 @@ --TEST-- -locale_get_display_script() icu >= 4.8 +locale_get_display_script() icu = 4.8 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> -<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?> +<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0 || version_compare(INTL_ICU_VERSION, '49') >= 0) print 'skip'; ?> --FILE-- <?php diff --git a/ext/intl/tests/locale_get_display_script3.phpt b/ext/intl/tests/locale_get_display_script3.phpt new file mode 100644 index 0000000000..447766e6bd --- /dev/null +++ b/ext/intl/tests/locale_get_display_script3.phpt @@ -0,0 +1,275 @@ +--TEST-- +locale_get_display_script() icu >= 49 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if(version_compare(INTL_ICU_VERSION, '49') < 0) print 'skip'; ?> +--FILE-- +<?php + +/* + * Try getting the display_script for different locales + * with Procedural and Object methods. + */ + +function ut_main() +{ + $res_str = ''; + + $disp_locales=array('en','fr','de'); + + $locales = array( + 'uk-ua_CALIFORNIA@currency=;currency=GRN', + 'root', + 'uk@currency=EURO', + 'Hindi', +//Simple language subtag + 'de', + 'fr', + 'ja', + 'i-enochian', //(example of a grandfathered tag) +//Language subtag plus Script subtag: + 'zh-Hant', + 'zh-Hans', + 'sr-Cyrl', + 'sr-Latn', +//Language-Script-Region + 'zh-Hans-CN', + 'sr-Latn-CS', +//Language-Variant + 'sl-rozaj', + 'sl-nedis', +//Language-Region-Variant + 'de-CH-1901', + 'sl-IT-nedis', +//Language-Script-Region-Variant + 'sl-Latn-IT-nedis', +//Language-Region: + 'de-DE', + 'en-US', + 'es-419', +//Private use subtags: + 'de-CH-x-phonebk', + 'az-Arab-x-AZE-derbend', +//Extended language subtags + 'zh-min', + 'zh-min-nan-Hant-CN', +//Private use registry values + 'x-whatever', + 'qaa-Qaaa-QM-x-southern', + 'sr-Latn-QM', + 'sr-Qaaa-CS', +/*Tags that use extensions (examples ONLY: extensions MUST be defined + by revision or update to this document or by RFC): */ + 'en-US-u-islamCal', + 'zh-CN-a-myExt-x-private', + 'en-a-myExt-b-another', +//Some Invalid Tags: + 'de-419-DE', + 'a-DE', + 'ar-a-aaa-b-bbb-a-ccc' + ); + + + $res_str = ''; + + foreach( $locales as $locale ) + { + $res_str .= "locale='$locale'\n"; + foreach( $disp_locales as $disp_locale ) + { + $scr = ut_loc_get_display_script( $locale ,$disp_locale ); + $res_str .= "disp_locale=$disp_locale : display_script=$scr"; + $res_str .= "\n"; + } + $res_str .= "-----------------\n"; + } + + return $res_str; + +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECT-- +locale='uk-ua_CALIFORNIA@currency=;currency=GRN' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='root' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='uk@currency=EURO' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='Hindi' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='fr' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='ja' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='i-enochian' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-Hant' +disp_locale=en : display_script=Traditional Han +disp_locale=fr : display_script=chinois traditionnel +disp_locale=de : display_script=Traditionelles Chinesisch +----------------- +locale='zh-Hans' +disp_locale=en : display_script=Simplified Han +disp_locale=fr : display_script=chinois simplifié +disp_locale=de : display_script=Vereinfachtes Chinesisch +----------------- +locale='sr-Cyrl' +disp_locale=en : display_script=Cyrillic +disp_locale=fr : display_script=cyrillique +disp_locale=de : display_script=Kyrillisch +----------------- +locale='sr-Latn' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='zh-Hans-CN' +disp_locale=en : display_script=Simplified Han +disp_locale=fr : display_script=chinois simplifié +disp_locale=de : display_script=Vereinfachtes Chinesisch +----------------- +locale='sr-Latn-CS' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='sl-rozaj' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-nedis' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-CH-1901' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-IT-nedis' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-Latn-IT-nedis' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='de-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='en-US' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='es-419' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-CH-x-phonebk' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='az-Arab-x-AZE-derbend' +disp_locale=en : display_script=Arabic +disp_locale=fr : display_script=arabe +disp_locale=de : display_script=Arabisch +----------------- +locale='zh-min' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-min-nan-Hant-CN' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='x-whatever' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='qaa-Qaaa-QM-x-southern' +disp_locale=en : display_script=Qaaa +disp_locale=fr : display_script=Qaaa +disp_locale=de : display_script=Qaaa +----------------- +locale='sr-Latn-QM' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='sr-Qaaa-CS' +disp_locale=en : display_script=Qaaa +disp_locale=fr : display_script=Qaaa +disp_locale=de : display_script=Qaaa +----------------- +locale='en-US-u-islamCal' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-CN-a-myExt-x-private' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='en-a-myExt-b-another' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-419-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='a-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='ar-a-aaa-b-bbb-a-ccc' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- diff --git a/ext/intl/tests/locale_get_display_variant.phpt b/ext/intl/tests/locale_get_display_variant.phpt index 9f72ee0498..9f72ee0498 100755..100644 --- a/ext/intl/tests/locale_get_display_variant.phpt +++ b/ext/intl/tests/locale_get_display_variant.phpt diff --git a/ext/intl/tests/locale_get_keywords.phpt b/ext/intl/tests/locale_get_keywords.phpt index 4a09f54d36..4a09f54d36 100755..100644 --- a/ext/intl/tests/locale_get_keywords.phpt +++ b/ext/intl/tests/locale_get_keywords.phpt diff --git a/ext/intl/tests/locale_get_primary_language.phpt b/ext/intl/tests/locale_get_primary_language.phpt index bc92e9266c..bc92e9266c 100755..100644 --- a/ext/intl/tests/locale_get_primary_language.phpt +++ b/ext/intl/tests/locale_get_primary_language.phpt diff --git a/ext/intl/tests/locale_get_region.phpt b/ext/intl/tests/locale_get_region.phpt index 0baae49932..0baae49932 100755..100644 --- a/ext/intl/tests/locale_get_region.phpt +++ b/ext/intl/tests/locale_get_region.phpt diff --git a/ext/intl/tests/locale_get_script.phpt b/ext/intl/tests/locale_get_script.phpt index 6a794fdb12..6a794fdb12 100755..100644 --- a/ext/intl/tests/locale_get_script.phpt +++ b/ext/intl/tests/locale_get_script.phpt diff --git a/ext/intl/tests/locale_lookup.phpt b/ext/intl/tests/locale_lookup.phpt index f0affafa6f..f0affafa6f 100755..100644 --- a/ext/intl/tests/locale_lookup.phpt +++ b/ext/intl/tests/locale_lookup.phpt diff --git a/ext/intl/tests/locale_parse_locale.phpt b/ext/intl/tests/locale_parse_locale.phpt index c8aa2f4123..c8aa2f4123 100755..100644 --- a/ext/intl/tests/locale_parse_locale.phpt +++ b/ext/intl/tests/locale_parse_locale.phpt diff --git a/ext/intl/tests/locale_set_default.phpt b/ext/intl/tests/locale_set_default.phpt index 7debf4d3de..7debf4d3de 100755..100644 --- a/ext/intl/tests/locale_set_default.phpt +++ b/ext/intl/tests/locale_set_default.phpt diff --git a/ext/intl/tests/msgfmt_clone_bad_obj.phpt b/ext/intl/tests/msgfmt_clone_bad_obj.phpt new file mode 100644 index 0000000000..48321094d1 --- /dev/null +++ b/ext/intl/tests/msgfmt_clone_bad_obj.phpt @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed MessageFormatter +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + +class A extends MessageFormatter { + function __construct() {} +} + +$a = new A; +try { + $b = clone $a; +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +--EXPECTF-- +string(%d) "Cannot clone unconstructed MessageFormatter" diff --git a/ext/intl/tests/msgfmt_fail.phpt b/ext/intl/tests/msgfmt_fail.phpt index bffb71c56d..bffb71c56d 100755..100644 --- a/ext/intl/tests/msgfmt_fail.phpt +++ b/ext/intl/tests/msgfmt_fail.phpt diff --git a/ext/intl/tests/msgfmt_format.phpt b/ext/intl/tests/msgfmt_format.phpt index c1bf5e9db6..c1bf5e9db6 100755..100644 --- a/ext/intl/tests/msgfmt_format.phpt +++ b/ext/intl/tests/msgfmt_format.phpt diff --git a/ext/intl/tests/msgfmt_get_error.phpt b/ext/intl/tests/msgfmt_get_error.phpt index 015c50d465..015c50d465 100755..100644 --- a/ext/intl/tests/msgfmt_get_error.phpt +++ b/ext/intl/tests/msgfmt_get_error.phpt diff --git a/ext/intl/tests/msgfmt_get_locale.phpt b/ext/intl/tests/msgfmt_get_locale.phpt index 4c2651fe2b..4c2651fe2b 100755..100644 --- a/ext/intl/tests/msgfmt_get_locale.phpt +++ b/ext/intl/tests/msgfmt_get_locale.phpt diff --git a/ext/intl/tests/msgfmt_get_set_pattern.phpt b/ext/intl/tests/msgfmt_get_set_pattern.phpt index 67b1aca459..67b1aca459 100755..100644 --- a/ext/intl/tests/msgfmt_get_set_pattern.phpt +++ b/ext/intl/tests/msgfmt_get_set_pattern.phpt diff --git a/ext/intl/tests/msgfmt_parse.phpt b/ext/intl/tests/msgfmt_parse.phpt index b9ec36374b..b9ec36374b 100755..100644 --- a/ext/intl/tests/msgfmt_parse.phpt +++ b/ext/intl/tests/msgfmt_parse.phpt diff --git a/ext/intl/tests/normalizer_normalize.phpt b/ext/intl/tests/normalizer_normalize.phpt index 238b7423cf..238b7423cf 100755..100644 --- a/ext/intl/tests/normalizer_normalize.phpt +++ b/ext/intl/tests/normalizer_normalize.phpt diff --git a/ext/intl/tests/regression_sort_and_cow.phpt b/ext/intl/tests/regression_sort_and_cow.phpt index d7ff797705..d7ff797705 100755..100644 --- a/ext/intl/tests/regression_sort_and_cow.phpt +++ b/ext/intl/tests/regression_sort_and_cow.phpt diff --git a/ext/intl/tests/regression_sort_eq.phpt b/ext/intl/tests/regression_sort_eq.phpt index 8676c5c931..8676c5c931 100755..100644 --- a/ext/intl/tests/regression_sort_eq.phpt +++ b/ext/intl/tests/regression_sort_eq.phpt diff --git a/ext/intl/tests/regression_sortwsk_and_cow.phpt b/ext/intl/tests/regression_sortwsk_and_cow.phpt index a4953232ef..a4953232ef 100755..100644 --- a/ext/intl/tests/regression_sortwsk_and_cow.phpt +++ b/ext/intl/tests/regression_sortwsk_and_cow.phpt diff --git a/ext/intl/tests/regression_sortwsk_eq.phpt b/ext/intl/tests/regression_sortwsk_eq.phpt index 945bac300a..945bac300a 100755..100644 --- a/ext/intl/tests/regression_sortwsk_eq.phpt +++ b/ext/intl/tests/regression_sortwsk_eq.phpt diff --git a/ext/intl/tests/resourcebundle.build b/ext/intl/tests/resourcebundle.build index 6a7eeae5eb..6a7eeae5eb 100755..100644 --- a/ext/intl/tests/resourcebundle.build +++ b/ext/intl/tests/resourcebundle.build diff --git a/ext/intl/tests/resourcebundle_locales.phpt b/ext/intl/tests/resourcebundle_locales.phpt index e14a7e5aa1..e14a7e5aa1 100755..100644 --- a/ext/intl/tests/resourcebundle_locales.phpt +++ b/ext/intl/tests/resourcebundle_locales.phpt diff --git a/ext/intl/tests/resourcebundle_null_mandatory_args.phpt b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt index 8fde61bd21..17fab6d630 100644 --- a/ext/intl/tests/resourcebundle_null_mandatory_args.phpt +++ b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt @@ -1,11 +1,13 @@ --TEST-- -IntlCalendar::setTime() basic test +ResourceBundle constructor bundle accepts NULL for first two arguments --INI-- date.timezone=Atlantic/Azores --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '4.8') < 0) + die('skip ICU >= 4.8 only'); --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/spoofchecker_001.phpt b/ext/intl/tests/spoofchecker_001.phpt index 7904b3a4c0..7904b3a4c0 100755..100644 --- a/ext/intl/tests/spoofchecker_001.phpt +++ b/ext/intl/tests/spoofchecker_001.phpt diff --git a/ext/intl/tests/spoofchecker_002.phpt b/ext/intl/tests/spoofchecker_002.phpt index d570917350..d570917350 100755..100644 --- a/ext/intl/tests/spoofchecker_002.phpt +++ b/ext/intl/tests/spoofchecker_002.phpt diff --git a/ext/intl/tests/spoofchecker_003.phpt b/ext/intl/tests/spoofchecker_003.phpt index 0be9bfa409..0be9bfa409 100755..100644 --- a/ext/intl/tests/spoofchecker_003.phpt +++ b/ext/intl/tests/spoofchecker_003.phpt diff --git a/ext/intl/tests/spoofchecker_004.phpt b/ext/intl/tests/spoofchecker_004.phpt index b38c61d717..b38c61d717 100755..100644 --- a/ext/intl/tests/spoofchecker_004.phpt +++ b/ext/intl/tests/spoofchecker_004.phpt diff --git a/ext/intl/tests/symfony_format_type_double_intl1.phpt b/ext/intl/tests/symfony_format_type_double_intl1.phpt new file mode 100644 index 0000000000..13a7ad761f --- /dev/null +++ b/ext/intl/tests/symfony_format_type_double_intl1.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeDoubleIntl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_double_intl2.phpt b/ext/intl/tests/symfony_format_type_double_intl2.phpt new file mode 100644 index 0000000000..6bff7cc355 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_double_intl2.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #2 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:3:"1.1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeDoubleIntl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(3) "1.1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_double_intl3.phpt b/ext/intl/tests/symfony_format_type_double_intl3.phpt new file mode 100644 index 0000000000..3b0d576df7 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_double_intl3.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #3 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeDoubleIntl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_double_intl4.phpt b/ext/intl/tests/symfony_format_type_double_intl4.phpt new file mode 100644 index 0000000000..3476e10892 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_double_intl4.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #4 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.10";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeDoubleIntl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.10" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl1.phpt b/ext/intl/tests/symfony_format_type_int32_intl1.phpt new file mode 100644 index 0000000000..2867b35690 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl1.phpt @@ -0,0 +1,49 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + +// port of Symfony's Symfony\Component\Locale\Tests\Stub\StubNumberFormatterTest#testFormatTypeInt32Intl + + +// Crashes on Windows +// Windows note: the popup '...program has stopped working'(AEDebug Popup) +// doesn't always show if you're rapidly running this test repeatedly. +// regardless of that, the test always crashes every time. +// (it will show up the first time, or if you wait a while before running it again.) +// (the popup may also be disabled, which can be done with a registry setting.) +// you can confirm it crashed by checking the exit code OR +// the message this test prints at the very end (expected output for pass). +// +// Get Exit Code +// Linux: echo $? +// Windows: echo %ErrorLevel% + + + + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl2.phpt b/ext/intl/tests/symfony_format_type_int32_intl2.phpt new file mode 100644 index 0000000000..6a65a0a809 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl2.phpt @@ -0,0 +1,33 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #2 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + +// StubNumberFormatterTest#testFormatTypeInt32Intl is tested many times, each with different args. +// there are 7 sets of args that crash PHP (and other args that don't), each of those 7 is now a separate PHPT test +// to ensure that each of the 7 args are always tested. + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:1:"1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(1) "1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl3.phpt b/ext/intl/tests/symfony_format_type_int32_intl3.phpt new file mode 100644 index 0000000000..5e657db419 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl3.phpt @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #3 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:14:"-2,147,483,648";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(14) "-2,147,483,648" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl4.phpt b/ext/intl/tests/symfony_format_type_int32_intl4.phpt new file mode 100644 index 0000000000..54043d92e9 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl4.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #4 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl5.phpt b/ext/intl/tests/symfony_format_type_int32_intl5.phpt new file mode 100644 index 0000000000..d5f78d7119 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl5.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #5 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl6.phpt b/ext/intl/tests/symfony_format_type_int32_intl6.phpt new file mode 100644 index 0000000000..fa708799d1 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl6.phpt @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #6 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:21:"(SFD2,147,483,648.00)";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(21) "(SFD2,147,483,648.00)" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int32_intl7.phpt b/ext/intl/tests/symfony_format_type_int32_intl7.phpt new file mode 100644 index 0000000000..5bbe426677 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int32_intl7.phpt @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #7 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl +$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:19:"SFD2,147,483,647.00";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(19) "SFD2,147,483,647.00" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl1.phpt b/ext/intl/tests/symfony_format_type_int64_intl1.phpt new file mode 100644 index 0000000000..01f5820911 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl1.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +//$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl2.phpt b/ext/intl/tests/symfony_format_type_int64_intl2.phpt new file mode 100644 index 0000000000..13d1cdaee7 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl2.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #2 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:1:"1";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(1) "1" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl3.phpt b/ext/intl/tests/symfony_format_type_int64_intl3.phpt new file mode 100644 index 0000000000..a7c80b34c3 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl3.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #3 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:13:"2,147,483,648";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(13) "2,147,483,648" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl4.phpt b/ext/intl/tests/symfony_format_type_int64_intl4.phpt new file mode 100644 index 0000000000..f1a0801edf --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl4.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #4 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:14:"-2,147,483,649";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(14) "-2,147,483,649" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl5.phpt b/ext/intl/tests/symfony_format_type_int64_intl5.phpt new file mode 100644 index 0000000000..dad8735b89 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl5.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #5 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl6.phpt b/ext/intl/tests/symfony_format_type_int64_intl6.phpt new file mode 100644 index 0000000000..f038cbd0c3 --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl6.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #6 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl7.phpt b/ext/intl/tests/symfony_format_type_int64_intl7.phpt new file mode 100644 index 0000000000..9c8853cafc --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl7.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #7 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:19:"SFD2,147,483,648.00";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(19) "SFD2,147,483,648.00" +} +== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl8.phpt b/ext/intl/tests/symfony_format_type_int64_intl8.phpt new file mode 100644 index 0000000000..50524976ab --- /dev/null +++ b/ext/intl/tests/symfony_format_type_int64_intl8.phpt @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #8 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php + + +// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl +$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:21:"(SFD2,147,483,649.00)";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt64Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(21) "(SFD2,147,483,649.00)" +} +== didn't crash == diff --git a/ext/intl/tests/ut_common.inc b/ext/intl/tests/ut_common.inc index 09be22bf5a..09be22bf5a 100755..100644 --- a/ext/intl/tests/ut_common.inc +++ b/ext/intl/tests/ut_common.inc diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 8d4d0649e9..5ef80fb482 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -162,7 +162,7 @@ static zend_object_value Transliterator_clone_obj( zval *object TSRMLS_DC ) to_orig = zend_object_store_get_object( object TSRMLS_CC ); intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC ); - ret_val = Transliterator_ce_ptr->create_object( Transliterator_ce_ptr TSRMLS_CC ); + ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC ); to_new = zend_object_store_get_object_by_handle( ret_val.handle TSRMLS_CC ); zend_objects_clone_members( &to_new->zo, ret_val, diff --git a/ext/json/json.c b/ext/json/json.c index 557fbc3e0c..786b21ac91 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -302,7 +302,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); - + php_json_encode(buf, *data, options TSRMLS_CC); } else { if (need_comma) { @@ -320,7 +320,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); - + php_json_encode(buf, *data, options TSRMLS_CC); } } @@ -331,7 +331,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) } } } - + --JSON_G(encoder_depth); json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); @@ -351,6 +351,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR int pos = 0, ulen = 0; unsigned short us; unsigned short *utf16; + size_t newlen; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); @@ -378,9 +379,9 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR } return; } - + } - + utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0); ulen = utf8_to_utf16(utf16, s, len); if (ulen <= 0) { @@ -402,6 +403,8 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR len = ulen; } + /* pre-allocate for string length plus 2 quotes */ + smart_str_alloc(buf, len+2, 0); smart_str_appendc(buf, '"'); while (pos < len) @@ -514,13 +517,13 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio zend_class_entry *ce = Z_OBJCE_P(val); zval *retval = NULL, fname; HashTable* myht; - + if (Z_TYPE_P(val) == IS_ARRAY) { myht = HASH_OF(val); } else { myht = Z_OBJPROP_P(val); - } - + } + if (myht && myht->nApplyCount > 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); smart_str_appendl(buf, "null", 4); @@ -533,7 +536,7 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name); smart_str_appendl(buf, "null", sizeof("null") - 1); return; - } + } if (EG(exception)) { /* Error already raised */ diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index e42d845f90..a39c875b2c 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -677,9 +677,18 @@ is_string: static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL, const char *ID, xmlParserCtxtPtr context) { + TSRMLS_FETCH(); + /* Check whether we're running in a PHP context, since the entity loader - * we've defined is an application level (true global) setting */ - if (xmlGenericError == php_libxml_error_handler) { + * we've defined is an application level (true global) setting. + * If we are, we also want to check whether we've finished activating + * the modules (RINIT phase). Using our external entity loader during a + * RINIT should not be problem per se (though during MINIT it is, because + * we don't even have a resource list by then), but then whether one + * extension would be using the custom external entity loader or not + * could depend on extension loading order + * (if _php_libxml_per_request_initialization */ + if (xmlGenericError == php_libxml_error_handler && PG(modules_activated)) { return _php_libxml_external_entity_loader(URL, ID, context); } else { return _php_libxml_default_entity_loader(URL, ID, context); diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 0d2b53a7ca..76654edbf8 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2715,9 +2715,10 @@ PHP_FUNCTION(mb_substr) char *str, *encoding; long from, len; int mblen, str_len, encoding_len; + zval **z_len = NULL; mbfl_string string, result, *ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", &str, &str_len, &from, &len, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) { return; } @@ -2736,8 +2737,11 @@ PHP_FUNCTION(mb_substr) string.val = (unsigned char *)str; string.len = str_len; - if (argc < 3) { + if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) { len = str_len; + } else { + convert_to_long_ex(z_len); + len = Z_LVAL_PP(z_len); } /* measures length */ @@ -2788,13 +2792,14 @@ PHP_FUNCTION(mb_strcut) char *encoding; long from, len; int encoding_len; + zval **z_len = NULL; mbfl_string string, result, *ret; mbfl_string_init(&string); string.no_language = MBSTRG(language); string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", (char **)&string.val, (int **)&string.len, &from, &len, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) { return; } @@ -2806,8 +2811,11 @@ PHP_FUNCTION(mb_strcut) } } - if (argc < 3) { + if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) { len = string.len; + } else { + convert_to_long_ex(z_len); + len = Z_LVAL_PP(z_len); } /* if "from" position is negative, count start position from the end diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt index e4a235df30..5fb642f9b2 100644 --- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt +++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt @@ -28,5 +28,3 @@ baz baz foo ==DONE== ---XFAIL-- -mb functions fail to allow null instead of actual value diff --git a/ext/mcrypt/tests/mcrypt_cbf.phpt b/ext/mcrypt/tests/mcrypt_cfb.phpt index 8ec3cd7d3e..54919c8589 100644 --- a/ext/mcrypt/tests/mcrypt_cbf.phpt +++ b/ext/mcrypt/tests/mcrypt_cfb.phpt @@ -1,5 +1,5 @@ --TEST-- -mcrypt_cbf +mcrypt_cfb --SKIPIF-- <?php if (!extension_loaded("mcrypt")) print "skip"; ?> --FILE-- @@ -8,7 +8,7 @@ $key = "FooBar"; $secret = "PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; -$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); +$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CFB), MCRYPT_RAND); $enc_data = mcrypt_cfb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); // we have to trim as AES rounds the blocks and decrypt doesnt detect that @@ -20,4 +20,4 @@ mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT); --EXPECTF-- PHP Testfest 2008 -Warning: mcrypt_cfb(): Attempt to use an empty IV, which is NOT recommend in %s on line %d
\ No newline at end of file +Warning: mcrypt_cfb(): Attempt to use an empty IV, which is NOT recommend in %s on line %d diff --git a/ext/mcrypt/tests/mcrypt_create_iv.phpt b/ext/mcrypt/tests/mcrypt_create_iv.phpt index cf6456fef7..1aa48868b0 100644 --- a/ext/mcrypt/tests/mcrypt_create_iv.phpt +++ b/ext/mcrypt/tests/mcrypt_create_iv.phpt @@ -5,13 +5,13 @@ mcrypt_create_iv --FILE-- <?php $iv1 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_RAND); -$iv2 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM); -$iv3 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_DEV_RANDOM); +$iv2 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM); +$iv3 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_RANDOM); echo strlen($iv1) . "\n"; echo strlen($iv2) . "\n"; echo strlen($iv3) . "\n"; --EXPECT-- 16 -24 -32 +16 +16 diff --git a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt index 339d36c934..aa15f5ca12 100644 --- a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt +++ b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt @@ -2,7 +2,6 @@ LOAD DATA INFILE - open_basedir --SKIPIF-- <?php -@include_once("connect.inc"); include_once('skipif.inc'); include_once('skipifconnectfailure.inc'); diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index f18a503b5e..6d283aa9ca 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -162,7 +162,7 @@ void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC) { if (stmt->stmt) { if (mysqli_stmt_close(stmt->stmt, TRUE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occured while closing statement"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement"); return; } } diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 0cc1240208..7e1b9355d0 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -781,6 +781,11 @@ PHP_FUNCTION(mysqli_poll) RETURN_FALSE; } + if (!r_array && !e_array) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed"); + RETURN_FALSE; + } + if (r_array != NULL) { mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array TSRMLS_CC); } diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt new file mode 100644 index 0000000000..9fb0aa0f03 --- /dev/null +++ b/ext/mysqli/tests/bug62885.phpt @@ -0,0 +1,26 @@ +--TEST--
+Bug #62885 (mysqli_poll - Segmentation fault)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once("connect.inc");
+if (!$IS_MYSQLND) {
+ die("skip mysqlnd only test");
+}
+?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+$tablica = array();
+$test1 = mysqli_poll($test2, $test3, $tablica, null);
+
+$test2 = array();
+$test2 = array();
+$test1 = mysqli_poll($test2, $test3, $tablica, null);
+echo "okey";
+?>
+--EXPECTF--
+Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
+
+Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
+okey
diff --git a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt index b8dd11a699..7fc32f7e61 100644 --- a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt @@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc'); // NOTE: the error message varies with the MySQL Server version, dump only the error code! printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt)); - /* an error occured: affected rows should return -1 */ + /* an error occurred: affected rows should return -1 */ if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt))) printf("[010] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 797cadd624..900f8207b4 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -764,6 +764,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent); conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no); + if (!conn->greet_charset) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no); + SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, + "Server sent charset unknown to the client. Please, report to the developers"); + goto err; + } /* we allow load data local infile by default */ mysql_flags |= MYSQLND_CAPABILITIES; @@ -2177,7 +2184,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn, } memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len); - DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data); + DBG_INF_FMT("salt=[%*.s]", plugin_data_len - 1, plugin_data); /* The data should be allocated with malloc() */ scrambled_data = diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index a1b401bb59..25b9877078 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -450,20 +450,27 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 6, "hp8", "hp8_english_ci", 1, 1, "", NULL, NULL}, { 7, "koi8r", "koi8r_general_ci", 1, 1, "", NULL, NULL}, { 8, "latin1", "latin1_swedish_ci", 1, 1, "", NULL, NULL}, + { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, /* should be after 0x9 because swedish_ci is the default collation */ { 9, "latin2", "latin2_general_ci", 1, 1, "", NULL, NULL}, + { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, /* should be after 0x9 because general_ci is the default collation */ { 10, "swe7", "swe7_swedish_ci", 1, 1, "", NULL, NULL}, { 11, "ascii", "ascii_general_ci", 1, 1, "", NULL, NULL}, { 12, "ujis", "ujis_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis}, { 13, "sjis", "sjis_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_sjis, check_mb_sjis}, { 16, "hebrew", "hebrew_general_ci", 1, 1, "", NULL, NULL}, + { 17, "filename", "filename", 1, 5, "", NULL, NULL}, { 18, "tis620", "tis620_thai_ci", 1, 1, "", NULL, NULL}, { 19, "euckr", "euckr_korean_ci", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr}, + { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, + { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 22, "koi8u", "koi8u_general_ci", 1, 1, "", NULL, NULL}, { 24, "gb2312", "gb2312_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gb2312, check_mb_gb2312}, { 25, "greek", "greek_general_ci", 1, 1, "", NULL, NULL}, { 26, "cp1250", "cp1250_general_ci", 1, 1, "", NULL, NULL}, { 28, "gbk", "gbk_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gbk, check_mb_gbk}, { 30, "latin5", "latin5_turkish_ci", 1, 1, "", NULL, NULL}, + { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, + { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, { 32, "armscii8", "armscii8_general_ci", 1, 1, "", NULL, NULL}, { 33, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 35, "ucs2", "ucs2_general_ci", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, @@ -473,22 +480,11 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 39, "macroman", "macroman_general_ci", 1, 1, "", NULL, NULL}, { 40, "cp852", "cp852_general_ci", 1, 1, "", NULL, NULL}, { 41, "latin7", "latin7_general_ci", 1, 1, "", NULL, NULL}, - { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, { 57, "cp1256", "cp1256_general_ci", 1, 1, "", NULL, NULL}, { 59, "cp1257", "cp1257_general_ci", 1, 1, "", NULL, NULL}, { 63, "binary", "binary", 1, 1, "", NULL, NULL}, - { 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL}, - { 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, { 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, - { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, - { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, - { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, - { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, - { 17, "filename", "filename", 1, 5, "", NULL, NULL}, - { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, - { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, - { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, - { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 29, "cp1257", "cp1257_lithunian_ci", 1, 1, "", NULL, NULL}, { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, { 34, "cp1250", "cp1250_czech_cs", 1, 1, "", NULL, NULL}, @@ -500,6 +496,9 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL}, { 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL}, { 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL}, + { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, + { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, { 50, "cp1251", "cp1251_bin", 1, 1, "", NULL, NULL}, { 52, "cp1251", "cp1251_general_cs", 1, 1, "", NULL, NULL}, { 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL}, @@ -509,8 +508,8 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = #ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5 { 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL}, #endif - { 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, - { 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, { 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL}, { 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL}, { 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL}, @@ -528,7 +527,6 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 80, "cp850", "cp850_bin", 1, 1, "", NULL, NULL}, { 81, "cp852", "cp852_bin", 1, 1, "", NULL, NULL}, { 82, "swe7", "swe7_bin", 1, 1, "", NULL, NULL}, - { 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL}, { 83, UTF8_MB3, UTF8_MB3"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 84, "big5", "big5_bin", 1, 2, "", mysqlnd_mbcharlen_big5, check_mb_big5}, { 85, "euckr", "euckr_bin", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr}, @@ -538,10 +536,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 89, "tis620", "tis620_bin", 1, 1, "", NULL, NULL}, { 90, "ucs2", "ucs2_bin", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 91, "ujis", "ujis_bin", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis}, + { 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL}, + { 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL}, { 94, "latin1", "latin1_spanish_ci", 1, 1, "", NULL, NULL}, + { 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, { 96, "cp932", "cp932_bin", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, - { 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL}, + { 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, { 98, "eucjpms", "eucjpms_bin", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, + { 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL}, { 128, "ucs2", "ucs2_unicode_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 129, "ucs2", "ucs2_icelandic_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 130, "ucs2", "ucs2_latvian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, @@ -562,7 +564,35 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 145, "ucs2", "ucs2_esperanto_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 146, "ucs2", "ucs2_hungarian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 147, "ucs2", "ucs2_sinhala_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, - { 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, /* MDB */ + { 148, "ucs2", "ucs2_german2_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 150, "ucs2", "ucs2_unicode_520_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 151, "ucs2", "ucs2_vietnamese_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + +/*56*/{160, "utf32", "utf32_unicode_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{161, "utf32", "utf32_icelandic_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{162, "utf32", "utf32_latvian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{163, "utf32", "utf32_romanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{164, "utf32", "utf32_slovenian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{165, "utf32", "utf32_polish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{166, "utf32", "utf32_estonian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{167, "utf32", "utf32_spanish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{168, "utf32", "utf32_swedish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{169, "utf32", "utf32_turkish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{170, "utf32", "utf32_czech_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{171, "utf32", "utf32_danish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{172, "utf32", "utf32_lithuanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{173, "utf32", "utf32_slovak_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{174, "utf32", "utf32_spanish2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{175, "utf32", "utf32_roman_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{176, "utf32", "utf32_persian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{177, "utf32", "utf32_esperanto_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{178, "utf32", "utf32_hungarian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{179, "utf32", "utf32_sinhala_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{180, "utf32", "utf32_german2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{181, "utf32", "utf32_croatian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{182, "utf32", "utf32_unicode_520_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{183, "utf32", "utf32_vietnamese_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, { 192, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 193, UTF8_MB3, UTF8_MB3"_icelandic_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, @@ -571,7 +601,7 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 196, UTF8_MB3, UTF8_MB3"_slovenian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 197, UTF8_MB3, UTF8_MB3"_polish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 198, UTF8_MB3, UTF8_MB3"_estonian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, - { 119, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 199, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 200, UTF8_MB3, UTF8_MB3"_swedish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 201, UTF8_MB3, UTF8_MB3"_turkish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 202, UTF8_MB3, UTF8_MB3"_czech_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, @@ -584,7 +614,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 209, UTF8_MB3, UTF8_MB3"_esperanto_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 210, UTF8_MB3, UTF8_MB3"_hungarian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 211, UTF8_MB3, UTF8_MB3"_sinhala_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, - { 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/ + { 211, UTF8_MB3, UTF8_MB3"_german2_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 214, UTF8_MB3, UTF8_MB3"_unicode_520_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 215, UTF8_MB3, UTF8_MB3"_vietnamese_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 224, UTF8_MB4, UTF8_MB4"_unicode_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 225, UTF8_MB4, UTF8_MB4"_icelandic_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, @@ -606,6 +639,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 241, UTF8_MB4, UTF8_MB4"_esperanto_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 242, UTF8_MB4, UTF8_MB4"_hungarian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 243, UTF8_MB4, UTF8_MB4"_sinhala_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 244, UTF8_MB4, UTF8_MB4"_german2_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 245, UTF8_MB4, UTF8_MB4"_croatian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 246, UTF8_MB4, UTF8_MB4"_unicode_520_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 247, UTF8_MB4, UTF8_MB4"_vietnamese_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 0, NULL, NULL, 0, 0, NULL, NULL, NULL} diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 5c77b42459..044a7d6807 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -516,9 +516,11 @@ enum mysqlnd_debug_parser_state static void MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const mode) { - unsigned int mode_len = strlen(mode), i; + unsigned int mode_len, i; enum mysqlnd_debug_parser_state state = PARSER_WAIT_MODIFIER; + mode_len = mode? strlen(mode) : 0; + self->flags = 0; self->nest_level_limit = 0; if (self->file_name && self->file_name != mysqlnd_debug_default_trace_file) { diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index 8e8622e540..82ee63458e 100644 --- a/ext/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c @@ -188,7 +188,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen char tmp_buf[sizeof(conn->error_info->error)]; int tmp_error_no; *is_warning = TRUE; - /* error occured */ + /* error occurred */ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC); SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf); /* write empty packet to server */ @@ -211,7 +211,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen goto infile_error; } - /* error during read occured */ + /* error during read occurred */ if (bufsize < 0) { char tmp_buf[sizeof(conn->error_info->error)]; int tmp_error_no; diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index 0634e96288..976eb9e846 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -49,8 +49,8 @@ AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[ AC_DEFUN([AC_OCI8IC_VERSION],[ AC_MSG_CHECKING([Oracle Instant Client library version compatibility]) OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc - OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -1` + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc + OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -n1` if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then if test ! -f "$OCI8_LCS_BASE"; then AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found]) @@ -65,7 +65,7 @@ AC_DEFUN([AC_OCI8IC_VERSION],[ AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ AC_MSG_CHECKING([Oracle library version compatibility]) OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc if test -s "$OCI8_DIR/orainst/unix.rgs"; then OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 @@ -278,7 +278,7 @@ if test "$PHP_OCI8" != "no"; then dnl user must pass in the library directory. But on Linux we default dnl to the most recent version in /usr/lib which is where the Oracle dnl Instant Client RPM gets installed. - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` + PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -n1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` if test -z "$PHP_OCI8_INSTANT_CLIENT"; then AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR]) fi diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index d3a912832f..eac3f06552 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -37,8 +37,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> <time>12:00:00</time> <version> - <release>1.4.7</release> - <api>1.4.7</api> + <release>1.4.8</release> + <api>1.4.8</api> </version> <stability> <release>stable</release> @@ -46,11 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> </stability> <license uri="http://www.php.net/license">PHP</license> <notes> - Fixed bug #59985 (show normal warning text for OCI_NO_DATA) - Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) - Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) - Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size - Improve internal initalization failure error messages + Fixed bug #60901 (Improve "tail" syntax for AIX installation) </notes> <contents> <dir name="/"> @@ -416,6 +412,25 @@ http://pear.php.net/dtd/package-2.0.xsd"> <release> <version> + <release>1.4.7</release> + <api>1.4.7</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.php.net/license">PHP</license> + <notes> + Fixed bug #59985 (show normal warning text for OCI_NO_DATA) + Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) + Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) + Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size + Improve internal initalization failure error messages + </notes> +</release> + +<release> + <version> <release>1.4.6</release> <api>1.4.6</api> </version> diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt index 8bb28733fe..edb2a12ff0 100644 --- a/ext/oci8/tests/bind_char_2_11gR1.phpt +++ b/ext/oci8/tests/bind_char_2_11gR1.phpt @@ -5,7 +5,7 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index 4c6241ccfd..fea77754d1 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -5,7 +5,7 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index 14d5878856..2bc2f14246 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -5,7 +5,7 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff --git a/ext/oci8/tests/details.inc b/ext/oci8/tests/details.inc index 0f03c3a65f..9a86c46868 100644 --- a/ext/oci8/tests/details.inc +++ b/ext/oci8/tests/details.inc @@ -45,31 +45,34 @@ if (file_exists(dirname(__FILE__)."/details_local.inc")) { * Used for creating/dropping schema objects used by a test */ -function oci8_test_sql_execute($c, $stmtarray) -{ - foreach ($stmtarray as $stmt) { - $s = oci_parse($c, $stmt); - if (!$s) { - $m = oci_error($c); - echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; - } - else { - $r = @oci_execute($s); - if (!$r) { - $m = oci_error($s); - if (!in_array($m['code'], array( // ignore expected errors - 942 // table or view does not exist - , 1918 // user does not exist - , 2024 // database link not found - , 2289 // sequence does not exist - , 4080 // trigger does not exist - , 38802 // edition does not exist - ))) { - echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; - } - } - } - } +if (!function_exists('oci8_test_sql_execute')) { + function oci8_test_sql_execute($c, $stmtarray) + { + foreach ($stmtarray as $stmt) { + $s = oci_parse($c, $stmt); + if (!$s) { + $m = oci_error($c); + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; + } + else { + $r = @oci_execute($s); + if (!$r) { + $m = oci_error($s); + if (!in_array($m['code'], array( // ignore expected errors + 942 // table or view does not exist + , 1918 // user does not exist + , 2024 // database link not found + , 2289 // sequence does not exist + , 4080 // trigger does not exist + , 38802 // edition does not exist + ))) { + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; + } + } + } + } + } + } ?> diff --git a/ext/oci8/tests/pecl_bug10194.phpt b/ext/oci8/tests/pecl_bug10194.phpt index 9947e15dbc..3c1c7887c2 100644 --- a/ext/oci8/tests/pecl_bug10194.phpt +++ b/ext/oci8/tests/pecl_bug10194.phpt @@ -5,6 +5,9 @@ PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=10M diff --git a/ext/oci8/tests/pecl_bug10194_blob.phpt b/ext/oci8/tests/pecl_bug10194_blob.phpt index faf87ab3c1..96f94bcf4c 100644 --- a/ext/oci8/tests/pecl_bug10194_blob.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob.phpt @@ -6,6 +6,9 @@ $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on t require(dirname(__FILE__).'/skipif.inc'); if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=3M diff --git a/ext/oci8/tests/pecl_bug10194_blob_64.phpt b/ext/oci8/tests/pecl_bug10194_blob_64.phpt index 45788a41b4..e1a4cc034e 100644 --- a/ext/oci8/tests/pecl_bug10194_blob_64.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob_64.phpt @@ -6,6 +6,9 @@ $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on t require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=6M diff --git a/ext/oci8/tests/xmltype_01.phpt b/ext/oci8/tests/xmltype_01.phpt index 21aca6cc12..ebbbb31fac 100644 --- a/ext/oci8/tests/xmltype_01.phpt +++ b/ext/oci8/tests/xmltype_01.phpt @@ -5,6 +5,7 @@ Basic XMLType test if (!extension_loaded("simplexml")) die("skip no simplexml extension"); $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); +?> --FILE-- <?php diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e98d863be9..52d46b2fd0 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -387,7 +387,7 @@ const zend_function_entry odbc_functions[] = { }; /* }}} */ -ZEND_DECLARE_MODULE_GLOBALS(odbc); +ZEND_DECLARE_MODULE_GLOBALS(odbc) static PHP_GINIT_FUNCTION(odbc); /* {{{ odbc_module_entry diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7187a9601e..2b8cfd571a 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -69,7 +69,13 @@ #define OPENSSL_ALGO_MD2 4 #endif #define OPENSSL_ALGO_DSS1 5 - +#if OPENSSL_VERSION_NUMBER >= 0x0090708fL +#define OPENSSL_ALGO_SHA224 6 +#define OPENSSL_ALGO_SHA256 7 +#define OPENSSL_ALGO_SHA384 8 +#define OPENSSL_ALGO_SHA512 9 +#define OPENSSL_ALGO_RMD160 10 +#endif #define DEBUG_SMIME 0 /* FIXME: Use the openssl constants instead of @@ -954,6 +960,23 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */ case OPENSSL_ALGO_DSS1: mdtype = (EVP_MD *) EVP_dss1(); break; +#if OPENSSL_VERSION_NUMBER >= 0x0090708fL + case OPENSSL_ALGO_SHA224: + mdtype = (EVP_MD *) EVP_sha224(); + break; + case OPENSSL_ALGO_SHA256: + mdtype = (EVP_MD *) EVP_sha256(); + break; + case OPENSSL_ALGO_SHA384: + mdtype = (EVP_MD *) EVP_sha384(); + break; + case OPENSSL_ALGO_SHA512: + mdtype = (EVP_MD *) EVP_sha512(); + break; + case OPENSSL_ALGO_RMD160: + mdtype = (EVP_MD *) EVP_ripemd160(); + break; +#endif default: return NULL; break; @@ -1048,6 +1071,13 @@ PHP_MINIT_FUNCTION(openssl) REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); #endif REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); +#if OPENSSL_VERSION_NUMBER >= 0x0090708fL + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA384", OPENSSL_ALGO_SHA384, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA512", OPENSSL_ALGO_SHA512, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RMD160", OPENSSL_ALGO_RMD160, CONST_CS|CONST_PERSISTENT); +#endif /* flags for S/MIME */ REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT); diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index e5910a5dca..8647e105ef 100755 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -816,7 +816,7 @@ PHP_FUNCTION(pcntl_exec) if (execve(path, argv, envp) == -1) { PCNTL_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno)); } /* Cleanup */ @@ -826,7 +826,7 @@ PHP_FUNCTION(pcntl_exec) if (execv(path, argv) == -1) { PCNTL_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno)); } } @@ -1127,7 +1127,7 @@ PHP_FUNCTION(pcntl_getpriority) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno); break; } RETURN_FALSE; @@ -1167,7 +1167,7 @@ PHP_FUNCTION(pcntl_setpriority) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno); break; } RETURN_FALSE; diff --git a/ext/pcntl/tests/pcntl_exec_3.phpt b/ext/pcntl/tests/pcntl_exec_3.phpt index d27c1c9962..5349381d92 100644 --- a/ext/pcntl/tests/pcntl_exec_3.phpt +++ b/ext/pcntl/tests/pcntl_exec_3.phpt @@ -13,5 +13,5 @@ unlink($file); Warning: pcntl_exec() expects at least 1 parameter, 0 given %s NULL -Warning: pcntl_exec(): Error has occured: (errno %d) %s +Warning: pcntl_exec(): Error has occurred: (errno %d) %s bool(false) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index c9d707280c..f61364cde9 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -275,7 +275,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le get to the end without encountering a delimiter. */ while (isspace((int)*(unsigned char *)p)) p++; if (*p == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, + p < regex + regex_len ? "Null byte in regex" : "Empty regular expression"); return NULL; } @@ -292,21 +293,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le delimiter = pp[5]; end_delimiter = delimiter; + pp = p; + if (start_delimiter == end_delimiter) { /* We need to iterate through the pattern, searching for the ending delimiter, but skipping the backslashed delimiters. If the ending delimiter is not found, display a warning. */ - pp = p; while (*pp != 0) { if (*pp == '\\' && pp[1] != 0) pp++; else if (*pp == delimiter) break; pp++; } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter); - return NULL; - } } else { /* We iterate through the pattern, searching for the matching ending * delimiter. For each matching starting delimiter, we increment nesting @@ -314,7 +312,6 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le * reach the end of the pattern without matching, display a warning. */ int brackets = 1; /* brackets nesting level */ - pp = p; while (*pp != 0) { if (*pp == '\\' && pp[1] != 0) pp++; else if (*pp == end_delimiter && --brackets <= 0) @@ -323,10 +320,17 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le brackets++; pp++; } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", end_delimiter); - return NULL; + } + + if (*pp == 0) { + if (pp < regex + regex_len) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex"); + } else if (start_delimiter == end_delimiter) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter); + } else { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter); } + return NULL; } /* Make a copy of the actual pattern. */ @@ -337,7 +341,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le /* Parse through the options, setting appropriate flags. Display a warning if we encounter an unknown modifier. */ - while (*pp != 0) { + while (pp < regex + regex_len) { switch (*pp++) { /* Perl compatible options */ case 'i': coptions |= PCRE_CASELESS; break; @@ -368,7 +372,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le break; default: - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]); + if (pp[-1]) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]); + } else { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex"); + } efree(pattern); return NULL; } diff --git a/ext/pcre/tests/null_bytes.phpt b/ext/pcre/tests/null_bytes.phpt new file mode 100644 index 0000000000..9a3f433ffb --- /dev/null +++ b/ext/pcre/tests/null_bytes.phpt @@ -0,0 +1,42 @@ +--TEST-- +Zero byte test +--FILE-- +<?php + +preg_match("\0//i", ""); +preg_match("/\0/i", ""); +preg_match("//\0i", ""); +preg_match("//i\0", ""); +preg_match("/\\\0/i", ""); + +preg_match("\0[]i", ""); +preg_match("[\0]i", ""); +preg_match("[]\0i", ""); +preg_match("[]i\0", ""); +preg_match("[\\\0]i", ""); + +preg_replace("/foo/e\0/i", "echo('Eek');", ""); + +?> +--EXPECTF-- +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 3 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 4 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 5 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 6 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 7 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 9 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 10 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 11 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 12 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 13 + +Warning: preg_replace(): Null byte in regex in %snull_bytes.php on line 15 diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index b4f383c94f..acdc0dd90d 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -700,7 +700,7 @@ static PHP_METHOD(PDO, inTransaction) RETURN_BOOL(dbh->in_txn); } - RETURN_LONG(dbh->methods->in_transaction(dbh TSRMLS_CC)); + RETURN_BOOL(dbh->methods->in_transaction(dbh TSRMLS_CC)); } /* }}} */ diff --git a/ext/pdo/tests/bug_43130.phpt b/ext/pdo/tests/bug_43130.phpt index a35138a07f..70f8887111 100644 --- a/ext/pdo/tests/bug_43130.phpt +++ b/ext/pdo/tests/bug_43130.phpt @@ -8,6 +8,7 @@ if (false == $dir) die('skip no driver'); if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite', strlen('sqlite'))) die('skip not relevant for sqlite driver'); if (!strncasecmp(getenv('PDOTEST_DSN'), 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver'); if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip not relevant for oci driver - Hyphen is not legal for bind names in Oracle DB'); +if (!strncasecmp(getenv('PDOTEST_DSN'), 'firebird', strlen('firebird'))) die('skip not relevant for firebird driver'); require_once $dir . 'pdo_test.inc'; PDOTest::skip(); ?> diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc index f2e076793a..443c8dd822 100644 --- a/ext/pdo/tests/pdo_test.inc +++ b/ext/pdo/tests/pdo_test.inc @@ -66,13 +66,19 @@ class PDOTest { } static function test_factory($file) { - $data = file_get_contents($file); - $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data); - $config = eval($data); + $config = self::get_config($file); foreach ($config['ENV'] as $k => $v) { putenv("$k=$v"); } return self::factory(); } + + static function get_config($file) { + $data = file_get_contents($file); + $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data); + $config = eval($data); + + return $config; + } } ?> diff --git a/ext/pdo_firebird/tests/bug_47415.phpt b/ext/pdo_firebird/tests/bug_47415.phpt index cedc2c45b2..12cd782f26 100644 --- a/ext/pdo_firebird/tests/bug_47415.phpt +++ b/ext/pdo_firebird/tests/bug_47415.phpt @@ -2,6 +2,7 @@ Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn() --SKIPIF-- <?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_48877.phpt b/ext/pdo_firebird/tests/bug_48877.phpt index 290cd7a3a0..cbab84b372 100644 --- a/ext/pdo_firebird/tests/bug_48877.phpt +++ b/ext/pdo_firebird/tests/bug_48877.phpt @@ -2,6 +2,7 @@ PDO_Firebird: bug 48877 The "bindValue" and "bindParam" do not work for PDO Firebird if we use named parameters (:parameter). --SKIPIF-- <?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_53280.phpt b/ext/pdo_firebird/tests/bug_53280.phpt index 1be4e8a826..3139867af1 100644 --- a/ext/pdo_firebird/tests/bug_53280.phpt +++ b/ext/pdo_firebird/tests/bug_53280.phpt @@ -2,6 +2,7 @@ PDO_Firebird: bug 53280 segfaults if query column count is less than param count --SKIPIF-- <?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/connect.phpt b/ext/pdo_firebird/tests/connect.phpt index e4bb8ef54e..cbe76e6865 100644 --- a/ext/pdo_firebird/tests/connect.phpt +++ b/ext/pdo_firebird/tests/connect.phpt @@ -2,6 +2,7 @@ PDO_Firebird: connect/disconnect --SKIPIF-- <?php include("skipif.inc"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php /* $Id$ */ diff --git a/ext/pdo_firebird/tests/ddl.phpt b/ext/pdo_firebird/tests/ddl.phpt index 9a3ddd1002..9d2a0953ec 100644 --- a/ext/pdo_firebird/tests/ddl.phpt +++ b/ext/pdo_firebird/tests/ddl.phpt @@ -2,6 +2,7 @@ PDO_Firebird: DDL/transactions --SKIPIF-- <?php include("skipif.inc"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php /* $Id$ */ diff --git a/ext/pdo_firebird/tests/execute.phpt b/ext/pdo_firebird/tests/execute.phpt index 3a759fc51b..896347e935 100644 --- a/ext/pdo_firebird/tests/execute.phpt +++ b/ext/pdo_firebird/tests/execute.phpt @@ -2,6 +2,7 @@ PDO_Firebird: prepare/execute/binding --SKIPIF-- <?php include("skipif.inc"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --INI-- ibase.timestampformat=%Y-%m-%d %H:%M:%S --FILE-- diff --git a/ext/pdo_firebird/tests/rowCount.phpt b/ext/pdo_firebird/tests/rowCount.phpt index 3d7f71c83b..1a009508e0 100644 --- a/ext/pdo_firebird/tests/rowCount.phpt +++ b/ext/pdo_firebird/tests/rowCount.phpt @@ -2,6 +2,7 @@ PDO_Firebird: rowCount --SKIPIF-- <?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php function_exists("ibase_query") or die("skip"); ?> --FILE-- <?php /* $Id$ */ diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 0c2689f9d5..fc5ec5135b 100755 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -134,7 +134,7 @@ static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ row_count = mysql_affected_rows(H->server); if (row_count == (my_ulonglong)-1) { - /* we either have a query that returned a result set or an error occured + /* we either have a query that returned a result set or an error occurred lets see if we have access to a result set */ if (!H->buffered) { S->result = mysql_use_result(H->server); diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 5118406e9e..ea69c3c11b 100755 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -35,7 +35,7 @@ ZEND_GET_MODULE(pdo_mysql) #endif -ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql); +ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql) /* The default socket location is sometimes defined by configure. diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 4e039d2a74..e700ef8c3c 100755 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -633,58 +633,49 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l } if (rc == SQL_SUCCESS_WITH_INFO) { - /* promote up to a bigger buffer */ - - if (C->fetched_len != SQL_NO_TOTAL) { - /* use size suggested by the driver, if it knows it */ - buf = emalloc(C->fetched_len + 1); - memcpy(buf, C->data, C->fetched_len); - buf[C->fetched_len] = 0; - used = C->fetched_len; - } else { - buf = estrndup(C->data, 256); - used = 255; /* not 256; the driver NUL terminated the buffer */ - } - + /* this is a 'long column' + + read the column in 255 byte blocks until the end of the column is reached, reassembling those blocks + in order into the output buffer + + this loop has to work whether or not SQLGetData() provides the total column length. + calling SQLDescribeCol() or other, specifically to get the column length, then doing a single read + for that size would be slower except maybe for extremely long columns.*/ + char *buf2; + + buf2 = emalloc(256); + buf = estrndup(C->data, 256); + used = 255; /* not 256; the driver NUL terminated the buffer */ + do { C->fetched_len = 0; - rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, - buf + used, alloced - used, - &C->fetched_len); - - if (rc == SQL_NO_DATA) { - /* we got the lot */ - break; - } else if (rc != SQL_SUCCESS) { - pdo_odbc_stmt_error("SQLGetData"); - if (rc != SQL_SUCCESS_WITH_INFO) { - break; - } - } - - if (C->fetched_len == SQL_NO_TOTAL) { - used += alloced - used; + /* read block. 256 bytes => 255 bytes are actually read, the last 1 is NULL */ + rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, buf2, 256, &C->fetched_len); + + /* resize output buffer and reassemble block */ + if (rc==SQL_SUCCESS_WITH_INFO) { + /* point 5, in section "Retrieving Data with SQLGetData" in http://msdn.microsoft.com/en-us/library/windows/desktop/ms715441(v=vs.85).aspx + states that if SQL_SUCCESS_WITH_INFO, fetched_len will be > 255 (greater than buf2's size) + (if a driver fails to follow that and wrote less than 255 bytes to buf2, this will AV or read garbage into buf) */ + buf = erealloc(buf, used + 255+1); + memcpy(buf + used, buf2, 255); + used = used + 255; + } else if (rc==SQL_SUCCESS) { + buf = erealloc(buf, used + C->fetched_len+1); + memcpy(buf + used, buf2, C->fetched_len); + used = used + C->fetched_len; } else { - used += C->fetched_len; - } - - if (rc == SQL_SUCCESS) { - /* this was the final fetch */ + /* includes SQL_NO_DATA */ break; } - - /* we need to fetch another chunk; resize the - * buffer */ - alloced *= 2; - buf = erealloc(buf, alloced); + } while (1); - - /* size down */ - if (used < alloced - 1024) { - alloced = used+1; - buf = erealloc(buf, used+1); - } + + efree(buf2); + + /* NULL terminate the buffer once, when finished, for use with the rest of PHP */ buf[used] = '\0'; + *ptr = buf; *caller_frees = 1; *len = used; diff --git a/ext/pdo_odbc/tests/common.phpt b/ext/pdo_odbc/tests/common.phpt index f64da1a438..276f2b78e3 100644 --- a/ext/pdo_odbc/tests/common.phpt +++ b/ext/pdo_odbc/tests/common.phpt @@ -2,17 +2,40 @@ ODBC --SKIPIF-- <?php # vim:ft=php -if (!extension_loaded('pdo_odbc')) print 'skip'; ?> +if (!extension_loaded('pdo_odbc')) print 'skip'; +if (substr(PHP_OS, 0, 3) == 'WIN' && + false === getenv('PDOTEST_DSN') && + false === getenv('PDO_ODBC_TEST_DSN') && + !extension_loaded('com_dotnet')) { + die('skip - either PDOTEST_DSN or com_dotnet extension is needed to setup the connection'); +} --REDIRECTTEST-- # magic auto-configuration $config = array( - 'TESTS' => 'ext/pdo/tests' + 'TESTS' => 'ext/pdo/tests', + 'ENV' => array() ); - -if (false !== getenv('PDO_ODBC_TEST_DSN')) { - # user set them from their shell +// try loading PDO driver using ENV vars and if none given, and on Windows, try using MS Access +// and if not, skip the test +// +// try to use common PDO env vars, instead of PDO_ODBC specific +if (false !== getenv('PDOTEST_DSN')) { + // user should have to set PDOTEST_DSN so that: + // 1. test is skipped if user doesn't want to test it, even if they have MS Access installed + // 2. it detects if ODBC driver is not installed - to avoid test bug + // 3. it detects if ODBC driver is installed - so test will be run + // 4. so a specific ODBC driver can be tested - if system has multiple ODBC drivers + + $config['ENV']['PDOTEST_DSN'] = getenv('PDOTEST_DSN'); + $config['ENV']['PDOTEST_USER'] = getenv('PDOTEST_USER'); + $config['ENV']['PDOTEST_PASS'] = getenv('PDOTEST_PASS'); + if (false !== getenv('PDOTEST_ATTR')) { + $config['ENV']['PDOTEST_ATTR'] = getenv('PDOTEST_ATTR'); + } +} else if (false !== getenv('PDO_ODBC_TEST_DSN')) { + // user set these from their shell instead $config['ENV']['PDOTEST_DSN'] = getenv('PDO_ODBC_TEST_DSN'); $config['ENV']['PDOTEST_USER'] = getenv('PDO_ODBC_TEST_USER'); $config['ENV']['PDOTEST_PASS'] = getenv('PDO_ODBC_TEST_PASS'); @@ -20,10 +43,13 @@ if (false !== getenv('PDO_ODBC_TEST_DSN')) { $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR'); } } elseif (preg_match('/^WIN/i', PHP_OS)) { - # on windows, try to create a temporary MS access database + // on Windows and user didn't set PDOTEST_DSN, try this as a fallback: + // check if MS Access DB is installed, and if yes, try using it. create a temporary MS access database. + // $path = realpath(dirname(__FILE__)) . '\pdo_odbc.mdb'; if (!file_exists($path)) { try { + // try to create database $adox = new COM('ADOX.Catalog'); $adox->Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' . $path); $adox = null; @@ -32,9 +58,12 @@ if (false !== getenv('PDO_ODBC_TEST_DSN')) { } } if (file_exists($path)) { + // database was created and written to file system $config['ENV']['PDOTEST_DSN'] = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=$path;Uid=Admin"; - } -} + } // else: $config['ENV']['PDOTEST_DSN'] not set +} // else: $config['ENV']['PDOTEST_DSN'] not set +// test will be skipped. see SKIPIF section of long_columns.phpt + # other magic autodetection here, eg: for DB2 by inspecting env /* $USER = 'db2inst1'; diff --git a/ext/pdo_odbc/tests/long_columns.phpt b/ext/pdo_odbc/tests/long_columns.phpt index 65ec2f96e9..e3430ded47 100644 --- a/ext/pdo_odbc/tests/long_columns.phpt +++ b/ext/pdo_odbc/tests/long_columns.phpt @@ -3,9 +3,44 @@ PDO ODBC "long" columns --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo_odbc')) print 'skip not loaded'; +// make sure there is an ODBC driver and a DSN, or the test will fail +include 'ext/pdo/tests/pdo_test.inc'; +$config = PDOTest::get_config('ext/pdo_odbc/tests/common.phpt'); +if (!isset($config['ENV']['PDOTEST_DSN']) || $config['ENV']['PDOTEST_DSN']===false) print 'skip'; ?> --FILE-- <?php +// setup: set PDOTEST_DSN environment variable +// for MyODBC (MySQL) and MS SQL Server, you need to also set PDOTEST_USER and PDOTEST_PASS +// +// can use MS SQL Server on Linux - using unixODBC +// -RHEL6.2 +// -download & instructions: http://www.microsoft.com/en-us/download/details.aspx?id=28160 +// -Linux6\sqlncli-11.0.1790.0.tar.gz (it calls RHEL6.x 'Linux6' for some reason) +// -follow instructions on web page and install script +// -may have to specify connection info in connection string without using a DSN (DSN-less connection) +// -for example: +// set PDOTEST_DSN='odbc:Driver=SQL Server Native Client 11.0;Server=10.200.51.179;Database=testdb' +// set PDOTEST_USER=sa +// set PDOTEST_PASS=Password01 +// +// on Windows, the easy way to do this: +// 1. install MS Access (part of MS Office) and include ODBC (Development tools feature) +// install the x86 build of the Drivers. You might not be able to load the x64 drivers. +// 2. in Control Panel, search for ODBC and open "Setup data sources (ODBC)" +// 3. click on System DSN tab +// 4. click Add and choose "Microsoft Access Driver (*.mdb, *.accdb)" driver +// 5. enter a DSN, ex: accdb12 +// 6. click 'Create' and select a file to save the database as +// -otherwise, you'll have to open MS Access, create a database, then load that file in this Window to map it to a DSN +// 7. set the environment variable PDOTEST_DSN="odbc:<system dsn from step 5>" ex: SET PDOTEST_DSN=odbc:accdb12 +// -note: on Windows, " is included in environment variable +// +// easy way to compile: +// configure --disable-all --enable-cli --enable-zts --enable-pdo --with-pdo-odbc --enable-debug +// configure --disable-all --eanble-cli --enable-pdo --with-pdo-odbc=unixODBC,/usr,/usr --with-unixODBC=/usr --enable-debug +// + require 'ext/pdo/tests/pdo_test.inc'; $db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); @@ -20,27 +55,86 @@ if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data CL $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -$sizes = array(32, 64, 128, 253, 254, 255, 256, 257, 258, 512, 1024, 2048, 3998, 3999, 4000); +// the driver reads columns in blocks of 255 bytes and then reassembles those blocks into a single buffer. +// test sizes around 255 to make sure that the reassembly works (and that the column is split into 255 byte blocks by the database) +// also, test sizes below 255 to make sure that they work - and are not treated as a long column (should be read in a single read) +$sizes = array(32, 53, 64, 79, 128, 253, 254, 255, 256, 257, 258, 1022, 1023, 1024, 1025, 1026, 510, 511, 512, 513, 514, 1278, 1279, 1280, 1281, 1282, 2046, 2047, 2048, 2049, 2050, 1534, 1535, 1536, 1537, 1538, 3070, 3071, 3072, 3073, 3074, 3998, 3999, 4000); -$db->beginTransaction(); -$insert = $db->prepare('INSERT INTO TEST VALUES (?, ?)'); +function alpha_repeat($len) { + // use the alphabet instead of 'i' characters to make sure the blocks don't overlap when they are reassembled + $out = ""; + while (strlen($out) < $len) { + $out .= "abcdefghijklmnopqrstuvwxyz"; + } + return substr($out, 0, $len); +} + +// don't use Prepared Statements. that fails on MS SQL server (works with Access, MyODBC), which is a separate failure, feature/code-path from what +// this test does - nice to be able to test using MS SQL server foreach ($sizes as $num) { - $insert->execute(array($num, str_repeat('i', $num))); + $text = alpha_repeat($num); + $db->exec("INSERT INTO TEST VALUES($num, '$text')"); } -$insert = null; -$db->commit(); +// verify data foreach ($db->query('SELECT id, data from TEST') as $row) { - $expect = str_repeat('i', $row[0]); + $expect = alpha_repeat($row[0]); if (strcmp($expect, $row[1])) { echo "Failed on size $row[id]:\n"; printf("Expected %d bytes, got %d\n", strlen($expect), strlen($row['data'])); - echo bin2hex($expect) . "\n"; - echo bin2hex($row['data']) . "\n"; + echo ($expect) . "\n"; + echo ($row['data']) . "\n"; + } else { + echo "Passed on size $row[id]\n"; } } echo "Finished\n"; --EXPECT-- +Passed on size 32 +Passed on size 53 +Passed on size 64 +Passed on size 79 +Passed on size 128 +Passed on size 253 +Passed on size 254 +Passed on size 255 +Passed on size 256 +Passed on size 257 +Passed on size 258 +Passed on size 1022 +Passed on size 1023 +Passed on size 1024 +Passed on size 1025 +Passed on size 1026 +Passed on size 510 +Passed on size 511 +Passed on size 512 +Passed on size 513 +Passed on size 514 +Passed on size 1278 +Passed on size 1279 +Passed on size 1280 +Passed on size 1281 +Passed on size 1282 +Passed on size 2046 +Passed on size 2047 +Passed on size 2048 +Passed on size 2049 +Passed on size 2050 +Passed on size 1534 +Passed on size 1535 +Passed on size 1536 +Passed on size 1537 +Passed on size 1538 +Passed on size 3070 +Passed on size 3071 +Passed on size 3072 +Passed on size 3073 +Passed on size 3074 +Passed on size 3998 +Passed on size 3999 +Passed on size 4000 Finished + diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index f81cf9b1ed..480c728d15 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -760,7 +760,7 @@ static struct pdo_dbh_methods sqlite_methods = { static char *make_filename_safe(const char *filename TSRMLS_DC) { - if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { + if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { diff --git a/ext/phar/cgidebug b/ext/phar/cgidebug deleted file mode 100755 index 1907581900..0000000000 --- a/ext/phar/cgidebug +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -export SCRIPT_NAME=/front.phar.php -export PATH_INFO=/index.php -export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php -export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php -export REDIRECT_STATUS=1 -export REQUEST_METHOD=GET -export REQUEST_URI=/front.phar.php/index.php -cd /home/cellog/workspace/php5 -ddd sapi/cgi/php-cgi & -cd /home/cellog/workspace/php5/ext/phar diff --git a/ext/phar/package.php b/ext/phar/package.php deleted file mode 100644 index 181c7c45ff..0000000000 --- a/ext/phar/package.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php - -$notes = ' -BC BREAKING RELEASE - BC breaks: - * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), - Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress(). - * phar.extract_list and Phar::getExtractList() are removed - -Major feature functionality release - * phar.cache_list allows web-based phar applications to run at equal or faster than - their on-disk equivalent [Greg] - * new default stub allows running of phar-based phars without phar extension [Greg/Steph] - * add support for tar-based and zip-based phar archives [Greg] - * add support for OpenSSL-based true signatures [Greg] - * add support for signatures to tar-based phar archives [Greg] - * add Phar::isFileFormat() [Greg] - * add Phar::convertToExecutable(), Phar::convertToData() [Greg] - * add Phar::compress() [Greg] - * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to - decompressFiles() [Greg] - * conversion to compressed or to other file formats automatically copies the archive - to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph] - * add Phar::webPhar() for running a web-based application unmodified - directly from a phar archive [Greg] - * file functions (fopen-based and stat-based) can be instructed to only look for - relative paths within a phar via Phar::interceptFileFuncs() - * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph] - non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg] - * paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg] - * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg] - * add option to compress the entire phar file for phar/tar file format [Greg] - * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg] - * implement Phar::copy(string $from, string $to) [Greg] - * implement Phar::running(), returns path or URL to currently executed phar - * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] - * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph] - * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] - * add Phar::delete() [Greg] - * implement Phar::unlinkArchive() [Greg] - -Security addition - * aliases are validated so that they contain no directory separators as intended - * on conversion to other formats, user-supplied aliases are validated - -Changes since 2.0.0RC2: - fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in - getSignature() call - fixed PHP Bug #49020: phar misinterprets ustar long filename standard - fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed - fixed PHP Bug #48791: open office files always reported as corrupted - fixed PHP Bug #48783: make install will fail saying phar file exists - fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location - fixed PHP Bug #48681: openssl signature verification for tar archives broken - fixed PHP Bug #48377: error message unclear on converting phar with existing file - fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists) - - make phar work in PHP 6 -Changes since 2.0.0RC1: - security vulnerability in handling of long tar filenames fixed - fixed PECL Bug #14646: phar error message unclear with php stream wrappers - fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() - fixed PHP Bug #48257: PharData throws an exception with non-phar tar - fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist - fixed PHP Bug #46032: PharData::__construct() - wrong memory read - fixed PHP Bug #46060: Phar::addEmptyDir() breaks - fixed PHP Bug #45907: undefined reference to \'PHP_SHA512Init\' - fixed PHP Bug #45726: PHP_Archive / Archive.php missing -Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, - conversion API refactored -Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes - implement OpenSSL asynchronous true package signing - add support for package signing to tar-based archives - require PHP 5.2.1+ -'; - -if (!class_exists("Phar") && !extension_loaded("Phar")) { - die("Extension phar not present"); -} -error_reporting(E_ALL & ~E_DEPRECATED); - -require_once 'PEAR/PackageFileManager2.php'; - -PEAR::setErrorHandling(PEAR_ERROR_DIE); - -$options = array( - 'filelistgenerator' => 'svn', - 'changelogoldtonew' => false, - 'simpleoutput' => true, - 'baseinstalldir' => '/', - 'packagedirectory' => dirname(__FILE__), - 'packagefile' => 'package.xml', - 'clearcontents' => true, - 'ignore' => array('package*.php', 'package*.xml'), - 'dir_roles' => array( - 'docs' => 'doc', - 'examples' => 'doc', - 'tests' => 'test', - 'phar' => 'src', - ), - 'exceptions' => array( - 'CREDITS' => 'doc', - 'EXPERIMENTAL' => 'doc', - 'LICENSE' => 'doc', - 'Makefile.frag' => 'src', - 'phar_path_check.re' => 'src', - 'TODO' => 'doc', - 'phar.phar' => 'script', - ), -); - -$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options); - -$package->clearDeps(); -$package->setPhpDep('5.2.1'); -$package->setPearInstallerDep('1.4.3'); -$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2'); -// all this false business sets the <providesextension> tag that allows us to have hash built -// in statically -$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash'); -$package->addExtensionDep('optional', 'spl'); -$package->addExtensionDep('optional', 'zlib'); -$package->setPackageType('extsrc'); -$package->addRelease(); -$package->setReleaseVersion(phpversion('phar')); -$package->setAPIVersion(Phar::apiVersion()); -$package->setReleaseStability('stable'); -$package->setAPIStability('stable'); -$package->setNotes("\n$notes\n"); -//$package->addGlobalReplacement('package-info', '@package_version@', 'version'); -$package->generateContents(); - -if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { - $package->writePackageFile(); -} else { - $package->debugPackageFile(); -} - -?> diff --git a/ext/phar/package.xml b/ext/phar/package.xml index 45bdb9edcb..4a9798e252 100644 --- a/ext/phar/package.xml +++ b/ext/phar/package.xml @@ -941,7 +941,6 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement <file name="zf_test.phpt" role="test" /> </dir> <!-- /tests --> <file name="build_precommand.php" role="php" /> - <file name="cgidebug" role="data" /> <file name="config.m4" role="src" /> <file name="config.w32" role="src" /> <file name="CREDITS" role="doc" /> diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 2a47d3d035..cc7eac717d 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2647,11 +2647,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, len = -len; } user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else + if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (closeoldfile) { php_stream_close(oldfile); } diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index 9e968694c3..cb343675b5 100755 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc @@ -91,7 +91,7 @@ class PharCommand extends CLICommand 'h' => array( 'typ' => 'select', 'val' => NULL, - 'inf' => '<method> Selects the hash algorithmn.', + 'inf' => '<method> Selects the hash algorithm.', 'select' => array('md5' => 'MD5','sha1' => 'SHA1') ), 'i' => array( @@ -107,7 +107,7 @@ class PharCommand extends CLICommand 'l' => array( 'typ' => 'int', 'val' => 0, - 'inf' => '<level> Number of preceeding subdirectories to strip from file entries', + 'inf' => '<level> Number of preceding subdirectories to strip from file entries', ), 'm' => array( 'typ' => 'any', @@ -461,7 +461,7 @@ class PharCommand extends CLICommand 'typ' => 'any', 'val' => NULL, 'required' => 1, - 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching thegiven regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', + 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching the given regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', ); return $args; @@ -981,7 +981,7 @@ class PharCommand extends CLICommand 'type' => 'any', 'val' => NULL, 'required' => 1, - 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching thegiven regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', + 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching the given regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', ); return $args; } diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index de9fffc115..561ba7bf24 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -58,9 +58,6 @@ static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len TSRMLS_DC) /* {{{ */ { -#if PHP_MAJOR_VERSION >= 6 - int is_unicode = 0; -#endif HashTable *_SERVER; zval **stuff; char *path_info; @@ -76,18 +73,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char _SERVER = Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]); /* PATH_INFO and PATH_TRANSLATED should always be munged */ -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PATH_INFO", sizeof("PATH_INFO"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PATH_INFO", sizeof("PATH_INFO"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -96,38 +82,19 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO"), &temp, sizeof(zval **), NULL); } } -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PATH_TRANSLATED", sizeof("PHAR_PATH_TRANSLATED"), (void *) &temp, sizeof(zval **), NULL); } @@ -136,18 +103,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_REQUEST_URI) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -156,29 +112,14 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_REQUEST_URI", sizeof("PHAR_REQUEST_URI"), (void *) &temp, sizeof(zval **), NULL); } } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_PHP_SELF) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PHP_SELF", sizeof("PHP_SELF"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PHP_SELF", sizeof("PHP_SELF"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -187,68 +128,34 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PHP_SELF", sizeof("PHAR_PHP_SELF"), (void *) &temp, sizeof(zval **), NULL); } } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_SCRIPT_NAME) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); ZVAL_STRINGL(*stuff, entry, entry_len, 1); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_SCRIPT_NAME", sizeof("PHAR_SCRIPT_NAME"), (void *) &temp, sizeof(zval **), NULL); } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_SCRIPT_FILENAME) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_SCRIPT_FILENAME", sizeof("PHAR_SCRIPT_FILENAME"), (void *) &temp, sizeof(zval **), NULL); } } @@ -942,11 +849,7 @@ PHP_METHOD(Phar, webPhar) if (ext) { ++ext; -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val TSRMLS_CC)) { -#else if (SUCCESS == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { -#endif switch (Z_TYPE_PP(val)) { case IS_LONG: if (Z_LVAL_PP(val) == PHAR_MIME_PHP || Z_LVAL_PP(val) == PHAR_MIME_PHPS) { @@ -960,11 +863,6 @@ PHP_METHOD(Phar, webPhar) RETURN_FALSE; } break; -#if PHP_MAJOR_VERSION >= 6 - case IS_UNICODE: - zval_unicode_to_string(*(val) TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: mime_type = Z_STRVAL_PP(val); code = PHAR_MIME_OTHER; @@ -1015,26 +913,12 @@ PHP_METHOD(Phar, mungServer) for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(mungvalues)); SUCCESS == zend_hash_has_more_elements(Z_ARRVAL_P(mungvalues)); zend_hash_move_forward(Z_ARRVAL_P(mungvalues))) { zval **data = NULL; -#if PHP_MAJOR_VERSION >= 6 - zval *unicopy = NULL; -#endif if (SUCCESS != zend_hash_get_current_data(Z_ARRVAL_P(mungvalues), (void **) &data)) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to retrieve array value in Phar::mungServer()"); return; } -#if PHP_MAJOR_VERSION >= 6 - if (Z_TYPE_PP(data) == IS_UNICODE) { - MAKE_STD_ZVAL(unicopy); - *unicopy = **data; - zval_copy_ctor(unicopy); - INIT_PZVAL(unicopy); - zval_unicode_to_string(unicopy TSRMLS_CC); - data = &unicopy; - } -#endif - if (Z_TYPE_PP(data) != IS_STRING) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME"); return; @@ -1056,11 +940,6 @@ PHP_METHOD(Phar, mungServer) if (Z_STRLEN_PP(data) == sizeof("SCRIPT_FILENAME")-1 && !strncmp(Z_STRVAL_PP(data), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1)) { PHAR_GLOBALS->phar_SERVER_mung_list |= PHAR_MUNG_SCRIPT_FILENAME; } -#if PHP_MAJOR_VERSION >= 6 - if (unicopy) { - zval_ptr_dtor(&unicopy); - } -#endif } } /* }}} */ @@ -5037,11 +4916,7 @@ PHP_METHOD(PharFileInfo, getContent) phar_seek_efp(link, 0, SEEK_SET, 0, 0 TSRMLS_CC); Z_TYPE_P(return_value) = IS_STRING; -#if PHP_MAJOR_VERSION >= 6 - Z_STRLEN_P(return_value) = php_stream_copy_to_mem(fp, (void **) &(Z_STRVAL_P(return_value)), link->uncompressed_filesize, 0); -#else Z_STRLEN_P(return_value) = php_stream_copy_to_mem(fp, &(Z_STRVAL_P(return_value)), link->uncompressed_filesize, 0); -#endif if (!Z_STRVAL_P(return_value)) { Z_STRVAL_P(return_value) = estrndup("", 0); diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 2f72551262..bf0913d683 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -207,30 +207,19 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, char *pat fpf = php_stream_alloc(&phar_ops, idata, NULL, mode); php_url_free(resource); efree(internal_file); -#if PHP_MAJOR_VERSION >= 6 - if (context && context->options && phar_find_key(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption TSRMLS_CC)) { -#else + if (context && context->options && zend_hash_find(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption) == SUCCESS) { -#endif pharcontext = HASH_OF(*pzoption); if (idata->internal_file->uncompressed_filesize == 0 && idata->internal_file->compressed_filesize == 0 -#if PHP_MAJOR_VERSION >= 6 - && phar_find_key(pharcontext, "compress", sizeof("compress"), (void**)&pzoption TSRMLS_CC) -#else && zend_hash_find(pharcontext, "compress", sizeof("compress"), (void**)&pzoption) == SUCCESS -#endif && Z_TYPE_PP(pzoption) == IS_LONG && (Z_LVAL_PP(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0 ) { idata->internal_file->flags &= ~PHAR_ENT_COMPRESSION_MASK; idata->internal_file->flags |= Z_LVAL_PP(pzoption); } -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption TSRMLS_CC)) { -#else if (zend_hash_find(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption) == SUCCESS) { -#endif if (idata->internal_file->metadata) { zval_ptr_dtor(&idata->internal_file->metadata); idata->internal_file->metadata = NULL; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 917734c992..43d1ede238 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -986,11 +986,8 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau len = -len; } user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else + if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (error) { spprintf(error, 0, "unable to read resource to copy stub to new tar-based phar \"%s\"", phar->fname); } diff --git a/ext/phar/util.c b/ext/phar/util.c index d5b6a5dd13..5fcb2b6573 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -210,8 +210,6 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, return FAILURE; } #endif - - filename_len = strlen(entry.tmp); filename = entry.tmp; /* only check openbasedir for files, not for phar streams */ diff --git a/ext/phar/zip.c b/ext/phar/zip.c index ced975cb38..3372622552 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -603,11 +603,7 @@ foundit: php_stream_filter_append(&fp->readfilters, filter); -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); #if PHP_VERSION_ID < 50207 PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); @@ -628,11 +624,7 @@ foundit: php_stream_filter_append(&fp->readfilters, filter); -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); #if PHP_VERSION_ID < 50207 PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); @@ -643,11 +635,7 @@ foundit: php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); } else { -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); PHAR_ZIP_FAIL("unable to read in alias, truncated"); } @@ -1252,11 +1240,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (error) { spprintf(error, 0, "unable to read resource to copy stub to new zip-based phar \"%s\"", phar->fname); } diff --git a/ext/posix/tests/posix_getegid_basic.phpt b/ext/posix/tests/posix_getegid_basic.phpt new file mode 100644 index 0000000000..d0016f497f --- /dev/null +++ b/ext/posix/tests/posix_getegid_basic.phpt @@ -0,0 +1,15 @@ +--TEST-- +Test function posix_getegid() by calling it with its expected arguments +--CREDITS-- +Michelangelo van Dam dragonbe@gmail.com +#PHPTestFest Dutch PHP Conference 2012 +--SKIPIF-- +<?php + if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; +?> +--FILE-- +<?php +var_dump(posix_getegid()); +?> +--EXPECTF-- +int(%d) diff --git a/ext/recode/recode.c b/ext/recode/recode.c index e17429b238..a1a74deff3 100644 --- a/ext/recode/recode.c +++ b/ext/recode/recode.c @@ -63,7 +63,7 @@ ZEND_END_MODULE_GLOBALS(recode) # define ReSG(v) (recode_globals.v) #endif -ZEND_DECLARE_MODULE_GLOBALS(recode); +ZEND_DECLARE_MODULE_GLOBALS(recode) static PHP_GINIT_FUNCTION(recode); /* {{{ arginfo */ diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9346587eb7..7c9981924d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1457,6 +1457,49 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c } /* }}} */ +/* {{{ _reflection_param_get_default_param */ +static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS) +{ + reflection_object *intern; + parameter_reference *param; + + intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC); + if (intern == NULL || intern->ptr == NULL) { + if (EG(exception) && Z_OBJCE_P(EG(exception)) == reflection_exception_ptr) { + return NULL; + } + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); + } + + param = intern->ptr; + if (param->fptr->type != ZEND_USER_FUNCTION) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions"); + return NULL; + } + + return param; +} +/* }}} */ + +/* {{{ _reflection_param_get_default_precv */ +static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, parameter_reference *param) +{ + zend_op *precv; + + if (param == NULL) { + return NULL; + } + + precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); + if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value"); + return NULL; + } + + return precv; +} +/* }}} */ + /* {{{ Preventing __clone from being called */ ZEND_METHOD(reflection, __clone) { @@ -2520,9 +2563,7 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) { RETURN_FALSE; } - if (param->offset < param->required) { - RETURN_FALSE; - } + precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { RETURN_FALSE; @@ -2535,27 +2576,20 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) Returns the default value of this parameter or throws an exception */ ZEND_METHOD(reflection_parameter, getDefaultValue) { - reflection_object *intern; parameter_reference *param; zend_op *precv; if (zend_parse_parameters_none() == FAILURE) { return; } - GET_REFLECTION_OBJECT_PTR(param); - if (param->fptr->type != ZEND_USER_FUNCTION) - { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions"); + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { return; } - if (param->offset < param->required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional"); - return; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error"); + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (!precv) { return; } @@ -2569,6 +2603,54 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) } /* }}} */ +/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant() + Returns whether the default value of this parameter is constant */ +ZEND_METHOD(reflection_parameter, isDefaultValueConstant) +{ + zend_op *precv; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { + RETURN_FALSE; + } + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + RETURN_TRUE; + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName() + Returns the default value's constant name if default value is constant or null */ +ZEND_METHOD(reflection_parameter, getDefaultValueConstantName) +{ + zend_op *precv; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { + return; + } + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + RETURN_STRINGL(Z_STRVAL_P(precv->op2.zv), Z_STRLEN_P(precv->op2.zv), 1); + } +} +/* }}} */ + /* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ ZEND_METHOD(reflection_method, export) @@ -2923,6 +3005,14 @@ ZEND_METHOD(reflection_method, invokeArgs) fcc.calling_scope = obj_ce; fcc.called_scope = intern->ce; fcc.object_ptr = object; + + /* + * Copy the zend_function when calling via handler (e.g. Closure::__invoke()) + */ + if (mptr->type == ZEND_INTERNAL_FUNCTION && + (mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) { + fcc.function_handler = _copy_function(mptr TSRMLS_CC); + } result = zend_call_function(&fci, &fcc TSRMLS_CC); @@ -4374,8 +4464,10 @@ ZEND_METHOD(reflection_class, getTraitAliases) int method_name_len; zend_trait_method_reference *cur_ref = ce->trait_aliases[i]->trait_method; - method_name_len = spprintf(&method_name, 0, "%s::%s", cur_ref->class_name, cur_ref->method_name); - add_assoc_stringl_ex(return_value, ce->trait_aliases[i]->alias, ce->trait_aliases[i]->alias_len + 1, method_name, method_name_len, 0); + if (ce->trait_aliases[i]->alias) { + method_name_len = spprintf(&method_name, 0, "%s::%s", cur_ref->class_name, cur_ref->method_name); + add_assoc_stringl_ex(return_value, ce->trait_aliases[i]->alias, ce->trait_aliases[i]->alias_len + 1, method_name, method_name_len, 0); + } i++; } } @@ -5904,6 +5996,8 @@ static const zend_function_entry reflection_parameter_functions[] = { ZEND_ME(reflection_parameter, isOptional, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, isDefaultValueAvailable, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getDefaultValue, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, isDefaultValueConstant, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, getDefaultValueConstantName, arginfo_reflection__void, 0) PHP_FE_END }; diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt new file mode 100644 index 0000000000..cdd00d2624 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt @@ -0,0 +1,52 @@ +--TEST-- +ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() +--FILE-- +<?php + +define("CONST_TEST_1", "const1"); + +function ReflectionParameterTest($test1=array(), $test2 = CONST_TEST_1) { + echo $test; +} +$reflect = new ReflectionFunction('ReflectionParameterTest'); +foreach($reflect->getParameters() as $param) { + if($param->getName() == 'test1') { + var_dump($param->isDefaultValueConstant()); + } + if($param->getName() == 'test2') { + var_dump($param->isDefaultValueConstant()); + } + if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) { + var_dump($param->getDefaultValueConstantName()); + } +} + +class Foo2 { + const bar = 'Foo2::bar'; +} + +class Foo { + const bar = 'Foo::bar'; + + public function baz($param1 = self::bar, $param2=Foo2::bar, $param3=CONST_TEST_1) { + } +} + +$method = new ReflectionMethod('Foo', 'baz'); +$params = $method->getParameters(); + +foreach ($params as $param) { + if ($param->isDefaultValueConstant()) { + var_dump($param->getDefaultValueConstantName()); + } +} +?> +==DONE== +--EXPECT-- +bool(false) +bool(true) +string(12) "CONST_TEST_1" +string(9) "self::bar" +string(9) "Foo2::bar" +string(12) "CONST_TEST_1" +==DONE== diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt new file mode 100644 index 0000000000..1ee9e93735 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt @@ -0,0 +1,30 @@ +--TEST-- +ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace +--FILE-- +<?php + +namespace ReflectionTestNamespace { + CONST TEST_CONST_1 = "Test Const 1"; + + class TestClass { + const TEST_CONST_2 = "Test Const 2 in class"; + } +} + +namespace { + function ReflectionParameterTest($test=ReflectionTestNamespace\TestClass::TEST_CONST_2, $test2 = ReflectionTestNamespace\CONST_TEST_1) { + echo $test; + } + $reflect = new ReflectionFunction('ReflectionParameterTest'); + foreach($reflect->getParameters() as $param) { + if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) { + echo $param->getDefaultValueConstantName() . "\n"; + } + } + echo "==DONE=="; +} +?> +--EXPECT-- +ReflectionTestNamespace\TestClass::TEST_CONST_2 +ReflectionTestNamespace\CONST_TEST_1 +==DONE== diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt new file mode 100644 index 0000000000..a2c2d24582 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt @@ -0,0 +1,23 @@ +--TEST-- +ReflectionParameter::getDefaultValueConstant() should raise exception on non optional parameter +--FILE-- +<?php + +define("CONST_TEST_1", "const1"); + +function ReflectionParameterTest($test, $test2 = CONST_TEST_1) { + echo $test; +} +$reflect = new ReflectionFunction('ReflectionParameterTest'); +foreach($reflect->getParameters() as $param) { + try { + echo $param->getDefaultValueConstantName() . "\n"; + } + catch(ReflectionException $e) { + echo $e->getMessage() . "\n"; + } +} +?> +--EXPECT-- +Internal error: Failed to retrieve the default value +CONST_TEST_1 diff --git a/ext/reflection/tests/bug62384.phpt b/ext/reflection/tests/bug62384.phpt new file mode 100644 index 0000000000..90a871fa2a --- /dev/null +++ b/ext/reflection/tests/bug62384.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #62384 (Attempting to invoke a Closure more than once causes segfaul) +--FILE-- +<?php + +$closure1 = function($val){ return $val; }; +$closure2 = function($val){ return $val; }; + +$reflection_class = new ReflectionClass($closure1); +$reflection_method = $reflection_class->getMethod('__invoke'); + +$arguments1 = array('hello'); +$arguments2 = array('world'); + +var_dump($reflection_method->invokeArgs($closure1, $arguments1)); +var_dump($reflection_method->invokeArgs($closure2, $arguments2)); + +?> +--EXPECT-- +string(5) "hello" +string(5) "world" diff --git a/ext/reflection/tests/bug62715.phpt b/ext/reflection/tests/bug62715.phpt new file mode 100644 index 0000000000..feb67f614b --- /dev/null +++ b/ext/reflection/tests/bug62715.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result) +--FILE-- +<?php + +function test(PDO $a = null, $b = 0, array $c) {} +$r = new ReflectionFunction('test'); + +foreach ($r->getParameters() as $p) { + var_dump($p->isDefaultValueAvailable()); +} + +foreach ($r->getParameters() as $p) { + if ($p->isDefaultValueAvailable()) { + var_dump($p->getDefaultValue()); + } +} +?> +--EXPECT-- +bool(true) +bool(true) +bool(false) +NULL +int(0) diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 2ff5302f78..84a28d3427 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -63,7 +63,7 @@ static zval *ps_call_handler(zval *func, int argc, zval **argv TSRMLS_DC) } #define STDVARS \ - zval *retval; \ + zval *retval = NULL; \ int ret = FAILURE #define PSF(a) PS(mod_user_names).name.ps_##a @@ -99,6 +99,7 @@ PS_OPEN_FUNC(user) PS_CLOSE_FUNC(user) { + zend_bool bailout = 0; STDVARS; if (!PS(mod_user_implemented)) { @@ -106,9 +107,21 @@ PS_CLOSE_FUNC(user) return SUCCESS; } - retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + zend_try { + retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + } zend_catch { + bailout = 1; + } zend_end_try(); + PS(mod_user_implemented) = 0; + if (bailout) { + if (retval) { + zval_ptr_dtor(&retval); + } + zend_bailout(); + } + FINISH; } diff --git a/ext/session/session.c b/ext/session/session.c index 7a8199d810..0c08d49681 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -59,7 +59,7 @@ #include "mod_mm.h" #endif -PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps); +PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps) static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC); static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); diff --git a/ext/session/tests/bug60634_error_5.phpt b/ext/session/tests/bug60634_error_5.phpt index 376b65f20b..8081ab988a 100644 --- a/ext/session/tests/bug60634_error_5.phpt +++ b/ext/session/tests/bug60634_error_5.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in close during exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 455280fc74..5514f0fc89 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1417,7 +1417,11 @@ SXE_METHOD(asXML) xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding); xmlOutputBufferFlush(outbuf); +#ifdef LIBXML2_NEW_BUFFER + RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1); +#else RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1); +#endif xmlOutputBufferClose(outbuf); } } else { @@ -1513,22 +1517,28 @@ static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, } /* }}} */ -/* {{{ proto string SimpleXMLElement::getDocNamespaces([bool recursive]) +/* {{{ proto string SimpleXMLElement::getDocNamespaces([bool recursive [, bool from_root]) Return all namespaces registered with document */ SXE_METHOD(getDocNamespaces) { - zend_bool recursive = 0; + zend_bool recursive = 0, from_root = 1; php_sxe_object *sxe; + xmlNodePtr node; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &recursive) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &recursive, &from_root) == FAILURE) { return; } array_init(return_value); sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); + if(from_root){ + node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr); + }else{ + GET_NODE(sxe, node); + } - sxe_add_registered_namespaces(sxe, xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr), recursive, return_value TSRMLS_CC); + sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC); } /* }}} */ @@ -2518,6 +2528,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_simplexmlelement_getnamespaces, 0, 0, 0) ZEND_ARG_INFO(0, recursve) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_simplexmlelement_getdocnamespaces, 0, 0, 0) + ZEND_ARG_INFO(0, recursve) + ZEND_ARG_INFO(0, from_root) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_simplexmlelement_children, 0, 0, 0) ZEND_ARG_INFO(0, ns) ZEND_ARG_INFO(0, is_prefix) @@ -2586,7 +2601,7 @@ static const zend_function_entry sxe_functions[] = { /* {{{ */ SXE_ME(attributes, arginfo_simplexmlelement_children, ZEND_ACC_PUBLIC) SXE_ME(children, arginfo_simplexmlelement_children, ZEND_ACC_PUBLIC) SXE_ME(getNamespaces, arginfo_simplexmlelement_getnamespaces, ZEND_ACC_PUBLIC) - SXE_ME(getDocNamespaces, arginfo_simplexmlelement_getnamespaces, ZEND_ACC_PUBLIC) + SXE_ME(getDocNamespaces, arginfo_simplexmlelement_getdocnamespaces, ZEND_ACC_PUBLIC) SXE_ME(getName, arginfo_simplexmlelement__void, ZEND_ACC_PUBLIC) SXE_ME(addChild, arginfo_simplexmlelement_addchild, ZEND_ACC_PUBLIC) SXE_ME(addAttribute, arginfo_simplexmlelement_addchild, ZEND_ACC_PUBLIC) diff --git a/ext/simplexml/tests/bug48601.phpt b/ext/simplexml/tests/bug48601.phpt index 24bf2bf8a5..0b81facf49 100644 --- a/ext/simplexml/tests/bug48601.phpt +++ b/ext/simplexml/tests/bug48601.phpt @@ -10,7 +10,7 @@ $sxe = simplexml_load_string('<root><node1>1</node1></root>'); $nodes = $sxe->xpath("/root/node2/@test"); if (! is_array($nodes)) { - echo "An error occured\n"; + echo "An error occurred\n"; } else { echo "Result Count: " . count($nodes) . "\n"; } diff --git a/ext/simplexml/tests/feature55218.phpt b/ext/simplexml/tests/feature55218.phpt new file mode 100644 index 0000000000..25ea534376 --- /dev/null +++ b/ext/simplexml/tests/feature55218.phpt @@ -0,0 +1,117 @@ +--TEST-- +Bug #55218 getDocNamespaces from current element and not root +--SKIPIF-- +<?php +if (!extension_loaded("simplexml")) print "skip SimpleXML not present"; +if (!extension_loaded("libxml")) print "skip LibXML not present"; +?> +--FILE-- +<?php + +$x = new SimpleXMLElement( +'<?xml version="1.0" standalone="yes"?> +<people xmlns:p="http://example.org/p" > + <person id="1" xmlns:t="http://example.org/t" > + <t:name>John Doe</t:name> + </person> + <person id="2">Susie Q. Public</person> + <o> + <p:div>jdslkfjsldk jskdfjsmlkjfkldjkjflskj kljfslkjf sldk</p:div> + </o> +</people>'); + +echo "getDocNamespaces\n"; +echo "\nBackwards Compatibility:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true) ) ; +var_dump( $x->person[0]->getDocNamespaces(true) ); +var_dump( $x->person[1]->getDocNamespaces(true) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false) ); +var_dump( $x->person[0]->getDocNamespaces(false) ); +var_dump( $x->person[1]->getDocNamespaces(false) ); + +echo "\n\nUsing new 'from_root' bool set to false:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true, false) ) ; +var_dump( $x->person[0]->getDocNamespaces(true, false) ); +var_dump( $x->person[1]->getDocNamespaces(true, false) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false, false) ); +var_dump( $x->person[0]->getDocNamespaces(false, false) ); +var_dump( $x->person[1]->getDocNamespaces(false, false) ); + +?> +===DONE=== +--EXPECTF-- +getDocNamespaces + +Backwards Compatibility: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} + + +Using new 'from_root' bool set to false: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} +===DONE===
\ No newline at end of file diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 84d603b591..5addec4ff2 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1818,11 +1818,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * zend_hash_internal_pointer_reset_ex(model->u.content, &pos); while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) { - if ((*tmp)->min_occurs > 0) { + if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) { + if (!strict || (*tmp)->min_occurs > 0) { return 0; } } + strict = 1; zend_hash_move_forward_ex(model->u.content, &pos); } return 1; @@ -1845,7 +1846,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return ret; } case XSD_CONTENT_GROUP: { - return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC); + return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC); } default: break; diff --git a/ext/soap/tests/bugs/bug50997.phpt b/ext/soap/tests/bugs/bug50997.phpt new file mode 100644 index 0000000000..0508aaccdc --- /dev/null +++ b/ext/soap/tests/bugs/bug50997.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +<?php +$soapClient = new SoapClient(__DIR__ . '/bug50997.wsdl', array('trace' => 1, 'exceptions'=>0)); +$params = array('code'=>'foo'); +$soapClient->newOperation($params); +echo $soapClient->__getLastRequest(); +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/service2/"><SOAP-ENV:Body><ns1:NewOperation><code>foo</code></ns1:NewOperation></SOAP-ENV:Body></SOAP-ENV:Envelope> diff --git a/ext/soap/tests/bugs/bug50997.wsdl b/ext/soap/tests/bugs/bug50997.wsdl new file mode 100644 index 0000000000..16c6d36752 --- /dev/null +++ b/ext/soap/tests/bugs/bug50997.wsdl @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/service2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="service2" targetNamespace="http://www.example.org/service2/"> + <wsdl:types> + <xsd:schema targetNamespace="http://www.example.org/service2/"> + <xsd:element name="NewOperation"> + <xsd:complexType> + <xsd:choice> + <xsd:sequence> + <xsd:element name="firstName" type="xsd:string"> </xsd:element> + <xsd:element name="surName" type="xsd:string"/> + </xsd:sequence> + <xsd:element name="code" type="xsd:string"/> + </xsd:choice> + </xsd:complexType> + </xsd:element> + <xsd:element name="NewOperationResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="out" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="NewOperationRequest"> + <wsdl:part element="tns:NewOperation" name="parameters"/> + </wsdl:message> + <wsdl:message name="NewOperationResponse"> + <wsdl:part element="tns:NewOperationResponse" name="parameters"/> + </wsdl:message> + <wsdl:portType name="service2"> + <wsdl:operation name="NewOperation"> + <wsdl:input message="tns:NewOperationRequest"/> + <wsdl:output message="tns:NewOperationResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="service2SOAP" type="tns:service2"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="NewOperation"> + <soap:operation soapAction="http://www.example.org/service2/NewOperation"/> + <wsdl:input> + <soap:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="service2"> + <wsdl:port binding="tns:service2SOAP" name="service2SOAP"> + <soap:address location="test://"/> + </wsdl:port> + </wsdl:service> + </wsdl:definitions> diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index ccd9b1d2a8..5619c9c7fb 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -19,11 +19,12 @@ /* $Id$ */ #if defined(MCAST_JOIN_GROUP) && \ - (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) + (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \ + !defined(__APPLE__) #define RFC3678_API 1 /* has block/unblock and source membership, in this case for both IPv4 and IPv6 */ #define HAS_MCAST_EXT 1 -#elif defined(IP_ADD_SOURCE_MEMBERSHIP) +#elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__) /* has block/unblock and source membership, but only for IPv4 */ #define HAS_MCAST_EXT 1 #endif diff --git a/ext/sockets/tests/bug63000.phpt b/ext/sockets/tests/bug63000.phpt new file mode 100644 index 0000000000..c806ba4c08 --- /dev/null +++ b/ext/sockets/tests/bug63000.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #63000: Multicast on OSX +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('skip sockets extension not available.'); +} +if (PHP_OS !== 'Darwin') { + die('is not OSX.'); +} +--FILE-- +<?php +$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); +socket_bind($socket, '0.0.0.0', 31057); + +$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array( + "group" => '224.0.0.251', + "interface" => 0, +)); +var_dump($so); +--EXPECTF-- +bool(true) diff --git a/ext/sockets/tests/socket_import_stream-4-win.phpt b/ext/sockets/tests/socket_import_stream-4-win.phpt new file mode 100644 index 0000000000..e2fc523ce5 --- /dev/null +++ b/ext/sockets/tests/socket_import_stream-4-win.phpt @@ -0,0 +1,106 @@ +--TEST-- +socket_import_stream: effects of closing +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die("skip Not Valid for Linux"); +} + +--FILE-- +<?php + +function test($stream, $sock) { + if ($stream !== null) { + echo "stream_set_blocking "; + print_r(stream_set_blocking($stream, 0)); + echo "\n"; + } + if ($sock !== null) { + echo "socket_set_block "; + print_r(socket_set_block($sock)); + echo "\n"; + echo "socket_get_option "; + print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE)); + echo "\n"; + } + echo "\n"; +} + +echo "normal\n"; +$stream0 = stream_socket_server("udp://0.0.0.0:58380", $errno, $errstr, STREAM_SERVER_BIND); +$sock0 = socket_import_stream($stream0); +test($stream0, $sock0); + +echo "\nunset stream\n"; +$stream1 = stream_socket_server("udp://0.0.0.0:58381", $errno, $errstr, STREAM_SERVER_BIND); +$sock1 = socket_import_stream($stream1); +unset($stream1); +test(null, $sock1); + +echo "\nunset socket\n"; +$stream2 = stream_socket_server("udp://0.0.0.0:58382", $errno, $errstr, STREAM_SERVER_BIND); +$sock2 = socket_import_stream($stream2); +unset($sock2); +test($stream2, null); + +echo "\nclose stream\n"; +$stream3 = stream_socket_server("udp://0.0.0.0:58383", $errno, $errstr, STREAM_SERVER_BIND); +$sock3 = socket_import_stream($stream3); +fclose($stream3); +test($stream3, $sock3); + +echo "\nclose socket\n"; +$stream4 = stream_socket_server("udp://0.0.0.0:58384", $errno, $errstr, STREAM_SERVER_BIND); +$sock4 = socket_import_stream($stream4); +socket_close($sock4); +test($stream4, $sock4); + +echo "Done.\n"; +--EXPECTF-- +normal +stream_set_blocking 1 +socket_set_block 1 +socket_get_option 2 + + +unset stream +socket_set_block 1 +socket_get_option 2 + + +unset socket +stream_set_blocking 1 + + +close stream +stream_set_blocking +Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d + +socket_set_block +Warning: socket_set_block(): An operation was attempted on something that is not a socket. + in %ssocket_import_stream-4-win.php on line %d + +Warning: socket_set_block(): unable to set blocking mode [%d]: An operation was attempted on something that is not a socket. + in %ssocket_import_stream-4-win.php on line %d + +socket_get_option +Warning: socket_get_option(): unable to retrieve socket option [%d]: An operation was attempted on something that is not a socket. + in %ssocket_import_stream-4-win.php on line %d + + + +close socket +stream_set_blocking +Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d + +socket_set_block +Warning: socket_set_block(): %d is not a valid Socket resource in %s on line %d + +socket_get_option +Warning: socket_get_option(): %d is not a valid Socket resource in %s on line %d + + +Done. diff --git a/ext/sockets/tests/socket_import_stream-4.phpt b/ext/sockets/tests/socket_import_stream-4.phpt index 33ab104d62..8095d8dac7 100644 --- a/ext/sockets/tests/socket_import_stream-4.phpt +++ b/ext/sockets/tests/socket_import_stream-4.phpt @@ -5,7 +5,9 @@ socket_import_stream: effects of closing if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } - +if(substr(PHP_OS, 0, 3) == 'WIN' ) { + die("skip Not Valid for Windows"); +} --FILE-- <?php diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt index 96cbf8f4db..bf95044d48 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt @@ -25,7 +25,7 @@ if (!extension_loaded('sockets')) { $len = strlen($msg); $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address, 1223); if ($bytes_sent == -1) { - die('An error occured while sending to the socket'); + die('An error occurred while sending to the socket'); } else if ($bytes_sent != $len) { die($bytes_sent . ' bytes have been sent instead of the ' . $len . ' bytes expected'); } @@ -36,7 +36,7 @@ if (!extension_loaded('sockets')) { socket_recvfrom($socket, $buf, 12, 0, $from); // cause warning $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from, $port); if ($bytes_received == -1) { - die('An error occured while receiving from the socket'); + die('An error occurred while receiving from the socket'); } else if ($bytes_received != $len) { die($bytes_received . ' bytes have been received instead of the ' . $len . ' bytes expected'); } diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt index 1fa42fd5da..04f62eddd3 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt @@ -26,7 +26,7 @@ require 'ipv6_skipif.inc'; $len = strlen($msg); $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address, 1223); if ($bytes_sent == -1) { - die('An error occured while sending to the socket'); + die('An error occurred while sending to the socket'); } else if ($bytes_sent != $len) { die($bytes_sent . ' bytes have been sent instead of the ' . $len . ' bytes expected'); } @@ -37,7 +37,7 @@ require 'ipv6_skipif.inc'; socket_recvfrom($socket, $buf, 12, 0, $from); // cause warning $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from, $port); if ($bytes_received == -1) { - die('An error occured while receiving from the socket'); + die('An error occurred while receiving from the socket'); } else if ($bytes_received != $len) { die($bytes_received . ' bytes have been received instead of the ' . $len . ' bytes expected'); } diff --git a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt index 4cfdebbcbe..55ad75c65e 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt @@ -30,7 +30,7 @@ if (!extension_loaded('sockets')) { $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address); if ($bytes_sent == -1) { @unlink($address); - die('An error occured while sending to the socket'); + die('An error occurred while sending to the socket'); } else if ($bytes_sent != $len) { @unlink($address); die($bytes_sent . ' bytes have been sent instead of the ' . $len . ' bytes expected'); @@ -41,7 +41,7 @@ if (!extension_loaded('sockets')) { $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from); if ($bytes_received == -1) { @unlink($address); - die('An error occured while receiving from the socket'); + die('An error occurred while receiving from the socket'); } else if ($bytes_received != $len) { @unlink($address); die($bytes_received . ' bytes have been received instead of the ' . $len . ' bytes expected'); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index e448731a52..3c6b41edbc 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -58,6 +58,10 @@ PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator; #define SPL_ARRAY_INT_MASK 0xFFFF0000 #define SPL_ARRAY_CLONE_MASK 0x0300FFFF +#define SPL_ARRAY_METHOD_NO_ARG 0 +#define SPL_ARRAY_METHOD_USE_ARG 1 +#define SPL_ARRAY_METHOD_MAY_USER_ARG 2 + typedef struct _spl_array_object { zend_object std; zval *array; @@ -302,41 +306,41 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, long index; HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); -/* We cannot get the pointer pointer so we don't allow it here for now - if (check_inherited && intern->fptr_offset_get) { - return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset); - }*/ - if (!offset) { return &EG(uninitialized_zval_ptr); } if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->nApplyCount > 0)) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); - return &EG(uninitialized_zval_ptr);; + return &EG(error_zval_ptr);; } switch(Z_TYPE_P(offset)) { + case IS_NULL: + Z_STRVAL_P(offset) = ""; + Z_STRLEN_P(offset) = 0; case IS_STRING: if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) { - if (type == BP_VAR_W || type == BP_VAR_RW) { - zval *value; - ALLOC_INIT_ZVAL(value); - zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL); - if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) != FAILURE) { - return retval; - } else { - return &EG(uninitialized_zval_ptr); + switch (type) { + case BP_VAR_R: + zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset)); + case BP_VAR_UNSET: + case BP_VAR_IS: + retval = &EG(uninitialized_zval_ptr); + break; + case BP_VAR_RW: + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + case BP_VAR_W: { + zval *value; + ALLOC_INIT_ZVAL(value); + zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), (void **)&retval); } - } else { - zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset)); - return &EG(uninitialized_zval_ptr); } - } else { - return retval; } - case IS_DOUBLE: + return retval; case IS_RESOURCE: + zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(offset), Z_LVAL_P(offset)); + case IS_DOUBLE: case IS_BOOL: case IS_LONG: if (offset->type == IS_DOUBLE) { @@ -345,26 +349,27 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, index = Z_LVAL_P(offset); } if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) { - if (type == BP_VAR_W || type == BP_VAR_RW) { - zval *value; - ALLOC_INIT_ZVAL(value); - zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL); - if (zend_hash_index_find(ht, index, (void **) &retval) != FAILURE) { - return retval; - } else { - return &EG(uninitialized_zval_ptr); - } - } else { - zend_error(E_NOTICE, "Undefined offset: %ld", index); - return &EG(uninitialized_zval_ptr); + switch (type) { + case BP_VAR_R: + zend_error(E_NOTICE, "Undefined offset: %ld", index); + case BP_VAR_UNSET: + case BP_VAR_IS: + retval = &EG(uninitialized_zval_ptr); + break; + case BP_VAR_RW: + zend_error(E_NOTICE, "Undefined offset: %ld", index); + case BP_VAR_W: { + zval *value; + ALLOC_INIT_ZVAL(value); + zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), (void **)&retval); + } } - } else { - return retval; } - break; + return retval; default: zend_error(E_WARNING, "Illegal offset type"); - return &EG(uninitialized_zval_ptr); + return (type == BP_VAR_W || type == BP_VAR_RW) ? + &EG(error_zval_ptr) : &EG(uninitialized_zval_ptr); } } /* }}} */ @@ -515,11 +520,11 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval } if (ht == &EG(symbol_table)) { if (zend_delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } } else { if (zend_symtable_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } else { spl_array_object *obj = intern; @@ -565,7 +570,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval return; } if (zend_hash_index_del(ht, index) == FAILURE) { - zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset)); + zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset)); } break; default: @@ -650,6 +655,28 @@ static int spl_array_has_dimension(zval *object, zval *offset, int check_empty T return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC); } /* }}} */ +/* {{{ spl_array_object_verify_pos_ex */ +static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix TSRMLS_DC) +{ + if (!ht) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix); + return FAILURE; + } + + if (object->pos && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht TSRMLS_CC) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix); + return FAILURE; + } + + return SUCCESS; +} /* }}} */ + +/* {{{ spl_array_object_verify_pos */ +static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht TSRMLS_DC) +{ + return spl_array_object_verify_pos_ex(object, ht, "" TSRMLS_CC); +} /* }}} */ + /* {{{ proto bool ArrayObject::offsetExists(mixed $index) proto bool ArrayIterator::offsetExists(mixed $index) Returns whether the requested $index exists. */ @@ -687,7 +714,6 @@ SPL_METHOD(Array, offsetSet) spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC); } /* }}} */ - void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); @@ -963,17 +989,11 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) { return zend_user_it_valid(iter TSRMLS_CC); } else { - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and is no longer an array"); - return FAILURE; - } - - if (object->pos && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): " TSRMLS_CC) == FAILURE) { return FAILURE; - } else { - return zend_hash_has_more_elements_ex(aht, &object->pos); } + + return zend_hash_has_more_elements_ex(aht, &object->pos); } } /* }}} */ @@ -1003,13 +1023,7 @@ static int spl_array_it_get_current_key(zend_object_iterator *iter, char **str_k if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) { return zend_user_it_get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC); } else { - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); - return HASH_KEY_NON_EXISTANT; - } - - if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) { return HASH_KEY_NON_EXISTANT; } @@ -1416,26 +1430,36 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - zval *tmp, *arg; + zval *tmp, *arg = NULL; zval *retval_ptr = NULL; MAKE_STD_ZVAL(tmp); Z_TYPE_P(tmp) = IS_ARRAY; Z_ARRVAL_P(tmp) = aht; - if (use_arg) { - if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (!use_arg) { + aht->nApplyCount++; + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 1, tmp, NULL TSRMLS_CC); + aht->nApplyCount--; + } else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) { Z_TYPE_P(tmp) = IS_NULL; zval_ptr_dtor(&tmp); - zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC); return; } aht->nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 2, tmp, arg TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, arg? 2 : 1, tmp, arg TSRMLS_CC); aht->nApplyCount--; } else { + if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + Z_TYPE_P(tmp) = IS_NULL; + zval_ptr_dtor(&tmp); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); + return; + } aht->nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 1, tmp, NULL TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 2, tmp, arg TSRMLS_CC); aht->nApplyCount--; } Z_TYPE_P(tmp) = IS_NULL; /* we want to destroy the zval, not the hashtable */ @@ -1451,35 +1475,35 @@ SPL_METHOD(cname, fname) \ spl_array_method(INTERNAL_FUNCTION_PARAM_PASSTHRU, #fname, sizeof(#fname)-1, use_arg); \ } -/* {{{ proto int ArrayObject::asort() - proto int ArrayIterator::asort() +/* {{{ proto int ArrayObject::asort([int $sort_flags = SORT_REGULAR ]) + proto int ArrayIterator::asort([int $sort_flags = SORT_REGULAR ]) Sort the entries by values. */ -SPL_ARRAY_METHOD(Array, asort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, asort, SPL_ARRAY_METHOD_MAY_USER_ARG) /* }}} */ -/* {{{ proto int ArrayObject::ksort() - proto int ArrayIterator::ksort() +/* {{{ proto int ArrayObject::ksort([int $sort_flags = SORT_REGULAR ]) + proto int ArrayIterator::ksort([int $sort_flags = SORT_REGULAR ]) Sort the entries by key. */ -SPL_ARRAY_METHOD(Array, ksort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, ksort, SPL_ARRAY_METHOD_MAY_USER_ARG) /* }}} */ /* {{{ proto int ArrayObject::uasort(callback cmp_function) proto int ArrayIterator::uasort(callback cmp_function) Sort the entries by values user defined function. */ -SPL_ARRAY_METHOD(Array, uasort, 1) /* }}} */ +SPL_ARRAY_METHOD(Array, uasort, SPL_ARRAY_METHOD_USE_ARG) /* }}} */ /* {{{ proto int ArrayObject::uksort(callback cmp_function) proto int ArrayIterator::uksort(callback cmp_function) Sort the entries by key using user defined function. */ -SPL_ARRAY_METHOD(Array, uksort, 1) /* }}} */ +SPL_ARRAY_METHOD(Array, uksort, SPL_ARRAY_METHOD_USE_ARG) /* }}} */ /* {{{ proto int ArrayObject::natsort() proto int ArrayIterator::natsort() Sort the entries by values using "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natsort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, natsort, SPL_ARRAY_METHOD_NO_ARG) /* }}} */ /* {{{ proto int ArrayObject::natcasesort() proto int ArrayIterator::natcasesort() Sort the entries by key using case insensitive "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natcasesort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, natcasesort, SPL_ARRAY_METHOD_NO_ARG) /* }}} */ /* {{{ proto mixed|NULL ArrayIterator::current() Return current array entry */ @@ -1494,13 +1518,7 @@ SPL_METHOD(Array, current) return; } - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1530,13 +1548,7 @@ void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ * ulong num_key; HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1564,13 +1576,12 @@ SPL_METHOD(Array, next) if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } - spl_array_next_ex(intern, aht TSRMLS_CC); + spl_array_next_no_verify(intern, aht TSRMLS_CC); } /* }}} */ @@ -1585,14 +1596,8 @@ SPL_METHOD(Array, valid) if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { RETURN_FALSE; } else { RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS); @@ -1611,14 +1616,8 @@ SPL_METHOD(Array, hasChildren) if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - RETURN_FALSE; - } - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { RETURN_FALSE; } @@ -1642,13 +1641,7 @@ SPL_METHOD(Array, getChildren) return; } - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1943,6 +1936,7 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate); REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); spl_handler_ArrayObject.clone_obj = spl_array_object_clone; @@ -1967,6 +1961,7 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator); REGISTER_SPL_IMPLEMENTS(ArrayIterator, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers)); spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator; @@ -1974,9 +1969,6 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator); spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator; - REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); - REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST); REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index dbae3e2a09..b86e68659d 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -433,7 +433,6 @@ static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_ if (file_path && !use_copy) { efree(file_path); } - use_copy = 1; file_path_len = 1; file_path = "/"; #endif @@ -1432,6 +1431,7 @@ SPL_METHOD(FilesystemIterator, __construct) SPL_METHOD(FilesystemIterator, rewind) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -1443,7 +1443,7 @@ SPL_METHOD(FilesystemIterator, rewind) } do { spl_filesystem_dir_read(intern TSRMLS_CC); - } while (spl_filesystem_is_dot(intern->u.dir.entry.d_name)); + } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); } /* }}} */ diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 1124285545..244bd3e0df 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -223,10 +223,14 @@ static zend_object_value spl_fixedarray_object_new_ex(zend_class_entry *class_ty if (orig && clone_orig) { spl_fixedarray_object *other = (spl_fixedarray_object*)zend_object_store_get_object(orig TSRMLS_CC); intern->ce_get_iterator = other->ce_get_iterator; - - intern->array = emalloc(sizeof(spl_fixedarray)); - spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC); - spl_fixedarray_copy(intern->array, other->array TSRMLS_CC); + if (!other->array) { + /* leave a empty object, will be dtor later by CLONE handler */ + zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0 TSRMLS_CC); + } else { + intern->array = emalloc(sizeof(spl_fixedarray)); + spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC); + spl_fixedarray_copy(intern->array, other->array TSRMLS_CC); + } } while (parent) { diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 19a68f6372..098d7dc1e2 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1289,6 +1289,8 @@ static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *met *object_ptr = intern->inner.zobject; function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len, key TSRMLS_CC); } + } else { + *object_ptr = intern->inner.zobject; } } return function_handler; @@ -2818,7 +2820,7 @@ SPL_METHOD(CachingIterator, offsetGet) } if (zend_symtable_find(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1, (void**)&value) == FAILURE) { - zend_error(E_NOTICE, "Undefined index: %s", arKey); + zend_error(E_NOTICE, "Undefined index: %s", arKey); return; } diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt new file mode 100644 index 0000000000..a4b0073d56 --- /dev/null +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt @@ -0,0 +1,52 @@ +--TEST-- +RecursiveDirectoryIterator::getBasePath() - basic test +--CREDITS-- +Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl> +#testfest AmsterdamPHP 2012-06-23 +--FILE-- +<?php +$depth0 = md5('recursiveDirectoryIterator::getSubPath'); +$depth1 = md5('depth1'); +$depth2 = md5('depth2'); +$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2; +mkdir($targetDir, 0777, true); +touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPath_test.tmp'); +$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0); +$it = new RecursiveIteratorIterator($iterator); + +$list = []; +while($it->valid()) { + $list[] = $it->getSubPath(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> +==DONE== +--CLEAN-- +<?php +function rrmdir($dir) { + foreach(glob($dir . '/*') as $file) { + if(is_dir($file)) { + rrmdir($file); + } else { + unlink($file); + } + } + + rmdir($dir); + } + + $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('recursiveDirectoryIterator::getSubPath'); + rrmdir($targetDir); +?> + +--EXPECTF-- +a0c967a6c2c34786e4802f59af9356f5 +a0c967a6c2c34786e4802f59af9356f5 +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507 +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507 +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507 +==DONE== diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt new file mode 100644 index 0000000000..5c294a93ad --- /dev/null +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt @@ -0,0 +1,58 @@ +--TEST-- +RecursiveDirectoryIterator::getBasePathname() - basic test +--CREDITS-- +Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl> +#testfest AmsterdamPHP 2012-06-23 +--FILE-- +<?php +$depth0 = md5('recursiveDirectoryIterator::getSubPathname'); +$depth1 = md5('depth1'); +$depth2 = md5('depth2'); +$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2; +mkdir($targetDir, 0777, true); +touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPathname_test_2.tmp'); +touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . 'getSubPathname_test_3.tmp'); +touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . 'getSubPathname_test_1.tmp'); +$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0); +$it = new RecursiveIteratorIterator($iterator); + +$list = []; +while($it->valid()) { + $list[] = $it->getSubPathname(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> +==DONE== +--CLEAN-- +<?php +function rrmdir($dir) { + foreach(glob($dir . '/*') as $file) { + if(is_dir($file)) { + rrmdir($file); + } else { + unlink($file); + } + } + + rmdir($dir); +} + +$targetDir = __DIR__ . DIRECTORY_SEPARATOR . md5('recursiveDirectoryIterator::getSubPathname'); +rrmdir($targetDir); +?> +--EXPECTF-- +. +. +.. +a0c967a6c2c34786e4802f59af9356f5%c. +a0c967a6c2c34786e4802f59af9356f5%c.. +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507%c. +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507%c.. +a0c967a6c2c34786e4802f59af9356f5%c9925aabb545352472e4d77942627b507%cgetSubPathname_test_2.tmp +a0c967a6c2c34786e4802f59af9356f5%cgetSubPathname_test_3.tmp +getSubPathname_test_1.tmp +==DONE== diff --git a/ext/spl/tests/SplFileObject_current_basic.phpt b/ext/spl/tests/SplFileObject_current_basic.phpt new file mode 100644 index 0000000000..d3f4802a53 --- /dev/null +++ b/ext/spl/tests/SplFileObject_current_basic.phpt @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::current basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +echo $s->current(); + +?> +--EXPECT-- +<?php diff --git a/ext/spl/tests/SplFileObject_current_error001.phpt b/ext/spl/tests/SplFileObject_current_error001.phpt new file mode 100644 index 0000000000..23c126648f --- /dev/null +++ b/ext/spl/tests/SplFileObject_current_error001.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::current variation error +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +$s->seek(2); + +echo $s->current('foo'); +?> +--EXPECTF-- +Warning: SplFileObject::current() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_current_variation001.phpt b/ext/spl/tests/SplFileObject_current_variation001.phpt new file mode 100644 index 0000000000..0cc588a7f0 --- /dev/null +++ b/ext/spl/tests/SplFileObject_current_variation001.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::current variation +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +$s->seek(2); + +echo $s->current(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 3 diff --git a/ext/spl/tests/SplFileObject_getchildren_basic.phpt b/ext/spl/tests/SplFileObject_getchildren_basic.phpt new file mode 100644 index 0000000000..065e8eae45 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getchildren_basic.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::getchildren basic +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +var_dump($s->getChildren()); + +?> +--EXPECT-- +NULL diff --git a/ext/spl/tests/SplFileObject_getchildren_error001.phpt b/ext/spl/tests/SplFileObject_getchildren_error001.phpt new file mode 100644 index 0000000000..9c17a82977 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getchildren_error001.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::getchildren error 001 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +$s->getChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getChildren() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_getflags_basic.phpt b/ext/spl/tests/SplFileObject_getflags_basic.phpt new file mode 100644 index 0000000000..5addadf380 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::getFlags basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php + +file_put_contents('testdata.csv', 'eerste;tweede;derde'); + +$fo = new SplFileObject('testdata.csv'); + +$fo->setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); +?> +--CLEAN-- +<?php +unlink('testdata.csv'); +?> +--EXPECT-- +int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error001.phpt b/ext/spl/tests/SplFileObject_getflags_error001.phpt new file mode 100644 index 0000000000..1602f88885 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_error001.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php + +file_put_contents('testdata.csv', 'eerste;tweede;derde'); + + +$fo = new SplFileObject('testdata.csv'); +$fo->setFlags(SplFileObject::READ_CSV); + +$fo->setFlags(SplFileObject::DROP_NEW_LINE); + +var_dump($fo->getFlags()); + +?> +--CLEAN-- +<?php +unlink('testdata.csv'); +?> +--EXPECT-- +int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error002.phpt b/ext/spl/tests/SplFileObject_getflags_error002.phpt new file mode 100644 index 0000000000..e2c8255f44 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_error002.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Erwin Poeze <erwin.poeze@gmail.com> +--FILE-- +<?php + +file_put_contents('testdata.csv', 'eerste;tweede;derde'); + +$fo = new SplFileObject('testdata.csv'); +$fo->setFlags(SplFileObject::READ_CSV); + +$fo->getFlags('fake'); + +?> +--CLEAN-- +<?php +unlink('testdata.csv'); +?> +--EXPECTF-- +Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_getflags_variation001.phpt b/ext/spl/tests/SplFileObject_getflags_variation001.phpt new file mode 100644 index 0000000000..640de03511 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_variation001.phpt @@ -0,0 +1,29 @@ +--TEST-- +SPL: SplFileObject::getFlags +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php + +$fo = new SplFileObject(__FILE__); + +$fo->setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_AHEAD); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::SKIP_EMPTY); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_CSV); +var_dump($fo->getFlags()); + +?> +--EXPECT-- +int(1) +int(2) +int(4) +int(8) diff --git a/ext/spl/tests/SplFileObject_haschildren_basic.phpt b/ext/spl/tests/SplFileObject_haschildren_basic.phpt new file mode 100644 index 0000000000..1ce00bfd42 --- /dev/null +++ b/ext/spl/tests/SplFileObject_haschildren_basic.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::haschildren basic +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +var_dump($s->hasChildren()); + +?> +--EXPECT-- +bool(false) diff --git a/ext/spl/tests/SplFileObject_haschildren_error001.phpt b/ext/spl/tests/SplFileObject_haschildren_error001.phpt new file mode 100644 index 0000000000..0c4e1de3b7 --- /dev/null +++ b/ext/spl/tests/SplFileObject_haschildren_error001.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::haschildren error 001 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +$s->hasChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::hasChildren() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_key_basic.phpt b/ext/spl/tests/SplFileObject_key_basic.phpt new file mode 100644 index 0000000000..4081d314ea --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::key basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(3); +echo $s->key(); +?> +--EXPECT-- +3 diff --git a/ext/spl/tests/SplFileObject_key_error001.phpt b/ext/spl/tests/SplFileObject_key_error001.phpt new file mode 100644 index 0000000000..b0834f0029 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error001.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(12); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff --git a/ext/spl/tests/SplFileObject_key_error002.phpt b/ext/spl/tests/SplFileObject_key_error002.phpt new file mode 100644 index 0000000000..8fc9b7fef0 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error002.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(120); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff --git a/ext/spl/tests/SplFileObject_key_error003.phpt b/ext/spl/tests/SplFileObject_key_error003.phpt new file mode 100644 index 0000000000..7568cf55f4 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error003.phpt @@ -0,0 +1,15 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Erwin Poeze <erwin.poeze AT gmail.com> +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +$s->key(3); +?> +--EXPECTF-- +Warning: SplFileObject::key() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_next_basic.phpt b/ext/spl/tests/SplFileObject_next_basic.phpt new file mode 100644 index 0000000000..59dc7ab58d --- /dev/null +++ b/ext/spl/tests/SplFileObject_next_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::next basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +echo $s->current(); +$s->next(); + +echo $s->current(); + +?> +--EXPECT-- +<?php +//line 2 diff --git a/ext/spl/tests/SplFileObject_next_variation001.phpt b/ext/spl/tests/SplFileObject_next_variation001.phpt new file mode 100644 index 0000000000..34771dd523 --- /dev/null +++ b/ext/spl/tests/SplFileObject_next_variation001.phpt @@ -0,0 +1,24 @@ +--TEST-- +SPL: SplFileObject::next variation 001 +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(13); +echo $s->current(); + +$s->next(); +echo $s->current(); +var_dump($s->valid()); +?> +--EXPECT-- +?> +bool(false) diff --git a/ext/spl/tests/SplFileObject_next_variation002.phpt b/ext/spl/tests/SplFileObject_next_variation002.phpt new file mode 100644 index 0000000000..d48ff8c223 --- /dev/null +++ b/ext/spl/tests/SplFileObject_next_variation002.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::next variation 002, read ahead +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); +$s->seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); + +$s->setFlags(SplFileObject::READ_AHEAD); + +$s->seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 4 +//line 3 +//line 4 diff --git a/ext/spl/tests/SplFileObject_rewind_basic.phpt b/ext/spl/tests/SplFileObject_rewind_basic.phpt new file mode 100644 index 0000000000..331c587e4a --- /dev/null +++ b/ext/spl/tests/SplFileObject_rewind_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::rewind basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(3); + +$s->rewind(); +echo $s->current(); +?> +--EXPECT-- +<?php diff --git a/ext/spl/tests/SplFileObject_rewind_error001.phpt b/ext/spl/tests/SplFileObject_rewind_error001.phpt new file mode 100644 index 0000000000..bdb3301e63 --- /dev/null +++ b/ext/spl/tests/SplFileObject_rewind_error001.phpt @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::rewind() with a parameter. +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php + +file_put_contents('testdata.csv', 'eerste;tweede;derde'); + +$fo = new SplFileObject('testdata.csv'); + +$fo->rewind( "invalid" ); + +?> +--EXPECTF-- +Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_rewind_variation001.phpt b/ext/spl/tests/SplFileObject_rewind_variation001.phpt new file mode 100644 index 0000000000..d835c443de --- /dev/null +++ b/ext/spl/tests/SplFileObject_rewind_variation001.phpt @@ -0,0 +1,28 @@ +--TEST-- +SPL: SplFileObject::rewind variation 001 +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(15); +echo $s->current(); +$s->next(); +echo $s->current(); +var_dump($s->valid()); +$s->rewind(); +var_dump($s->valid()); +echo $s->current(); +?> +--EXPECT-- +?> +bool(false) +bool(true) +<?php diff --git a/ext/spl/tests/SplFileObject_seek_basic.phpt b/ext/spl/tests/SplFileObject_seek_basic.phpt new file mode 100644 index 0000000000..7106f70cce --- /dev/null +++ b/ext/spl/tests/SplFileObject_seek_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::seek basic +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(2); +echo $s->current(); +?> +--EXPECT-- +//line 3 diff --git a/ext/spl/tests/SplFileObject_seek_error002.phpt b/ext/spl/tests/SplFileObject_seek_error002.phpt new file mode 100644 index 0000000000..057c8d3251 --- /dev/null +++ b/ext/spl/tests/SplFileObject_seek_error002.phpt @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::seek error 001 +--CREDITS-- +Ricardo Oedietram <ricardo@odracir.nl> +Erwin Poeze <erwin.poeze@gmail.com> +#PFZ June PHP TestFest 2012 +--FILE-- +<?php +//line 2 +//line 3 +//line 4 +//line 5 +$s = new SplFileObject(__FILE__); + +$s->seek(20); +echo $s->current(); +?> +--EXPECT-- diff --git a/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt b/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt new file mode 100644 index 0000000000..b2630606e8 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::setCsvControl basic +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +file_put_contents('csv_control_data.csv', +<<<CDATA +'groene appelen'|10 +'gele bananen'|20 +'rode kersen'|30 +CDATA +); +$s = new SplFileObject('csv_control_data.csv'); +$s->setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', '/'); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- +<?php +unlink('csv_control_data.csv'); +?> +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt new file mode 100644 index 0000000000..f582a4a894 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt @@ -0,0 +1,24 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 001 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +file_put_contents('csv_control_data.csv', +<<<CDATA +'groene appelen'|10 +'gele bananen'|20 +'rode kersen'|30 +CDATA +); +$s = new SplFileObject('csv_control_data.csv'); +$s->setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('||'); +?> +--CLEAN-- +<?php +unlink('csv_control_data.csv'); +?> +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): delimiter must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt new file mode 100644 index 0000000000..bcfd9c4dd6 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt @@ -0,0 +1,24 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 002 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +file_put_contents('csv_control_data.csv', +<<<CDATA +'groene appelen'|10 +'gele bananen'|20 +'rode kersen'|30 +CDATA +); +$s = new SplFileObject('csv_control_data.csv'); +$s->setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', 'two'); +?> +--CLEAN-- +<?php +unlink('csv_control_data.csv'); +?> +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): enclosure must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt new file mode 100644 index 0000000000..8b1f54d5a4 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 003 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--INI-- +include_path=. +--FILE-- +<?php +file_put_contents('csv_control_data.csv', +<<<CDATA +'groene appelen'|10 +'gele bananen'|20 +'rode kersen'|30 +CDATA +); +$s = new SplFileObject('csv_control_data.csv'); +$s->setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', 'three'); +?> +--CLEAN-- +<?php +unlink('csv_control_data.csv'); +?> +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): escape must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt b/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt new file mode 100644 index 0000000000..7aaf8a3fe6 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::setCsvControl variation 001 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +file_put_contents('csv_control_data.csv', +<<<CDATA +"groene appelen",10 +"gele bananen",20 +"rode kersen",30 +CDATA +); +$s = new SplFileObject('csv_control_data.csv'); +$s->setFlags(SplFileObject::READ_CSV); +$s->setCsvControl(); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- +<?php +unlink('csv_control_data.csv'); +?> +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff --git a/ext/spl/tests/arrayObject___construct_basic2.phpt b/ext/spl/tests/arrayObject___construct_basic2.phpt index 9ff0e4257a..bd27c42774 100644 --- a/ext/spl/tests/arrayObject___construct_basic2.phpt +++ b/ext/spl/tests/arrayObject___construct_basic2.phpt @@ -63,7 +63,7 @@ bool(true) Notice: Undefined property: ArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,7 +91,7 @@ bool(true) Notice: Undefined property: MyArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff --git a/ext/spl/tests/arrayObject___construct_basic3.phpt b/ext/spl/tests/arrayObject___construct_basic3.phpt index 1abd1a1ab1..11a17a6dc4 100644 --- a/ext/spl/tests/arrayObject___construct_basic3.phpt +++ b/ext/spl/tests/arrayObject___construct_basic3.phpt @@ -63,7 +63,7 @@ bool(true) Notice: Undefined property: ArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,7 +91,7 @@ bool(true) Notice: Undefined property: MyArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff --git a/ext/spl/tests/arrayObject___construct_basic4.phpt b/ext/spl/tests/arrayObject___construct_basic4.phpt index 80f5e0861e..b0809de0d4 100644 --- a/ext/spl/tests/arrayObject___construct_basic4.phpt +++ b/ext/spl/tests/arrayObject___construct_basic4.phpt @@ -61,11 +61,11 @@ bool(true) bool(true) - Unset: -Notice: Undefined index: prop in %s on line 39 +Notice: Undefined index: prop in %s on line 39 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,9 +91,9 @@ bool(true) bool(true) - Unset: -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff --git a/ext/spl/tests/arrayObject___construct_basic5.phpt b/ext/spl/tests/arrayObject___construct_basic5.phpt index 5368d250a1..8c44ee2ce4 100644 --- a/ext/spl/tests/arrayObject___construct_basic5.phpt +++ b/ext/spl/tests/arrayObject___construct_basic5.phpt @@ -61,11 +61,11 @@ bool(true) bool(true) - Unset: -Notice: Undefined index: prop in %s on line 39 +Notice: Undefined index: prop in %s on line 39 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,9 +91,9 @@ bool(true) bool(true) - Unset: -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff --git a/ext/spl/tests/arrayObject_asort_basic1.phpt b/ext/spl/tests/arrayObject_asort_basic1.phpt index ec69049a32..53df1d502b 100644 --- a/ext/spl/tests/arrayObject_asort_basic1.phpt +++ b/ext/spl/tests/arrayObject_asort_basic1.phpt @@ -17,12 +17,14 @@ var_dump($ao1->asort()); var_dump($ao1); var_dump($ao2->asort('blah')); var_dump($ao2); +var_dump($ao2->asort(SORT_NUMERIC)); +var_dump($ao2); ?> ===DONE=== --EXPECTF-- *** Testing ArrayObject::asort() : basic functionality *** bool(true) -object(ArrayObject)#1 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> @@ -33,8 +35,22 @@ object(ArrayObject)#1 (1) { int(4) } } + +Warning: asort() expects parameter 2 to be long, string given in %sarrayObject_asort_basic1.php on line %d +bool(false) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["a"]=> + int(4) + ["b"]=> + int(2) + ["c"]=> + int(3) + } +} bool(true) -object(ArrayObject)#2 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { ["b"]=> diff --git a/ext/spl/tests/arrayObject_ksort_basic1.phpt b/ext/spl/tests/arrayObject_ksort_basic1.phpt index 9c8d1e7345..8f37938126 100644 --- a/ext/spl/tests/arrayObject_ksort_basic1.phpt +++ b/ext/spl/tests/arrayObject_ksort_basic1.phpt @@ -16,12 +16,14 @@ var_dump($ao1->ksort()); var_dump($ao1); var_dump($ao2->ksort('blah')); var_dump($ao2); +var_dump($ao2->ksort(SORT_STRING)); +var_dump($ao2); ?> ===DONE=== --EXPECTF-- *** Testing ArrayObject::ksort() : basic functionality *** bool(true) -object(ArrayObject)#1 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { [0]=> @@ -32,18 +34,34 @@ object(ArrayObject)#1 (1) { int(3) } } -bool(true) + +Warning: ksort() expects parameter 2 to be long, string given in %sarrayObject_ksort_basic1.php on line %d +bool(false) object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(4) { - ["a"]=> - int(2) ["b"]=> int(4) + ["a"]=> + int(2) ["q"]=> int(3) [99]=> string(1) "x" } } +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(4) { + [99]=> + string(1) "x" + ["a"]=> + int(2) + ["b"]=> + int(4) + ["q"]=> + int(3) + } +} ===DONE=== diff --git a/ext/spl/tests/arrayObject_magicMethods1.phpt b/ext/spl/tests/arrayObject_magicMethods1.phpt index b1de4a951e..ec4812f107 100644 --- a/ext/spl/tests/arrayObject_magicMethods1.phpt +++ b/ext/spl/tests/arrayObject_magicMethods1.phpt @@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) { --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 42 +Notice: Undefined index: nonexistent in %s on line 42 NULL string(11) "new.changed" Original wrapped object: @@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) { --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 60 +Notice: Undefined index: nonexistent in %s on line 60 Original wrapped object: object(UsesMagic)#1 (3) { ["b"]=> diff --git a/ext/spl/tests/arrayObject_magicMethods3.phpt b/ext/spl/tests/arrayObject_magicMethods3.phpt index 16a6a3b80c..6231ceabb7 100644 --- a/ext/spl/tests/arrayObject_magicMethods3.phpt +++ b/ext/spl/tests/arrayObject_magicMethods3.phpt @@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) { --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 42 +Notice: Undefined index: nonexistent in %s on line 42 NULL string(11) "new.changed" Original wrapped object: @@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) { --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 60 +Notice: Undefined index: nonexistent in %s on line 60 Original wrapped object: object(UsesMagic)#1 (3) { ["b"]=> diff --git a/ext/spl/tests/arrayObject_magicMethods4.phpt b/ext/spl/tests/arrayObject_magicMethods4.phpt index 3c9f78781a..9580dc5ae7 100644 --- a/ext/spl/tests/arrayObject_magicMethods4.phpt +++ b/ext/spl/tests/arrayObject_magicMethods4.phpt @@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) { --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 45 +Notice: Undefined index: nonexistent in %s on line 45 NULL string(11) "new.changed" Original wrapped object: @@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) { --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 63 +Notice: Undefined index: nonexistent in %s on line 63 Original wrapped object: object(C)#1 (3) { ["b"]=> diff --git a/ext/spl/tests/arrayObject_magicMethods6.phpt b/ext/spl/tests/arrayObject_magicMethods6.phpt index 45a0e4a768..b43f56c2b0 100644 --- a/ext/spl/tests/arrayObject_magicMethods6.phpt +++ b/ext/spl/tests/arrayObject_magicMethods6.phpt @@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) { --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 45 +Notice: Undefined index: nonexistent in %s on line 45 NULL string(11) "new.changed" Original wrapped object: @@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) { --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 63 +Notice: Undefined index: nonexistent in %s on line 63 Original wrapped object: object(C)#1 (3) { ["b"]=> diff --git a/ext/spl/tests/arrayObject_setFlags_basic1.phpt b/ext/spl/tests/arrayObject_setFlags_basic1.phpt index d8d4f2e96d..391b0eeae7 100644 --- a/ext/spl/tests/arrayObject_setFlags_basic1.phpt +++ b/ext/spl/tests/arrayObject_setFlags_basic1.phpt @@ -44,8 +44,8 @@ string(21) "array element.changed" --> Remove the array element and try access again: bool(false) -Notice: Undefined index: p in %s on line 10 +Notice: Undefined index: p in %s on line 10 NULL -Notice: Undefined index: p in %s on line 12 +Notice: Undefined index: p in %s on line 12 string(8) ".changed" diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt index d9fb57c4ce..b55fcba1fd 100755 --- a/ext/spl/tests/array_001.phpt +++ b/ext/spl/tests/array_001.phpt @@ -79,15 +79,15 @@ object(ArrayObject)#%d (1) { } int(0) -Notice: Undefined offset: 6 in %sarray_001.php on line %d +Notice: Undefined offset: 6 in %sarray_001.php on line %d NULL -Notice: Undefined index: b in %sarray_001.php on line %d +Notice: Undefined index: b in %sarray_001.php on line %d NULL -Notice: Undefined offset: 7 in %sarray_001.php on line %d +Notice: Undefined offset: 7 in %sarray_001.php on line %d -Notice: Undefined index: c in %sarray_001.php on line %d +Notice: Undefined index: c in %sarray_001.php on line %d object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(2) { diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/array_010.phpt index 6b331e4b51..d2f3de7f6d 100755 --- a/ext/spl/tests/array_010.phpt +++ b/ext/spl/tests/array_010.phpt @@ -94,10 +94,10 @@ int(1) string(3) "3rd" int(4) -Notice: Undefined index: 5th in %sarray_010.php on line %d +Notice: Undefined index: 5th in %sarray_010.php on line %d NULL -Notice: Undefined offset: 6 in %sarray_010.php on line %d +Notice: Undefined offset: 6 in %sarray_010.php on line %d NULL ===offsetSet=== WRITE 1 @@ -128,9 +128,9 @@ array(6) { string(9) "changed 6" } -Notice: Undefined offset: 7 in %sarray_010.php on line %d +Notice: Undefined offset: 7 in %sarray_010.php on line %d -Notice: Undefined index: 8th in %sarray_010.php on line %d +Notice: Undefined index: 8th in %sarray_010.php on line %d array(4) { [0]=> string(3) "1st" diff --git a/ext/spl/tests/bug45622.phpt b/ext/spl/tests/bug45622.phpt index c47b62cbdf..a8fe2c4641 100644 --- a/ext/spl/tests/bug45622.phpt +++ b/ext/spl/tests/bug45622.phpt @@ -42,7 +42,7 @@ bool(true) --> Remove the array element and try access again: bool(false) -Notice: Undefined index: p in %s on line %d +Notice: Undefined index: p in %s on line %d NULL --> Re-add the real property: diff --git a/ext/spl/tests/bug45622b.phpt b/ext/spl/tests/bug45622b.phpt index 9d49392111..f101a8459d 100644 --- a/ext/spl/tests/bug45622b.phpt +++ b/ext/spl/tests/bug45622b.phpt @@ -25,9 +25,9 @@ isset($ao->prop4); --EXPECTF-- Doesn't trigger __get. -Notice: Undefined index: prop1 in %s on line 11 +Notice: Undefined index: prop1 in %s on line 11 Doesn't trigger __set. Doesn't trigger __unset. -Notice: Undefined index: prop3 in %s on line 17 +Notice: Undefined index: prop3 in %s on line 17 Shouldn't trigger __isset.
\ No newline at end of file diff --git a/ext/spl/tests/bug52238.phpt b/ext/spl/tests/bug52238.phpt index 85410bdf1e..10da0b5fd9 100644 --- a/ext/spl/tests/bug52238.phpt +++ b/ext/spl/tests/bug52238.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #52238 - Crash when an Exception occured in iterator_to_array +Bug #52238 - Crash when an Exception occurred in iterator_to_array --FILE-- <?php class Foo implements IteratorAggregate diff --git a/ext/spl/tests/bug54323.phpt b/ext/spl/tests/bug54323.phpt index 35a16a4637..df6416a0f1 100644 --- a/ext/spl/tests/bug54323.phpt +++ b/ext/spl/tests/bug54323.phpt @@ -19,6 +19,6 @@ function testAccess($c, $ao) { --EXPECTF-- Notice: Undefined property: C::$prop in %sbug54323.php on line 14 -Notice: Undefined index: prop in %sbug54323.php on line 14 +Notice: Undefined index: prop in %sbug54323.php on line 14 NULL NULL diff --git a/ext/spl/tests/bug61527.phpt b/ext/spl/tests/bug61527.phpt new file mode 100644 index 0000000000..ab13c69547 --- /dev/null +++ b/ext/spl/tests/bug61527.phpt @@ -0,0 +1,92 @@ +--TEST-- +Bug #61527 (Recursive/ArrayIterator gives misleading notice when array empty or moved to the end) +--FILE-- +<?php +$ao = new ArrayObject(array()); +$ai = $ao->getIterator(); + +/* testing empty array, should no notice at all */ +$ai->next(); +var_dump($ai->key()); +var_dump($ai->current()); + +/* testing array changing */ +$ao2 = new ArrayObject(array(1 => 1, 2, 3, 4, 5)); +$ai2 = $ao2->getIterator(); + +$ao2->offsetUnset($ai2->key()); +$ai2->next(); + +/* now point to 2 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->key()); + +/* now point to 3 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->current()); + +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +/* should be at the end and no notice */ +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +$ai2->rewind(); +$ai2->next(); +$ai2->next(); +/* should reached the end */ +var_dump($ai2->next()); +var_dump($ai2->key()); + +/* testing RecursiveArrayIterator */ +$ao3 = new ArrayObject(array(), NULL, 'RecursiveArrayIterator'); +$ai3 = $ao3->getIterator(); + +var_dump($ai3->getChildren()); + +$ao4 = new ArrayObject(array(1, 2), NULL, 'RecursiveArrayIterator'); +$ai4 = $ao4->getIterator(); + +$ai4->next(); +$ai4->next(); +$ai4->next(); +var_dump($ai4->hasChildren()); + +$ai4->rewind(); +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->hasChildren()); + +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->getChildren()); +?> +==DONE== +<?php exit(0); ?> +--EXPECTF-- +NULL +NULL + +Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d + +Notice: ArrayIterator::key(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL + +Notice: ArrayIterator::current(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL +int(5) +int(5) +NULL +NULL +NULL +NULL +NULL +bool(false) + +Notice: RecursiveArrayIterator::hasChildren(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +bool(false) + +Notice: RecursiveArrayIterator::getChildren(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL +==DONE== diff --git a/ext/spl/tests/bug62262.phpt b/ext/spl/tests/bug62262.phpt new file mode 100644 index 0000000000..0e006ec2c2 --- /dev/null +++ b/ext/spl/tests/bug62262.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #62262: RecursiveArrayIterator does not implement Countable +--FILE-- +<?php + +var_dump(new RecursiveArrayIterator(array()) instanceof Countable); + +?> +--EXPECT-- +bool(true) diff --git a/ext/spl/tests/bug62328.phpt b/ext/spl/tests/bug62328.phpt new file mode 100644 index 0000000000..33a8aeee95 --- /dev/null +++ b/ext/spl/tests/bug62328.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #62328 (cast_object takes precedence over __toString) +--CREDITS-- +leight at gmail dot com +--FILE-- +<?php + +class SplFileInfo62328 extends SplFileInfo +{ + public function __toString() + { + return '__toString'; + } +} + +$fi = new SplFileInfo62328(__FILE__); + +echo (string)$fi . PHP_EOL; +echo (string)$fi->__toString() . PHP_EOL; + +?> +--EXPECT-- +__toString +__toString diff --git a/ext/spl/tests/bug62433.phpt b/ext/spl/tests/bug62433.phpt new file mode 100644 index 0000000000..bfb3568bac --- /dev/null +++ b/ext/spl/tests/bug62433.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #62433 Inconsistent behavior of RecursiveDirectoryIterator to dot files (. and ..) +--FILE-- +<?php +$dots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__))); +$ndots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS))); + +var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $dots)); +var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $dots)); + +var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '.', $ndots)); +var_dump(in_array(__DIR__ . DIRECTORY_SEPARATOR . '..', $ndots)); +?> +--EXPECT-- +bool(true) +bool(true) +bool(false) +bool(false) diff --git a/ext/spl/tests/bug62616.phpt b/ext/spl/tests/bug62616.phpt new file mode 100644 index 0000000000..4e4be94491 --- /dev/null +++ b/ext/spl/tests/bug62616.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) +--FILE-- +<?php +$ai = new ArrayIterator(array(0,1)); + +var_dump($ai->count()); + +$ii = new IteratorIterator($ai); + +var_dump($ii->count()); +?> +--EXPECTF-- +int(2) +int(2) diff --git a/ext/spl/tests/bug62904.phpt b/ext/spl/tests/bug62904.phpt new file mode 100644 index 0000000000..7e392da9ab --- /dev/null +++ b/ext/spl/tests/bug62904.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #62904 (Crash when cloning an object which inherits SplFixedArray) +--FILE-- +<?php + +class foo extends SplFixedArray { + public function __construct($size) { + } +} + +$x = new foo(2); + +try { + $z = clone $x; +} catch (Exception $e) { + var_dump($e->getMessage()); +} +--EXPECTF-- +string(40) "The instance wasn't initialized properly" diff --git a/ext/spl/tests/bug62978.phpt b/ext/spl/tests/bug62978.phpt new file mode 100644 index 0000000000..0d91609f88 --- /dev/null +++ b/ext/spl/tests/bug62978.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables) +--FILE-- +<?php +$a = new ArrayObject(); + +$b = array(); + +$a[null]['hurr'] = 'durr'; + +var_dump($a['epic_magic']); +var_dump($b['epic_magic']); +var_dump($c['epic_magic']); // Undefined var!! + +$d = array(); +var_dump($a['epic_magic']); // more magic! +var_dump($d['epic_magic']); + +$e = 'srsly?'; +var_dump($a['epic_magic']); // srsly. +var_dump(isset($a['epic_magic'])); + +$fp = fopen(__FILE__, 'r'); +var_dump($a[$fp]); + +fclose($fp); +--EXPECTF-- +Notice: Undefined index: epic_magic in %sbug62978.php on line %d +NULL + +Notice: Undefined index: epic_magic in %sbug62978.php on line %d +NULL + +Notice: Undefined variable: c in %sbug62978.php on line %d +NULL + +Notice: Undefined index: epic_magic in %sbug62978.php on line %d +NULL + +Notice: Undefined index: epic_magic in %sbug62978.php on line %d +NULL + +Notice: Undefined index: epic_magic in %sbug62978.php on line %d +NULL +bool(false) + +Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %sbug62978.php on line %d + +Notice: Undefined offset: %d in %sbug62978.php on line %d +NULL diff --git a/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt b/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt new file mode 100644 index 0000000000..3c0c9eebd5 --- /dev/null +++ b/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::getMaxLineLen error 001 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--INI-- +include_path=. +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +$s->getMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getMaxLineLen() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt new file mode 100644 index 0000000000..6bfdfdcf50 --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt @@ -0,0 +1,17 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 001() +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +try { + $s->setMaxLineLen(-1); +} +catch (DomainException $e) { + echo 'DomainException thrown'; +} + +?> +--EXPECT-- +DomainException thrown diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt new file mode 100644 index 0000000000..dad59fca5f --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 002 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +$s->setMaxLineLen(); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects exactly 1 parameter, 0 given in %s on line %d diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt new file mode 100644 index 0000000000..8dc50d5fc7 --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 003 +--CREDITS-- +Erwin Poeze <erwin.poeze at gmail.com> +--FILE-- +<?php +$s = new SplFileObject( __FILE__ ); +$s->setMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects parameter 1 to be long, string given in %s on line %d diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index 6d25531175..1271ccaa64 100755 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -81,7 +81,7 @@ NULL int(0) bool(false) -Notice: Undefined index: 0 in %siterator_044.php on line %d +Notice: Undefined index: 0 in %siterator_044.php on line %d NULL ===1=== object(stdClass)#%d (0) { @@ -97,31 +97,31 @@ object(MyFoo)#%d (0) { } bool(false) -Notice: Undefined index: foo in %siterator_044.php on line %d +Notice: Undefined index: foo in %siterator_044.php on line %d NULL ===3=== NULL bool(false) -Notice: Undefined index: in %siterator_044.php on line %d +Notice: Undefined index: in %siterator_044.php on line %d NULL ===4=== int(2) bool(false) -Notice: Undefined index: 2 in %siterator_044.php on line %d +Notice: Undefined index: 2 in %siterator_044.php on line %d NULL ===5=== string(3) "foo" bool(false) -Notice: Undefined index: foo in %siterator_044.php on line %d +Notice: Undefined index: foo in %siterator_044.php on line %d NULL ===6=== int(3) bool(false) -Notice: Undefined index: 3 in %siterator_044.php on line %d +Notice: Undefined index: 3 in %siterator_044.php on line %d NULL ===FILL=== ===0=== @@ -146,7 +146,7 @@ int(1) NULL bool(false) -Notice: Undefined index: in %siterator_044.php on line %d +Notice: Undefined index: in %siterator_044.php on line %d NULL ===4=== int(2) @@ -160,6 +160,6 @@ int(1) int(3) bool(false) -Notice: Undefined index: 3 in %siterator_044.php on line %d +Notice: Undefined index: 3 in %siterator_044.php on line %d NULL ===DONE=== diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c index a3d542a40c..d96367e212 100644 --- a/ext/sqlite3/libsqlite/sqlite3.c +++ b/ext/sqlite3/libsqlite/sqlite3.c @@ -23307,7 +23307,7 @@ static int os2OpenSharedMemory( os2File *fd, int szRegion ) { sqlite3_mutex_leave(pNode->mutex); } else { - /* Error occured. Free our link object. */ + /* Error occurred. Free our link object. */ sqlite3_free(pLink); } @@ -28994,7 +28994,7 @@ static int fillInUnixFile( unixEnterMutex(); rc = findInodeInfo(pNew, &pNew->pInode); if( rc!=SQLITE_OK ){ - /* If an error occured in findInodeInfo(), close the file descriptor + /* If an error occurred in findInodeInfo(), close the file descriptor ** immediately, before releasing the mutex. findInodeInfo() may fail ** in two scenarios: ** @@ -32173,7 +32173,7 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){ ** containing the lower 32-bits of the new file-offset. Or, if it fails, ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine - ** whether an error has actually occured, it is also necessary to call + ** whether an error has actually occurred, it is also necessary to call ** GetLastError(). */ dwRet = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); @@ -32273,7 +32273,7 @@ static int winWrite( int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ - int rc; /* True if error has occured, else false */ + int rc; /* True if error has occurred, else false */ winFile *pFile = (winFile*)id; /* File handle */ assert( amt>0 ); @@ -37068,7 +37068,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** * A write transaction is active. ** * An EXCLUSIVE or greater lock is held on the database file. ** * All writing and syncing of journal and database data has finished. -** If no error occured, all that remains is to finalize the journal to +** If no error occurred, all that remains is to finalize the journal to ** commit the transaction. If an error did occur, the caller will need ** to rollback the transaction. ** @@ -54279,7 +54279,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( insertCell(pPage, idx, newCell, szNew, 0, 0, &rc); assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 ); - /* If no error has occured and pPage has an overflow cell, call balance() + /* If no error has occurred and pPage has an overflow cell, call balance() ** to redistribute the cells within the tree. Since balance() may move ** the cursor, zero the BtCursor.info.nSize and BtCursor.validNKey ** variables. @@ -57935,7 +57935,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ } sqlite3DbFree(v->db, sIter.apSub); - /* Return true if hasAbort==mayAbort. Or if a malloc failure occured. + /* Return true if hasAbort==mayAbort. Or if a malloc failure occurred. ** If malloc failed, then the while() loop above may not have iterated ** through all opcodes and hasAbort may be set incorrectly. Return ** true for this case to prevent the assert() in the callers frame @@ -59562,7 +59562,7 @@ SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){ /* If p->iStatement is greater than zero, then this Vdbe opened a ** statement transaction that should be closed here. The only exception - ** is that an IO error may have occured, causing an emergency rollback. + ** is that an IO error may have occurred, causing an emergency rollback. ** In this case (db->nStatement==0), and there is nothing to do. */ if( db->nStatement && p->iStatement ){ @@ -59697,7 +59697,7 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ ** ** Even if the statement is read-only, it is important to perform ** a statement or transaction rollback operation. If the error - ** occured while writing to the journal, sub-journal or database + ** occurred while writing to the journal, sub-journal or database ** file as part of an effort to free up cache space (see function ** pagerStress() in pager.c), the rollback is required to restore ** the pager to a consistent state. @@ -61245,7 +61245,7 @@ end_of_step: assert( p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE ); if( p->isPrepareV2 && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){ /* If this statement was prepared using sqlite3_prepare_v2(), and an - ** error has occured, then return the error code in p->rc to the + ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same value. */ rc = db->errCode = p->rc; @@ -113286,7 +113286,7 @@ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ }else{ int rc = sqlite3_reset(pCsr->pStmt); if( rc==SQLITE_OK ){ - /* If no row was found and no error has occured, then the %_content + /* If no row was found and no error has occurred, then the %_content ** table is missing a row that is present in the full-text index. ** The data structures are corrupt. */ diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index a420d5d708..0bb8616d96 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -114,7 +114,10 @@ PHP_METHOD(sqlite3, open) zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC); } - if (strncmp(filename, ":memory:", 8) != 0) { + if (strlen(filename) != filename_len) { + return; + } + if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) { if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); return; @@ -1094,7 +1097,7 @@ static int php_sqlite3_stream_close(php_stream *stream, int close_handle TSRMLS_ php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract; if (sqlite3_blob_close(sqlite3_stream->blob) != SQLITE_OK) { - /* Error occured, but it still closed */ + /* Error occurred, but it still closed */ } efree(sqlite3_stream); @@ -1959,7 +1962,7 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar switch (access_type) { case SQLITE_ATTACH: { - if (strncmp(arg3, ":memory:", sizeof(":memory:")-1) && *arg3) { + if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) { TSRMLS_FETCH(); #if PHP_API_VERSION < 20100412 diff --git a/ext/standard/assert.c b/ext/standard/assert.c index a2c50d5cb6..15fbefd51c 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -136,20 +136,20 @@ PHP_MINFO_FUNCTION(assert) /* {{{ */ } /* }}} */ -/* {{{ proto int assert(string|bool assertion) +/* {{{ proto int assert(string|bool assertion[, string description]) Checks if assertion is false */ PHP_FUNCTION(assert) { zval **assertion; - int val; + int val, description_len = 0; char *myeval = NULL; - char *compiled_string_description; + char *compiled_string_description, *description = NULL; if (! ASSERTG(active)) { RETURN_TRUE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &assertion) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s", &assertion, &description, &description_len) == FAILURE) { return; } @@ -167,7 +167,11 @@ PHP_FUNCTION(assert) compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC); if (zend_eval_stringl(myeval, Z_STRLEN_PP(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) { efree(compiled_string_description); - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); + if (description_len == 0) { + php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval); + } if (ASSERTG(bail)) { zend_bailout(); } @@ -196,7 +200,7 @@ PHP_FUNCTION(assert) } if (ASSERTG(callback)) { - zval *args[3]; + zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0); zval *retval; int i; uint lineno = zend_get_executed_lineno(TSRMLS_C); @@ -214,19 +218,38 @@ PHP_FUNCTION(assert) ZVAL_FALSE(retval); /* XXX do we want to check for error here? */ - call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC); + if (description_len == 0) { + call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC); + for (i = 0; i <= 2; i++) { + zval_ptr_dtor(&(args[i])); + } + } else { + MAKE_STD_ZVAL(args[3]); + ZVAL_STRINGL(args[3], SAFE_STRING(description), description_len, 1); - for (i = 0; i <= 2; i++) { - zval_ptr_dtor(&(args[i])); + call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 4, args TSRMLS_CC); + for (i = 0; i <= 3; i++) { + zval_ptr_dtor(&(args[i])); + } } + + efree(args); zval_ptr_dtor(&retval); } if (ASSERTG(warning)) { - if (myeval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); + if (description_len == 0) { + if (myeval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); + } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); + if (myeval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description); + } } } @@ -321,3 +344,4 @@ PHP_FUNCTION(assert_options) * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ + diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 9e9c36250c..d78cb244c5 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -59,14 +59,14 @@ PHPAPI unsigned char *php_base64_encode(const unsigned char *str, int length, in unsigned char *p; unsigned char *result; - if ((length + 2) < 0 || ((length + 2) / 3) >= (1 << (sizeof(int) * 8 - 2))) { + if (length < 0) { if (ret_length != NULL) { *ret_length = 0; } return NULL; } - result = (unsigned char *)safe_emalloc(((length + 2) / 3) * 4, sizeof(char), 1); + result = (unsigned char *) safe_emalloc((length + 2) / 3, 4 * sizeof(char), 1); p = result; while (length > 2) { /* keep going until we have less than 24 bits */ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 646005ebc7..72f1dc3c76 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3719,8 +3719,6 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ /* Default to global filters only */ FG(stream_filters) = NULL; - FG(wrapper_errors) = NULL; - return SUCCESS; } /* }}} */ @@ -3833,7 +3831,7 @@ PHP_NAMED_FUNCTION(php_inet_ntop) } if (!inet_ntop(af, address, buffer, sizeof(buffer))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occured"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred"); RETURN_FALSE; } @@ -5045,8 +5043,11 @@ void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ zend_hash_destroy(BG(user_shutdown_function_names)); FREE_HASHTABLE(BG(user_shutdown_function_names)); BG(user_shutdown_function_names) = NULL; - } - zend_end_try(); + } zend_catch { + /* maybe shutdown method call exit, we just ignore it */ + FREE_HASHTABLE(BG(user_shutdown_function_names)); + BG(user_shutdown_function_names) = NULL; + } zend_end_try(); } /* }}} */ diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index de6d18094e..ae5e90cf9b 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -43,7 +43,7 @@ ZEND_BEGIN_MODULE_GLOBALS(browscap) browser_data activation_bdata; ZEND_END_MODULE_GLOBALS(browscap) -ZEND_DECLARE_MODULE_GLOBALS(browscap); +ZEND_DECLARE_MODULE_GLOBALS(browscap) #ifdef ZTS #define BROWSCAP_G(v) TSRMG(browscap_globals_id, zend_browscap_globals *, v) diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 9a1fcf1f69..27a8d82d0e 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -199,7 +199,7 @@ PHP_FUNCTION(crypt) char *output; int needed = (sizeof(sha512_salt_prefix) - 1 + sizeof(sha512_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); + + salt_in_len + 1 + 86 + 1); output = emalloc(needed); salt[salt_in_len] = '\0'; @@ -214,7 +214,7 @@ PHP_FUNCTION(crypt) RETVAL_STRING(output, 1); } - memset(output, 0, PHP_MAX_SALT_LEN + 1); + memset(output, 0, needed); efree(output); } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { const char sha256_salt_prefix[] = "$5$"; @@ -222,7 +222,7 @@ PHP_FUNCTION(crypt) char *output; int needed = (sizeof(sha256_salt_prefix) - 1 + sizeof(sha256_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); + + salt_in_len + 1 + 43 + 1); output = emalloc(needed); salt[salt_in_len] = '\0'; @@ -237,7 +237,7 @@ PHP_FUNCTION(crypt) RETVAL_STRING(output, 1); } - memset(output, 0, PHP_MAX_SALT_LEN + 1); + memset(output, 0, needed); efree(output); } else if ( salt[0] == '$' && diff --git a/ext/standard/file.c b/ext/standard/file.c index 7d01d31350..cce0143fff 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -161,6 +161,7 @@ static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC) FG(pclose_ret) = 0; FG(user_stream_current_filename) = NULL; FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE; + FG(wrapper_errors) = NULL; } static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC) diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 0ca2f04cf7..f6d3750e2b 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -109,6 +109,8 @@ static zend_object_value php_create_incomplete_object(zend_class_entry *class_ty value = zend_objects_new(&object, class_type TSRMLS_CC); value.handlers = &php_incomplete_object_handlers; + object_properties_init(object, class_type); + return value; } diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 36568c508e..364f7fc399 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -39,6 +39,7 @@ #endif #endif +#include "php_syslog.h" #include "php_mail.h" #include "php_ini.h" #include "php_string.h" @@ -189,6 +190,37 @@ PHP_FUNCTION(mail) } /* }}} */ + +void php_mail_log_crlf_to_spaces(char *message) { + /* Find all instances of carriage returns or line feeds and + * replace them with spaces. Thus, a log line is always one line + * long + */ + char *p = message; + while ((p = strpbrk(p, "\r\n"))) { + *p = ' '; + } +} + +void php_mail_log_to_syslog(char *message) { + /* Write 'message' to syslog. */ +#ifdef HAVE_SYSLOG_H + php_syslog(LOG_NOTICE, "%s", message); +#endif +} + + +void php_mail_log_to_file(char *filename, char *message, size_t message_size TSRMLS_DC) { + /* Write 'message' to the given file. */ + uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR; + php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL); + if (stream) { + php_stream_write(stream, message, message_size); + php_stream_close(stream); + } +} + + /* {{{ php_mail */ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) @@ -216,19 +248,22 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (mail_log && *mail_log) { char *tmp; int l = spprintf(&tmp, 0, "mail() on [%s:%d]: To: %s -- Headers: %s\n", zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : ""); - php_stream *stream = php_stream_open_wrapper(mail_log, "a", IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR, NULL); - if (hdr) { /* find all \r\n instances and replace them with spaces, so a log line is always one line long */ - char *p = tmp; - while ((p = strpbrk(p, "\r\n"))) { - *p = ' '; - } - tmp[l - 1] = '\n'; + if (hdr) { + php_mail_log_crlf_to_spaces(tmp); } - if (stream) { - php_stream_write(stream, tmp, l); - php_stream_close(stream); + + if (!strcmp(mail_log, "syslog")) { + /* Drop the final space when logging to syslog. */ + tmp[l - 1] = 0; + php_mail_log_to_syslog(tmp); + } + else { + /* Convert the final space to a newline when logging to file. */ + tmp[l - 1] = '\n'; + php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC); } + efree(tmp); } if (PG(mail_x_header)) { diff --git a/ext/standard/math.c b/ext/standard/math.c index b3e8c6f086..6e934a3857 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1120,6 +1120,10 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point, tmplen = spprintf(&tmpbuf, 0, "%.*F", dec, d); if (tmpbuf == NULL || !isdigit((int)tmpbuf[0])) { + if (result_len) { + *result_len = tmplen; + } + return tmpbuf; } diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 1ce7eff052..4eb69d7ef2 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -162,7 +162,10 @@ PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t len lp = 0; } else { if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { - if ((lp += 3) > PHP_QPRINT_MAXL) { + if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) + || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) + || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) + || ((c > 0xef) && (c <= 0xf4) && ((lp + 9) > PHP_QPRINT_MAXL))) { *d++ = '='; *d++ = '\015'; *d++ = '\012'; @@ -283,4 +286,4 @@ PHP_FUNCTION(quoted_printable_encode) * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 - */ + */
\ No newline at end of file diff --git a/ext/standard/string.c b/ext/standard/string.c index 5c33232f7d..9154b3296c 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -131,8 +131,8 @@ static char *php_bin2hex(const unsigned char *old, const size_t oldlen, size_t * register unsigned char *result = NULL; size_t i, j; - result = (unsigned char *) safe_emalloc(oldlen * 2, sizeof(char), 1); - + result = (unsigned char *) safe_emalloc(oldlen, 2 * sizeof(char), 1); + for (i = j = 0; i < oldlen; i++) { result[j++] = hexconvtab[old[i] >> 4]; result[j++] = hexconvtab[old[i] & 15]; @@ -3930,7 +3930,6 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) new_char_count--; } if (new_char_count > 0) { - char_count=new_char_count; begin=new_begin; } } @@ -4029,13 +4028,12 @@ PHP_FUNCTION(nl2br) RETURN_STRINGL(str, str_len, 1); } - if (is_xhtml) { - new_length = str_len + repl_cnt * (sizeof("<br />") - 1); - } else { - new_length = str_len + repl_cnt * (sizeof("<br>") - 1); - } + { + size_t repl_len = is_xhtml ? (sizeof("<br />") - 1) : (sizeof("<br>") - 1); - tmp = target = emalloc(new_length + 1); + new_length = str_len + repl_cnt * repl_len; + tmp = target = safe_emalloc(repl_cnt, repl_len, str_len + 1); + } while (str < end) { switch (*str) { diff --git a/ext/standard/tests/assert/assert04.phpt b/ext/standard/tests/assert/assert04.phpt index 0da23186e6..bffadcb97c 100644 --- a/ext/standard/tests/assert/assert04.phpt +++ b/ext/standard/tests/assert/assert04.phpt @@ -15,7 +15,7 @@ assert(1); /* Wrong parameter count in assert */ assert_options(ASSERT_ACTIVE, 1); -assert(2,3); +assert(2, "failure", 3); /* Wrong parameter count in assert_options */ assert_options(ASSERT_ACTIVE, 0, 2); @@ -36,7 +36,7 @@ echo "not reached\n"; ?> --EXPECTF-- -Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d +Warning: assert() expects at most 2 parameters, 3 given in %s on line %d Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d @@ -45,3 +45,4 @@ Warning: assert_options() expects parameter 1 to be long, %unicode_string_option Warning: assert(): Assertion failed in %s on line %d Warning: assert(): Assertion failed in %s on line %d + diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt new file mode 100644 index 0000000000..2a73713437 --- /dev/null +++ b/ext/standard/tests/assert/assert_basic6.phpt @@ -0,0 +1,26 @@ +--TEST-- +assert() - basic - Test that bailout works +--INI-- +assert.active = 1 +assert.warning = 1 +assert.callback = f1 +assert.quiet_eval = 1 +assert.bail = 0 +--FILE-- +<?php +function f1($message) +{ + echo "f1 called\n"; +} + +//bail out on error +var_dump($rao = assert_options(ASSERT_BAIL, 1)); +$sa = "0 != 0"; +var_dump($r2 = assert($sa, "0 is 0")); +echo "If this is printed BAIL hasn't worked"; +--EXPECTF-- +int(0) +f1 called + +Warning: assert(): 0 is 0: "0 != 0" failed in %s on line 10 + diff --git a/ext/standard/tests/assert/assert_error1.phpt b/ext/standard/tests/assert/assert_error1.phpt index 6211f1c918..657b411f67 100644 --- a/ext/standard/tests/assert/assert_error1.phpt +++ b/ext/standard/tests/assert/assert_error1.phpt @@ -20,19 +20,19 @@ function handler($errno, $errstr) { //Wrong number of parameters for assert_options() assert_options(ASSERT_WARNING, 1); -var_dump($rao=assert_options(ASSERT_CALLBACK,"f1",1)); +var_dump($rao = assert_options(ASSERT_CALLBACK, "f1", 1)); //Unknown option for assert_options() -var_dump($rao=assert_options("F1","f1")); +var_dump($rao=assert_options("F1", "f1")); //Wrong number of parameters for assert() $sa="0 != 0"; -var_dump($r2=assert($sa,1)); +var_dump($r2 = assert($sa, "message", 1)); //Catch recoverable error with handler -var_dump($rc=assert('aa=sd+as+safsafasfaçsafçsafç')); +var_dump($rc = assert('aa=sd+as+safsafasfaçsafçsafç')); --EXPECTF-- Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d NULL @@ -40,5 +40,6 @@ NULL Warning: assert_options() expects parameter 1 to be long, string given in %s on line %d NULL -Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d +Warning: assert() expects at most 2 parameters, 3 given in %s on line %d NULL + diff --git a/ext/standard/tests/assert/assert_error2.phpt b/ext/standard/tests/assert/assert_error2.phpt new file mode 100644 index 0000000000..da7c3d9e0b --- /dev/null +++ b/ext/standard/tests/assert/assert_error2.phpt @@ -0,0 +1,30 @@ +--TEST-- +assert() - basic - Test that bailout works +--INI-- +assert.active = 1 +assert.warning = 1 +assert.callback = f1 +assert.quiet_eval = 1 +assert.bail = 0 +error_reporting = -1 +display_errors = 1 +--FILE-- +<?php +function f1($script, $line, $message, $user_message) +{ + echo "f1 called\n"; +} + +//bail out on error +var_dump($rao = assert_options(ASSERT_BAIL, 1)); +$sa = "0 != 0"; +var_dump($r2 = assert($sa)); +echo "If this is printed BAIL hasn't worked"; +--EXPECTF-- +int(0) + +Warning: Missing argument 4 for f1() in %s on line 2 +f1 called + +Warning: assert(): Assertion "0 != 0" failed in %s on line 10 + diff --git a/ext/standard/tests/assert/assert_error3.phpt b/ext/standard/tests/assert/assert_error3.phpt new file mode 100644 index 0000000000..54b91edd3d --- /dev/null +++ b/ext/standard/tests/assert/assert_error3.phpt @@ -0,0 +1,21 @@ +--TEST-- +assert() - basic - Test recoverable error +--INI-- +assert.active = 1 +assert.warning = 1 +assert.callback = f1 +assert.quiet_eval = 0 +assert.bail = 0 +error_reporting = -1 +display_errors = 1 +--FILE-- +<?php +$sa = "0 $ 0"; +var_dump($r2 = assert($sa)); +--EXPECTF-- + +Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1 + +Catchable fatal error: assert(): Failure evaluating code: +0 $ 0 in %s on line 3 + diff --git a/ext/standard/tests/assert/assert_error4.phpt b/ext/standard/tests/assert/assert_error4.phpt new file mode 100644 index 0000000000..264cc8fecf --- /dev/null +++ b/ext/standard/tests/assert/assert_error4.phpt @@ -0,0 +1,21 @@ +--TEST-- +assert() - basic - Test recoverable error +--INI-- +assert.active = 1 +assert.warning = 1 +assert.callback = f1 +assert.quiet_eval = 0 +assert.bail = 0 +error_reporting = -1 +display_errors = 1 +--FILE-- +<?php +$sa = "0 $ 0"; +var_dump($r2 = assert($sa, "Describing what was asserted")); +--EXPECTF-- + +Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1 + +Catchable fatal error: assert(): Failure evaluating code: +Describing what was asserted:"0 $ 0" in %s on line 3 + diff --git a/ext/standard/tests/file/bug51094.phpt b/ext/standard/tests/file/bug51094.phpt new file mode 100644 index 0000000000..7823558722 --- /dev/null +++ b/ext/standard/tests/file/bug51094.phpt @@ -0,0 +1,22 @@ +--TEST-- +Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon). +--FILE-- +<?php + +$ini = parse_ini_string('ini="ini;raw"', null, INI_SCANNER_RAW); +var_dump($ini['ini']); +$ini = parse_ini_string('ini="ini;raw', null, INI_SCANNER_RAW); +var_dump($ini['ini']); +$ini = parse_ini_string('ini=ini;raw', null, INI_SCANNER_RAW); +var_dump($ini['ini']); +$ini = parse_ini_string('ini=ini"raw', null, INI_SCANNER_RAW); +var_dump($ini['ini']); +$ini = parse_ini_string("ini=\r\niniraw", null, INI_SCANNER_RAW); +var_dump($ini['ini']); +--EXPECTF-- +string(7) "ini;raw" +string(8) ""ini;raw" +string(3) "ini" +string(7) "ini"raw" +string(0) "" + diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt index 92d6fc5b2a..0eb9dc519a 100644 --- a/ext/standard/tests/file/realpath_cache.phpt +++ b/ext/standard/tests/file/realpath_cache.phpt @@ -19,7 +19,7 @@ echo "Done\n"; int(%d) array(4) { ["key"]=> - %s(%d) + %s(%f) ["is_dir"]=> bool(true) ["realpath"]=> diff --git a/ext/standard/tests/file/umask_basic.phpt b/ext/standard/tests/file/umask_basic.phpt index 7a2eb762db..761df97253 100644 --- a/ext/standard/tests/file/umask_basic.phpt +++ b/ext/standard/tests/file/umask_basic.phpt @@ -20,7 +20,7 @@ for($mask = 0000; $mask <= 0777; $mask++) { var_dump( umask() ); echo "\n"; if ($mask != umask()) { - die('An error occured while changing back the umask'); + die('An error occurred while changing back the umask'); } } diff --git a/ext/standard/tests/general_functions/bug27678.phpt b/ext/standard/tests/general_functions/bug27678.phpt index 5db5890a1c..6f95509e14 100644 --- a/ext/standard/tests/general_functions/bug27678.phpt +++ b/ext/standard/tests/general_functions/bug27678.phpt @@ -6,9 +6,11 @@ Bug #27678 (number_format() crashes with large numbers) number_format(1e80, 0, '', ' '); number_format(1e300, 0, '', ' '); number_format(1e320, 0, '', ' '); -number_format(1e1000, 0, '', ' '); +$num = number_format(1e1000, 0, '', ' '); +var_dump(strlen($num) == 3); // $num == 'inf' echo "Done\n"; ?> --EXPECT-- +bool(true) Done diff --git a/ext/standard/tests/general_functions/bug60723.phpt b/ext/standard/tests/general_functions/bug60723.phpt new file mode 100644 index 0000000000..07b801bcfe --- /dev/null +++ b/ext/standard/tests/general_functions/bug60723.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #60723 (error_log error time has changed to UTC ignoring default timezo) +--INI-- +date.timezone=ASIA/Chongqing +log_errors=On +--FILE-- +<?php +$dir = dirname(__FILE__); +$log = $dir . "/tmp.err"; +ini_set("error_log", $log); +echo $aa; +error_log("dummy"); +readfile($log); +unlink($log); +?> +--EXPECTF-- +Notice: Undefined variable: aa in %sbug60723.php on line %d +[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d +[%s ASIA/Chongqing] dummy diff --git a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt index dd4b5142a1..78f0f03003 100644 --- a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt +++ b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt @@ -1,5 +1,7 @@ --TEST-- Test debug_zval_dump() function : working on objects +--SKIPIF-- +<?php if (PHP_ZTS) { print "skip only for no-zts build"; } --FILE-- <?php /* Prototype: void debug_zval_dump ( mixed $variable ); diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt index 9a9c573327..2da832b8ed 100644 --- a/ext/standard/tests/general_functions/uniqid_basic.phpt +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -1,73 +1,72 @@ ---TEST--
-Test uniqid() function : basic functionality
---FILE--
-<?php
-/* Prototype : string uniqid ([ string $prefix= "" [, bool $more_entropy= false ]] )
- * Description: Gets a prefixed unique identifier based on the current time in microseconds.
- * Source code: ext/standard/uniqid.c
-*/
-echo "*** Testing uniqid() : basic functionality ***\n";
-
-echo "\nuniqid() without a prefix\n";
-var_dump(uniqid());
-var_dump(uniqid(null, true));
-var_dump(uniqid(null, false));
-echo "\n\n";
-
-echo "uniqid() with a prefix\n";
-
-// Use a fixed prefix so we can ensure length of o/p id is fixed
-$prefix = array (
- 99999,
- "99999",
- 10.5e2,
- null,
- true,
- false
- );
-
-for ($i = 0; $i < count($prefix); $i++) {
- var_dump(uniqid($prefix[$i]));
- var_dump(uniqid($prefix[$i], true));
- var_dump(uniqid($prefix[$i], false));
- echo "\n";
-}
-
-?>
-===DONE===
---EXPECTF--
-*** Testing uniqid() : basic functionality ***
-
-uniqid() without a prefix
-string(13) "%s"
-string(23) "%s.%s"
-string(13) "%s"
-
-
-uniqid() with a prefix
-string(18) "99999%s"
-string(28) "99999%s.%s"
-string(18) "99999%s"
-
-string(18) "999994%s"
-string(28) "999994%s.%s"
-string(18) "999994%s"
-
-string(17) "1050%s"
-string(27) "1050%s.%s"
-string(17) "1050%s"
-
-string(13) "%s"
-string(23) "%s.%s"
-string(13) "%s"
-
-string(14) "1%s"
-string(24) "1%s.%s"
-string(14) "1%s"
-
-string(13) "%s"
-string(23) "%s.%s"
-string(13) "%s"
-
-===DONE===
-
\ No newline at end of file +--TEST-- +Test uniqid() function : basic functionality +--FILE-- +<?php +/* Prototype : string uniqid ([ string $prefix= "" [, bool $more_entropy= false ]] ) + * Description: Gets a prefixed unique identifier based on the current time in microseconds. + * Source code: ext/standard/uniqid.c +*/ +echo "*** Testing uniqid() : basic functionality ***\n"; + +echo "\nuniqid() without a prefix\n"; +var_dump(uniqid()); +var_dump(uniqid(null, true)); +var_dump(uniqid(null, false)); +echo "\n\n"; + +echo "uniqid() with a prefix\n"; + +// Use a fixed prefix so we can ensure length of o/p id is fixed +$prefix = array ( + 99999, + "99999", + 10.5e2, + null, + true, + false + ); + +for ($i = 0; $i < count($prefix); $i++) { + var_dump(uniqid($prefix[$i])); + var_dump(uniqid($prefix[$i], true)); + var_dump(uniqid($prefix[$i], false)); + echo "\n"; +} + +?> +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + + +uniqid() with a prefix +string(18) "99999%s" +string(28) "99999%s.%s" +string(18) "99999%s" + +string(18) "99999%s" +string(28) "99999%s.%s" +string(18) "99999%s" + +string(17) "1050%s" +string(27) "1050%s.%s" +string(17) "1050%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +string(14) "1%s" +string(24) "1%s.%s" +string(14) "1%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +===DONE=== diff --git a/ext/standard/tests/general_functions/var_export_error2.phpt b/ext/standard/tests/general_functions/var_export_error2.phpt index 2b306696a6..a6403e610d 100644 --- a/ext/standard/tests/general_functions/var_export_error2.phpt +++ b/ext/standard/tests/general_functions/var_export_error2.phpt @@ -15,4 +15,5 @@ var_export($obj, true); ===DONE=== --EXPECTF-- -Fatal error: Nesting level too deep - recursive dependency? in %s on line 9
\ No newline at end of file +Warning: var_export does not handle circular references in %s on line 9 +===DONE=== diff --git a/ext/standard/tests/general_functions/var_export_error3.phpt b/ext/standard/tests/general_functions/var_export_error3.phpt index 03ed496aca..c862691e91 100644 --- a/ext/standard/tests/general_functions/var_export_error3.phpt +++ b/ext/standard/tests/general_functions/var_export_error3.phpt @@ -15,4 +15,5 @@ var_export($a, true); ===DONE=== --EXPECTF-- -Fatal error: Nesting level too deep - recursive dependency? in %s on line 9
\ No newline at end of file +Warning: var_export does not handle circular references in %s on line 9 +===DONE=== diff --git a/ext/standard/tests/serialize/bug62373.phpt b/ext/standard/tests/serialize/bug62373.phpt new file mode 100644 index 0000000000..666c33ebdb --- /dev/null +++ b/ext/standard/tests/serialize/bug62373.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #62373 (serialize() generates wrong reference to the object) +--FILE-- +<?php +class A {} +class B {} + +$size_of_ce = (((int)(log(PHP_INT_MAX) / log(2)) + 1 == 32 ? 368: 680) + 15) & ~15; +$dummy = array(); +$b = new B(); +$period = $size_of_ce << 5; +for ($i = 0; $i < $period * 3; $i++) { + $a = new A(); + $s = unserialize(serialize(array($b, $a))); + if ($s[0] === $s[1]) { + echo "OOPS\n"; + break; + } + $dummy[] = $a; +} + +echo "OK\n"; +?> +--EXPECT-- +OK diff --git a/ext/standard/tests/serialize/bug62836_1.phpt b/ext/standard/tests/serialize/bug62836_1.phpt new file mode 100644 index 0000000000..7291046410 --- /dev/null +++ b/ext/standard/tests/serialize/bug62836_1.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #62836 (Seg fault or broken object references on unserialize()) +--FILE-- +<?php +$serialized_object='O:1:"A":4:{s:1:"b";O:1:"B":0:{}s:2:"b1";r:2;s:1:"c";O:1:"B":0:{}s:2:"c1";r:4;}'; +function __autoload($name) { + unserialize("i:4;"); + eval("class $name {} "); +} + +print_r(unserialize($serialized_object)); +echo "okey"; +?> +--EXPECT-- +A Object +( + [b] => B Object + ( + ) + + [b1] => B Object + ( + ) + + [c] => B Object + ( + ) + + [c1] => B Object + ( + ) + +) +okey diff --git a/ext/standard/tests/serialize/bug62836_2.phpt b/ext/standard/tests/serialize/bug62836_2.phpt new file mode 100644 index 0000000000..0634b1dac1 --- /dev/null +++ b/ext/standard/tests/serialize/bug62836_2.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #62836 (Seg fault or broken object references on unserialize()) +--FILE-- +<?php +$serialized_object='O:1:"A":4:{s:1:"b";O:1:"B":0:{}s:2:"b1";r:2;s:1:"c";O:1:"B":0:{}s:2:"c1";r:4;}'; + +ini_set('unserialize_callback_func','mycallback'); + +function mycallback($classname) { + unserialize("i:4;"); + eval ("class $classname {} "); +} + +print_r(unserialize($serialized_object)); +echo "okey"; +?> +--EXPECT-- +A Object +( + [b] => B Object + ( + ) + + [b1] => B Object + ( + ) + + [c] => B Object + ( + ) + + [c1] => B Object + ( + ) + +) +okey diff --git a/ext/standard/tests/streams/bug40459.phpt b/ext/standard/tests/streams/bug40459.phpt new file mode 100644 index 0000000000..8ee4363ed9 --- /dev/null +++ b/ext/standard/tests/streams/bug40459.phpt @@ -0,0 +1,103 @@ +--TEST-- +bug 40459 - Test whether the constructor of the user-space stream wrapper is called when stream functions are called +--FILE-- +<?php +// Test whether the constructor of the user-space stream wrapper is called when stream functions are called +class testwrapper { + private $constructorCalled = false; + function __construct() { + $this->constructorCalled = true; + } + + function stream_open($path, $mode, $options, &$opened_path) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return true; + } + + function url_stat($url, $flags) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return array(); + } + + function unlink($url) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rename($from, $to) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function mkdir($dir, $mode, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rmdir($dir, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function dir_opendir($url, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } + function stream_metadata() + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } +} + +stream_wrapper_register('test', 'testwrapper', STREAM_IS_URL); + +echo 'stream_open: '; +fopen('test://test', 'r'); +echo "\n"; + +echo 'url_stat: '; +stat('test://test'); +echo "\n"; + +echo 'dir_opendir: '; +opendir('test://test'); +echo "\n"; + +echo 'rmdir: '; +rmdir('test://test'); +echo "\n"; + +echo 'mkdir: '; +mkdir('test://test'); +echo "\n"; + +echo 'rename: '; +rename('test://test', 'test://test2'); +echo "\n"; + +echo 'unlink: '; +unlink('test://test'); +echo "\n"; + +echo 'touch: '; +touch('test://test', time()); +echo "\n"; + + + +?> +==DONE== +--EXPECT-- +stream_open: yes +url_stat: yes +dir_opendir: yes +rmdir: yes +mkdir: yes +rename: yes +unlink: yes +touch: yes +==DONE== diff --git a/ext/standard/tests/streams/bug61115-1.phpt b/ext/standard/tests/streams/bug61115-1.phpt index 89374e7353..99e2f7929c 100644 --- a/ext/standard/tests/streams/bug61115-1.phpt +++ b/ext/standard/tests/streams/bug61115-1.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link - variation 1 +--SKIPIF-- +<?php +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} +?> --FILE-- <?php diff --git a/ext/standard/tests/strings/bug62443.phpt b/ext/standard/tests/strings/bug62443.phpt new file mode 100644 index 0000000000..9e0dc38cfb --- /dev/null +++ b/ext/standard/tests/strings/bug62443.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #62443 Crypt SHA256/512 Segfaults With Malformed Salt +--FILE-- +<?php +crypt("foo", '$5$'.chr(0).'abc'); +crypt("foo", '$6$'.chr(0).'abc'); +echo "OK!"; +--EXPECT-- +OK! diff --git a/ext/standard/tests/strings/bug62462.phpt b/ext/standard/tests/strings/bug62462.phpt new file mode 100644 index 0000000000..c6eb41a543 --- /dev/null +++ b/ext/standard/tests/strings/bug62462.phpt @@ -0,0 +1,17 @@ +--TEST-- +Multibyte characters shouldn't be split by soft line break added by quoted_printable_encode - 4 byte character test +--FILE-- +<?php +echo quoted_printable_encode(str_repeat("\xc4\x85", 77)); +?> + +==DONE== +--EXPECT-- +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85 +==DONE== diff --git a/ext/standard/tests/strings/http_build_query_error.phpt b/ext/standard/tests/strings/http_build_query_error.phpt new file mode 100644 index 0000000000..30155e62a3 --- /dev/null +++ b/ext/standard/tests/strings/http_build_query_error.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing error on null parameter 1 of http_build_query() +--CREDITS-- +Pawel Krynicki <pawel.krynicki [at] xsolve [dot] pl> +#testfest AmsterdamPHP 2012-06-23 +--FILE-- +<?php + +$result = http_build_query(null); + +?> +--EXPECTF-- +Warning: http_build_query(): Parameter 1 expected to be Array or Object. %s value given in %s on line %d
\ No newline at end of file diff --git a/ext/standard/tests/strings/http_build_query_variation1.phpt b/ext/standard/tests/strings/http_build_query_variation1.phpt new file mode 100644 index 0000000000..56d81c9fdd --- /dev/null +++ b/ext/standard/tests/strings/http_build_query_variation1.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test http_build_query() function: usage variations - first arguments as object +--CREDITS-- +Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com> +--FILE-- +<?php +/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] ) + * Description: Generates a URL-encoded query string from the associative (or indexed) array provided. + * Source code: ext/standard/http.c +*/ + +class UrlBuilder +{ + public $name = 'homepage'; + public $page = 1; + protected $sort = 'desc,name'; + private $access = 'admin'; +} + +$obj = new stdClass; +$obj->name = 'homepage'; +$obj->page = 1; +$obj->sort = 'desc,name'; + +echo http_build_query($obj) . PHP_EOL; +echo http_build_query(new UrlBuilder()); +?> +--EXPECTF-- +name=homepage&page=1&sort=desc%2Cname +name=homepage&page=1 diff --git a/ext/standard/tests/strings/http_build_query_variation2.phpt b/ext/standard/tests/strings/http_build_query_variation2.phpt new file mode 100644 index 0000000000..ca1d8f459a --- /dev/null +++ b/ext/standard/tests/strings/http_build_query_variation2.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test http_build_query() function: usage variations - first arguments as multidimensional array and second argument present/not present +--CREDITS-- +Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com> +--FILE-- +<?php +/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] ) + * Description: Generates a URL-encoded query string from the associative (or indexed) array provided. + * Source code: ext/standard/http.c +*/ + +$mDimensional = array( + 20, + 5 => 13, + "9" => array( + 1 => "val1", + 3 => "val2", + "string" => "string" + ), + "name" => "homepage", + "page" => 10, + "sort" => array( + "desc", + "admin" => array( + "admin1", + "admin2" => array( + "who" => "admin2", + 2 => "test" + ) + ) + ) +); + +echo http_build_query($mDimensional) . PHP_EOL; +echo http_build_query($mDimensional, 'prefix_'); +?> +--EXPECTF-- +0=20&5=13&9%5B1%5D=val1&9%5B3%5D=val2&9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test +prefix_0=20&prefix_5=13&prefix_9%5B1%5D=val1&prefix_9%5B3%5D=val2&prefix_9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test diff --git a/ext/standard/tests/strings/http_build_query_variation3.phpt b/ext/standard/tests/strings/http_build_query_variation3.phpt new file mode 100644 index 0000000000..107120e084 --- /dev/null +++ b/ext/standard/tests/strings/http_build_query_variation3.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test http_build_query() function: usage variations - testing four parameter added in PHP 5.4.0 +--CREDITS-- +Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com> +--SKIPIF-- +<?php + if (version_compare(PHP_VERSION, '5.4.0', '<')) die("skip this test if PHP_VERSION is less than 5.4.0"); +?> +--FILE-- +<?php +/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] ) + * Description: Generates a URL-encoded query string from the associative (or indexed) array provided. + * Source code: ext/standard/http.c +*/ + +$oDimensional = array( + "name" => "main page", + "sort" => "desc,admin", + "equation" => "10 + 10 - 5" +); + +echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC1738) . PHP_EOL; +echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC3986); +?> +--EXPECTF-- +name=main+page&sort=desc%2Cadmin&equation=10+%2B+10+-+5 +name=main%20page&sort=desc%2Cadmin&equation=10%20%2B%2010%20-%205 diff --git a/ext/standard/tests/strings/quoted_printable_encode_002.phpt b/ext/standard/tests/strings/quoted_printable_encode_002.phpt Binary files differindex 5380eb0bff..aaf5608f33 100644 --- a/ext/standard/tests/strings/quoted_printable_encode_002.phpt +++ b/ext/standard/tests/strings/quoted_printable_encode_002.phpt diff --git a/ext/standard/tests/strings/str_pad_variation5.phpt b/ext/standard/tests/strings/str_pad_variation5.phpt index 4b300c4717..cd979a1c8b 100644 --- a/ext/standard/tests/strings/str_pad_variation5.phpt +++ b/ext/standard/tests/strings/str_pad_variation5.phpt @@ -5,6 +5,9 @@ memory_limit=128M --SKIPIF-- <?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --FILE-- <?php diff --git a/ext/standard/tests/url/parse_url_relative_scheme.phpt b/ext/standard/tests/url/parse_url_relative_scheme.phpt new file mode 100644 index 0000000000..7c8952db71 --- /dev/null +++ b/ext/standard/tests/url/parse_url_relative_scheme.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test parse_url() function: Checks relative URL schemes (e.g. "//example.com") +--FILE-- +<?php +var_dump(parse_url('//example.org')); +--EXPECT-- +array(1) { + ["host"]=> + string(11) "example.org" +} + diff --git a/ext/standard/tests/zend_logo_guid.phpt b/ext/standard/tests/zend_logo_guid.phpt index d26ed45e9e..44e213b25d 100644 --- a/ext/standard/tests/zend_logo_guid.phpt +++ b/ext/standard/tests/zend_logo_guid.phpt @@ -1,5 +1,5 @@ --TEST-- -Checking the zend_logo_guid() functio +Checking the zend_logo_guid() function --CREDITS-- Sebastian Schürmann sschuermann@chip.de diff --git a/ext/standard/url.c b/ext/standard/url.c index 8489f42091..44a568032b 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -204,6 +204,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) } else { goto just_path; } + } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + s += 2; } else { just_path: ue = s + length; @@ -220,14 +222,14 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) if (query && fragment) { if (query > fragment) { - p = e = fragment; + e = fragment; } else { - p = e = query; + e = query; } } else if (query) { - p = e = query; + e = query; } else if (fragment) { - p = e = fragment; + e = fragment; } } else { e = p; diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index d883d4dfa3..1ec269de30 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -2,9 +2,9 @@ #line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ - | PHP Version 6 | + | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index e7218a14f1..2e37cf0ba4 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -1,8 +1,8 @@ /* +----------------------------------------------------------------------+ - | PHP Version 6 | + | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/ext/standard/var.c b/ext/standard/var.c index c6126e95fa..494fb583c7 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -453,6 +453,11 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC) break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); + if(myht && myht->nApplyCount > 0){ + smart_str_appendl(buf, "NULL", 4); + zend_error(E_WARNING, "var_export does not handle circular references"); + return; + } if (level > 1) { smart_str_appendc(buf, '\n'); buffer_append_spaces(buf, level - 1); @@ -469,6 +474,11 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC) case IS_OBJECT: myht = Z_OBJPROP_PP(struc); + if(myht && myht->nApplyCount > 0){ + smart_str_appendl(buf, "NULL", 4); + zend_error(E_WARNING, "var_export does not handle circular references"); + return; + } if (level > 1) { smart_str_appendc(buf, '\n'); buffer_append_spaces(buf, level - 1); @@ -541,12 +551,9 @@ static inline int php_add_var_hash(HashTable *var_hash, zval *var, void *var_old /* relies on "(long)" being a perfect hash function for data pointers, * however the actual identity of an object has had to be determined - * by its object handle and the class entry since 5.0. */ + * by its object handle since 5.0. */ if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, - (((size_t)Z_OBJCE_P(var) << 5) - | ((size_t)Z_OBJCE_P(var) >> (sizeof(long) * 8 - 5))) - + (long) Z_OBJ_HANDLE_P(var)); + p = smart_str_print_long(id + sizeof(id) - 1, (long) Z_OBJ_HANDLE_P(var)); *(--p) = 'O'; len = id + sizeof(id) - 1 - p; } else { diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index e1ac636d04..2537c5213b 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -620,10 +620,13 @@ yy20: do { /* Try to find class directly */ + BG(serialize_lock) = 1; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { + BG(serialize_lock) = 0; ce = *pce; break; } + BG(serialize_lock) = 0; /* Check for unserialize callback */ if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { @@ -638,7 +641,9 @@ yy20: args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); + BG(serialize_lock) = 1; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { + BG(serialize_lock) = 0; php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); incomplete_class = 1; ce = PHP_IC_ENTRY; @@ -646,6 +651,7 @@ yy20: zval_ptr_dtor(&arg_func_name); break; } + BG(serialize_lock) = 0; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } diff --git a/ext/tidy/examples/cleanhtml.php b/ext/tidy/examples/cleanhtml.php index 9a6713dc55..2644210cbf 100644 --- a/ext/tidy/examples/cleanhtml.php +++ b/ext/tidy/examples/cleanhtml.php @@ -26,7 +26,7 @@ if(tidy_warning_count() || tidy_error_count()) { - echo "\n\nThe following errors or warnings occured:\n"; + echo "\n\nThe following errors or warnings occurred:\n"; echo tidy_get_error_buffer(); echo "\n"; } diff --git a/ext/tidy/examples/cleanhtml5.php b/ext/tidy/examples/cleanhtml5.php index 4dfd7643e1..2ce683acad 100644 --- a/ext/tidy/examples/cleanhtml5.php +++ b/ext/tidy/examples/cleanhtml5.php @@ -25,7 +25,7 @@ if(!empty($tidy->errorBuffer)) { - echo "\n\nThe following errors or warnings occured:\n"; + echo "\n\nThe following errors or warnings occurred:\n"; echo "{$tidy->errorBuffer}\n"; } diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 5ac1a69196..72d8f5db66 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -1238,7 +1238,7 @@ static PHP_FUNCTION(tidy_parse_string) /* }}} */ /* {{{ proto string tidy_get_error_buffer() - Return warnings and errors which occured parsing the specified document*/ + Return warnings and errors which occurred parsing the specified document*/ static PHP_FUNCTION(tidy_get_error_buffer) { TIDY_FETCH_OBJECT; diff --git a/ext/wddx/tests/bug48562.phpt b/ext/wddx/tests/bug48562.phpt index ebd2004e0a..ee9f271d91 100644 --- a/ext/wddx/tests/bug48562.phpt +++ b/ext/wddx/tests/bug48562.phpt @@ -16,6 +16,12 @@ $a['x'] = &$a; var_dump(wddx_serialize_vars($a)); +// replace $a - the recursion detection seems to be causing $a to be not an array here, maybe its internally a pointer +// replacing $a with a new array() allows this test to still check for 2 things +// 1. recursion detection in &$a; +// 2. recursion detection in adding $a to itself and then serializing $a +// the one thing the test won't check is using $a as an array after doing &$a; which isn't really a wddx problem. +$a = array(); $a['x'] = 'foo'; $a['x'] = $a; diff --git a/ext/xml/tests/bug62328.phpt b/ext/xml/tests/bug62328.phpt new file mode 100644 index 0000000000..e4c3c59d37 --- /dev/null +++ b/ext/xml/tests/bug62328.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #62328 (implementing __toString and a cast to string fails) +--SKIPIF-- +<?php +require_once("skipif.inc"); +?> +--FILE-- +<?php +class UberSimpleXML extends SimpleXMLElement { + public function __toString() { + return 'stringification'; + } +} + +$xml = new UberSimpleXML('<xml/>'); + +var_dump((string) $xml); +var_dump($xml->__toString()); +--EXPECT-- +string(15) "stringification" +string(15) "stringification" diff --git a/ext/xmlrpc/tests/bug61264.phpt b/ext/xmlrpc/tests/bug61264.phpt index b1da27f252..24e4b2749c 100644 --- a/ext/xmlrpc/tests/bug61264.phpt +++ b/ext/xmlrpc/tests/bug61264.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable +--SKIPIF-- +<?php if (!extension_loaded("xmlrpc")) print "skip"; ?> --FILE-- <?php $xml = <<<XML diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index d48e7090ae..5aa6aa943b 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -336,7 +336,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler)); valuePush(ctxt, xmlXPathNewString("")); } - /* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */ + /* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */ } else if (retval == NULL) { } else { if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index d5c24ce9cf..85f9119f5a 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -89,7 +89,14 @@ yes lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ - lib/zip_error_clear.c lib/zip_file_error_clear.c" + lib/zip_error_clear.c lib/zip_file_error_clear.c \ + lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \ + lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \ + lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \ + lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \ + lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \ + lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \ + lib/zip_source_read.c lib/zip_source_stat.c" AC_DEFINE(HAVE_ZIP,1,[ ]) PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) diff --git a/ext/zip/config.w32 b/ext/zip/config.w32 index e60a983b3a..fa0a5180df 100644 --- a/ext/zip/config.w32 +++ b/ext/zip/config.w32 @@ -27,7 +27,14 @@ if (PHP_ZIP != "no") { zip_get_archive_comment.c zip_get_file_comment.c \ zip_set_archive_comment.c zip_set_file_comment.c \ zip_unchange_archive.c zip_memdup.c zip_stat_init.c \ - zip_add_dir.c zip_file_error_clear.c zip_error_clear.c", "zip"); + zip_add_dir.c zip_file_error_clear.c zip_error_clear.c \ + zip_fdopen.c zip_fopen_encrypted.c zip_fopen_index_encrypted.c \ + zip_get_compression_implementation.c zip_get_encryption_implementation.c \ + zip_get_file_extra.c zip_get_num_entries.c zip_set_default_password.c \ + zip_set_file_extra.c zip_source_close.c zip_source_crc.c \ + zip_source_deflate.c zip_source_error.c zip_source_layered.c \ + zip_source_open.c zip_source_pkware.c zip_source_pop.c \ + zip_source_read.c zip_source_stat.c", "zip"); AC_DEFINE('HAVE_ZIP', 1); } else { diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h index 14a57bc582..f11c9aba7f 100644 --- a/ext/zip/lib/zip.h +++ b/ext/zip/lib/zip.h @@ -3,7 +3,7 @@ /* zip.h -- exported declarations. - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -52,6 +52,8 @@ BEGIN_EXTERN_C() +#include "zipconf.h" + #include <sys/types.h> #include <stdio.h> #include <time.h> @@ -71,10 +73,19 @@ BEGIN_EXTERN_C() #define ZIP_FL_COMPRESSED 4 /* read compressed data */ #define ZIP_FL_UNCHANGED 8 /* use original data, ignoring changes */ #define ZIP_FL_RECOMPRESS 16 /* force recompression of data */ +#define ZIP_FL_ENCRYPTED 32 /* read encrypted data + (implies ZIP_FL_COMPRESSED) */ /* archive global flags flags */ #define ZIP_AFL_TORRENT 1 /* torrent zipped */ +#define ZIP_AFL_RDONLY 2 /* read only -- cannot be cleared */ + + +/* flags for compression and encryption sources */ + +#define ZIP_CODEC_ENCODE 1 /* compress/encrypt */ + /* libzip error codes */ @@ -102,7 +113,10 @@ BEGIN_EXTERN_C() #define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */ #define ZIP_ER_REMOVE 22 /* S Can't remove file */ #define ZIP_ER_DELETED 23 /* N Entry has been deleted */ - +#define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ +#define ZIP_ER_RDONLY 25 /* N Read-only archive */ +#define ZIP_ER_NOPASSWD 26 /* N No password provided */ +#define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ /* type of system error value */ @@ -162,69 +176,99 @@ enum zip_source_cmd { ZIP_SOURCE_FREE /* cleanup and free resources */ }; -typedef ssize_t (*zip_source_callback)(void *state, void *data, - size_t len, enum zip_source_cmd cmd); +#define ZIP_SOURCE_ERR_LOWER -2 + +#define ZIP_STAT_NAME 0x0001 +#define ZIP_STAT_INDEX 0x0002 +#define ZIP_STAT_SIZE 0x0004 +#define ZIP_STAT_COMP_SIZE 0x0008 +#define ZIP_STAT_MTIME 0x0010 +#define ZIP_STAT_CRC 0x0020 +#define ZIP_STAT_COMP_METHOD 0x0040 +#define ZIP_STAT_ENCRYPTION_METHOD 0x0080 +#define ZIP_STAT_FLAGS 0x0100 struct zip_stat { + zip_uint64_t valid; /* which fields have valid values */ const char *name; /* name of the file */ - int index; /* index within archive */ - unsigned int crc; /* crc of file data */ + zip_uint64_t index; /* index within archive */ + zip_uint64_t size; /* size of file (uncompressed) */ + zip_uint64_t comp_size; /* size of file (compressed) */ time_t mtime; /* modification time */ - off_t size; /* size of file (uncompressed) */ - off_t comp_size; /* size of file (compressed) */ - unsigned short comp_method; /* compression method used */ - unsigned short encryption_method; /* encryption method used */ + zip_uint32_t crc; /* crc of file data */ + zip_uint16_t comp_method; /* compression method used */ + zip_uint16_t encryption_method; /* encryption method used */ + zip_uint32_t flags; /* reserved for future use */ }; struct zip; struct zip_file; struct zip_source; +typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, + enum zip_source_cmd); + -ZIP_EXTERN(int) zip_add(struct zip *, const char *, struct zip_source *); -ZIP_EXTERN(int) zip_add_dir(struct zip *, const char *); +ZIP_EXTERN(zip_int64_t) zip_add(struct zip *, const char *, struct zip_source *); +ZIP_EXTERN(zip_int64_t) zip_add_dir(struct zip *, const char *); ZIP_EXTERN(int) zip_close(struct zip *); -ZIP_EXTERN(int) zip_delete(struct zip *, int); +ZIP_EXTERN(int) zip_delete(struct zip *, zip_uint64_t); ZIP_EXTERN(void) zip_error_clear(struct zip *); ZIP_EXTERN(void) zip_error_get(struct zip *, int *, int *); ZIP_EXTERN(int) zip_error_get_sys_type(int); -ZIP_EXTERN(int) zip_error_to_str(char *, size_t, int, int); +ZIP_EXTERN(int) zip_error_to_str(char *, zip_uint64_t, int, int); ZIP_EXTERN(int) zip_fclose(struct zip_file *); +ZIP_EXTERN(struct zip *)zip_fdopen(int, int, int *); ZIP_EXTERN(void) zip_file_error_clear(struct zip_file *); ZIP_EXTERN(void) zip_file_error_get(struct zip_file *, int *, int *); ZIP_EXTERN(const char *)zip_file_strerror(struct zip_file *); -ZIP_EXTERN(struct zip_file *)zip_fopen(struct zip *, const char *, int); -ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, int, int); -ZIP_EXTERN(ssize_t) zip_fread(struct zip_file *, void *, size_t); +ZIP_EXTERN(struct) zip_file *zip_fopen(struct zip *, const char *, int); +ZIP_EXTERN(struct) zip_file *zip_fopen_encrypted(struct zip *, const char *, + int, const char *); +ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, zip_uint64_t, int); +ZIP_EXTERN(struct zip_file *)zip_fopen_index_encrypted(struct zip *, + zip_uint64_t, int, + const char *); +ZIP_EXTERN(zip_int64_t) zip_fread(struct zip_file *, void *, zip_uint64_t); ZIP_EXTERN(const char *)zip_get_archive_comment(struct zip *, int *, int); ZIP_EXTERN(int) zip_get_archive_flag(struct zip *, int, int); -ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, int, int *, int); -ZIP_EXTERN(const char *)zip_get_name(struct zip *, int, int); -ZIP_EXTERN(int) zip_get_num_files(struct zip *); +ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, zip_uint64_t, + int *, int); +ZIP_EXTERN(const char *)zip_get_file_extra(struct zip *, zip_uint64_t, + int *, int); +ZIP_EXTERN(const char *)zip_get_name(struct zip *, zip_uint64_t, int); +ZIP_EXTERN(zip_uint64_t) zip_get_num_entries(struct zip *, int); +ZIP_EXTERN(int) zip_get_num_files(struct zip *); /* deprecated, use zip_get_num_entries instead */ ZIP_EXTERN(int) zip_name_locate(struct zip *, const char *, int); ZIP_EXTERN(struct zip *)zip_open(const char *, int, int *); -ZIP_EXTERN(int) zip_rename(struct zip *, int, const char *); -ZIP_EXTERN(int) zip_replace(struct zip *, int, struct zip_source *); +ZIP_EXTERN(int) zip_rename(struct zip *, zip_uint64_t, const char *); +ZIP_EXTERN(int) zip_replace(struct zip *, zip_uint64_t, struct zip_source *); ZIP_EXTERN(int) zip_set_archive_comment(struct zip *, const char *, int); ZIP_EXTERN(int) zip_set_archive_flag(struct zip *, int, int); -ZIP_EXTERN(int) zip_set_file_comment(struct zip *, int, const char *, int); -ZIP_EXTERN(struct zip_source *)zip_source_buffer(struct zip *, const void *, - off_t, int); -ZIP_EXTERN(struct zip_source *)zip_source_file(struct zip *, const char *, - off_t, off_t); -ZIP_EXTERN(struct zip_source *)zip_source_filep(struct zip *, FILE *, - off_t, off_t); +ZIP_EXTERN(int) zip_set_default_password(struct zip *, const char *); +ZIP_EXTERN(int) zip_set_file_comment(struct zip *, zip_uint64_t, + const char *, int); +ZIP_EXTERN(int) zip_set_file_extra(struct zip *, zip_uint64_t, + const char *, int); +ZIP_EXTERN(struct) zip_source *zip_source_buffer(struct zip *, const void *, + zip_uint64_t, int); +ZIP_EXTERN(struct) zip_source *zip_source_file(struct zip *, const char *, + zip_uint64_t, zip_int64_t); +ZIP_EXTERN(struct) zip_source *zip_source_filep(struct zip *, FILE *, + zip_uint64_t, zip_int64_t); ZIP_EXTERN(void) zip_source_free(struct zip_source *); ZIP_EXTERN(struct zip_source *)zip_source_function(struct zip *, zip_source_callback, void *); ZIP_EXTERN(struct zip_source *)zip_source_zip(struct zip *, struct zip *, - int, int, off_t, off_t); + zip_uint64_t, int, + zip_uint64_t, zip_int64_t); ZIP_EXTERN(int) zip_stat(struct zip *, const char *, int, struct zip_stat *); -ZIP_EXTERN(int) zip_stat_index(struct zip *, int, int, struct zip_stat *); +ZIP_EXTERN(int) zip_stat_index(struct zip *, zip_uint64_t, int, + struct zip_stat *); ZIP_EXTERN(void) zip_stat_init(struct zip_stat *); ZIP_EXTERN(const char *)zip_strerror(struct zip *); -ZIP_EXTERN(int) zip_unchange(struct zip *, int); +ZIP_EXTERN(int) zip_unchange(struct zip *, zip_uint64_t); ZIP_EXTERN(int) zip_unchange_all(struct zip *); ZIP_EXTERN(int) zip_unchange_archive(struct zip *); diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c index 85d5997911..6067abbac4 100644 --- a/ext/zip/lib/zip_add.c +++ b/ext/zip/lib/zip_add.c @@ -37,13 +37,20 @@ -ZIP_EXTERN(int) +/* + NOTE: Return type is signed so we can return -1 on error. + The index can not be larger than ZIP_INT64_MAX since the size + of the central directory cannot be larger than + ZIP_UINT64_MAX, and each entry is larger than 2 bytes. +*/ + +ZIP_EXTERN(zip_int64_t) zip_add(struct zip *za, const char *name, struct zip_source *source) { if (name == NULL || source == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - - return _zip_replace(za, -1, name, source); + + return _zip_replace(za, ZIP_UINT64_MAX, name, source); } diff --git a/ext/zip/lib/zip_add_dir.c b/ext/zip/lib/zip_add_dir.c index 9b23425194..0a9d7f4863 100644 --- a/ext/zip/lib/zip_add_dir.c +++ b/ext/zip/lib/zip_add_dir.c @@ -1,6 +1,6 @@ /* zip_add_dir.c -- add directory - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -40,13 +40,21 @@ -ZIP_EXTERN(int) +/* NOTE: Signed due to -1 on error. See zip_add.c for more details. */ + +ZIP_EXTERN(zip_int64_t) zip_add_dir(struct zip *za, const char *name) { - int len, ret; + int len; + zip_int64_t ret; char *s; struct zip_source *source; + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (name == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c index 0796f27462..362f92d749 100644 --- a/ext/zip/lib/zip_close.c +++ b/ext/zip/lib/zip_close.c @@ -1,6 +1,6 @@ /* zip_close.c -- close zip archive and update changes - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -33,26 +33,28 @@ +#include "zipint.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include <sys/types.h> #include <sys/stat.h> - -#include "zipint.h" +#ifdef PHP_WIN32 +#include <io.h> +#include <fcntl.h> +#endif static int add_data(struct zip *, struct zip_source *, struct zip_dirent *, FILE *); -static int add_data_comp(zip_source_callback, void *, struct zip_stat *, - FILE *, struct zip_error *); -static int add_data_uncomp(struct zip *, zip_source_callback, void *, - struct zip_stat *, FILE *); -static void ch_set_error(struct zip_error *, zip_source_callback, void *); static int copy_data(FILE *, off_t, FILE *, struct zip_error *); +static int copy_source(struct zip *, struct zip_source *, FILE *); static int write_cdir(struct zip *, struct zip_cdir *, FILE *); static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *); -static int _zip_changed(struct zip *, int *); static char *_zip_create_temp_output(struct zip *, FILE **); static int _zip_torrentzip_cmp(const void *, const void *); @@ -72,7 +74,9 @@ zip_close(struct zip *za) int i, j, error; char *temp; FILE *out; +#ifndef PHP_WIN32 mode_t mask; +#endif struct zip_cdir *cd; struct zip_dirent de; struct filelist *filelist; @@ -99,7 +103,7 @@ zip_close(struct zip *za) } _zip_free(za); return 0; - } + } if ((filelist=(struct filelist *)malloc(sizeof(filelist[0])*survivors)) == NULL) @@ -126,11 +130,11 @@ zip_close(struct zip *za) cd->comment_len = TORRENT_SIG_LEN + TORRENT_CRC_LEN; } else if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, ZIP_FL_UNCHANGED) == 0) { - if (_zip_cdir_set_comment(cd, za) == -1) { - _zip_cdir_free(cd); + if (_zip_cdir_set_comment(cd, za) == -1) { + _zip_cdir_free(cd); free(filelist); - return -1; - } + return -1; + } } if ((temp=_zip_create_temp_output(za, &out)) == NULL) { @@ -198,8 +202,7 @@ zip_close(struct zip *za) error = 1; break; } - memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j])); - + memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j])); if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) { de.crc = za->cdir->entry[i].crc; de.comp_size = za->cdir->entry[i].comp_size; @@ -220,6 +223,22 @@ zip_close(struct zip *za) cd->entry[j].filename_len = de.filename_len; } + if (za->entry[i].ch_extra_len != -1) { + free(de.extrafield); + if ((de.extrafield=malloc(za->entry[i].ch_extra_len)) == NULL) { + error = 1; + break; + } + memcpy(de.extrafield, za->entry[i].ch_extra, za->entry[i].ch_extra_len); + de.extrafield_len = za->entry[i].ch_extra_len; + /* as the rest of cd entries, its malloc/free is done by za */ + /* TODO unsure if this should also be set in the CD -- + * not done for now + cd->entry[j].extrafield = za->entry[i].ch_extra; + cd->entry[j].extrafield_len = za->entry[i].ch_extra_len; + */ + } + if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0 && za->entry[i].ch_comment_len != -1) { /* as the rest of cd entries, its malloc/free is done by za */ @@ -234,16 +253,22 @@ zip_close(struct zip *za) zs = NULL; if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) { - if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) == NULL) { - error = 1; - break; - } + if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) + == NULL) { + error = 1; + break; + } } if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) { error = 1; + if (zs) + zip_source_free(zs); break; } + if (zs) + zip_source_free(zs); + cd->entry[j].last_mod = de.last_mod; cd->entry[j].comp_method = de.comp_method; cd->entry[j].comp_size = de.comp_size; @@ -291,27 +316,27 @@ zip_close(struct zip *za) free(temp); return -1; } - - if (za->zp) { - fclose(za->zp); - za->zp = NULL; - reopen_on_error = 1; + + if (za->zp) { + fclose(za->zp); + za->zp = NULL; + reopen_on_error = 1; } if (_zip_rename(temp, za->zn) != 0) { - _zip_error_set(&za->error, ZIP_ER_RENAME, errno); - remove(temp); - free(temp); - if (reopen_on_error) { - /* ignore errors, since we're already in an error case */ - za->zp = fopen(za->zn, "rb"); - } - return -1; + _zip_error_set(&za->error, ZIP_ER_RENAME, errno); + remove(temp); + free(temp); + if (reopen_on_error) { + /* ignore errors, since we're already in an error case */ + za->zp = fopen(za->zn, "rb"); } + return -1; + } +#ifndef PHP_WIN32 mask = umask(0); umask(mask); chmod(za->zn, 0666&~mask); - if (za->ch_comment) - free(za->ch_comment); +#endif _zip_free(za); free(temp); @@ -322,23 +347,17 @@ zip_close(struct zip *za) static int -add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) +add_data(struct zip *za, struct zip_source *src, struct zip_dirent *de, + FILE *ft) { - off_t offstart, offend; - zip_source_callback cb; - void *ud; + off_t offstart, offdata, offend; struct zip_stat st; - - cb = zs->f; - ud = zs->ud; - - if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) { - ch_set_error(&za->error, cb, ud); - return -1; - } - - if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) { - ch_set_error(&za->error, cb, ud); + struct zip_source *s2; + zip_compression_implementation comp_impl; + int ret; + + if (zip_source_stat(src, &st) < 0) { + _zip_error_set_from_source(&za->error, src); return -1; } @@ -347,19 +366,49 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) if (_zip_dirent_write(de, ft, 1, &za->error) < 0) return -1; - if (st.comp_method != ZIP_CM_STORE) { - if (add_data_comp(cb, ud, &st, ft, &za->error) < 0) - return -1; + if ((s2=zip_source_crc(za, src, 0)) == NULL) { + zip_source_pop(s2); + return -1; } - else { - if (add_data_uncomp(za, cb, ud, &st, ft) < 0) + + /* XXX: deflate 0-byte files for torrentzip? */ + if (((st.valid & ZIP_STAT_COMP_METHOD) == 0 + || st.comp_method == ZIP_CM_STORE) + && ((st.valid & ZIP_STAT_SIZE) == 0 || st.size != 0)) { + comp_impl = NULL; + if ((comp_impl=zip_get_compression_implementation(ZIP_CM_DEFLATE)) + == NULL) { + _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); + zip_source_pop(s2); + return -1; + } + if ((s2=comp_impl(za, s2, ZIP_CM_DEFLATE, ZIP_CODEC_ENCODE)) + == NULL) { + /* XXX: set error? */ + zip_source_pop(s2); return -1; + } + } + else + s2 = src; + + offdata = ftello(ft); + + ret = copy_source(za, s2, ft); + + if (zip_source_stat(s2, &st) < 0) + ret = -1; + + while (s2 != src) { + if ((s2=zip_source_pop(s2)) == NULL) { + /* XXX: set erorr */ + ret = -1; + break; + } } - if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) { - ch_set_error(&za->error, cb, ud); + if (ret < 0) return -1; - } offend = ftello(ft); @@ -368,19 +417,18 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) return -1; } - de->last_mod = st.mtime; de->comp_method = st.comp_method; de->crc = st.crc; de->uncomp_size = st.size; - de->comp_size = st.comp_size; + de->comp_size = offend - offdata; if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) _zip_dirent_torrent_normalize(de); if (_zip_dirent_write(de, ft, 1, &za->error) < 0) return -1; - + if (fseeko(ft, offend, SEEK_SET) < 0) { _zip_error_set(&za->error, ZIP_ER_SEEK, errno); return -1; @@ -392,133 +440,6 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) static int -add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft, - struct zip_error *error) -{ - char buf[BUFSIZE]; - ssize_t n; - - st->comp_size = 0; - while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) { - if (fwrite(buf, 1, n, ft) != (size_t)n) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - st->comp_size += n; - } - if (n < 0) { - ch_set_error(error, cb, ud); - return -1; - } - - return 0; -} - - - -static int -add_data_uncomp(struct zip *za, zip_source_callback cb, void *ud, - struct zip_stat *st, FILE *ft) -{ - char b1[BUFSIZE], b2[BUFSIZE]; - int end, flush, ret; - ssize_t n; - size_t n2; - z_stream zstr; - int mem_level; - - st->comp_method = ZIP_CM_DEFLATE; - st->comp_size = st->size = 0; - st->crc = crc32(0, NULL, 0); - - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = NULL; - zstr.avail_in = 0; - zstr.avail_out = 0; - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - mem_level = TORRENT_MEM_LEVEL; - else - mem_level = MAX_MEM_LEVEL; - - /* -MAX_WBITS: undocumented feature of zlib to _not_ write a zlib header */ - deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, mem_level, - Z_DEFAULT_STRATEGY); - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - zstr.next_in = NULL; - zstr.avail_in = 0; - - flush = 0; - end = 0; - while (!end) { - if (zstr.avail_in == 0 && !flush) { - if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) { - ch_set_error(&za->error, cb, ud); - deflateEnd(&zstr); - return -1; - } - if (n > 0) { - zstr.avail_in = n; - zstr.next_in = (Bytef *)b1; - st->size += n; - st->crc = crc32(st->crc, (Bytef *)b1, n); - } - else - flush = Z_FINISH; - } - - ret = deflate(&zstr, flush); - if (ret != Z_OK && ret != Z_STREAM_END) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - return -1; - } - - if (zstr.avail_out != sizeof(b2)) { - n2 = sizeof(b2) - zstr.avail_out; - - if (fwrite(b2, 1, n2, ft) != n2) { - _zip_error_set(&za->error, ZIP_ER_WRITE, errno); - return -1; - } - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - st->comp_size += n2; - } - - if (ret == Z_STREAM_END) { - deflateEnd(&zstr); - end = 1; - } - } - - return 0; -} - - - -static void -ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud) -{ - int e[2]; - - if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) { - error->zip_err = ZIP_ER_INTERNAL; - error->sys_err = 0; - } - else { - error->zip_err = e[0]; - error->sys_err = e[1]; - } -} - - - -static int copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error) { char buf[BUFSIZE]; @@ -552,6 +473,40 @@ copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error) static int +copy_source(struct zip *za, struct zip_source *src, FILE *ft) +{ + char buf[BUFSIZE]; + zip_int64_t n; + int ret; + + if (zip_source_open(src) < 0) { + _zip_error_set_from_source(&za->error, src); + return -1; + } + + ret = 0; + while ((n=zip_source_read(src, buf, sizeof(buf))) > 0) { + if (fwrite(buf, 1, n, ft) != (size_t)n) { + _zip_error_set(&za->error, ZIP_ER_WRITE, errno); + ret = -1; + break; + } + } + + if (n < 0) { + if (ret == 0) + _zip_error_set_from_source(&za->error, src); + ret = -1; + } + + zip_source_close(src); + + return ret; +} + + + +static int write_cdir(struct zip *za, struct zip_cdir *cd, FILE *out) { off_t offset; @@ -613,7 +568,7 @@ _zip_cdir_set_comment(struct zip_cdir *dest, struct zip *src) -static int +int _zip_changed(struct zip *za, int *survivorsp) { int changed, i, survivors; @@ -626,13 +581,15 @@ _zip_changed(struct zip *za, int *survivorsp) for (i=0; i<za->nentry; i++) { if ((za->entry[i].state != ZIP_ST_UNCHANGED) + || (za->entry[i].ch_extra_len != -1) || (za->entry[i].ch_comment_len != -1)) changed = 1; if (za->entry[i].state != ZIP_ST_DELETED) survivors++; } - *survivorsp = survivors; + if (survivorsp) + *survivorsp = survivors; return changed; } @@ -668,6 +625,10 @@ _zip_create_temp_output(struct zip *za, FILE **outp) return NULL; } #ifdef PHP_WIN32 + /* + According to Pierre Joye, Windows in some environments per + default creates text files, so force binary mode. + */ _setmode(_fileno(tfp), _O_BINARY ); #endif diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c index 4591ff7f86..131d444124 100644 --- a/ext/zip/lib/zip_delete.c +++ b/ext/zip/lib/zip_delete.c @@ -1,6 +1,6 @@ /* zip_delete.c -- delete file from zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -38,13 +38,18 @@ ZIP_EXTERN(int) -zip_delete(struct zip *za, int idx) +zip_delete(struct zip *za, zip_uint64_t idx) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + /* allow duplicate file names, because the file will * be removed directly afterwards */ if (_zip_unchange(za, idx, 1) != 0) diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c index 59f8ab0af9..b5b9d273be 100644 --- a/ext/zip/lib/zip_dirent.c +++ b/ext/zip/lib/zip_dirent.c @@ -45,7 +45,6 @@ static time_t _zip_d2u_time(int, int); static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *); static char *_zip_readstr(unsigned char **, int, int, struct zip_error *); -static void _zip_u2d_time(time_t, unsigned short *, unsigned short *); static void _zip_write2(unsigned short, FILE *); static void _zip_write4(unsigned int, FILE *); @@ -213,13 +212,13 @@ _zip_dirent_init(struct zip_dirent *de) int _zip_dirent_read(struct zip_dirent *zde, FILE *fp, - unsigned char **bufp, unsigned int *leftp, int local, + unsigned char **bufp, zip_uint32_t *leftp, int local, struct zip_error *error) { unsigned char buf[CDENTRYSIZE]; unsigned char *cur; unsigned short dostime, dosdate; - unsigned int size; + zip_uint32_t size; if (local) size = LENTRYSIZE; @@ -473,8 +472,10 @@ _zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp, static time_t _zip_d2u_time(int dtime, int ddate) { - struct tm tm = {0}; + struct tm tm; + memset(&tm, 0, sizeof(tm)); + /* let mktime decide if DST is in effect */ tm.tm_isdst = -1; @@ -598,7 +599,7 @@ _zip_write4(unsigned int i, FILE *fp) -static void +void _zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate) { struct tm *tm; diff --git a/ext/zip/lib/zip_entry_free.c b/ext/zip/lib/zip_entry_free.c index c50c9434bd..e8a77707f0 100644 --- a/ext/zip/lib/zip_entry_free.c +++ b/ext/zip/lib/zip_entry_free.c @@ -44,6 +44,9 @@ _zip_entry_free(struct zip_entry *ze) { free(ze->ch_filename); ze->ch_filename = NULL; + free(ze->ch_extra); + ze->ch_extra = NULL; + ze->ch_extra_len = -1; free(ze->ch_comment); ze->ch_comment = NULL; ze->ch_comment_len = -1; diff --git a/ext/zip/lib/zip_entry_new.c b/ext/zip/lib/zip_entry_new.c index 7059b1b060..ad5d59975a 100644 --- a/ext/zip/lib/zip_entry_new.c +++ b/ext/zip/lib/zip_entry_new.c @@ -1,6 +1,6 @@ /* zip_entry_new.c -- create and init struct zip_entry - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -46,20 +46,21 @@ _zip_entry_new(struct zip *za) if (!za) { ze = (struct zip_entry *)malloc(sizeof(struct zip_entry)); if (!ze) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } } else { - if (za->nentry >= za->nentry_alloc-1) { + if (za->nentry+1 >= za->nentry_alloc) { + struct zip_entry *rentries; za->nentry_alloc += 16; - za->entry = (struct zip_entry *)realloc(za->entry, - sizeof(struct zip_entry) - * za->nentry_alloc); - if (!za->entry) { + rentries = (struct zip_entry *)realloc(za->entry, + sizeof(struct zip_entry) + * za->nentry_alloc); + if (!rentries) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } + za->entry = rentries; } ze = za->entry+za->nentry; } @@ -67,6 +68,8 @@ _zip_entry_new(struct zip *za) ze->state = ZIP_ST_UNCHANGED; ze->ch_filename = NULL; + ze->ch_extra = NULL; + ze->ch_extra_len = -1; ze->ch_comment = NULL; ze->ch_comment_len = -1; ze->source = NULL; diff --git a/ext/zip/lib/zip_err_str.c b/ext/zip/lib/zip_err_str.c index 3fcdf1738a..8fb60036e0 100644 --- a/ext/zip/lib/zip_err_str.c +++ b/ext/zip/lib/zip_err_str.c @@ -32,6 +32,10 @@ const char * const _zip_err_str[] = { "Zip archive inconsistent", "Can't remove file", "Entry has been deleted", + "Encryption method not supported", + "Read-only archive", + "No password provided", + "Wrong password provided", }; const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); @@ -65,4 +69,8 @@ const int _zip_err_type[] = { N, S, N, + N, + N, + N, + N, }; diff --git a/ext/zip/lib/zip_error.c b/ext/zip/lib/zip_error.c index aab7079456..b8d907abf4 100644 --- a/ext/zip/lib/zip_error.c +++ b/ext/zip/lib/zip_error.c @@ -1,6 +1,6 @@ /* zip_error.c -- struct zip_error helper functions - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -99,3 +99,14 @@ _zip_error_set(struct zip_error *err, int ze, int se) err->sys_err = se; } } + + + +void +_zip_error_set_from_source(struct zip_error *err, struct zip_source *src) +{ + int ze, se; + + zip_source_error(src, &ze, &se); + _zip_error_set(err, ze, se); +} diff --git a/ext/zip/lib/zip_error_to_str.c b/ext/zip/lib/zip_error_to_str.c index 4dea4d667a..bafe74335a 100644 --- a/ext/zip/lib/zip_error_to_str.c +++ b/ext/zip/lib/zip_error_to_str.c @@ -1,6 +1,6 @@ /* zip_error_to_str.c -- get string representation of zip error code - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -43,7 +43,7 @@ ZIP_EXTERN(int) -zip_error_to_str(char *buf, size_t len, int ze, int se) +zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se) { const char *zs, *ss; diff --git a/ext/zip/lib/zip_fclose.c b/ext/zip/lib/zip_fclose.c index 8f062d9d09..eb55ddbcea 100644 --- a/ext/zip/lib/zip_fclose.c +++ b/ext/zip/lib/zip_fclose.c @@ -44,28 +44,20 @@ zip_fclose(struct zip_file *zf) { int i, ret; - if (zf->zstr) - inflateEnd(zf->zstr); - free(zf->buffer); - free(zf->zstr); - if (zf->za) { - for (i=0; i<zf->za->nfile; i++) { - if (zf->za->file[i] == zf) { - zf->za->file[i] = zf->za->file[zf->za->nfile-1]; - zf->za->nfile--; - break; - } - } + if (zf->src) + zip_source_free(zf->src); + + for (i=0; i<zf->za->nfile; i++) { + if (zf->za->file[i] == zf) { + zf->za->file[i] = zf->za->file[zf->za->nfile-1]; + zf->za->nfile--; + break; } + } ret = 0; if (zf->error.zip_err) ret = zf->error.zip_err; - else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) { - /* if EOF, compare CRC */ - if (zf->crc_orig != zf->crc) - ret = ZIP_ER_CRC; - } free(zf); return ret; diff --git a/ext/zip/lib/zip_fdopen.c b/ext/zip/lib/zip_fdopen.c new file mode 100644 index 0000000000..df70f27561 --- /dev/null +++ b/ext/zip/lib/zip_fdopen.c @@ -0,0 +1,62 @@ +/* + zip_fdopen.c -- open read-only archive from file descriptor + Copyright (C) 2009-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip *) +zip_fdopen(int fd_orig, int flags, int *zep) +{ + int fd; + FILE *fp; + + /* We dup() here to avoid messing with the passed in fd. + We could not restore it to the original state in case of error. */ + + if ((fd=dup(fd_orig)) < 0) { + *zep = ZIP_ER_OPEN; + return NULL; + } + + if ((fp=fdopen(fd, "rb")) == NULL) { + close(fd); + *zep = ZIP_ER_OPEN; + return NULL; + } + + close(fd_orig); + return _zip_open(NULL, fp, flags, ZIP_AFL_RDONLY, zep); +} diff --git a/ext/zip/lib/zip_filerange_crc.c b/ext/zip/lib/zip_filerange_crc.c index c6890987b1..4d1ad56692 100644 --- a/ext/zip/lib/zip_filerange_crc.c +++ b/ext/zip/lib/zip_filerange_crc.c @@ -1,6 +1,6 @@ /* zip_filerange_crc.c -- compute CRC32 for a range of a file - Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> diff --git a/ext/zip/lib/zip_fopen.c b/ext/zip/lib/zip_fopen.c index b4b76049f4..f62adbbf92 100644 --- a/ext/zip/lib/zip_fopen.c +++ b/ext/zip/lib/zip_fopen.c @@ -1,6 +1,6 @@ /* zip_fopen.c -- open file in zip archive for reading - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -45,5 +45,5 @@ zip_fopen(struct zip *za, const char *fname, int flags) if ((idx=zip_name_locate(za, fname, flags)) < 0) return NULL; - return zip_fopen_index(za, idx, flags); + return zip_fopen_index_encrypted(za, idx, flags, za->default_password); } diff --git a/ext/zip/lib/zip_fopen_encrypted.c b/ext/zip/lib/zip_fopen_encrypted.c new file mode 100644 index 0000000000..8aba062567 --- /dev/null +++ b/ext/zip/lib/zip_fopen_encrypted.c @@ -0,0 +1,50 @@ +/* + zip_fopen_encrypted.c -- open file for reading with password + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_file *) +zip_fopen_encrypted(struct zip *za, const char *fname, int flags, + const char *password) +{ + int idx; + + if ((idx=zip_name_locate(za, fname, flags)) < 0) + return NULL; + + return zip_fopen_index_encrypted(za, idx, flags, password); +} diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c index 1e7e419897..b60fd33e8f 100644 --- a/ext/zip/lib/zip_fopen_index.c +++ b/ext/zip/lib/zip_fopen_index.c @@ -1,6 +1,6 @@ /* zip_fopen_index.c -- open file in zip archive for reading by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -39,178 +39,10 @@ #include "zipint.h" -static struct zip_file *_zip_file_new(struct zip *za); - ZIP_EXTERN(struct zip_file *) -zip_fopen_index(struct zip *za, int fileno, int flags) +zip_fopen_index(struct zip *za, zip_uint64_t fileno, int flags) { - int len, ret; - int zfflags; - struct zip_file *zf; - - if ((fileno < 0) || (fileno >= za->nentry)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) == 0 - && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) { - _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return NULL; - } - - if (fileno >= za->cdir->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - zfflags = 0; - switch (za->cdir->entry[fileno].comp_method) { - case ZIP_CM_STORE: - zfflags |= ZIP_ZF_CRC; - break; - - case ZIP_CM_DEFLATE: - if ((flags & ZIP_FL_COMPRESSED) == 0) - zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP; - break; - default: - if ((flags & ZIP_FL_COMPRESSED) == 0) { - _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); - return NULL; - } - break; - } - - zf = _zip_file_new(za); - - zf->flags = zfflags; - /* zf->name = za->cdir->entry[fileno].filename; */ - zf->method = za->cdir->entry[fileno].comp_method; - zf->bytes_left = za->cdir->entry[fileno].uncomp_size; - zf->cbytes_left = za->cdir->entry[fileno].comp_size; - zf->crc_orig = za->cdir->entry[fileno].crc; - - if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) { - zip_fclose(zf); - return NULL; - } - - if ((zf->flags & ZIP_ZF_DECOMP) == 0) - zf->bytes_left = zf->cbytes_left; - else { - if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - - len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (len <= 0) { - _zip_error_copy(&za->error, &zf->error); - zip_fclose(zf); - return NULL; - } - - if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - zf->zstr->zalloc = Z_NULL; - zf->zstr->zfree = Z_NULL; - zf->zstr->opaque = NULL; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = len; - - /* negative value to tell zlib that there is no header */ - if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - zip_fclose(zf); - return NULL; - } - } - - return zf; -} - - - -int -_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf) -{ - int i, j; - - if (zf->error.zip_err != ZIP_ER_OK) - return -1; - - if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0) - return 0; - - if (fseeko(zf->za->zp, zf->fpos, SEEK_SET) < 0) { - _zip_error_set(&zf->error, ZIP_ER_SEEK, errno); - return -1; - } - if (buflen < zf->cbytes_left) - i = buflen; - else - i = zf->cbytes_left; - - j = fread(buf, 1, i, zf->za->zp); - if (j == 0) { - _zip_error_set(&zf->error, ZIP_ER_EOF, 0); - j = -1; - } - else if (j < 0) - _zip_error_set(&zf->error, ZIP_ER_READ, errno); - else { - zf->fpos += j; - zf->cbytes_left -= j; - } - - return j; -} - - - -static struct zip_file * -_zip_file_new(struct zip *za) -{ - struct zip_file *zf, **file; - int n; - - if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - if (za->nfile >= za->nfile_alloc-1) { - n = za->nfile_alloc + 10; - file = (struct zip_file **)realloc(za->file, - n*sizeof(struct zip_file *)); - if (file == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - free(zf); - return NULL; - } - za->nfile_alloc = n; - za->file = file; - } - - za->file[za->nfile++] = zf; - - zf->za = za; - _zip_error_init(&zf->error); - zf->flags = 0; - zf->crc = crc32(0L, Z_NULL, 0); - zf->crc_orig = 0; - zf->method = -1; - zf->bytes_left = zf->cbytes_left = 0; - zf->fpos = 0; - zf->buffer = NULL; - zf->zstr = NULL; - - return zf; + return zip_fopen_index_encrypted(za, fileno, flags, za->default_password); } diff --git a/ext/zip/lib/zip_fopen_index_encrypted.c b/ext/zip/lib/zip_fopen_index_encrypted.c new file mode 100644 index 0000000000..988a78fe03 --- /dev/null +++ b/ext/zip/lib/zip_fopen_index_encrypted.c @@ -0,0 +1,191 @@ +/* + zip_fopen_index_encrypted.c -- open file for reading by index w/ password + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> + +#include "zipint.h" + +static struct zip_file *_zip_file_new(struct zip *za); + + + +ZIP_EXTERN(struct zip_file *) +zip_fopen_index_encrypted(struct zip *za, zip_uint64_t fileno, int flags, + const char *password) +{ + struct zip_file *zf; + zip_compression_implementation comp_impl; + zip_encryption_implementation enc_impl; + struct zip_source *src, *s2; + zip_uint64_t start; + struct zip_stat st; + + if (fileno >= za->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((flags & ZIP_FL_UNCHANGED) == 0 + && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) { + _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); + return NULL; + } + + if (fileno >= za->cdir->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if (flags & ZIP_FL_ENCRYPTED) + flags |= ZIP_FL_COMPRESSED; + + zip_stat_index(za, fileno, flags, &st); + + enc_impl = NULL; + if ((flags & ZIP_FL_ENCRYPTED) == 0) { + if (st.encryption_method != ZIP_EM_NONE) { + if (password == NULL) { + _zip_error_set(&za->error, ZIP_ER_NOPASSWD, 0); + return NULL; + } + if ((enc_impl=zip_get_encryption_implementation( + st.encryption_method)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); + return NULL; + } + } + } + + comp_impl = NULL; + if ((flags & ZIP_FL_COMPRESSED) == 0) { + if (st.comp_method != ZIP_CM_STORE) { + if ((comp_impl=zip_get_compression_implementation( + st.comp_method)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); + return NULL; + } + } + } + + if ((start=_zip_file_get_offset(za, fileno)) == 0) + return NULL; + + if (st.comp_size == 0) { + if ((src=zip_source_buffer(za, NULL, 0, 0)) == NULL) + return NULL; + } + else { + if ((src=_zip_source_file_or_p(za, NULL, za->zp, start, st.comp_size, + 0, &st)) == NULL) + return NULL; + if (enc_impl) { + if ((s2=enc_impl(za, src, ZIP_EM_TRAD_PKWARE, 0, + password)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + if (comp_impl) { + if ((s2=comp_impl(za, src, za->cdir->entry[fileno].comp_method, + 0)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + if ((flags & ZIP_FL_COMPRESSED) == 0 + || st.comp_method == ZIP_CM_STORE ) { + if ((s2=zip_source_crc(za, src, 1)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + } + + if (zip_source_open(src) < 0) { + _zip_error_set_from_source(&za->error, src); + zip_source_free(src); + return NULL; + } + + zf = _zip_file_new(za); + + zf->src = src; + + return zf; +} + + + +static struct zip_file * +_zip_file_new(struct zip *za) +{ + struct zip_file *zf, **file; + int n; + + if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + if (za->nfile >= za->nfile_alloc-1) { + n = za->nfile_alloc + 10; + file = (struct zip_file **)realloc(za->file, + n*sizeof(struct zip_file *)); + if (file == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + free(zf); + return NULL; + } + za->nfile_alloc = n; + za->file = file; + } + + za->file[za->nfile++] = zf; + + zf->za = za; + _zip_error_init(&zf->error); + zf->eof = 0; + zf->src = NULL; + + return zf; +} diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c index 00a6bdc4e0..a6c0851b0a 100644 --- a/ext/zip/lib/zip_fread.c +++ b/ext/zip/lib/zip_fread.c @@ -1,6 +1,6 @@ /* zip_fread.c -- read from file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -37,12 +37,10 @@ -ZIP_EXTERN(ssize_t) -zip_fread(struct zip_file *zf, void *outbuf, size_t toread) +ZIP_EXTERN(zip_int64_t) +zip_fread(struct zip_file *zf, void *outbuf, zip_uint64_t toread) { - int ret; - size_t out_before, len; - int i; + zip_int64_t n; if (!zf) return -1; @@ -50,81 +48,18 @@ zip_fread(struct zip_file *zf, void *outbuf, size_t toread) if (zf->error.zip_err != 0) return -1; - if ((zf->flags & ZIP_ZF_EOF) || (toread == 0)) - return 0; + if (toread > ZIP_INT64_MAX) { + _zip_error_set(&zf->error, ZIP_ER_INVAL, 0); + return -1; + } - if (zf->bytes_left == 0) { - zf->flags |= ZIP_ZF_EOF; - if (zf->flags & ZIP_ZF_CRC) { - if (zf->crc != zf->crc_orig) { - _zip_error_set(&zf->error, ZIP_ER_CRC, 0); - return -1; - } - } + if ((zf->eof) || (toread == 0)) return 0; - } - if ((zf->flags & ZIP_ZF_DECOMP) == 0) { - ret = _zip_file_fillbuf(outbuf, toread, zf); - if (ret > 0) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret); - zf->bytes_left -= ret; - } - return ret; + if ((n=zip_source_read(zf->src, outbuf, toread)) < 0) { + _zip_error_set_from_source(&zf->error, zf->src); + return -1; } - - zf->zstr->next_out = (Bytef *)outbuf; - zf->zstr->avail_out = toread; - out_before = zf->zstr->total_out; - - /* endless loop until something has been accomplished */ - for (;;) { - ret = inflate(zf->zstr, Z_SYNC_FLUSH); - switch (ret) { - case Z_STREAM_END: - if (zf->zstr->total_out == out_before) { - if (zf->crc != zf->crc_orig) { - _zip_error_set(&zf->error, ZIP_ER_CRC, 0); - return -1; - } - else - return 0; - } - - /* fallthrough */ - - case Z_OK: - len = zf->zstr->total_out - out_before; - if (len >= zf->bytes_left || len >= toread) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, len); - zf->bytes_left -= len; - return len; - } - break; - - case Z_BUF_ERROR: - if (zf->zstr->avail_in == 0) { - i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (i == 0) { - _zip_error_set(&zf->error, ZIP_ER_INCONS, 0); - return -1; - } - else if (i < 0) - return -1; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = i; - continue; - } - /* fallthrough */ - case Z_NEED_DICT: - case Z_DATA_ERROR: - case Z_STREAM_ERROR: - case Z_MEM_ERROR: - _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret); - return -1; - } - } + return n; } diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c index 76c3a9673f..9932c14fec 100644 --- a/ext/zip/lib/zip_free.c +++ b/ext/zip/lib/zip_free.c @@ -57,7 +57,9 @@ _zip_free(struct zip *za) if (za->zp) fclose(za->zp); + free(za->default_password); _zip_cdir_free(za->cdir); + free(za->ch_comment); if (za->entry) { for (i=0; i<za->nentry; i++) { diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c index ed1324fd5b..fe97e6e8c1 100644 --- a/ext/zip/lib/zip_get_archive_comment.c +++ b/ext/zip/lib/zip_get_archive_comment.c @@ -42,11 +42,11 @@ zip_get_archive_comment(struct zip *za, int *lenp, int flags) { if ((flags & ZIP_FL_UNCHANGED) || (za->ch_comment_len == -1)) { - if (za->cdir) { - if (lenp != NULL) - *lenp = za->cdir->comment_len; - return za->cdir->comment; - } + if (za->cdir) { + if (lenp != NULL) + *lenp = za->cdir->comment_len; + return za->cdir->comment; + } else { if (lenp != NULL) *lenp = -1; diff --git a/ext/zip/lib/zip_get_archive_flag.c b/ext/zip/lib/zip_get_archive_flag.c index a595c51f59..2d46aa39ff 100644 --- a/ext/zip/lib/zip_get_archive_flag.c +++ b/ext/zip/lib/zip_get_archive_flag.c @@ -1,6 +1,6 @@ /* zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> diff --git a/ext/zip/lib/zip_get_compression_implementation.c b/ext/zip/lib/zip_get_compression_implementation.c new file mode 100644 index 0000000000..197cd49635 --- /dev/null +++ b/ext/zip/lib/zip_get_compression_implementation.c @@ -0,0 +1,46 @@ +/* + zip_get_compression_implementation.c -- get compression implementation + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_compression_implementation) +zip_get_compression_implementation(zip_uint16_t cm) +{ + if (cm == ZIP_CM_DEFLATE) + return zip_source_deflate; + return NULL; +} diff --git a/ext/zip/lib/zip_get_encryption_implementation.c b/ext/zip/lib/zip_get_encryption_implementation.c new file mode 100644 index 0000000000..783d538d3f --- /dev/null +++ b/ext/zip/lib/zip_get_encryption_implementation.c @@ -0,0 +1,46 @@ +/* + zip_get_encryption_implementation.c -- get encryption implementation + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_encryption_implementation) +zip_get_encryption_implementation(zip_uint16_t em) +{ + if (em == ZIP_EM_TRAD_PKWARE) + return zip_source_pkware; + return NULL; +} diff --git a/ext/zip/lib/zip_get_file_comment.c b/ext/zip/lib/zip_get_file_comment.c index 57dd9028bc..43c1520e1d 100644 --- a/ext/zip/lib/zip_get_file_comment.c +++ b/ext/zip/lib/zip_get_file_comment.c @@ -38,9 +38,9 @@ ZIP_EXTERN(const char *) -zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags) +zip_get_file_comment(struct zip *za, zip_uint64_t idx, int *lenp, int flags) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } diff --git a/ext/zip/lib/zip_get_file_extra.c b/ext/zip/lib/zip_get_file_extra.c new file mode 100644 index 0000000000..a27edd8ee9 --- /dev/null +++ b/ext/zip/lib/zip_get_file_extra.c @@ -0,0 +1,58 @@ +/* + zip_get_file_extra.c -- get file extra field + Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(const char *) +zip_get_file_extra(struct zip *za, zip_uint64_t idx, int *lenp, int flags) +{ + if (idx >= za->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((flags & ZIP_FL_UNCHANGED) + || (za->entry[idx].ch_extra_len == -1)) { + if (lenp != NULL) + *lenp = za->cdir->entry[idx].extrafield_len; + return za->cdir->entry[idx].extrafield; + } + + if (lenp != NULL) + *lenp = za->entry[idx].ch_extra_len; + return za->entry[idx].ch_extra; +} diff --git a/ext/zip/lib/zip_get_name.c b/ext/zip/lib/zip_get_name.c index b58d972058..945e24e150 100644 --- a/ext/zip/lib/zip_get_name.c +++ b/ext/zip/lib/zip_get_name.c @@ -38,7 +38,7 @@ ZIP_EXTERN(const char *) -zip_get_name(struct zip *za, int idx, int flags) +zip_get_name(struct zip *za, zip_uint64_t idx, int flags) { return _zip_get_name(za, idx, flags, &za->error); } @@ -46,9 +46,10 @@ zip_get_name(struct zip *za, int idx, int flags) const char * -_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error) +_zip_get_name(struct zip *za, zip_uint64_t idx, int flags, + struct zip_error *error) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } diff --git a/ext/zip/lib/zip_get_num_entries.c b/ext/zip/lib/zip_get_num_entries.c new file mode 100644 index 0000000000..dd392e9095 --- /dev/null +++ b/ext/zip/lib/zip_get_num_entries.c @@ -0,0 +1,52 @@ +/* + zip_get_num_entries.c -- get number of entries in archive + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_uint64_t) +zip_get_num_entries(struct zip *za, int flags) +{ + if (za == NULL) + return -1; + + if (flags & ZIP_FL_UNCHANGED) { + if (za->cdir == NULL) + return 0; + return za->cdir->nentry; + } + return za->nentry; +} diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c index 96c4f937e0..8cdd2c4d7e 100644 --- a/ext/zip/lib/zip_name_locate.c +++ b/ext/zip/lib/zip_name_locate.c @@ -1,6 +1,6 @@ /* zip_name_locate.c -- get index by name - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -55,13 +55,17 @@ _zip_name_locate(struct zip *za, const char *fname, int flags, const char *fn, *p; int i, n; + if (za == NULL) + return -1; + if (fname == NULL) { _zip_error_set(error, ZIP_ER_INVAL, 0); return -1; } - if((flags & ZIP_FL_UNCHANGED) && !za->cdir) { - return -1; + if ((flags & ZIP_FL_UNCHANGED) && za->cdir == NULL) { + _zip_error_set(error, ZIP_ER_NOENT, 0); + return -1; } cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp; @@ -76,7 +80,7 @@ _zip_name_locate(struct zip *za, const char *fname, int flags, /* newly added (partially filled) entry */ if (fn == NULL) continue; - + if (flags & ZIP_FL_NODIR) { p = strrchr(fn, '/'); if (p) diff --git a/ext/zip/lib/zip_new.c b/ext/zip/lib/zip_new.c index 3e8ccee644..7ce1237cdb 100644 --- a/ext/zip/lib/zip_new.c +++ b/ext/zip/lib/zip_new.c @@ -65,6 +65,7 @@ _zip_new(struct zip_error *error) za->nfile = za->nfile_alloc = 0; za->file = NULL; za->flags = za->ch_flags = 0; + za->default_password = NULL; return za; } diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index 31e12f4fc5..2f56881b0a 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -1,6 +1,6 @@ /* - zip_open.c -- open zip archive - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + zip_open.c -- open zip archive by name + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -52,7 +52,7 @@ static int _zip_headercomp(struct zip_dirent *, int, struct zip_dirent *, int); static unsigned char *_zip_memmem(const unsigned char *, int, const unsigned char *, int); -static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *, +static struct zip_cdir *_zip_readcdir(FILE *, off_t, unsigned char *, unsigned char *, int, int, struct zip_error *); @@ -61,10 +61,6 @@ ZIP_EXTERN(struct zip *) zip_open(const char *fn, int flags, int *zep) { FILE *fp; - struct zip *za; - struct zip_cdir *cdir; - int i; - off_t len; if (flags & ZIP_OVERWRITE) { return _zip_allocate_new(fn, zep); @@ -75,10 +71,8 @@ zip_open(const char *fn, int flags, int *zep) if (!(flags & ZIP_OVERWRITE)) { return NULL; } - case 0: return _zip_allocate_new(fn, zep); - default: break; } @@ -88,7 +82,23 @@ zip_open(const char *fn, int flags, int *zep) return NULL; } - fseeko(fp, 0, SEEK_END); + return _zip_open(fn, fp, flags, 0, zep); +} + + + +struct zip * +_zip_open(const char *fn, FILE *fp, int flags, int aflags, int *zep) +{ + struct zip *za; + struct zip_cdir *cdir; + int i; + off_t len; + + if (fseeko(fp, 0, SEEK_END) < 0) { + *zep = ZIP_ER_SEEK; + return NULL; + } len = ftello(fp); /* treat empty files as empty archives */ @@ -156,13 +166,13 @@ set_error(int *zep, struct zip_error *err, int ze) entries, or NULL if unsuccessful. */ static struct zip_cdir * -_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, +_zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eocd, int buflen, int flags, struct zip_error *error) { struct zip_cdir *cd; unsigned char *cdp, **bufp; int i, comlen, nentry; - unsigned int left; + zip_uint32_t left; comlen = buf + buflen - eocd - EOCDLEN; if (comlen < 0) { @@ -196,14 +206,24 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, cd->comment = NULL; cd->comment_len = _zip_read2(&cdp); + if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) { + /* cdir spans past EOCD record */ + _zip_error_set(error, ZIP_ER_INCONS, 0); + cd->nentry = 0; + _zip_cdir_free(cd); + return NULL; + } + if ((comlen < cd->comment_len) || (cd->nentry != i)) { _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) { _zip_error_set(error, ZIP_ER_INCONS, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } @@ -211,14 +231,15 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN, cd->comment_len, error)) == NULL) { - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } } - if (cd->size < (unsigned int)(eocd-buf)) { + if (cd->offset >= buf_offset) { /* if buffer already read in, use it */ - cdp = eocd - cd->size; + cdp = buf + (cd->offset - buf_offset); bufp = &cdp; } else { @@ -234,20 +255,15 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, _zip_error_set(error, ZIP_ER_SEEK, errno); else _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } } left = cd->size; i=0; - do { - if (i == cd->nentry && left > 0) { - /* Infozip extension for more than 64k entries: - nentries wraps around, size indicates correct EOCD */ - _zip_cdir_grow(cd, cd->nentry+0x10000, error); - } - + while (i<cd->nentry && left > 0) { if ((_zip_dirent_read(cd->entry+i, fp, bufp, &left, 0, error)) < 0) { cd->nentry = i; _zip_cdir_free(cd); @@ -255,7 +271,18 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, } i++; - } while (i<cd->nentry); + if (i == cd->nentry && left > 0) { + /* Infozip extension for more than 64k entries: + nentries wraps around, size indicates correct EOCD */ + if (_zip_cdir_grow(cd, cd->nentry+ZIP_UINT16_MAX, error) < 0) { + cd->nentry = i; + _zip_cdir_free(cd); + return NULL; + } + } + } + + cd->nentry = i; return cd; } @@ -336,17 +363,17 @@ _zip_check_torrentzip(struct zip *za) if (za->cdir->comment_len != TORRENT_SIG_LEN+8 || strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0) return; - + memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8); buf[8] = '\0'; errno = 0; crc_should = strtoul(buf, &end, 16); if ((crc_should == UINT_MAX && errno != 0) || (end && *end)) return; - + if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size, &crc_got, NULL) < 0) - return; + return; if (crc_got == crc_should) za->flags |= ZIP_AFL_TORRENT; @@ -434,12 +461,16 @@ _zip_allocate_new(const char *fn, int *zep) set_error(zep, &error, 0); return NULL; } - - za->zn = strdup(fn); - if (!za->zn) { - _zip_free(za); - set_error(zep, NULL, ZIP_ER_MEMORY); - return NULL; + + if (fn == NULL) + za->zn = NULL; + else { + za->zn = strdup(fn); + if (!za->zn) { + _zip_free(za); + set_error(zep, NULL, ZIP_ER_MEMORY); + return NULL; + } } return za; } @@ -481,6 +512,7 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len) { struct zip_cdir *cdir, *cdirnew; unsigned char *buf, *match; + off_t buf_offset; int a, best, buflen, i; struct zip_error zerr; @@ -490,7 +522,8 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len) set_error(zep, NULL, ZIP_ER_SEEK); return NULL; } - + buf_offset = ftello(fp); + /* 64k is too much for stack */ if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) { set_error(zep, NULL, ZIP_ER_MEMORY); @@ -516,7 +549,7 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len) /* found match -- check, if good */ /* to avoid finding the same match all over again */ match++; - if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags, + if ((cdirnew=_zip_readcdir(fp, buf_offset, buf, match-1, buflen, flags, &zerr)) == NULL) continue; diff --git a/ext/zip/lib/zip_rename.c b/ext/zip/lib/zip_rename.c index e40ab27674..6b5a035917 100644 --- a/ext/zip/lib/zip_rename.c +++ b/ext/zip/lib/zip_rename.c @@ -40,16 +40,21 @@ ZIP_EXTERN(int) -zip_rename(struct zip *za, int idx, const char *name) +zip_rename(struct zip *za, zip_uint64_t idx, const char *name) { const char *old_name; int old_is_dir, new_is_dir; - if (idx >= za->nentry || idx < 0 || name[0] == '\0') { + if (idx >= za->nentry || name[0] == '\0') { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if ((old_name=zip_get_name(za, idx, 0)) == NULL) return -1; diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c index ae69a86f63..6dc3dd5ab5 100644 --- a/ext/zip/lib/zip_replace.c +++ b/ext/zip/lib/zip_replace.c @@ -1,6 +1,6 @@ /* zip_replace.c -- replace file via callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -38,9 +38,9 @@ ZIP_EXTERN(int) -zip_replace(struct zip *za, int idx, struct zip_source *source) +zip_replace(struct zip *za, zip_uint64_t idx, struct zip_source *source) { - if (idx < 0 || idx >= za->nentry || source == NULL) { + if (idx >= za->nentry || source == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -54,11 +54,18 @@ zip_replace(struct zip *za, int idx, struct zip_source *source) -int -_zip_replace(struct zip *za, int idx, const char *name, +/* NOTE: Signed due to -1 on error. See zip_add.c for more details. */ + +zip_int64_t +_zip_replace(struct zip *za, zip_uint64_t idx, const char *name, struct zip_source *source) { - if (idx == -1) { + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if (idx == ZIP_UINT64_MAX) { if (_zip_entry_new(za) == NULL) return -1; diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c index c4bd070ddc..3cd069c757 100644 --- a/ext/zip/lib/zip_set_archive_comment.c +++ b/ext/zip/lib/zip_set_archive_comment.c @@ -1,6 +1,6 @@ /* zip_set_archive_comment.c -- set archive comment - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -50,6 +50,11 @@ zip_set_archive_comment(struct zip *za, const char *comment, int len) return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (len > 0) { if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) return -1; diff --git a/ext/zip/lib/zip_set_archive_flag.c b/ext/zip/lib/zip_set_archive_flag.c index 20316e4614..07bcfbe304 100644 --- a/ext/zip/lib/zip_set_archive_flag.c +++ b/ext/zip/lib/zip_set_archive_flag.c @@ -40,10 +40,30 @@ ZIP_EXTERN(int) zip_set_archive_flag(struct zip *za, int flag, int value) { + unsigned int new_flags; + if (value) - za->ch_flags |= flag; + new_flags = za->ch_flags | flag; else - za->ch_flags &= ~flag; + new_flags = za->ch_flags & ~flag; + + if (new_flags == za->ch_flags) + return 0; + + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if ((flag & ZIP_AFL_RDONLY) && value + && (za->ch_flags & ZIP_AFL_RDONLY) == 0) { + if (_zip_changed(za, NULL)) { + _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); + return -1; + } + } + + za->ch_flags = new_flags; return 0; } diff --git a/ext/zip/lib/zip_set_default_password.c b/ext/zip/lib/zip_set_default_password.c new file mode 100644 index 0000000000..c274d1100b --- /dev/null +++ b/ext/zip/lib/zip_set_default_password.c @@ -0,0 +1,62 @@ +/* + zip_set_default_password.c -- set default password for decryption + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> +#include <string.h> + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_set_default_password(struct zip *za, const char *passwd) +{ + if (za == NULL) + return -1; + + if (za->default_password) + free(za->default_password); + + if (passwd) { + if ((za->default_password=strdup(passwd)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return -1; + } + } + else + za->default_password = NULL; + + return 0; +} diff --git a/ext/zip/lib/zip_set_file_comment.c b/ext/zip/lib/zip_set_file_comment.c index 3d5dd6b5e3..5e63dc2730 100644 --- a/ext/zip/lib/zip_set_file_comment.c +++ b/ext/zip/lib/zip_set_file_comment.c @@ -1,6 +1,6 @@ /* zip_set_file_comment.c -- set comment for file in archive - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -40,17 +40,23 @@ ZIP_EXTERN(int) -zip_set_file_comment(struct zip *za, int idx, const char *comment, int len) +zip_set_file_comment(struct zip *za, zip_uint64_t idx, + const char *comment, int len) { char *tmpcom; - if (idx < 0 || idx >= za->nentry + if (idx >= za->nentry || len < 0 || len > MAXCOMLEN || (len > 0 && comment == NULL)) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (len > 0) { if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) return -1; diff --git a/ext/zip/lib/zip_set_file_extra.c b/ext/zip/lib/zip_set_file_extra.c new file mode 100644 index 0000000000..db829e2e0a --- /dev/null +++ b/ext/zip/lib/zip_set_file_extra.c @@ -0,0 +1,72 @@ +/* + zip_set_file_extra.c -- set extra field for file in archive + Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_set_file_extra(struct zip *za, zip_uint64_t idx, + const char *extra, int len) +{ + char *tmpext; + + if (idx >= za->nentry + || len < 0 || len > MAXEXTLEN + || (len > 0 && extra == NULL)) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return -1; + } + + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if (len > 0) { + if ((tmpext=(char *)_zip_memdup(extra, len, &za->error)) == NULL) + return -1; + } + else + tmpext = NULL; + + free(za->entry[idx].ch_extra); + za->entry[idx].ch_extra = tmpext; + za->entry[idx].ch_extra_len = len; + + return 0; +} diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c index 5c7da3d7c5..2a90601bfe 100644 --- a/ext/zip/lib/zip_set_name.c +++ b/ext/zip/lib/zip_set_name.c @@ -41,12 +41,12 @@ int -_zip_set_name(struct zip *za, int idx, const char *name) +_zip_set_name(struct zip *za, zip_uint64_t idx, const char *name) { char *s; - int i; + zip_int64_t i; - if (idx < 0 || idx >= za->nentry || name == NULL) { + if (idx >= za->nentry || name == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c index 867d3dfa3e..8c9154ce3c 100644 --- a/ext/zip/lib/zip_source_buffer.c +++ b/ext/zip/lib/zip_source_buffer.c @@ -1,6 +1,6 @@ /* zip_source_buffer.c -- create zip data source from buffer - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -44,13 +44,12 @@ struct read_data { int freep; }; -static ssize_t read_data(void *state, void *data, size_t len, - enum zip_source_cmd cmd); +static zip_int64_t read_data(void *, void *, zip_uint64_t, enum zip_source_cmd); ZIP_EXTERN(struct zip_source *) -zip_source_buffer(struct zip *za, const void *data, off_t len, int freep) +zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep) { struct read_data *f; struct zip_source *zs; @@ -58,7 +57,7 @@ zip_source_buffer(struct zip *za, const void *data, off_t len, int freep) if (za == NULL) return NULL; - if (len < 0 || (data == NULL && len > 0)) { + if (data == NULL && len > 0) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } @@ -83,12 +82,12 @@ zip_source_buffer(struct zip *za, const void *data, off_t len, int freep) -static ssize_t -read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_data *z; char *buf; - size_t n; + zip_uint64_t n; z = (struct read_data *)state; buf = (char *)data; @@ -99,6 +98,8 @@ read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd) return 0; case ZIP_SOURCE_READ: + /* XXX: return error if (len > ZIP_INT64_MAX) */ + n = z->end - z->buf; if (n > len) n = len; @@ -125,6 +126,11 @@ read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd) zip_stat_init(st); st->mtime = z->mtime; st->size = z->end - z->data; + st->comp_size = st->size; + st->comp_method = ZIP_CM_STORE; + st->encryption_method = ZIP_EM_NONE; + st->valid = ZIP_STAT_MTIME|ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE + |ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD; return sizeof(*st); } diff --git a/ext/zip/lib/zip_source_close.c b/ext/zip/lib/zip_source_close.c new file mode 100644 index 0000000000..a3bf7e5e1d --- /dev/null +++ b/ext/zip/lib/zip_source_close.c @@ -0,0 +1,54 @@ +/* + zip_source_close.c -- close zip_source (stop reading) + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(void) +zip_source_close(struct zip_source *src) +{ + if (!src->is_open) + return; + + if (src->src == NULL) + (void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + else { + (void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + zip_source_close(src->src); + } + + src->is_open = 0; +} diff --git a/ext/zip/lib/zip_source_crc.c b/ext/zip/lib/zip_source_crc.c new file mode 100644 index 0000000000..7fd78f5697 --- /dev/null +++ b/ext/zip/lib/zip_source_crc.c @@ -0,0 +1,159 @@ +/* + zip_source_crc.c -- pass-through source that calculates CRC32 and size + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> +#include <string.h> + +#include "zipint.h" + +struct crc { + int eof; + int validate; + int e[2]; + zip_uint64_t size; + zip_uint32_t crc; +}; + +static zip_int64_t crc_read(struct zip_source *, void *, void * + , zip_uint64_t, enum zip_source_cmd); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_crc(struct zip *za, struct zip_source *src, int validate) +{ + struct crc *ctx; + + if (src == NULL) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((ctx=(struct crc *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->validate = validate; + + return zip_source_layered(za, src, crc_read, ctx); +} + + + +static zip_int64_t +crc_read(struct zip_source *src, void *_ctx, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct crc *ctx; + zip_int64_t n; + + ctx = (struct crc *)_ctx; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + ctx->eof = 0; + ctx->crc = crc32(0, NULL, 0); + ctx->size = 0; + + return 0; + + case ZIP_SOURCE_READ: + if (ctx->eof || len == 0) + return 0; + + if ((n=zip_source_read(src, data, len)) < 0) + return ZIP_SOURCE_ERR_LOWER; + + if (n == 0) { + ctx->eof = 1; + if (ctx->validate) { + struct zip_stat st; + + if (zip_source_stat(src, &st) < 0) + return ZIP_SOURCE_ERR_LOWER; + + if ((st.valid & ZIP_STAT_CRC) && st.crc != ctx->crc) { + ctx->e[0] = ZIP_ER_CRC; + ctx->e[1] = 0; + + return -1; + } + if ((st.valid & ZIP_STAT_SIZE) && st.size != ctx->size) { + ctx->e[0] = ZIP_ER_INCONS; + ctx->e[1] = 0; + + return -1; + } + } + } + else { + ctx->size += n; + ctx->crc = crc32(ctx->crc, data, n); + } + return n; + + case ZIP_SOURCE_CLOSE: + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + if (ctx->eof) { + /* XXX: Set comp_size, comp_method, encryption_method? + After all, this only works for uncompressed data. */ + st->size = ctx->size; + st->crc = ctx->crc; + st->valid |= ZIP_STAT_SIZE|ZIP_STAT_CRC; + } + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(ctx->e)); + return 0; + + case ZIP_SOURCE_FREE: + free(ctx); + return 0; + + default: + return -1; + } + +} diff --git a/ext/zip/lib/zip_source_deflate.c b/ext/zip/lib/zip_source_deflate.c new file mode 100644 index 0000000000..5d9c5e67bb --- /dev/null +++ b/ext/zip/lib/zip_source_deflate.c @@ -0,0 +1,394 @@ +/* + zip_source_deflate.c -- deflate (de)compressoin routines + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> +#include <string.h> + +#include "zipint.h" + +struct deflate { + int e[2]; + + int eof; + int mem_level; + zip_uint64_t size; + char buffer[BUFSIZE]; + z_stream zstr; +}; + +static zip_int64_t compress_read(struct zip_source *, struct deflate *, + void *, zip_uint64_t); +static zip_int64_t decompress_read(struct zip_source *, struct deflate *, + void *, zip_uint64_t); +static zip_int64_t deflate_compress(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static zip_int64_t deflate_decompress(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static void deflate_free(struct deflate *); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_deflate(struct zip *za, struct zip_source *src, + zip_uint16_t cm, int flags) +{ + struct deflate *ctx; + struct zip_source *s2; + + if (src == NULL || cm != ZIP_CM_DEFLATE) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((ctx=(struct deflate *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->e[0] = ctx->e[1] = 0; + ctx->eof = 0; + if (flags & ZIP_CODEC_ENCODE) { + if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) + ctx->mem_level = TORRENT_MEM_LEVEL; + else + ctx->mem_level = MAX_MEM_LEVEL; + } + + if ((s2=zip_source_layered(za, src, + ((flags & ZIP_CODEC_ENCODE) + ? deflate_compress : deflate_decompress), + ctx)) == NULL) { + deflate_free(ctx); + return NULL; + } + + return s2; +} + + + +static zip_int64_t +compress_read(struct zip_source *src, struct deflate *ctx, + void *data, zip_uint64_t len) +{ + int end, ret; + zip_int64_t n; + + if (ctx->e[0] != 0) + return -1; + + if (len == 0) + return 0; + + ctx->zstr.next_out = (Bytef *)data; + ctx->zstr.avail_out = len; + + end = 0; + while (!end) { + ret = deflate(&ctx->zstr, ctx->eof ? Z_FINISH : 0); + + switch (ret) { + case Z_OK: + case Z_STREAM_END: + /* all ok */ + + if (ctx->zstr.avail_out == 0 + || (ctx->eof && ctx->zstr.avail_in == 0)) + end = 1; + break; + + case Z_BUF_ERROR: + if (ctx->zstr.avail_in == 0) { + if (ctx->eof) { + end = 1; + break; + } + + if ((n=zip_source_read(src, ctx->buffer, + sizeof(ctx->buffer))) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + end = 1; + break; + } + else if (n == 0) { + ctx->eof = 1; + ctx->size = ctx->zstr.total_in; + /* XXX: check against stat of src? */ + } + else { + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + } + continue; + } + /* fallthrough */ + case Z_NEED_DICT: + case Z_DATA_ERROR: + case Z_STREAM_ERROR: + case Z_MEM_ERROR: + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + + end = 1; + break; + } + } + + if (ctx->zstr.avail_out < len) + return len - ctx->zstr.avail_out; + + return (ctx->e[0] == 0) ? 0 : -1; +} + + + +static zip_int64_t +decompress_read(struct zip_source *src, struct deflate *ctx, + void *data, zip_uint64_t len) +{ + int end, ret; + zip_int64_t n; + + if (ctx->e[0] != 0) + return -1; + + if (len == 0) + return 0; + + ctx->zstr.next_out = (Bytef *)data; + ctx->zstr.avail_out = len; + + end = 0; + while (!end && ctx->zstr.avail_out) { + ret = inflate(&ctx->zstr, Z_SYNC_FLUSH); + + switch (ret) { + case Z_OK: + break; + + case Z_STREAM_END: + ctx->eof = 1; + end = 1; + break; + + case Z_BUF_ERROR: + if (ctx->zstr.avail_in == 0) { + if (ctx->eof) { + end = 1; + break; + } + + if ((n=zip_source_read(src, ctx->buffer, + sizeof(ctx->buffer))) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + end = 1; + break; + } + else if (n == 0) + ctx->eof = 1; + else { + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + } + continue; + } + /* fallthrough */ + case Z_NEED_DICT: + case Z_DATA_ERROR: + case Z_STREAM_ERROR: + case Z_MEM_ERROR: + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + end = 1; + break; + } + } + + if (ctx->zstr.avail_out < len) + return len - ctx->zstr.avail_out; + + return (ctx->e[0] == 0) ? 0 : -1; +} + + + +static zip_int64_t +deflate_compress(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct deflate *ctx; + int ret; + + ctx = (struct deflate *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + ctx->zstr.zalloc = Z_NULL; + ctx->zstr.zfree = Z_NULL; + ctx->zstr.opaque = NULL; + ctx->zstr.avail_in = 0; + ctx->zstr.next_in = NULL; + ctx->zstr.avail_out = 0; + ctx->zstr.next_out = NULL; + + /* negative value to tell zlib not to write a header */ + if ((ret=deflateInit2(&ctx->zstr, Z_BEST_COMPRESSION, Z_DEFLATED, + -MAX_WBITS, ctx->mem_level, + Z_DEFAULT_STRATEGY)) != Z_OK) { + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + return -1; + } + + return 0; + + case ZIP_SOURCE_READ: + return compress_read(src, ctx, data, len); + + case ZIP_SOURCE_CLOSE: + deflateEnd(&ctx->zstr); + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->comp_method = ZIP_CM_DEFLATE; + st->valid |= ZIP_STAT_COMP_METHOD; + if (ctx->eof) { + st->comp_size = ctx->size; + st->valid |= ZIP_STAT_COMP_SIZE; + } + else + st->valid &= ~ZIP_STAT_COMP_SIZE; + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + deflate_free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } +} + + + +static zip_int64_t +deflate_decompress(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct deflate *ctx; + zip_int64_t n; + int ret; + + ctx = (struct deflate *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + if ((n=zip_source_read(src, ctx->buffer, sizeof(ctx->buffer))) < 0) + return ZIP_SOURCE_ERR_LOWER; + + ctx->zstr.zalloc = Z_NULL; + ctx->zstr.zfree = Z_NULL; + ctx->zstr.opaque = NULL; + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + + /* negative value to tell zlib that there is no header */ + if ((ret=inflateInit2(&ctx->zstr, -MAX_WBITS)) != Z_OK) { + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + + return -1; + } + return 0; + + case ZIP_SOURCE_READ: + return decompress_read(src, ctx, data, len); + + case ZIP_SOURCE_CLOSE: + inflateEnd(&ctx->zstr); + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->comp_method = ZIP_CM_STORE; + if (st->comp_size > 0 && st->size > 0) + st->comp_size = st->size; + } + return 0; + + case ZIP_SOURCE_ERROR: + if (len < sizeof(int)*2) + return -1; + + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + /* XXX: inflateEnd if close was not called */ + free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } + +} + + + +static void +deflate_free(struct deflate *ctx) +{ + /* XXX: deflateEnd if close was not called */ + free(ctx); +} diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c new file mode 100644 index 0000000000..ffb4652d33 --- /dev/null +++ b/ext/zip/lib/zip_source_error.c @@ -0,0 +1,87 @@ +/* + zip_source_error.c -- get last error from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(void) +zip_source_error(struct zip_source *src, int *ze, int *se) +{ + int e[2]; + + if (src->src == NULL) { + } + else { + switch (src->error_source) { + case ZIP_LES_NONE: + if (src->src == NULL) { + if (src->cb.f(src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) { + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + } + else + e[0] = e[1] = 0; + break; + + case ZIP_LES_INVAL: + e[0] = ZIP_ER_INVAL; + e[1] = 0; + break; + + case ZIP_LES_LOWER: + zip_source_error(src->src, ze, se); + return; + + case ZIP_LES_UPPER: + if (src->cb.l(src->src, src->ud, e, sizeof(e), + ZIP_SOURCE_ERROR) < 0) { + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + break; + + default: + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + } + + if (ze) + *ze = e[0]; + if (se) + *se = e[1]; +} diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c index ab6466dcbd..681cc2f3ea 100644 --- a/ext/zip/lib/zip_source_file.c +++ b/ext/zip/lib/zip_source_file.c @@ -41,15 +41,16 @@ ZIP_EXTERN(struct zip_source *) -zip_source_file(struct zip *za, const char *fname, off_t start, off_t len) +zip_source_file(struct zip *za, const char *fname, zip_uint64_t start, + zip_int64_t len) { if (za == NULL) return NULL; - if (fname == NULL || start < 0 || len < -1) { + if (fname == NULL || len < -1) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } - return _zip_source_file_or_p(za, fname, NULL, start, len); + return _zip_source_file_or_p(za, fname, NULL, start, len, 1, NULL); } diff --git a/ext/zip/lib/zip_source_filep.c b/ext/zip/lib/zip_source_filep.c index 2a06a9f028..4d896a4c01 100644 --- a/ext/zip/lib/zip_source_filep.c +++ b/ext/zip/lib/zip_source_filep.c @@ -44,19 +44,23 @@ struct read_file { char *fname; /* name of file to copy from */ FILE *f; /* file to copy from */ - off_t off; /* start offset of */ - off_t len; /* lengt of data to copy */ - off_t remain; /* bytes remaining to be copied */ + int closep; /* close f */ + struct zip_stat st; /* stat information passed in */ + + zip_uint64_t off; /* start offset of */ + zip_int64_t len; /* length of data to copy */ + zip_int64_t remain; /* bytes remaining to be copied */ int e[2]; /* error codes */ }; -static ssize_t read_file(void *state, void *data, size_t len, +static zip_int64_t read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd); ZIP_EXTERN(struct zip_source *) -zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len) +zip_source_filep(struct zip *za, FILE *file, zip_uint64_t start, + zip_int64_t len) { if (za == NULL) return NULL; @@ -66,14 +70,15 @@ zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len) return NULL; } - return _zip_source_file_or_p(za, NULL, file, start, len); + return _zip_source_file_or_p(za, NULL, file, start, len, 1, NULL); } struct zip_source * _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file, - off_t start, off_t len) + zip_uint64_t start, zip_int64_t len, int closep, + const struct zip_stat *st) { struct read_file *f; struct zip_source *zs; @@ -99,7 +104,12 @@ _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file, f->f = file; f->off = start; f->len = (len ? len : -1); - + f->closep = f->fname ? 1 : closep; + if (st) + memcpy(&f->st, st, sizeof(f->st)); + else + zip_stat_init(&f->st); + if ((zs=zip_source_function(za, read_file, f)) == NULL) { free(f); return NULL; @@ -110,8 +120,8 @@ _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file, -static ssize_t -read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_file *z; char *buf; @@ -130,20 +140,33 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) } } - if (fseeko(z->f, z->off, SEEK_SET) < 0) { - z->e[0] = ZIP_ER_SEEK; - z->e[1] = errno; - return -1; + if (z->closep) { + if (fseeko(z->f, (off_t)z->off, SEEK_SET) < 0) { + z->e[0] = ZIP_ER_SEEK; + z->e[1] = errno; + return -1; + } } z->remain = z->len; return 0; case ZIP_SOURCE_READ: + /* XXX: return INVAL if len > size_t max */ if (z->remain != -1) n = len > z->remain ? z->remain : len; else n = len; - + + if (!z->closep) { + /* we might share this file with others, so let's be safe */ + if (fseeko(z->f, (off_t)(z->off + z->len-z->remain), + SEEK_SET) < 0) { + z->e[0] = ZIP_ER_SEEK; + z->e[1] = errno; + return -1; + } + } + if ((i=fread(buf, 1, n, z->f)) < 0) { z->e[0] = ZIP_ER_READ; z->e[1] = errno; @@ -164,34 +187,42 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) case ZIP_SOURCE_STAT: { - struct zip_stat *st; - struct stat fst; - int err; - - if (len < sizeof(*st)) + if (len < sizeof(z->st)) return -1; - if (z->f) - err = fstat(fileno(z->f), &fst); - else - err = stat(z->fname, &fst); - - if (err != 0) { - z->e[0] = ZIP_ER_READ; /* best match */ - z->e[1] = errno; - return -1; + if (z->st.valid != 0) + memcpy(data, &z->st, sizeof(z->st)); + else { + struct zip_stat *st; + struct stat fst; + int err; + + if (z->f) + err = fstat(fileno(z->f), &fst); + else + err = stat(z->fname, &fst); + + if (err != 0) { + z->e[0] = ZIP_ER_READ; /* best match */ + z->e[1] = errno; + return -1; + } + + st = (struct zip_stat *)data; + + zip_stat_init(st); + st->mtime = fst.st_mtime; + st->valid |= ZIP_STAT_MTIME; + if (z->len != -1) { + st->size = z->len; + st->valid |= ZIP_STAT_SIZE; + } + else if ((fst.st_mode&S_IFMT) == S_IFREG) { + st->size = fst.st_size; + st->valid |= ZIP_STAT_SIZE; + } } - - st = (struct zip_stat *)data; - - zip_stat_init(st); - st->mtime = fst.st_mtime; - if (z->len != -1) - st->size = z->len; - else if ((fst.st_mode&S_IFMT) == S_IFREG) - st->size = fst.st_size; - - return sizeof(*st); + return sizeof(z->st); } case ZIP_SOURCE_ERROR: @@ -203,8 +234,8 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) case ZIP_SOURCE_FREE: free(z->fname); - if (z->f) - fclose(z->f); + if (z->closep && z->f) + fclose(z->f); free(z); return 0; diff --git a/ext/zip/lib/zip_source_free.c b/ext/zip/lib/zip_source_free.c index 293e7f7e11..f71c71ed6c 100644 --- a/ext/zip/lib/zip_source_free.c +++ b/ext/zip/lib/zip_source_free.c @@ -1,6 +1,6 @@ /* zip_source_free.c -- free zip data source - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -40,12 +40,20 @@ ZIP_EXTERN(void) -zip_source_free(struct zip_source *source) +zip_source_free(struct zip_source *src) { - if (source == NULL) + if (src == NULL) return; - (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE); + if (src->is_open) + zip_source_close(src); - free(source); + if (src->src == NULL) + (void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_FREE); + else { + (void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_FREE); + zip_source_free(src->src); + } + + free(src); } diff --git a/ext/zip/lib/zip_source_function.c b/ext/zip/lib/zip_source_function.c index fe3e82aa5b..984b107f7b 100644 --- a/ext/zip/lib/zip_source_function.c +++ b/ext/zip/lib/zip_source_function.c @@ -1,6 +1,6 @@ /* zip_source_function.c -- create zip data source from callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -47,13 +47,32 @@ zip_source_function(struct zip *za, zip_source_callback zcb, void *ud) if (za == NULL) return NULL; - if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + if ((zs=_zip_source_new(za)) == NULL) return NULL; - } - zs->f = zcb; + zs->cb.f = zcb; zs->ud = ud; return zs; } + + + +struct zip_source * +_zip_source_new(struct zip *za) +{ + struct zip_source *src; + + if ((src=(struct zip_source *)malloc(sizeof(*src))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + src->src = NULL; + src->cb.f = NULL; + src->ud = NULL; + src->error_source = ZIP_LES_NONE; + src->is_open = 0; + + return src; +} diff --git a/ext/zip/lib/zip_source_layered.c b/ext/zip/lib/zip_source_layered.c new file mode 100644 index 0000000000..86ed420407 --- /dev/null +++ b/ext/zip/lib/zip_source_layered.c @@ -0,0 +1,59 @@ +/* + zip_source_layered.c -- create layered source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_source *) +zip_source_layered(struct zip *za, struct zip_source *src, + zip_source_layered_callback cb, void *ud) +{ + struct zip_source *zs; + + if (za == NULL) + return NULL; + + if ((zs=_zip_source_new(za)) == NULL) + return NULL; + + zs->src = src; + zs->cb.l = cb; + zs->ud = ud; + + return zs; +} diff --git a/ext/zip/lib/zip_source_open.c b/ext/zip/lib/zip_source_open.c new file mode 100644 index 0000000000..2c768f7f3a --- /dev/null +++ b/ext/zip/lib/zip_source_open.c @@ -0,0 +1,76 @@ +/* + zip_source_open.c -- open zip_source (prepare for reading) + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_source_open(struct zip_source *src) +{ + zip_int64_t ret; + + if (src->is_open) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) { + if (src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) + return -1; + } + else { + if (zip_source_open(src->src) < 0) { + src->error_source = ZIP_LES_LOWER; + return -1; + } + + ret = src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_OPEN); + + if (ret < 0) { + (void)zip_source_close(src->src); + + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + } + + src->is_open = 1; + + return 0; +} diff --git a/ext/zip/lib/zip_source_pkware.c b/ext/zip/lib/zip_source_pkware.c new file mode 100644 index 0000000000..83b5cc5ad5 --- /dev/null +++ b/ext/zip/lib/zip_source_pkware.c @@ -0,0 +1,241 @@ +/* + zip_source_pkware.c -- Traditional PKWARE de/encryption routines + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> +#include <string.h> + +#include "zipint.h" + +struct trad_pkware { + int e[2]; + + zip_uint32_t key[3]; +}; + +#define HEADERLEN 12 +#define KEY0 305419896 +#define KEY1 591751049 +#define KEY2 878082192 + +static const uLongf *crc = NULL; + +#define CRC32(c, b) (crc[((c) ^ (b)) & 0xff] ^ ((c) >> 8)) + + + +static void decrypt(struct trad_pkware *, zip_uint8_t *, + const zip_uint8_t *, zip_uint64_t, int); +static int decrypt_header(struct zip_source *, struct trad_pkware *); +static zip_int64_t pkware_decrypt(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static void pkware_free(struct trad_pkware *); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_pkware(struct zip *za, struct zip_source *src, + zip_uint16_t em, int flags, const char *password) +{ + struct trad_pkware *ctx; + struct zip_source *s2; + + if (password == NULL || src == NULL || em != ZIP_EM_TRAD_PKWARE) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + if (flags & ZIP_CODEC_ENCODE) { + _zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); + return NULL; + } + + if (crc == NULL) + crc = get_crc_table(); + + if ((ctx=(struct trad_pkware *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->e[0] = ctx->e[1] = 0; + + ctx->key[0] = KEY0; + ctx->key[1] = KEY1; + ctx->key[2] = KEY2; + decrypt(ctx, NULL, (const zip_uint8_t *)password, strlen(password), 1); + + if ((s2=zip_source_layered(za, src, pkware_decrypt, ctx)) == NULL) { + pkware_free(ctx); + return NULL; + } + + return s2; +} + + + +static void +decrypt(struct trad_pkware *ctx, zip_uint8_t *out, const zip_uint8_t *in, + zip_uint64_t len, int update_only) +{ + zip_uint16_t tmp; + zip_uint64_t i; + Bytef b; + + for (i=0; i<len; i++) { + b = in[i]; + + if (!update_only) { + /* decrypt next byte */ + tmp = ctx->key[2] | 2; + tmp = (tmp * (tmp ^ 1)) >> 8; + b ^= tmp; + } + + /* store cleartext */ + if (out) + out[i] = b; + + /* update keys */ + ctx->key[0] = CRC32(ctx->key[0], b); + ctx->key[1] = (ctx->key[1] + (ctx->key[0] & 0xff)) * 134775813 + 1; + b = ctx->key[1] >> 24; + ctx->key[2] = CRC32(ctx->key[2], b); + } +} + + + +static int +decrypt_header(struct zip_source *src, struct trad_pkware *ctx) +{ + zip_uint8_t header[HEADERLEN]; + struct zip_stat st; + zip_int64_t n; + unsigned short dostime, dosdate; + + if ((n=zip_source_read(src, header, HEADERLEN)) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + return -1; + } + + if (n != HEADERLEN) { + ctx->e[0] = ZIP_ER_EOF; + ctx->e[1] = 0; + return -1; + } + + decrypt(ctx, header, header, HEADERLEN, 0); + + if (zip_source_stat(src, &st) < 0) { + /* stat failed, skip password validation */ + return 0; + } + + _zip_u2d_time(st.mtime, &dostime, &dosdate); + + if (header[HEADERLEN-1] != st.crc>>24 + && header[HEADERLEN-1] != dostime>>8) { + ctx->e[0] = ZIP_ER_WRONGPASSWD; + ctx->e[1] = 0; + return -1; + } + + return 0; +} + + + +static zip_int64_t +pkware_decrypt(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct trad_pkware *ctx; + zip_int64_t n; + + ctx = (struct trad_pkware *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + if (decrypt_header(src, ctx) < 0) + return -1; + return 0; + + case ZIP_SOURCE_READ: + if ((n=zip_source_read(src, data, len)) < 0) + return ZIP_SOURCE_ERR_LOWER; + + decrypt(ud, (zip_uint8_t *)data, (zip_uint8_t *)data, (zip_uint64_t)n, + 0); + return n; + + case ZIP_SOURCE_CLOSE: + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->encryption_method = ZIP_EM_NONE; + st->valid |= ZIP_STAT_ENCRYPTION_METHOD; + /* XXX: deduce HEADERLEN from size for uncompressed */ + if (st->valid & ZIP_STAT_COMP_SIZE) + st->comp_size -= HEADERLEN; + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + pkware_free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } +} + + + +static void +pkware_free(struct trad_pkware *ctx) +{ + free(ctx); +} diff --git a/ext/zip/lib/zip_source_pop.c b/ext/zip/lib/zip_source_pop.c new file mode 100644 index 0000000000..406093869b --- /dev/null +++ b/ext/zip/lib/zip_source_pop.c @@ -0,0 +1,63 @@ +/* + zip_source_pop.c -- pop top layer from zip data source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include <stdlib.h> + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_source *) +zip_source_pop(struct zip_source *src) +{ + struct zip_source *lower; + + if (src == NULL) + return NULL; + + lower = src->src; + + if (lower == NULL) + zip_source_free(src); + else { + if (src->is_open) + (void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + (void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_FREE); + + free(src); + } + + return lower; +} diff --git a/ext/zip/lib/zip_source_read.c b/ext/zip/lib/zip_source_read.c new file mode 100644 index 0000000000..7246f9ccb5 --- /dev/null +++ b/ext/zip/lib/zip_source_read.c @@ -0,0 +1,64 @@ +/* + zip_source_read.c -- read data from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_int64_t) +zip_source_read(struct zip_source *src, void *data, zip_uint64_t len) +{ + zip_int64_t ret; + + if (!src->is_open || len > ZIP_INT64_MAX || (len > 0 && data == NULL)) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) + return src->cb.f(src->ud, data, len, ZIP_SOURCE_READ); + + ret = src->cb.l(src->src, src->ud, data, len, ZIP_SOURCE_READ); + + if (ret < 0) { + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + + return ret; +} diff --git a/ext/zip/lib/zip_source_stat.c b/ext/zip/lib/zip_source_stat.c new file mode 100644 index 0000000000..662779eb6c --- /dev/null +++ b/ext/zip/lib/zip_source_stat.c @@ -0,0 +1,72 @@ +/* + zip_source_stat.c -- get meta information from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <libzip@nih.at> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_source_stat(struct zip_source *src, struct zip_stat *st) +{ + zip_int64_t ret; + + if (st == NULL) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) { + if (src->cb.f(src->ud, st, sizeof(*st), ZIP_SOURCE_STAT) < 0) + return -1; + return 0; + } + + if (zip_source_stat(src->src, st) < 0) { + src->error_source = ZIP_LES_LOWER; + return -1; + } + + ret = src->cb.l(src->src, src->ud, st, sizeof(*st), ZIP_SOURCE_STAT); + + if (ret < 0) { + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + + return 0; +} diff --git a/ext/zip/lib/zip_source_zip.c b/ext/zip/lib/zip_source_zip.c index 58119dd39f..228803c717 100644 --- a/ext/zip/lib/zip_source_zip.c +++ b/ext/zip/lib/zip_source_zip.c @@ -1,6 +1,6 @@ /* zip_source_zip.c -- create data source from zip file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -41,17 +41,18 @@ struct read_zip { struct zip_file *zf; struct zip_stat st; - off_t off, len; + zip_uint64_t off; + zip_int64_t len; }; -static ssize_t read_zip(void *st, void *data, size_t len, +static zip_int64_t read_zip(void *st, void *data, zip_uint64_t len, enum zip_source_cmd cmd); ZIP_EXTERN(struct zip_source *) -zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags, - off_t start, off_t len) +zip_source_zip(struct zip *za, struct zip *srcza, zip_uint64_t srcidx, + int flags, zip_uint64_t start, zip_int64_t len) { struct zip_error error; struct zip_source *zs; @@ -62,7 +63,7 @@ zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags, if (za == NULL) return NULL; - if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) { + if (srcza == NULL || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } @@ -115,12 +116,13 @@ zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags, -static ssize_t -read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_zip(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_zip *z; char b[8192], *buf; - int i, n; + int i; + zip_uint64_t n; z = (struct read_zip *)state; buf = (char *)data; diff --git a/ext/zip/lib/zip_stat_index.c b/ext/zip/lib/zip_stat_index.c index 26425206ca..8faa8cc394 100644 --- a/ext/zip/lib/zip_stat_index.c +++ b/ext/zip/lib/zip_stat_index.c @@ -1,6 +1,6 @@ /* zip_stat_index.c -- get information about file by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -38,11 +38,12 @@ ZIP_EXTERN(int) -zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) +zip_stat_index(struct zip *za, zip_uint64_t index, int flags, + struct zip_stat *st) { const char *name; - if (index < 0 || index >= za->nentry) { + if (index >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -53,8 +54,7 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) if ((flags & ZIP_FL_UNCHANGED) == 0 && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) { - if (za->entry[index].source->f(za->entry[index].source->ud, - st, sizeof(*st), ZIP_SOURCE_STAT) < 0) { + if (zip_source_stat(za->entry[index].source, st) < 0) { _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); return -1; } @@ -64,7 +64,9 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + + zip_stat_init(st); + st->crc = za->cdir->entry[index].crc; st->size = za->cdir->entry[index].uncomp_size; st->mtime = za->cdir->entry[index].last_mod; @@ -80,11 +82,13 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) } else st->encryption_method = ZIP_EM_NONE; - /* st->bitflags = za->cdir->entry[index].bitflags; */ + st->valid = ZIP_STAT_CRC|ZIP_STAT_SIZE|ZIP_STAT_MTIME + |ZIP_STAT_COMP_SIZE|ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD; } st->index = index; st->name = name; + st->valid |= ZIP_STAT_INDEX|ZIP_STAT_NAME; return 0; } diff --git a/ext/zip/lib/zip_stat_init.c b/ext/zip/lib/zip_stat_init.c index cb451dc3bc..74e1ffd0b0 100644 --- a/ext/zip/lib/zip_stat_init.c +++ b/ext/zip/lib/zip_stat_init.c @@ -1,6 +1,6 @@ /* zip_stat_init.c -- initialize struct zip_stat. - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -40,12 +40,13 @@ ZIP_EXTERN(void) zip_stat_init(struct zip_stat *st) { + st->valid = 0; st->name = NULL; - st->index = -1; + st->index = ZIP_UINT64_MAX; st->crc = 0; st->mtime = (time_t)-1; - st->size = -1; - st->comp_size = -1; + st->size = 0; + st->comp_size = 0; st->comp_method = ZIP_CM_STORE; st->encryption_method = ZIP_EM_NONE; } diff --git a/ext/zip/lib/zip_unchange.c b/ext/zip/lib/zip_unchange.c index 7366c9cc71..550e8b9903 100644 --- a/ext/zip/lib/zip_unchange.c +++ b/ext/zip/lib/zip_unchange.c @@ -40,7 +40,7 @@ ZIP_EXTERN(int) -zip_unchange(struct zip *za, int idx) +zip_unchange(struct zip *za, zip_uint64_t idx) { return _zip_unchange(za, idx, 0); } @@ -48,11 +48,11 @@ zip_unchange(struct zip *za, int idx) int -_zip_unchange(struct zip *za, int idx, int allow_duplicates) +_zip_unchange(struct zip *za, zip_uint64_t idx, int allow_duplicates) { int i; - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -72,6 +72,9 @@ _zip_unchange(struct zip *za, int idx, int allow_duplicates) za->entry[idx].ch_filename = NULL; } + free(za->entry[idx].ch_extra); + za->entry[idx].ch_extra = NULL; + za->entry[idx].ch_extra_len = -1; free(za->entry[idx].ch_comment); za->entry[idx].ch_comment = NULL; za->entry[idx].ch_comment_len = -1; diff --git a/ext/zip/lib/zip_unchange_archive.c b/ext/zip/lib/zip_unchange_archive.c index fe30a5ad2c..ca2b678544 100644 --- a/ext/zip/lib/zip_unchange_archive.c +++ b/ext/zip/lib/zip_unchange_archive.c @@ -1,6 +1,6 @@ /* zip_unchange_archive.c -- undo global changes to ZIP archive - Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> diff --git a/ext/zip/lib/zip_unchange_data.c b/ext/zip/lib/zip_unchange_data.c index 6fe89f4fb2..7dd93b768a 100644 --- a/ext/zip/lib/zip_unchange_data.c +++ b/ext/zip/lib/zip_unchange_data.c @@ -43,8 +43,7 @@ void _zip_unchange_data(struct zip_entry *ze) { if (ze->source) { - (void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE); - free(ze->source); + zip_source_free(ze->source); ze->source = NULL; } diff --git a/ext/zip/lib/zipconf.h b/ext/zip/lib/zipconf.h new file mode 100644 index 0000000000..2b4340c861 --- /dev/null +++ b/ext/zip/lib/zipconf.h @@ -0,0 +1,51 @@ +#ifndef _HAD_ZIPCONF_H +#define _HAD_ZIPCONF_H + +/* + zipconf.h -- platform specific include file + + This file was generated automatically by ./make_zipconf.sh + based on ../config.h. + */ + +#define LIBZIP_VERSION "0.10.1" +#define LIBZIP_VERSION_MAJOR 0 +#define LIBZIP_VERSION_MINOR 10 +#define LIBZIP_VERSION_MICRO 0 + +#ifdef PHP_WIN32 +#include <win32/php_stdint.h> +#else +#include <inttypes.h> +#endif + +typedef int8_t zip_int8_t; +#define ZIP_INT8_MIN INT8_MIN +#define ZIP_INT8_MAX INT8_MAX + +typedef uint8_t zip_uint8_t; +#define ZIP_UINT8_MAX UINT8_MAX + +typedef int16_t zip_int16_t; +#define ZIP_INT16_MIN INT16_MIN +#define ZIP_INT16_MAX INT16_MAX + +typedef uint16_t zip_uint16_t; +#define ZIP_UINT16_MAX UINT16_MAX + +typedef int32_t zip_int32_t; +#define ZIP_INT32_MIN INT32_MIN +#define ZIP_INT32_MAX INT32_MAX + +typedef uint32_t zip_uint32_t; +#define ZIP_UINT32_MAX UINT32_MAX + +typedef int64_t zip_int64_t; +#define ZIP_INT64_MIN INT64_MIN +#define ZIP_INT64_MAX INT64_MAX + +typedef uint64_t zip_uint64_t; +#define ZIP_UINT64_MAX UINT64_MAX + + +#endif /* zipconf.h */ diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h index d72ed144d4..ea21dddcd4 100644 --- a/ext/zip/lib/zipint.h +++ b/ext/zip/lib/zipint.h @@ -3,7 +3,7 @@ /* zipint.h -- internal declarations. - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -38,12 +38,37 @@ #include "zip.h" +#ifndef HAVE_FSEEKO +#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) +#endif + +#ifndef HAVE_FTELLO +#define ftello(s) ((long)ftell((s))) +#endif + +#ifndef PHP_WIN32 +#ifndef HAVE_MKSTEMP +int _zip_mkstemp(char *); +#define mkstemp _zip_mkstemp +#endif +#endif + #ifdef PHP_WIN32 #include <windows.h> #include <wchar.h> #define _zip_rename(s, t) \ (!MoveFileExA((s), (t), \ MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING)) + +/* for dup(), close(), etc. */ +#include <io.h> + +#if !defined(HAVE_OPEN) +#if defined(HAVE__OPEN) +#define open(a, b, c) _open((a), (b)) +#endif +#endif + #else #define _zip_rename rename #endif @@ -52,12 +77,6 @@ # define strcmpi strcasecmp #endif -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) -#endif -#ifndef HAVE_FTELLO -#define ftello(s) ((long)ftell((s))) -#endif @@ -73,22 +92,77 @@ #define LENTRYSIZE 30 #undef MAXCOMLEN /* defined as 19 on BSD for max command name */ #define MAXCOMLEN 65536 +#define MAXEXTLEN 65536 #define EOCDLEN 22 #define CDBUFSIZE (MAXCOMLEN+EOCDLEN) #define BUFSIZE 8192 +/* This section contains API that won't materialize like this. It's + placed in the internal section, pending cleanup. */ + +typedef struct zip_source *(*zip_compression_implementation)(struct zip *, + struct zip_source *, + zip_uint16_t, int); +typedef struct zip_source *(*zip_encryption_implementation)(struct zip *, + struct zip_source *, + zip_uint16_t, int, + const char *); + +ZIP_EXTERN(zip_compression_implementation) zip_get_compression_implementation( + zip_uint16_t); +ZIP_EXTERN(zip_encryption_implementation) zip_get_encryption_implementation( + zip_uint16_t); + + + + +/* This section contains API that is of limited use until support for + user-supplied compression/encryption implementation is finished. + Thus we will keep it private for now. */ + +typedef zip_int64_t (*zip_source_layered_callback)(struct zip_source *, void *, + void *, zip_uint64_t, + enum zip_source_cmd); + +ZIP_EXTERN(void) zip_source_close(struct zip_source *); +ZIP_EXTERN(struct zip_source *)zip_source_crc(struct zip *, struct zip_source *, + int); +ZIP_EXTERN(struct zip_source *)zip_source_deflate(struct zip *, + struct zip_source *, + zip_uint16_t, int); +ZIP_EXTERN(void) zip_source_error(struct zip_source *, int *, int *); +ZIP_EXTERN(struct zip_source *)zip_source_layered(struct zip *, + struct zip_source *, + zip_source_layered_callback, + void *); +ZIP_EXTERN(int) zip_source_open(struct zip_source *); +ZIP_EXTERN(struct zip_source *)zip_source_pkware(struct zip *, + struct zip_source *, + zip_uint16_t, int, + const char *); +ZIP_EXTERN(zip_int64_t) zip_source_read(struct zip_source *, void *, + zip_uint64_t); +ZIP_EXTERN(int) zip_source_stat(struct zip_source *, struct zip_stat *); + + +/* This function will probably remain private. It is not needed to + implement compression/encryption routines. (We should probably + rename it to _zip_source_pop.) */ + +ZIP_EXTERN(struct zip_source *)zip_source_pop(struct zip_source *); + + + /* state of change of a file in zip archive */ enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED, ZIP_ST_ADDED, ZIP_ST_RENAMED }; -/* constants for struct zip_file's member flags */ +/* error source for layered sources */ -#define ZIP_ZF_EOF 1 /* EOF reached */ -#define ZIP_ZF_DECOMP 2 /* decompress data */ -#define ZIP_ZF_CRC 4 /* compute and compare CRC */ +enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL }; /* directory entry: general purpose bit flags */ @@ -114,12 +188,14 @@ struct zip { unsigned int flags; /* archive global flags */ unsigned int ch_flags; /* changed archive global flags */ + char *default_password; /* password used when no other supplied */ + struct zip_cdir *cdir; /* central directory */ char *ch_comment; /* changed archive comment */ int ch_comment_len; /* length of changed zip archive * comment, -1 if unchanged */ - int nentry; /* number of entries */ - int nentry_alloc; /* number of entries allocated */ + zip_uint64_t nentry; /* number of entries */ + zip_uint64_t nentry_alloc; /* number of entries allocated */ struct zip_entry *entry; /* entries */ int nfile; /* number of opened files within archive */ int nfile_alloc; /* number of files allocated */ @@ -131,18 +207,8 @@ struct zip { struct zip_file { struct zip *za; /* zip archive containing this file */ struct zip_error error; /* error information */ - int flags; /* -1: eof, >0: error */ - - int method; /* compression method */ - off_t fpos; /* position within zip file (fread/fwrite) */ - unsigned long bytes_left; /* number of bytes left to read */ - unsigned long cbytes_left; /* number of bytes of compressed data left */ - - unsigned long crc; /* CRC so far */ - unsigned long crc_orig; /* CRC recorded in archive */ - - char *buffer; - z_stream *zstr; + int eof; + struct zip_source *src; /* data source */ }; /* zip archive directory entry (central or local) */ @@ -183,8 +249,14 @@ struct zip_cdir { struct zip_source { - zip_source_callback f; + struct zip_source *src; + union { + zip_source_callback f; + zip_source_layered_callback l; + } cb; void *ud; + enum zip_les error_source; + int is_open; }; /* entry in zip archive directory */ @@ -193,6 +265,8 @@ struct zip_entry { enum zip_state state; struct zip_source *source; char *ch_filename; + char *ch_extra; + int ch_extra_len; char *ch_comment; int ch_comment_len; }; @@ -209,6 +283,8 @@ extern const int _zip_err_type[]; ((x)->state == ZIP_ST_REPLACED \ || (x)->state == ZIP_ST_ADDED) +#define ZIP_IS_RDONLY(za) ((za)->ch_flags & ZIP_AFL_RDONLY) + int _zip_cdir_compute_crc(struct zip *, uLong *); @@ -220,7 +296,7 @@ int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *); void _zip_dirent_finalize(struct zip_dirent *); void _zip_dirent_init(struct zip_dirent *); int _zip_dirent_read(struct zip_dirent *, FILE *, unsigned char **, - unsigned int *, int, struct zip_error *); + zip_uint32_t *, int, struct zip_error *); void _zip_dirent_torrent_normalize(struct zip_dirent *); int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *); @@ -234,6 +310,7 @@ void _zip_error_fini(struct zip_error *); void _zip_error_get(struct zip_error *, int *, int *); void _zip_error_init(struct zip_error *); void _zip_error_set(struct zip_error *, int, int); +void _zip_error_set_from_source(struct zip_error *, struct zip_source *); const char *_zip_error_strerror(struct zip_error *); int _zip_file_fillbuf(void *, size_t, struct zip_file *); @@ -241,20 +318,27 @@ unsigned int _zip_file_get_offset(struct zip *, int); int _zip_filerange_crc(FILE *, off_t, off_t, uLong *, struct zip_error *); +struct zip *_zip_open(const char *, FILE *, int, int, int *); + struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *, - off_t, off_t); + zip_uint64_t, zip_int64_t, int, + const struct zip_stat *); +struct zip_source *_zip_source_new(struct zip *); +int _zip_changed(struct zip *, int *); void _zip_free(struct zip *); -const char *_zip_get_name(struct zip *, int, int, struct zip_error *); +const char *_zip_get_name(struct zip *, zip_uint64_t, int, struct zip_error *); int _zip_local_header_read(struct zip *, int); void *_zip_memdup(const void *, size_t, struct zip_error *); int _zip_name_locate(struct zip *, const char *, int, struct zip_error *); struct zip *_zip_new(struct zip_error *); unsigned short _zip_read2(unsigned char **); unsigned int _zip_read4(unsigned char **); -int _zip_replace(struct zip *, int, const char *, struct zip_source *); -int _zip_set_name(struct zip *, int, const char *); -int _zip_unchange(struct zip *, int, int); +zip_int64_t _zip_replace(struct zip *, zip_uint64_t, const char *, + struct zip_source *); +int _zip_set_name(struct zip *, zip_uint64_t, const char *); +void _zip_u2d_time(time_t, unsigned short *, unsigned short *); +int _zip_unchange(struct zip *, zip_uint64_t, int); void _zip_unchange_data(struct zip_entry *); #endif /* zipint.h */ diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 55386558b6..74f868b5c3 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1152,7 +1152,13 @@ static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) if (zr_rsrc) { if (zr_rsrc->zf) { - zip_fclose(zr_rsrc->zf); + if (zr_rsrc->zf->za) { + zip_fclose(zr_rsrc->zf); + } else { + if (zr_rsrc->zf->src) + zip_source_free(zr_rsrc->zf->src); + free(zr_rsrc->zf); + } zr_rsrc->zf = NULL; } efree(zr_rsrc); @@ -1321,9 +1327,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open) } /* }}} */ -/* {{{ proto void zip_entry_close(resource zip_ent) +/* {{{ proto bool zip_entry_close(resource zip_ent) Close a zip entry */ -/* another dummy function to fit in the old api*/ static PHP_NAMED_FUNCTION(zif_zip_entry_close) { zval * zip_entry; @@ -1334,8 +1339,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close) } ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - /* we got a zip_entry resource, be happy */ - RETURN_TRUE; + + RETURN_BOOL(SUCCESS == zend_list_delete(Z_LVAL_P(zip_entry))); } /* }}} */ @@ -2863,7 +2868,7 @@ static PHP_MINFO_FUNCTION(zip) php_info_print_table_row(2, "Zip", "enabled"); php_info_print_table_row(2, "Extension Version","$Id$"); php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING); - php_info_print_table_row(2, "Libzip version", "0.9.0"); + php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION); php_info_print_table_end(); } diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index a321d90b04..f848ade8bc 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -30,7 +30,7 @@ extern zend_module_entry zip_module_entry; #include "lib/zip.h" -#define PHP_ZIP_VERSION_STRING "1.9.1" +#define PHP_ZIP_VERSION_STRING "1.11.0" #if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6) # define PHP_ZIP_USE_OO 1 diff --git a/ext/zip/tests/bug51353.phpt b/ext/zip/tests/bug51353.phpt new file mode 100644 index 0000000000..560945f9dd --- /dev/null +++ b/ext/zip/tests/bug51353.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #51353 ZIP64 problem, archive with 100000 items +--SKIPIF-- +<?php +if(!extension_loaded('zip')) die('skip'); +die('skip the test might get very long, activate it manually'); +--FILE-- +<?php +/* This test might get very long depending on the mashine it's running on. Therefore +adding an explicit skip, remove it to run this test. */ +set_time_limit(0); + +$base_path = dirname(__FILE__); + +/* Either we ship a file with 100000 entries which would be >12M big, + or create it dynamically. */ +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip", ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); +if ($r) { + for ($i = 0; $i < 100000; $i++) { + $zip->addFromString("$i.txt", '1'); + } + $zip->close(); +} else { + die("failed"); +} + +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip"); +if ($r) { + $zip->extractTo("$base_path/51353_unpack"); + $zip->close(); + + $a = glob("$base_path/51353_unpack/*.txt"); + echo count($a) . "\n"; +} else { + die("failed"); +} + +echo "OK"; +--CLEAN-- +<?php +$base_path = dirname(__FILE__); + +unlink("$base_path/51353.zip"); + +$a = glob("$base_path/51353_unpack/*.txt"); +foreach($a as $f) { + unlink($f); +} +rmdir("$base_path/51353_unpack"); +--EXPECT-- +100000 +OK diff --git a/ext/zip/tests/pecl12414.phpt b/ext/zip/tests/pecl12414.phpt index ab11d21a63..61546386ab 100644 --- a/ext/zip/tests/pecl12414.phpt +++ b/ext/zip/tests/pecl12414.phpt @@ -35,5 +35,4 @@ if ($res === TRUE) { ?> --DONE-- --EXPECTF-- -ZIP contents size: %d -zip_readfile recorded data does not match unpacked size: %specl12414.zip : MYLOGOV2.GFX +zip_readfile could not read from %specl12414.zip : MYLOGOV2.GFX diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index 3d8c90cbf5..e895e0e482 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -54,6 +54,8 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib) long output_compression_level; char *output_handler; php_zlib_context *ob_gzhandler; + long output_compression_default; + zend_bool handler_registered; ZEND_END_MODULE_GLOBALS(zlib); php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); diff --git a/ext/zlib/tests/bug55544-win.phpt b/ext/zlib/tests/bug55544-win.phpt Binary files differnew file mode 100644 index 0000000000..03fd6b1c90 --- /dev/null +++ b/ext/zlib/tests/bug55544-win.phpt diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt Binary files differnew file mode 100644 index 0000000000..a0d22f4fce --- /dev/null +++ b/ext/zlib/tests/bug55544.phpt diff --git a/ext/zlib/tests/bug_52944-darwin.phpt b/ext/zlib/tests/bug_52944-darwin.phpt new file mode 100644 index 0000000000..c25babadf5 --- /dev/null +++ b/ext/zlib/tests/bug_52944-darwin.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #52944 (segfault with zlib filter and corrupted data) +--SKIPIF-- +<?php if (!extension_loaded("zlib")) print "skip"; ?> +<?php +if (PHP_OS != 'Darwin') { + die("skip Darwin only"); +} +--INI-- +allow_url_fopen=1 +--FILE-- +<?php +require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; + +$fp = fopen('data://text/plain;base64,' . $data, 'r'); +stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); +var_dump(fread($fp,1)); +var_dump(fread($fp,1)); +fclose($fp); +echo "Done.\n"; +--EXPECT-- +string(1) "%" +string(1) "C" +Done. diff --git a/ext/zlib/tests/bug_52944-win.phpt b/ext/zlib/tests/bug_52944-win.phpt new file mode 100644 index 0000000000..fa369f8fb4 --- /dev/null +++ b/ext/zlib/tests/bug_52944-win.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #52944 (segfault with zlib filter and corrupted data) +--SKIPIF-- +<?php if (!extension_loaded("zlib")) print "skip"; ?> +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die("skip windows only"); +} +--INI-- +allow_url_fopen=1 +--FILE-- +<?php +require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; + +$fp = fopen('data://text/plain;base64,' . $data, 'r'); +stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); +var_dump(fread($fp,1)); +var_dump(fread($fp,1)); +fclose($fp); +echo "Done.\n"; +--EXPECT-- +string(1) "%" +string(1) "C" +Done. diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt index 850371190e..ed4af3e157 100644 --- a/ext/zlib/tests/bug_52944.phpt +++ b/ext/zlib/tests/bug_52944.phpt @@ -1,157 +1,27 @@ ---TEST--
-Bug #52944 (segfault with zlib filter and corrupted data)
---SKIPIF--
-<?php if (!extension_loaded("zlib")) print "skip"; ?>
---INI--
-allow_url_fopen=1
---FILE--
-<?php
-$data =
-'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'.
-'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'.
-'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'.
-'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'.
-'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'.
-'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'.
-'NV7mx3AovW/veYYnlUfNlF1TNysBvNPrs5V6ClWzREIaxqSGPIK+EoQEeqBvCarbQHOQnolOl/jMrmXPMBWbIDRkzJPVo3kCD3Us'.
-'NRXjK+Ad8/fMLPiqY7+CulD4Vc/pga9nIEdhGDsx1qvT4Aw9rpW6rGtv5tqvcnMLWCNgtbu7BZ25GYiGMwiStZFNs0jY+uxVFrcG'.
-'rOVt+PaYWLhRRxt3rOCm2E/BUUA75CBa7wmWkSkXFyV7bsA/9NU5TPSC8jU9p/fSqS0u9l44323oNb1h6KfYl1mvAYIzNUX0Csfp'.
-'pozkYa12FecgDSsD86KHnATUwz8uzu3jbL5Bkb9UyUtMjL30feyC0oVBYY/DcR8DYdAnbI1FcItMFuAcIkNLx7498TGqFlN49v/K'.
-'5TdaEbZPfKhWMwvZw5SKGjMvAGm6xBrEIRtYsmfRcY0NfA5ogzyuzS2nO9sCMcVkMlxTpc03vuJcSkv9T4aZkYktzv5j3FUIf9Eu'.
-'EVuPX9ZM2dBAEEEAmEzVXRcbdmMfGoEF0hn+ufCvjZoGXMbSLKGXRkIhYEcJFHzrGphvw7M/YAd1MT/q4b1weBHE7+N+ge1EyDGK'.
-'vT/q0GzHs65w1UpMcFyhKRUsLtZfOj1gG3MMrfijvnyV7gJ6DOJTfsQwogzOuESkGzr2vt7AB5ltDDDgs1YBLCP2Hs4ep/INGvDn'.
-'0gS4x7TeREJvQoEvnXoNF2AxzeJZadBG9nsfE1DhTWy/BU0CvZ/t/8VxK1No7y8OsiarJz7+Z4eP7zN0XqDFE2fBdgcLzaFdGau4'.
-'eCY+NT0bWZiQ9RJ8xXipdAO0oplw23O6CXo1DvAcC7C0VnHjT9+dnveSDURCDL+J058ivgw1MKpyUank1fTE7eD+MYNOtKepW3EM'.
-'5BaeogscRezzQwX74AjxOVQW7QYa4BPofdJVOrFAYE2dq42rbINe19qxXjuXQquNl2liaVckfFge4ywTvwxcfNuyttEveIsC5Efh'.
-'t/0A5I1okwDIHgrUs3fN2x3Q79uewcOW4/dgcJII2THNt84OUqH5dlnqMzEPzLrjLQi4S+MtVgp6vWcf+ZBE33o8admzR8jNW06P'.
-'QldnMQigV9BkjL7s2W0fRg+kbGLKAf78yTVnjHqLJv5Qjv0IeEDy4yPGq0JBW+BDvsVZShTCaCWReUxyexvGUy8LRxw72zipLkfM'.
-'a5oI2gU7/g1j8VDFlbFspQbEOJs7RdSJJDjP95E1IHKcjuHLG4xcDeh/dWXyLkXf/JFL2QJcW2nE5NXi4hT+b7e6jjOGiqHNMbWT'.
-'sLVBvw1MQLgf8dt69bepfRWCHfyDIx4Z+RYGUv6AqwxbGGD5A8YzzGY9+71nbKlzi0glZwx/ABx/NvCnUYMEyJXuvXns4PsG/jQ6'.
-'9kcfPq8j/DqmrZ9xXXoYSLidm1i1f/LA7BI807Pf4oZPYI19F9WRQRAtZJMeRRzCn8DnwMM9PzepeCNEb883OvT9HP0ovLO8UkY9'.
-'/oSSaM+n4dt20Kigx0lBgiPHgQFn4nAVc8ufSMdg4i0Z5mg0oDjD7s0saDFcEhehwEJntB2onT2hGTAXAx8MKgAVNU21E8wQNYXQ'.
-'NFf40yNVQga+Z0+xrAmk7oMUQWOfM/2ZTX758olZiaMm33pQ/X1BtvOrMAnHeJiBSheFXMKD94DNU2mkmsvE3AGrJtVcB2n/4inK'.
-'jwAZCUviQzNQgOMJojl7IF8e6YyJidrAa1HrParr/hwJifakm3TB5m8GqSGxuFhz2Nv4I4tpcyMhr4FeaN2ikWvSsZuGlgZCVWHF'.
-'Np2AKxTgEbXkY+6FyRivfDWrEnEbI0h5C9WhRdKUIws1Ah6PXb/LjqrO8bUMac6wX7iXoKV/qlgtU/vKMP8GXcQaGMxdF4PtMdNP'.
-'ZfKg8U56sg92RdJk2/hHYYCN5zp4Y3bwxvRIDt4rezRJujhIQWXMspk1tCIWF4Fj37holt/deS/w2ZSTfD2cxMJZPbDZ0OYnSf04'.
-'AG019g+HdEw8gKmvDnh0/LSRPjWAIn4zfc2aeSUXcBYeU1jd2I1B897dKS8OKHsMHdJLqeNoVE7kY6f05tQBMfvYtSMfCsHh2TKu'.
-'LJozmKY8Pt2g/m3wGcJKGzaKCYCjQaYqLY9ja5xckLecwnjndoKrMLh2ChaskC6FQQLdYmK3k6T6hmzudB5gliE9wbMKq0ZO2+Kd'.
-'frgGaU2bFYOwh4YbGc/Zhj9Itfsuumm46+8WuYgSemdNDMUOrLF9bIiF1SvIcfVibPsEfwXwEgRSrs4IkLhpCoDTFzjumlOAIgv7'.
-'dHqWGtnCI+BW4UFq1KaFKnGAPM8tcjzFDns13W1tFBMMjlEFXCANwEPGsKQoHiwupo+2BNgoJzXw8Jci0Ug780lYtzhDwyI4bF6x'.
-'tqUz//T3J/sNHcfVGwcG5Bv26+FhQ7/TQV2+UfYjXUmH+PYKvF9nYOAfXIFs05MF0GZuD+I1bxzCPYYAjX94gfYEikCDHljmHIQW'.
-'UdBAG97qgZKGn3X8eYo/z/DnOf58iz/fnZmpI6Hv5tHsjoPB/VhMZvm0zJxnI7sKbVamF/wDJ7XXkHRLpV/PHnqUZUHNI1FjPSox'.
-'M2fsNKtw7xDv3pBTh3Jpx8SUjDoe7Ssr/t9s7tgDz8hKkEz5kxsXB26mjTbLQ5gd0ryBQfK6DbLuACweipYkhxgdULB45bjEIYlj'.
-'hFzVsQOI9LI/eo5Cvzx90cFAgZLOlXo0DtD6ybmilDPD+Gr6DgT5PLw4dFw+wKZQgkwvoxcfLGV8/5ybY+ZeR4R9OdUvJqZS+MKc'.
-'s5i2khnoq5qlU1GEomn7cvac2y5zlAvJ5ekoBXEmmg4vFCRqJWfSDU8FLZagAgvcApwcX4zNnW+3KWE2YAQKUg1bPxdm05UZpCod'.
-'QOJfTouMHbo2uDhDcozKx1ymCZKK+RG2g1QRLvx2xHWCOiqI77EHF3INCaEsyzUz/VZsDo99btQVL3dOHTSHKdSbBiP8BunIxD/Q'.
-'kVOlT56ZzWmO6pBwBb6UZL5nVh1s0o0rPqys8GkNel/5BI5a7+5OBVgHLswDjCWAKA3QjzMQmuDJdZ4xFcc9XYlZf0GhqxmZKhXj'.
-'oLpb2QyUXsI4reNzqEBAwoCl1JXT28ixWewzk2fHsDUVeVTikTHNoQn+mMMZ1hXzRpybchWrwo89E5V7YBNqMbVKXjKa6zlzsufk'.
-'3oVshy4QS3Y9MPPSWuvCHpWGY1C0GsnGl0s+DtMkVYZBwZokYHiw02MjvySnMDkpMz/PzY/0ifyikqkgDvhBfOcL9CYY5bY/jvvi'.
-'0e1jIum7gPac24Oohaeixwlae4FNHGYihuxDmm5vHR6cHB3une9vHv+I6Kpgjt/uvj65F2Jzj7/nJomR+3jKD6fL8tO4vMaEMSSt'.
-'qrMG7I40BA458LMgpdHs7Nht3v3l2z5ZEqYieUvZsMg270hz7W51oW03NT86wygOKgqXRQeupQr6efBYaiBLDapLDYqlHoHOLpfY'.
-'qSwxB0tklaW15xDWlV1D20regqPt5Dtm5Dke7kiQcFviiCUS7AXYS7cA2w+BHXaH7agAmLjOQgbZqYZUqpmk1dxKpxmK9WQGSt0H'.
-'tjq2g344KEC+ySAZGy7LRpNxAezay+C2g3Hgj2kvUAFqoja5MwdSacnEzeM8wUWYAs5xJc4CpIJznOLcA4HSfxO2K+iz7YrmdOaB'.
-'KRi38xiPg/gqiPcL00gA5qRdfRQMonEwH7CeQ1iCXiiAr9E5dNU8uy2bgflDPygWVwCEMo/p9PojsEkKROm6WR8f8ynS1cxwojAD'.
-'jRQ2cAtQu3n2J8DNod+NioAjtzyoUCoWbckOnmzmqVBbfJpZGTAoAO62yjDtAsw+nXxWhusU4A4OyzDdAswxnY5WhgsLcCdBXFFi'.
-'zwOBkGtnVf0vvIyHN30/mgzHlVNpbyXQT7yZsAJIHB+AgBetQjGvMKaPji3BZ4IZFGF+FFXpFz+8UVjqSMR0HIrT5ApW8FTg2PQr'.
-'WzH1ZIgLNqVkSKexLqj0RCSMcioojOCFcTzVeEOD2wkEAs3RijgN/f3mSv15vfb06fOVNfCAFfDC1BXYlzONN8hBk/Dy861WFgiz'.
-'FTu4UpY7BrK5NYLExKnrzT8sbLXEUduODm2ntdo0ydwaoRviC0h6wcXqqjsHP0XD4LDdBhLTgfxi/+BjB6wzgabNaPCkCblpNb/L'.
-'TsD1Ujg2IA2xB/Gxo97KwLDXeJxC7rDERTxU6g8L+fMa9UVcRTdKhzZulFIaImUU3gR9SjGZSNdxCO3VX4SDjoYrmEvixGc8xnIM'.
-'OmQV/myETn396fPaYsepLd44a/oy1HIrhuroi7hsL1bTAZsMLaI1/ewLhyylRig7BACCp2sA/vMR4VrSvChuAeMt1Za061Bf1lt4'.
-'xn19SesG8IItxrfVlzrWHSh57Cyl9ZYnVcd2iLVONibfrj99Wlsc1RaHSwU+gazbGSuF2ymnhHhiG/FKmmiGx8vO0qJfxxPt+bm1'.
-'9FtJ/ocFaPR1oWuXFrtLy7l+xZJOHKiCJKfYO/AteCBvnSpiZgB/WDCMcNcJT9IjZZdWl0xgMgwBMRDtSe5w9nDXNBsiBwcvCDYP'.
-'Tx474dsSLJOgvSS7tqqWZkqqOIN7y3QXDAefl3TZ33pN14gWjl7XNaYBPa6+pPPxxTWEssfwnjy3NTVS+fQNEPbR7aPVJ397sLm/'.
-'g+79uzgYgL6xewnen4LX8y39ccRp50nXBfqdAxmXTDx3lm/aePRodRVd2+NBkr6TPIvpvhdHWyIl8GyJvmU4z9n6A1TsJSriFYEe'.
-'JV1QzJTyIRzKq0i5gEczU+JhJLJq8hrcaoz0NUMploYeyf80BMphPoc+HITjuQj/wBcYprUYdUHmnUOX4iWyg9F4KgjyCLjiG0Mn'.
-'lAwjIlZNnI42sFtGfRc4YPX072or35+tdiy8GEEex//Y0epreM/K43uRCCbkqs2rVu56xQ4OHfUi5KUYJWnzXgx4g5+x9Pk///rv'.
-'Pv+3z//l8z/8+u9+/ftf/8Pnf9A+/wsk/QWS/vHzP//695//n8//7dd//+t/+PXvNUj6LwD7f37+i4apn/9vzPT5L3iJKfSxpNGj'.
-'XIAtd3OJwHGAK3Z0h6mat9RfeB+KobfChDSJbvHtsxlwG1p+jqd6S9glunATWm8pkAyOCu2H48MDQ1/FbJgLhsdIt7ja8N9t+vRo'.
-'KRkkshqNuqUpX9ROW2rIKudSRVdaSq5eAmOkgCketpYaWk40p19nVnbdQnZHKh63mnGGXqKnnhvQFQRlvtnMk1VC434eKMBGc0PS'.
-'4q/nv3sZMC0vz0PiKhNZoeiCbsh4JJuN19AMEj4nNt/gL6ov1U6prag/ixClmCIeXVRaf+G91JdFzZb1F6veS9ytlGsBISD2RE5C'.
-'ZquEqJACxfboSg+WPksKkUGR0uhRlYrEC0QkqMw+E+RWeG0mcK+uziGlvHj3OBoEJ9AF+THMglcIXxvUwygGnXjuTabn3ni+lhi5'.
-'U1x4ovt++cphHs5hykdYxjt3ihJfliQ0Efym/5dKiW8TSs7duSWibvv5o1JglBm5go8kknDYRjTAKrdLYPbCmP35I85OLq/VQMD3'.
-'g/aYk/BpNje/2vklGSmyfZNdt+NFrem8upMeqqrfEoxpUEHTJbpiZskDBrhYMudUSOUkZctDnrj4T8MfSIHfNCQ5r9Yjr0dVo2nw'.
-'aOTAe0pPpJS2oq3Xak0BgXQCwkMbmE9NNgQNc3XNXFl7/gzhkHuQBMIkSOnPxhHK3cwa4jSQt9oSIYLeKKEmvixbGmwEqV0Lv1mn'.
-'Uk2ZFuUKZR06D28GMVNIV7BfwuRdOCTqzUPDHVVZh6wP77dfcoBzjQ++SwrZiyuFOKX4wtubgeJgHNpBu43n2OijST8BZ1HHy3HH'.
-'4ComjXVtZmnPcMsFtvkR3oZId/6xAau939V2KG+i1e1v7bX5NyF/r22+P3l7eHRsj28gUfg2fMPuJOSQUjzQ/OFrkQ34Wdnb3do5'.
-'ON5BZJxDXpZswE/ua3p9cnaJoigc+C2xszt+V9/vrorGrOavKWTyJHd3hjqB0JLpzq04d6mhExF0K3GvguzyhY7V5SgRHCptvETn'.
-'RVfefNWmEyzaRve0ffbYceiGQZy5wuUoPfBtvHfB7QQ2eJUAYXUwQjYZT/vBKb5TBIEFuhOg/roCccBwCfPKNqksEAA4ZZiV1bY6'.
-'vMbtOPo46uBh+3iActsOE0NvAJO2giEGSOPI0Rs6cm168HVnZoEJ98pNgn44LNaftmRa7WZyHdK5TxhYcesDrI7rSQ3cJchXXlHa'.
-'AAqCojHZfqZ+8KLxOBrgh7pIlpemhg7iXO2mNzXIguqyIBQWeqOdLwmYaQzjC5PzJRG7Y3qxoDYdwgkFkeQSjb+9abStaSMEmvKK'.
-'74cY9XCsUJbo2hYLXzBKkaL2JFwRbLdyzTkwVFyqnxR4RieROrdUZKNtw8gK4g8kOcmOtrjR8stbFrj8SW+D7YktIa4Qb3SMLJZo'.
-'LL1ohVcg81w8PauiOhrxp6O3o+F4Be8obNRrtb9peq5/0aGNXQ0KEeKaNtlhbuA+lObAjTvhsFFrjsCUAwe9UdNfvliF0tBplkeL'.
-'yxbyUXZUw1GUhLTvzHRwKyNYSL6OgdSkBeTHhg42Nd16rM/weLv5HzkWWR6ETCXQEibNoiQH7oExwmOhdqEWoVXHTUW4W5Y2ic34'.
-'YiqRi/inKltXZOvKbMW6lhpmQQ0aoYUYG13rEx2NIKE+rdDECHRRqqDmN48Q1RhRDdrKJWcbMHooT9C0/n35UXrSH0LgwHa6Z6dN'.
-'EoXWnETDMxkAgx/lQNfp3t3dzujODxiekCpBLnD9fjIMxw7Jr/fwZPSI3JgIY/tlDbLjYfvi/Ul7mZ4wfFu9AcodhgMYgeQ8NJSt'.
-'lKFFRbAUlftaL4DHJIy+cdEwehu9BolR5tFODlJsrAU4vn9dmmUYBUntKcTpXeJueXyInBabseI43Ei4zjS4dDx2i2b1RFEjKIpv'.
-'ANfxCKcR0gNN+Rkd4cdy2byNMBiYXaQ0caMrXClHJjW66EmlrzM+2xXIfzNGN+F2ZmU2rRBxP4XB9UZVIrroeNcXyJjWMdbc4Bsc'.
-'kBYNPvtzEiOH0EfeNUfFY2VTf45TuC1cWfyseoBp+ox3c/8b1DZfnaoKK+2RtZVKmjadD9Tt04PTGPRzxmmLi5iyuBins6D6fvRJ'.
-'py1/uVRxKaP4wGj6lNWI7QGtPqzSlO5qCFxkPC4lLi4+LogrRMISCz4afVuKlceptAVEWXImhAFVih4lzh0InzvWyHekLlcR5+0l'.
-'HsOAheABymIw4olaVsfKb18UtGmpHqUcEeoIqAQ41cWg0M8wnutBmBHrgSo4ayQ6l/o+hbiPXyVQNdeiYKVrN0aj/pS5DnQhMShd'.
-'+DTDACDlMicgjDyqH22LxUX8BSN2iJfG+GC3OQ6fTbmBHxp8AgcKcAw5CZy20FPVeR/n8hqh3ZrENOuwkT028JRxs9mFkda+Qc9w'.
-'o9YQvdN1nHTn/0a3QQDJKAhayWn37O5OebfPxeATyh3cALffR0MB+KkF+uV1qg3QKOOamuVva/xtrerbOn+DP0L2nqLVB7zVtXpn'.
-'M6jMMBUV56g8G5SET9Y5Gqv8jk/W+bkQkJTEz9a57HVOlW/WudLR/ElJsAQm5auSYLFCVXUhaELlMJTU8zjtnG2oL0Q/Zp/bQTDu'.
-'Rq1GxxL3GjfaqEattAO7liQ2GKEmqSdQxkiBwpbhlBGBbkBf9TXPcfJ4B2PVSPrR9d0wigdu/67tJmNz1bTH4KbkcpuZoUDCleg/'.
-'ZwjQUMwpT2q0Cu1nyC12N9BlsagT/82ahKX/Tk0i14maJNjwv1+jisMq9zUNH1RTQQR4UdQP3KFeJIng/d+JKtLnRLqkQzE3ckK0'.
-'IqW9mQ0XW7X6VPSnt4CnAb4pZT0Tmj8d57hpzlIH919ZGKMql6cqCixSlRjzijSkhmw/VjtgcbFtflFdBGOV6qKUTapnZg2ieNRV'.
-'ZwG6oKx7VTLqATp3BS0b4AoQhjPAzq54oa15NqIKzOEhS3gDOd+FbXO24qAZbdPq8tWBZIaf6nSLwAivq/sbfAALIDM+enimCgXy'.
-'SzPrwiTnwjklI+k1usjQS9ZF3rOA5xR/5v9uoaEFZbDr+4rMoXzaHthK+ZQjtJbySSfRSCb44i/48jiTwslK/clcYMU7DkZ4jFfm'.
-'5fBskI0WW+A42Ch8jsdOAKlBPxjglRfwNGw5nkF/zRl/EBNReChY3PEMffmU71Nxb4z0YpXUhoSsYB8+YQwgIFZEMSRflrMXtDOt'.
-'tWfPTAv+fjG+eoavruKr/0Z8axm+NRXfWg6f3Jts6eayburY3amN5hnisBg6v7IDNkheCNMldJjK9rrjrGfBd2QOOqtA1F+MX6BO'.
-'p7j2fFu31mcmvFpflPSLuQqGTYB7fCXi07SxbUkYJWWtlLJOKWeVtVk2Nhq/2Pxobpi//E2uFl//dW51eWhhhc0na/azZ1Yuda0y'.
-'dV2kyqr/0Th1V9qbK6+JQmsz86H3B0n3vES65yXSPTcryzfnvzxQ7HJ12cvVFVgu1gI60P3FqFma+H8FyTXXVubm0mvDT1uQHA4A'.
-'MH9D9Fl2oA0IC+mSdJqt6LaDN5hP4q3jY/pAYwDcRfAI8Y9SiI4ewRCcEjoHoovCrTVFm4EP1Ws7JcE545N7uk5XzC4dQO7sABFU'.
-'lhzbd+teTtzGaQ2HK/47s9xPkzhonK49VdK8IOxQGrzjvzWQQV4fzWLICf/Dt0nAL5whjq6HjdP682fW0zX4/5nlT91hrpyWG19k'.
-'uerr33OShIOELLETB1PEBkn8L00OGLhGlcC0i657EQLsdwD33Tp8+ZbT8Y6j4RiaioiV8iK8r1Ug+u4ZwltPRZYIeoCaDVWuP01L'.
-'iGIfzExA9GzdegYNqj3l9DhoSewCMnH7A/AiTtfWoSIAWl9b4w9XIVgdY4B++h1dvFBHPeR3k9Dl0gQVO1G/xQlr9WeINGvw2nf4'.
-'Dpo27ESN02+fUZMgRTSfem+9htU+s/qoF5nU9W/XAddz/CbSmd5ra0+znqF0UVT9KXxY/w4QPc0+QF9AnS3xT6SPwuGFoNV3a1b9'.
-'+3WRPg0wSlk0A/+tEaZBILkBapJ2jtL4gRtHSDxqKgIN3aupYJa1784s6jj+LKiR66/nhFip1Pdr0FVQqdEkHvUDiZdQpd2RJVFn'.
-'cm0ATRL2r4IYAL5fs8S/MwuG2DhQ2oWVLjYW8irjOA/M07VJOOzYPTDmhigOxDu9NtMJOplu3baCdkOHl+BwMv7TBLf/E2huWQjs'.
-'0oKRSZlPU+yA5EwBnFmIcHeI+O5D1APFv+qE5pPucpvziErcl2klzWV0V9ZMmXN3eF9eEISUaXXNfFHPyl9de9KlwlPckGIYKytd'.
-'gX2lrhSwNfFC/8vak2vRl+RDwboaQnGUt55v1nwE97ZLbRk3rLvirHEJKuGAavH4S9tV7Kv7c64Um/aku1Iv9dkcHA80rqLj0vY9'.
-'ybPGnybh8CtaWGjjw3kLTSz34HwkDzbynl4s9eRxcUG33B1kg/tRAoWGT9gif7cLhZvLPaXRDyESeGDwl/Go7X64QtiitE4CzRPA'.
-'mR96Ozej6B48QH/woTbaDVGvUXRtgEytYa9it5hK074AVQiolnuAzFhR0K0APqxYsW/nIkQPj3y7dNmNU7LmQymz+QxQbIpoiMoL'.
-'xfqh5MpxxFYY+w8NUO7Ky3hs1FfkMFDJjxLoATSSHySSdDgUBNk8NNVEULhDYO6mNVOpkC+bR0e+m3bwZPu8DMWFzoE8Sr7n1O1v'.
-'a/Vn3zX5Op9ak6fqB7SMXOpEI1x1+qbj1JWeHPC5/3g6e/9JzV6nzn5BVXM9vEQEJy4G8hDG1afZeje+GqK73+2a/ICK1RisdtNF'.
-'W2hZkSPCFaiBmQ1FI3zSX+mB6sqQrV7kmf9/fDrkqIA8Hz5IgeVBfsD+KxABGNcBvptDBgPo8KRuPzN/N2JgTdSRUrOfPflrGGQe'.
-'cb8QBXT0M5XKr9CTKwz0i3SoAw3TnUoYxSHILStxQcq4hyoOisNbJ7orocrFfy12kk89VteyhOWyYP9txQhR1suLsguUU10qDyjo'.
-'GMAMa89MUzZO6YKLnI6vAMeaqiL+FTjp/v3aeiW11CUFKQ8y/krXqhGwSt/5GKWgNl8Y9dU1+9tnpmoHfWs/e772DM0SREe8TAxv'.
-'rM2FxZZi8wQANK+GD4Xs6fc5CNbstRyG79cVHPOyPC/k+e6pyIUhdxkX3EuM7gvUWUXPyFZ7BnM8WRNUpoGS9vXcboEMK6GapScy'.
-'4qK0wQGSvHltdbULPjH5xQ18z0Jb6GQ/uRyQAuU2dKpT+5eTYBIUA2MCx+UVdKvlqJPpdMEzzomXptejkeuH46l+JoRmVgURxGgE'.
-'lmeL1VFaF7+7E+uGTT52PftKE+zw+Y9t+O/773UR6RNwAFaxbDwzKC3LvcKCWnhKkQjO4ly3hTY0+Cxmq4Cs4c+4Om3ntvipQ8v6'.
-'YMeJtcHbti0a7dRmQRpJ0bZuiaR8Zkq2Auylq/kWd34ja7Bwyv0IN3+Pi2uNSpGBCESeZU0W8ajcagFNdKV7JPhCR3uQhIG4Y5qW'.
-'EZSNLKE3wQ2c7bCPgZakYbw0MsC8zZ7nLSHarYB5SIZOFBh1XgjzOw5//v9XKLNoVJpjO8DdHkkDXx7JLvOhv+xeIsKe54xcER3+'.
-'deO2JcetGDLlUdi6dxS2lVFIIel3d8/Sc1zSwJTscXWt4VZEmKyuNUWQshwqKyszuu4oF6eMq2Q0pKXwsGq4hCcGbisdUrfie6MO'.
-'8tkqDhuz2XbaK2tpdJcPhpv/ot30Mfa6AkmtEsmXFjbLN+xL8auhVS25m+Brh5oMlv29G1WI+/raOrUEL+rtGz3fzkwyYHcqb6qQ'.
-'ONp5c76/c8w3/eI6He2zEKl4uK++2e9r7TDotxItBhxxGLR0BWQNQN65SXIdxQDRioZLY43C4FSgdQTqo77VXJyRJqmQ8LEcGki+'.
-'QaJCPwXovagTDrUw0cLhldsPc0U+g+87AzfsF77/YeH1zs52RXNkclV7wpjbk8Ksqdiv42jYYdx/WHh3dPh6d2+nogDlC5UxlyAq'.
-'IBb0+uSd1pdNpcIsbV2ju3i1QQj8MxkUs61XZrO1owADcP0xSF7KL2v9anP7/Hhn82jrraN/jCaa72KNwIJuaa5GO2w0jtzVrsNx'.
-'F2Q5COWpNnJjdwDaME7sF178Ev+9A2WXaC9cjY4HXFrlg71xG+rSSyDqi1X3paWNI4GaqNwPRDXev9s7hHq8PjzaP9/df+Poq8lq'.
-'OOisnuPdyKvBcJV1pd0J25xh5/z4ZPPk/fGrzaPz7Z3Xm+/3Tk52fj7hfX6OtnQc9ANqazvqY1C9top7u9Vcx5s/7ZxneSjXm2Cs'.
-'4emFVbAnh4d7J7vvOIuApRZQjqSY5Wjn9VER/VHQBhp1IUMyroIvFiHhZTHlXFCx3YM3spxH1HL3Co1X2y7CnhyebO4hmxwLeAA+'.
-'icau6IiGxhk2f9j8+fzD5m5a8ew/yLAVDYdAWChBgT7eOdiuhD4G9YqcQ3szZY32j9+c7xwdaVpllp04jmIt8v0JDLzHWY7jo5/O'.
-'63MKweN/xIWFZFfEgR91huEneAH6jUCWBoIY2OeHP84p+jWRGa3UlpZM6E709qTfnyq1qM4rCNMBtTvpk+pNHucKXKvOsykHwf2F'.
-'YtPXKhGcgJgEBu9HuDqkBRnpgHYamAGYiqKUC2lF13SYNJq3eezr1dhxSasNpL12k+EvIBSkCaz2y+bJyRyKgP0KWghjo/OFPeW9'.
-'uI8eKZ0HYmoydKn1odcPNKV+rw/3tneOKvuLhnaSgR4cahI3IT+Ism8fd45z3z4GSa6L1ufzBPfOkpA7b452t2G04mEU5ziacuBH'.
-'Ad5BwvRm9AT+ZufkfG/34McidilvEokcgc7fH+1V1gXSGSdBvT3Z36uConRAmiiwIFff71dSEKzKKJ4M0goIWXrOcuLdztH5u803'.
-'Owxer2Ut2t59t4d0LQ3GLvMic9xtbaataLf1mRa1tdu12VIZwfnJuz0FQf40AC314VGApJfg2OPoPW6v4dAL3qzOx5PUzeUlTewT'.
-'hiFQKn+WVeCE5Ofbww/nr48O9/Mt0NpxNGgsVQGfHKrNHYf9fhnu/at9VXziWEDzTIHb2X938rFIP+JYaqoC+WoHOm+nAAqQeJKS'.
-'Arb5+gT6CqAeKTDY6JpKdLALzk92T1SmJcDP/8fnv3z+p8///Ot/0j7/4+f/S/v8v37+y6//y+d/+PxPGnz63z//Z+3zvwDEv3z+'.
-'r5//UUW3t31UwofoOPs/ahneYq79j/l8kGt/Who3W4d77/cPzunglxyZYJCVwd4d7f60ebKj0CgOr1x/WoY83v1zHuExKIsy2HaG'.
-'TYzAEcpP7KI50Gsq9HYlWElmoIipaMzO0e7htiqNp6MKsP0dcL+3c3wx1TjevaLZOSGAbDnAY2+q6HNSpE9VU7YO3x+cHH1UlSCg'.
-'i6e/udG7B1uHWVcD2O4QdE4F4Kv3H4/zFXQrOWd7r8Dp231VBh1+OEC7syjEtoWirADNCWcA3UutRaEXjk9guJYE7RHPA1VVEI9K'.
-'rSg7qOo/suXUVo/B4kiq6Pj6MFc+nog5D1/90SOqIc45zS20XmOwTW+S3Ae1RlBvaQ5hPtQ6QW0Jc6I/1eKHSn+uVlLzprQnvwy+'.
-'uXWye3igcjgf4FQCPNpXB3eKujy0918dwuPh+3evPqqKO44mI6hGCfTVx+1NhTUBtOVOkwqwDzs7P6pdeR0EF1Vw+8Aeb48zuEE0'.
-'HHcF4NbbzaMTAVnidDQupcVXAV+SL6T3QKmGUnKo0PeNtyJcJmYknHYV9Seyu/KVBlbND09w2LMhX0KdQqeo54GTt5PCp67OPPD1'.
-'2naefOs1Les5FbK+XyA09UgFgY929nNwozi4CqMJOO7VGZ4XEXfdfntlCl50GXbtYwF2TUNAWV0m7u7xu73Nj+cgy/ePC/0M4nyg'.
-'GM7bO3sFES37I8ABKizJzVcABuLq9S546WoW5LY40KbRBFwY8XDtDsfo7bcIA3ohibCLN6rQCcH5RSjFpLqWpD7+XLRgO23tnMvZ'.
-'BcR9H+IJq3fiESmZWBbnilDlCKPe2X5QJA==';
-$fp = fopen('data://text/plain;base64,' . $data, 'r');
-stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
-var_dump(fread($fp,1));
-var_dump(fread($fp,1));
-fclose($fp);
-echo "Done.\n";
---EXPECT--
-string(0) ""
-string(0) ""
-Done.
+--TEST-- +Bug #52944 (segfault with zlib filter and corrupted data) +--SKIPIF-- +<?php if (!extension_loaded("zlib")) print "skip"; ?> +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip not for windows"); +} +if (PHP_OS == 'Darwin') { + die("skip not for Darwin"); +} +--INI-- +allow_url_fopen=1 +--FILE-- +<?php +require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; + +$fp = fopen('data://text/plain;base64,' . $data, 'r'); +stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); +var_dump(fread($fp,1)); +var_dump(fread($fp,1)); +fclose($fp); +echo "Done.\n"; +--EXPECT-- +string(0) "" +string(0) "" +Done. diff --git a/ext/zlib/tests/bug_52944_corrupted_data.inc b/ext/zlib/tests/bug_52944_corrupted_data.inc new file mode 100644 index 0000000000..ed46a36a1f --- /dev/null +++ b/ext/zlib/tests/bug_52944_corrupted_data.inc @@ -0,0 +1,142 @@ +<?php + +// corrupted data +$data = +'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'. +'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'. +'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'. +'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'. +'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'. +'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'. +'NV7mx3AovW/veYYnlUfNlF1TNysBvNPrs5V6ClWzREIaxqSGPIK+EoQEeqBvCarbQHOQnolOl/jMrmXPMBWbIDRkzJPVo3kCD3Us'. +'NRXjK+Ad8/fMLPiqY7+CulD4Vc/pga9nIEdhGDsx1qvT4Aw9rpW6rGtv5tqvcnMLWCNgtbu7BZ25GYiGMwiStZFNs0jY+uxVFrcG'. +'rOVt+PaYWLhRRxt3rOCm2E/BUUA75CBa7wmWkSkXFyV7bsA/9NU5TPSC8jU9p/fSqS0u9l44323oNb1h6KfYl1mvAYIzNUX0Csfp'. +'pozkYa12FecgDSsD86KHnATUwz8uzu3jbL5Bkb9UyUtMjL30feyC0oVBYY/DcR8DYdAnbI1FcItMFuAcIkNLx7498TGqFlN49v/K'. +'5TdaEbZPfKhWMwvZw5SKGjMvAGm6xBrEIRtYsmfRcY0NfA5ogzyuzS2nO9sCMcVkMlxTpc03vuJcSkv9T4aZkYktzv5j3FUIf9Eu'. +'EVuPX9ZM2dBAEEEAmEzVXRcbdmMfGoEF0hn+ufCvjZoGXMbSLKGXRkIhYEcJFHzrGphvw7M/YAd1MT/q4b1weBHE7+N+ge1EyDGK'. +'vT/q0GzHs65w1UpMcFyhKRUsLtZfOj1gG3MMrfijvnyV7gJ6DOJTfsQwogzOuESkGzr2vt7AB5ltDDDgs1YBLCP2Hs4ep/INGvDn'. +'0gS4x7TeREJvQoEvnXoNF2AxzeJZadBG9nsfE1DhTWy/BU0CvZ/t/8VxK1No7y8OsiarJz7+Z4eP7zN0XqDFE2fBdgcLzaFdGau4'. +'eCY+NT0bWZiQ9RJ8xXipdAO0oplw23O6CXo1DvAcC7C0VnHjT9+dnveSDURCDL+J058ivgw1MKpyUank1fTE7eD+MYNOtKepW3EM'. +'5BaeogscRezzQwX74AjxOVQW7QYa4BPofdJVOrFAYE2dq42rbINe19qxXjuXQquNl2liaVckfFge4ywTvwxcfNuyttEveIsC5Efh'. +'t/0A5I1okwDIHgrUs3fN2x3Q79uewcOW4/dgcJII2THNt84OUqH5dlnqMzEPzLrjLQi4S+MtVgp6vWcf+ZBE33o8admzR8jNW06P'. +'QldnMQigV9BkjL7s2W0fRg+kbGLKAf78yTVnjHqLJv5Qjv0IeEDy4yPGq0JBW+BDvsVZShTCaCWReUxyexvGUy8LRxw72zipLkfM'. +'a5oI2gU7/g1j8VDFlbFspQbEOJs7RdSJJDjP95E1IHKcjuHLG4xcDeh/dWXyLkXf/JFL2QJcW2nE5NXi4hT+b7e6jjOGiqHNMbWT'. +'sLVBvw1MQLgf8dt69bepfRWCHfyDIx4Z+RYGUv6AqwxbGGD5A8YzzGY9+71nbKlzi0glZwx/ABx/NvCnUYMEyJXuvXns4PsG/jQ6'. +'9kcfPq8j/DqmrZ9xXXoYSLidm1i1f/LA7BI807Pf4oZPYI19F9WRQRAtZJMeRRzCn8DnwMM9PzepeCNEb883OvT9HP0ovLO8UkY9'. +'/oSSaM+n4dt20Kigx0lBgiPHgQFn4nAVc8ufSMdg4i0Z5mg0oDjD7s0saDFcEhehwEJntB2onT2hGTAXAx8MKgAVNU21E8wQNYXQ'. +'NFf40yNVQga+Z0+xrAmk7oMUQWOfM/2ZTX758olZiaMm33pQ/X1BtvOrMAnHeJiBSheFXMKD94DNU2mkmsvE3AGrJtVcB2n/4inK'. +'jwAZCUviQzNQgOMJojl7IF8e6YyJidrAa1HrParr/hwJifakm3TB5m8GqSGxuFhz2Nv4I4tpcyMhr4FeaN2ikWvSsZuGlgZCVWHF'. +'Np2AKxTgEbXkY+6FyRivfDWrEnEbI0h5C9WhRdKUIws1Ah6PXb/LjqrO8bUMac6wX7iXoKV/qlgtU/vKMP8GXcQaGMxdF4PtMdNP'. +'ZfKg8U56sg92RdJk2/hHYYCN5zp4Y3bwxvRIDt4rezRJujhIQWXMspk1tCIWF4Fj37holt/deS/w2ZSTfD2cxMJZPbDZ0OYnSf04'. +'AG019g+HdEw8gKmvDnh0/LSRPjWAIn4zfc2aeSUXcBYeU1jd2I1B897dKS8OKHsMHdJLqeNoVE7kY6f05tQBMfvYtSMfCsHh2TKu'. +'LJozmKY8Pt2g/m3wGcJKGzaKCYCjQaYqLY9ja5xckLecwnjndoKrMLh2ChaskC6FQQLdYmK3k6T6hmzudB5gliE9wbMKq0ZO2+Kd'. +'frgGaU2bFYOwh4YbGc/Zhj9Itfsuumm46+8WuYgSemdNDMUOrLF9bIiF1SvIcfVibPsEfwXwEgRSrs4IkLhpCoDTFzjumlOAIgv7'. +'dHqWGtnCI+BW4UFq1KaFKnGAPM8tcjzFDns13W1tFBMMjlEFXCANwEPGsKQoHiwupo+2BNgoJzXw8Jci0Ug780lYtzhDwyI4bF6x'. +'tqUz//T3J/sNHcfVGwcG5Bv26+FhQ7/TQV2+UfYjXUmH+PYKvF9nYOAfXIFs05MF0GZuD+I1bxzCPYYAjX94gfYEikCDHljmHIQW'. +'UdBAG97qgZKGn3X8eYo/z/DnOf58iz/fnZmpI6Hv5tHsjoPB/VhMZvm0zJxnI7sKbVamF/wDJ7XXkHRLpV/PHnqUZUHNI1FjPSox'. +'M2fsNKtw7xDv3pBTh3Jpx8SUjDoe7Ssr/t9s7tgDz8hKkEz5kxsXB26mjTbLQ5gd0ryBQfK6DbLuACweipYkhxgdULB45bjEIYlj'. +'hFzVsQOI9LI/eo5Cvzx90cFAgZLOlXo0DtD6ybmilDPD+Gr6DgT5PLw4dFw+wKZQgkwvoxcfLGV8/5ybY+ZeR4R9OdUvJqZS+MKc'. +'s5i2khnoq5qlU1GEomn7cvac2y5zlAvJ5ekoBXEmmg4vFCRqJWfSDU8FLZagAgvcApwcX4zNnW+3KWE2YAQKUg1bPxdm05UZpCod'. +'QOJfTouMHbo2uDhDcozKx1ymCZKK+RG2g1QRLvx2xHWCOiqI77EHF3INCaEsyzUz/VZsDo99btQVL3dOHTSHKdSbBiP8BunIxD/Q'. +'kVOlT56ZzWmO6pBwBb6UZL5nVh1s0o0rPqys8GkNel/5BI5a7+5OBVgHLswDjCWAKA3QjzMQmuDJdZ4xFcc9XYlZf0GhqxmZKhXj'. +'oLpb2QyUXsI4reNzqEBAwoCl1JXT28ixWewzk2fHsDUVeVTikTHNoQn+mMMZ1hXzRpybchWrwo89E5V7YBNqMbVKXjKa6zlzsufk'. +'3oVshy4QS3Y9MPPSWuvCHpWGY1C0GsnGl0s+DtMkVYZBwZokYHiw02MjvySnMDkpMz/PzY/0ifyikqkgDvhBfOcL9CYY5bY/jvvi'. +'0e1jIum7gPac24Oohaeixwlae4FNHGYihuxDmm5vHR6cHB3une9vHv+I6Kpgjt/uvj65F2Jzj7/nJomR+3jKD6fL8tO4vMaEMSSt'. +'qrMG7I40BA458LMgpdHs7Nht3v3l2z5ZEqYieUvZsMg270hz7W51oW03NT86wygOKgqXRQeupQr6efBYaiBLDapLDYqlHoHOLpfY'. +'qSwxB0tklaW15xDWlV1D20regqPt5Dtm5Dke7kiQcFviiCUS7AXYS7cA2w+BHXaH7agAmLjOQgbZqYZUqpmk1dxKpxmK9WQGSt0H'. +'tjq2g344KEC+ySAZGy7LRpNxAezay+C2g3Hgj2kvUAFqoja5MwdSacnEzeM8wUWYAs5xJc4CpIJznOLcA4HSfxO2K+iz7YrmdOaB'. +'KRi38xiPg/gqiPcL00gA5qRdfRQMonEwH7CeQ1iCXiiAr9E5dNU8uy2bgflDPygWVwCEMo/p9PojsEkKROm6WR8f8ynS1cxwojAD'. +'jRQ2cAtQu3n2J8DNod+NioAjtzyoUCoWbckOnmzmqVBbfJpZGTAoAO62yjDtAsw+nXxWhusU4A4OyzDdAswxnY5WhgsLcCdBXFFi'. +'zwOBkGtnVf0vvIyHN30/mgzHlVNpbyXQT7yZsAJIHB+AgBetQjGvMKaPji3BZ4IZFGF+FFXpFz+8UVjqSMR0HIrT5ApW8FTg2PQr'. +'WzH1ZIgLNqVkSKexLqj0RCSMcioojOCFcTzVeEOD2wkEAs3RijgN/f3mSv15vfb06fOVNfCAFfDC1BXYlzONN8hBk/Dy861WFgiz'. +'FTu4UpY7BrK5NYLExKnrzT8sbLXEUduODm2ntdo0ydwaoRviC0h6wcXqqjsHP0XD4LDdBhLTgfxi/+BjB6wzgabNaPCkCblpNb/L'. +'TsD1Ujg2IA2xB/Gxo97KwLDXeJxC7rDERTxU6g8L+fMa9UVcRTdKhzZulFIaImUU3gR9SjGZSNdxCO3VX4SDjoYrmEvixGc8xnIM'. +'OmQV/myETn396fPaYsepLd44a/oy1HIrhuroi7hsL1bTAZsMLaI1/ewLhyylRig7BACCp2sA/vMR4VrSvChuAeMt1Za061Bf1lt4'. +'xn19SesG8IItxrfVlzrWHSh57Cyl9ZYnVcd2iLVONibfrj99Wlsc1RaHSwU+gazbGSuF2ymnhHhiG/FKmmiGx8vO0qJfxxPt+bm1'. +'9FtJ/ocFaPR1oWuXFrtLy7l+xZJOHKiCJKfYO/AteCBvnSpiZgB/WDCMcNcJT9IjZZdWl0xgMgwBMRDtSe5w9nDXNBsiBwcvCDYP'. +'Tx474dsSLJOgvSS7tqqWZkqqOIN7y3QXDAefl3TZ33pN14gWjl7XNaYBPa6+pPPxxTWEssfwnjy3NTVS+fQNEPbR7aPVJ397sLm/'. +'g+79uzgYgL6xewnen4LX8y39ccRp50nXBfqdAxmXTDx3lm/aePRodRVd2+NBkr6TPIvpvhdHWyIl8GyJvmU4z9n6A1TsJSriFYEe'. +'JV1QzJTyIRzKq0i5gEczU+JhJLJq8hrcaoz0NUMploYeyf80BMphPoc+HITjuQj/wBcYprUYdUHmnUOX4iWyg9F4KgjyCLjiG0Mn'. +'lAwjIlZNnI42sFtGfRc4YPX072or35+tdiy8GEEex//Y0epreM/K43uRCCbkqs2rVu56xQ4OHfUi5KUYJWnzXgx4g5+x9Pk///rv'. +'Pv+3z//l8z/8+u9+/ftf/8Pnf9A+/wsk/QWS/vHzP//695//n8//7dd//+t/+PXvNUj6LwD7f37+i4apn/9vzPT5L3iJKfSxpNGj'. +'XIAtd3OJwHGAK3Z0h6mat9RfeB+KobfChDSJbvHtsxlwG1p+jqd6S9glunATWm8pkAyOCu2H48MDQ1/FbJgLhsdIt7ja8N9t+vRo'. +'KRkkshqNuqUpX9ROW2rIKudSRVdaSq5eAmOkgCketpYaWk40p19nVnbdQnZHKh63mnGGXqKnnhvQFQRlvtnMk1VC434eKMBGc0PS'. +'4q/nv3sZMC0vz0PiKhNZoeiCbsh4JJuN19AMEj4nNt/gL6ov1U6prag/ixClmCIeXVRaf+G91JdFzZb1F6veS9ytlGsBISD2RE5C'. +'ZquEqJACxfboSg+WPksKkUGR0uhRlYrEC0QkqMw+E+RWeG0mcK+uziGlvHj3OBoEJ9AF+THMglcIXxvUwygGnXjuTabn3ni+lhi5'. +'U1x4ovt++cphHs5hykdYxjt3ihJfliQ0Efym/5dKiW8TSs7duSWibvv5o1JglBm5go8kknDYRjTAKrdLYPbCmP35I85OLq/VQMD3'. +'g/aYk/BpNje/2vklGSmyfZNdt+NFrem8upMeqqrfEoxpUEHTJbpiZskDBrhYMudUSOUkZctDnrj4T8MfSIHfNCQ5r9Yjr0dVo2nw'. +'aOTAe0pPpJS2oq3Xak0BgXQCwkMbmE9NNgQNc3XNXFl7/gzhkHuQBMIkSOnPxhHK3cwa4jSQt9oSIYLeKKEmvixbGmwEqV0Lv1mn'. +'Uk2ZFuUKZR06D28GMVNIV7BfwuRdOCTqzUPDHVVZh6wP77dfcoBzjQ++SwrZiyuFOKX4wtubgeJgHNpBu43n2OijST8BZ1HHy3HH'. +'4ComjXVtZmnPcMsFtvkR3oZId/6xAau939V2KG+i1e1v7bX5NyF/r22+P3l7eHRsj28gUfg2fMPuJOSQUjzQ/OFrkQ34Wdnb3do5'. +'ON5BZJxDXpZswE/ua3p9cnaJoigc+C2xszt+V9/vrorGrOavKWTyJHd3hjqB0JLpzq04d6mhExF0K3GvguzyhY7V5SgRHCptvETn'. +'RVfefNWmEyzaRve0ffbYceiGQZy5wuUoPfBtvHfB7QQ2eJUAYXUwQjYZT/vBKb5TBIEFuhOg/roCccBwCfPKNqksEAA4ZZiV1bY6'. +'vMbtOPo46uBh+3iActsOE0NvAJO2giEGSOPI0Rs6cm168HVnZoEJ98pNgn44LNaftmRa7WZyHdK5TxhYcesDrI7rSQ3cJchXXlHa'. +'AAqCojHZfqZ+8KLxOBrgh7pIlpemhg7iXO2mNzXIguqyIBQWeqOdLwmYaQzjC5PzJRG7Y3qxoDYdwgkFkeQSjb+9abStaSMEmvKK'. +'74cY9XCsUJbo2hYLXzBKkaL2JFwRbLdyzTkwVFyqnxR4RieROrdUZKNtw8gK4g8kOcmOtrjR8stbFrj8SW+D7YktIa4Qb3SMLJZo'. +'LL1ohVcg81w8PauiOhrxp6O3o+F4Be8obNRrtb9peq5/0aGNXQ0KEeKaNtlhbuA+lObAjTvhsFFrjsCUAwe9UdNfvliF0tBplkeL'. +'yxbyUXZUw1GUhLTvzHRwKyNYSL6OgdSkBeTHhg42Nd16rM/weLv5HzkWWR6ETCXQEibNoiQH7oExwmOhdqEWoVXHTUW4W5Y2ic34'. +'YiqRi/inKltXZOvKbMW6lhpmQQ0aoYUYG13rEx2NIKE+rdDECHRRqqDmN48Q1RhRDdrKJWcbMHooT9C0/n35UXrSH0LgwHa6Z6dN'. +'EoXWnETDMxkAgx/lQNfp3t3dzujODxiekCpBLnD9fjIMxw7Jr/fwZPSI3JgIY/tlDbLjYfvi/Ul7mZ4wfFu9AcodhgMYgeQ8NJSt'. +'lKFFRbAUlftaL4DHJIy+cdEwehu9BolR5tFODlJsrAU4vn9dmmUYBUntKcTpXeJueXyInBabseI43Ei4zjS4dDx2i2b1RFEjKIpv'. +'ANfxCKcR0gNN+Rkd4cdy2byNMBiYXaQ0caMrXClHJjW66EmlrzM+2xXIfzNGN+F2ZmU2rRBxP4XB9UZVIrroeNcXyJjWMdbc4Bsc'. +'kBYNPvtzEiOH0EfeNUfFY2VTf45TuC1cWfyseoBp+ox3c/8b1DZfnaoKK+2RtZVKmjadD9Tt04PTGPRzxmmLi5iyuBins6D6fvRJ'. +'py1/uVRxKaP4wGj6lNWI7QGtPqzSlO5qCFxkPC4lLi4+LogrRMISCz4afVuKlceptAVEWXImhAFVih4lzh0InzvWyHekLlcR5+0l'. +'HsOAheABymIw4olaVsfKb18UtGmpHqUcEeoIqAQ41cWg0M8wnutBmBHrgSo4ayQ6l/o+hbiPXyVQNdeiYKVrN0aj/pS5DnQhMShd'. +'+DTDACDlMicgjDyqH22LxUX8BSN2iJfG+GC3OQ6fTbmBHxp8AgcKcAw5CZy20FPVeR/n8hqh3ZrENOuwkT028JRxs9mFkda+Qc9w'. +'o9YQvdN1nHTn/0a3QQDJKAhayWn37O5OebfPxeATyh3cALffR0MB+KkF+uV1qg3QKOOamuVva/xtrerbOn+DP0L2nqLVB7zVtXpn'. +'M6jMMBUV56g8G5SET9Y5Gqv8jk/W+bkQkJTEz9a57HVOlW/WudLR/ElJsAQm5auSYLFCVXUhaELlMJTU8zjtnG2oL0Q/Zp/bQTDu'. +'Rq1GxxL3GjfaqEattAO7liQ2GKEmqSdQxkiBwpbhlBGBbkBf9TXPcfJ4B2PVSPrR9d0wigdu/67tJmNz1bTH4KbkcpuZoUDCleg/'. +'ZwjQUMwpT2q0Cu1nyC12N9BlsagT/82ahKX/Tk0i14maJNjwv1+jisMq9zUNH1RTQQR4UdQP3KFeJIng/d+JKtLnRLqkQzE3ckK0'. +'IqW9mQ0XW7X6VPSnt4CnAb4pZT0Tmj8d57hpzlIH919ZGKMql6cqCixSlRjzijSkhmw/VjtgcbFtflFdBGOV6qKUTapnZg2ieNRV'. +'ZwG6oKx7VTLqATp3BS0b4AoQhjPAzq54oa15NqIKzOEhS3gDOd+FbXO24qAZbdPq8tWBZIaf6nSLwAivq/sbfAALIDM+enimCgXy'. +'SzPrwiTnwjklI+k1usjQS9ZF3rOA5xR/5v9uoaEFZbDr+4rMoXzaHthK+ZQjtJbySSfRSCb44i/48jiTwslK/clcYMU7DkZ4jFfm'. +'5fBskI0WW+A42Ch8jsdOAKlBPxjglRfwNGw5nkF/zRl/EBNReChY3PEMffmU71Nxb4z0YpXUhoSsYB8+YQwgIFZEMSRflrMXtDOt'. +'tWfPTAv+fjG+eoavruKr/0Z8axm+NRXfWg6f3Jts6eayburY3amN5hnisBg6v7IDNkheCNMldJjK9rrjrGfBd2QOOqtA1F+MX6BO'. +'p7j2fFu31mcmvFpflPSLuQqGTYB7fCXi07SxbUkYJWWtlLJOKWeVtVk2Nhq/2Pxobpi//E2uFl//dW51eWhhhc0na/azZ1Yuda0y'. +'dV2kyqr/0Th1V9qbK6+JQmsz86H3B0n3vES65yXSPTcryzfnvzxQ7HJ12cvVFVgu1gI60P3FqFma+H8FyTXXVubm0mvDT1uQHA4A'. +'MH9D9Fl2oA0IC+mSdJqt6LaDN5hP4q3jY/pAYwDcRfAI8Y9SiI4ewRCcEjoHoovCrTVFm4EP1Ws7JcE545N7uk5XzC4dQO7sABFU'. +'lhzbd+teTtzGaQ2HK/47s9xPkzhonK49VdK8IOxQGrzjvzWQQV4fzWLICf/Dt0nAL5whjq6HjdP682fW0zX4/5nlT91hrpyWG19k'. +'uerr33OShIOELLETB1PEBkn8L00OGLhGlcC0i657EQLsdwD33Tp8+ZbT8Y6j4RiaioiV8iK8r1Ug+u4ZwltPRZYIeoCaDVWuP01L'. +'iGIfzExA9GzdegYNqj3l9DhoSewCMnH7A/AiTtfWoSIAWl9b4w9XIVgdY4B++h1dvFBHPeR3k9Dl0gQVO1G/xQlr9WeINGvw2nf4'. +'Dpo27ESN02+fUZMgRTSfem+9htU+s/qoF5nU9W/XAddz/CbSmd5ra0+znqF0UVT9KXxY/w4QPc0+QF9AnS3xT6SPwuGFoNV3a1b9'. +'+3WRPg0wSlk0A/+tEaZBILkBapJ2jtL4gRtHSDxqKgIN3aupYJa1784s6jj+LKiR66/nhFip1Pdr0FVQqdEkHvUDiZdQpd2RJVFn'. +'cm0ATRL2r4IYAL5fs8S/MwuG2DhQ2oWVLjYW8irjOA/M07VJOOzYPTDmhigOxDu9NtMJOplu3baCdkOHl+BwMv7TBLf/E2huWQjs'. +'0oKRSZlPU+yA5EwBnFmIcHeI+O5D1APFv+qE5pPucpvziErcl2klzWV0V9ZMmXN3eF9eEISUaXXNfFHPyl9de9KlwlPckGIYKytd'. +'gX2lrhSwNfFC/8vak2vRl+RDwboaQnGUt55v1nwE97ZLbRk3rLvirHEJKuGAavH4S9tV7Kv7c64Um/aku1Iv9dkcHA80rqLj0vY9'. +'ybPGnybh8CtaWGjjw3kLTSz34HwkDzbynl4s9eRxcUG33B1kg/tRAoWGT9gif7cLhZvLPaXRDyESeGDwl/Go7X64QtiitE4CzRPA'. +'mR96Ozej6B48QH/woTbaDVGvUXRtgEytYa9it5hK074AVQiolnuAzFhR0K0APqxYsW/nIkQPj3y7dNmNU7LmQymz+QxQbIpoiMoL'. +'xfqh5MpxxFYY+w8NUO7Ky3hs1FfkMFDJjxLoATSSHySSdDgUBNk8NNVEULhDYO6mNVOpkC+bR0e+m3bwZPu8DMWFzoE8Sr7n1O1v'. +'a/Vn3zX5Op9ak6fqB7SMXOpEI1x1+qbj1JWeHPC5/3g6e/9JzV6nzn5BVXM9vEQEJy4G8hDG1afZeje+GqK73+2a/ICK1RisdtNF'. +'W2hZkSPCFaiBmQ1FI3zSX+mB6sqQrV7kmf9/fDrkqIA8Hz5IgeVBfsD+KxABGNcBvptDBgPo8KRuPzN/N2JgTdSRUrOfPflrGGQe'. +'cb8QBXT0M5XKr9CTKwz0i3SoAw3TnUoYxSHILStxQcq4hyoOisNbJ7orocrFfy12kk89VteyhOWyYP9txQhR1suLsguUU10qDyjo'. +'GMAMa89MUzZO6YKLnI6vAMeaqiL+FTjp/v3aeiW11CUFKQ8y/krXqhGwSt/5GKWgNl8Y9dU1+9tnpmoHfWs/e772DM0SREe8TAxv'. +'rM2FxZZi8wQANK+GD4Xs6fc5CNbstRyG79cVHPOyPC/k+e6pyIUhdxkX3EuM7gvUWUXPyFZ7BnM8WRNUpoGS9vXcboEMK6GapScy'. +'4qK0wQGSvHltdbULPjH5xQ18z0Jb6GQ/uRyQAuU2dKpT+5eTYBIUA2MCx+UVdKvlqJPpdMEzzomXptejkeuH46l+JoRmVgURxGgE'. +'lmeL1VFaF7+7E+uGTT52PftKE+zw+Y9t+O/773UR6RNwAFaxbDwzKC3LvcKCWnhKkQjO4ly3hTY0+Cxmq4Cs4c+4Om3ntvipQ8v6'. +'YMeJtcHbti0a7dRmQRpJ0bZuiaR8Zkq2Auylq/kWd34ja7Bwyv0IN3+Pi2uNSpGBCESeZU0W8ajcagFNdKV7JPhCR3uQhIG4Y5qW'. +'EZSNLKE3wQ2c7bCPgZakYbw0MsC8zZ7nLSHarYB5SIZOFBh1XgjzOw5//v9XKLNoVJpjO8DdHkkDXx7JLvOhv+xeIsKe54xcER3+'. +'deO2JcetGDLlUdi6dxS2lVFIIel3d8/Sc1zSwJTscXWt4VZEmKyuNUWQshwqKyszuu4oF6eMq2Q0pKXwsGq4hCcGbisdUrfie6MO'. +'8tkqDhuz2XbaK2tpdJcPhpv/ot30Mfa6AkmtEsmXFjbLN+xL8auhVS25m+Brh5oMlv29G1WI+/raOrUEL+rtGz3fzkwyYHcqb6qQ'. +'ONp5c76/c8w3/eI6He2zEKl4uK++2e9r7TDotxItBhxxGLR0BWQNQN65SXIdxQDRioZLY43C4FSgdQTqo77VXJyRJqmQ8LEcGki+'. +'QaJCPwXovagTDrUw0cLhldsPc0U+g+87AzfsF77/YeH1zs52RXNkclV7wpjbk8Ksqdiv42jYYdx/WHh3dPh6d2+nogDlC5UxlyAq'. +'IBb0+uSd1pdNpcIsbV2ju3i1QQj8MxkUs61XZrO1owADcP0xSF7KL2v9anP7/Hhn82jrraN/jCaa72KNwIJuaa5GO2w0jtzVrsNx'. +'F2Q5COWpNnJjdwDaME7sF178Ev+9A2WXaC9cjY4HXFrlg71xG+rSSyDqi1X3paWNI4GaqNwPRDXev9s7hHq8PjzaP9/df+Poq8lq'. +'OOisnuPdyKvBcJV1pd0J25xh5/z4ZPPk/fGrzaPz7Z3Xm+/3Tk52fj7hfX6OtnQc9ANqazvqY1C9top7u9Vcx5s/7ZxneSjXm2Cs'. +'4emFVbAnh4d7J7vvOIuApRZQjqSY5Wjn9VER/VHQBhp1IUMyroIvFiHhZTHlXFCx3YM3spxH1HL3Co1X2y7CnhyebO4hmxwLeAA+'. +'icau6IiGxhk2f9j8+fzD5m5a8ew/yLAVDYdAWChBgT7eOdiuhD4G9YqcQ3szZY32j9+c7xwdaVpllp04jmIt8v0JDLzHWY7jo5/O'. +'63MKweN/xIWFZFfEgR91huEneAH6jUCWBoIY2OeHP84p+jWRGa3UlpZM6E709qTfnyq1qM4rCNMBtTvpk+pNHucKXKvOsykHwf2F'. +'YtPXKhGcgJgEBu9HuDqkBRnpgHYamAGYiqKUC2lF13SYNJq3eezr1dhxSasNpL12k+EvIBSkCaz2y+bJyRyKgP0KWghjo/OFPeW9'. +'uI8eKZ0HYmoydKn1odcPNKV+rw/3tneOKvuLhnaSgR4cahI3IT+Ism8fd45z3z4GSa6L1ufzBPfOkpA7b452t2G04mEU5ziacuBH'. +'Ad5BwvRm9AT+ZufkfG/34McidilvEokcgc7fH+1V1gXSGSdBvT3Z36uConRAmiiwIFff71dSEKzKKJ4M0goIWXrOcuLdztH5u803'. +'Owxer2Ut2t59t4d0LQ3GLvMic9xtbaataLf1mRa1tdu12VIZwfnJuz0FQf40AC314VGApJfg2OPoPW6v4dAL3qzOx5PUzeUlTewT'. +'hiFQKn+WVeCE5Ofbww/nr48O9/Mt0NpxNGgsVQGfHKrNHYf9fhnu/at9VXziWEDzTIHb2X938rFIP+JYaqoC+WoHOm+nAAqQeJKS'. +'Arb5+gT6CqAeKTDY6JpKdLALzk92T1SmJcDP/8fnv3z+p8///Ot/0j7/4+f/S/v8v37+y6//y+d/+PxPGnz63z//Z+3zvwDEv3z+'. +'r5//UUW3t31UwofoOPs/ahneYq79j/l8kGt/Who3W4d77/cPzunglxyZYJCVwd4d7f60ebKj0CgOr1x/WoY83v1zHuExKIsy2HaG'. +'TYzAEcpP7KI50Gsq9HYlWElmoIipaMzO0e7htiqNp6MKsP0dcL+3c3wx1TjevaLZOSGAbDnAY2+q6HNSpE9VU7YO3x+cHH1UlSCg'. +'i6e/udG7B1uHWVcD2O4QdE4F4Kv3H4/zFXQrOWd7r8Dp231VBh1+OEC7syjEtoWirADNCWcA3UutRaEXjk9guJYE7RHPA1VVEI9K'. +'rSg7qOo/suXUVo/B4kiq6Pj6MFc+nog5D1/90SOqIc45zS20XmOwTW+S3Ae1RlBvaQ5hPtQ6QW0Jc6I/1eKHSn+uVlLzprQnvwy+'. +'uXWye3igcjgf4FQCPNpXB3eKujy0918dwuPh+3evPqqKO44mI6hGCfTVx+1NhTUBtOVOkwqwDzs7P6pdeR0EF1Vw+8Aeb48zuEE0'. +'HHcF4NbbzaMTAVnidDQupcVXAV+SL6T3QKmGUnKo0PeNtyJcJmYknHYV9Seyu/KVBlbND09w2LMhX0KdQqeo54GTt5PCp67OPPD1'. +'2naefOs1Les5FbK+XyA09UgFgY929nNwozi4CqMJOO7VGZ4XEXfdfntlCl50GXbtYwF2TUNAWV0m7u7xu73Nj+cgy/ePC/0M4nyg'. +'GM7bO3sFES37I8ABKizJzVcABuLq9S546WoW5LY40KbRBFwY8XDtDsfo7bcIA3ohibCLN6rQCcH5RSjFpLqWpD7+XLRgO23tnMvZ'. +'BcR9H+IJq3fiESmZWBbnilDlCKPe2X5QJA=='; diff --git a/ext/zlib/tests/func.inc b/ext/zlib/tests/func.inc new file mode 100644 index 0000000000..0a422cab78 --- /dev/null +++ b/ext/zlib/tests/func.inc @@ -0,0 +1,17 @@ +<?php + +function get_zlib_version() +{ + $version = NULL; + + ob_start(); + phpinfo(); + $info = ob_get_contents(); + ob_end_clean(); + if (preg_match(',zlib.*Compiled Version => (\d+\.\d+\.\d+),s', $info, $match)) { + $version = $match[1]; + } + + return $version; +} + diff --git a/ext/zlib/tests/gzgetc_basic.phpt b/ext/zlib/tests/gzgetc_basic.phpt index ca2e38c0ec..5c814e0d1a 100644 --- a/ext/zlib/tests/gzgetc_basic.phpt +++ b/ext/zlib/tests/gzgetc_basic.phpt @@ -1,10 +1,14 @@ --TEST-- -Test function gzgetc() by calling it with its expected arguments +Test function gzgetc() by calling it with its expected arguments zlib 1.2.5 --SKIPIF-- <?php if (!extension_loaded("zlib")) { print "skip - ZLIB extension not loaded"; } +include 'func.inc'; +if (version_compare(get_zlib_version(), '1.2.5') > 0) { + die('skip - only for zlib <= 1.2.5'); +} ?> --FILE-- <?php @@ -35,4 +39,4 @@ as it turns around and I know that it descends down on me characters counted=176 -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/zlib/tests/gzgetc_basic_1.phpt b/ext/zlib/tests/gzgetc_basic_1.phpt new file mode 100644 index 0000000000..59e3eb6233 --- /dev/null +++ b/ext/zlib/tests/gzgetc_basic_1.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function gzgetc() by calling it with its expected arguments zlib 1.2.7 +--SKIPIF-- +<?php +if (!extension_loaded("zlib")) { + print "skip - ZLIB extension not loaded"; +} +include 'func.inc'; +if (version_compare(get_zlib_version(), '1.2.7') < 0) { + die('skip - only for zlib >= 1.2.7'); +} +?> +--FILE-- +<?php + +// note that gzgets is an alias to fgets. parameter checking tests will be +// the same as gzgets + +$f = dirname(__FILE__)."/004.txt.gz"; +$h = gzopen($f, 'r'); +if ($h) { + $count = 0; + while (($c = fgetc( $h )) !== false) { + $count++; + echo $c; + } + + echo "\ncharacters counted=$count\n"; + gzclose($h); +} + +?> +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me + +characters counted=176 +===DONE=== diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index c6e2e0cf8b..7ff2b30c4c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -263,6 +263,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name ZLIBG(output_compression) = chunk_size ? chunk_size : PHP_OUTPUT_HANDLER_DEFAULT_SIZE; } + ZLIBG(handler_registered) = 1; + if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) { php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC); } @@ -690,6 +692,7 @@ PHP_ZLIB_ENCODE_FUNC(zlib_encode, 0); /* {{{ proto binary zlib_decode(binary data[, int max_decoded_len]) Uncompress any raw/gzip/zlib encoded data */ PHP_ZLIB_DECODE_FUNC(zlib_decode, PHP_ZLIB_ENCODING_ANY); +/* }}} */ /* NOTE: The naming of these userland functions was quite unlucky */ /* {{{ proto binary gzdeflate(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_RAW]) @@ -701,18 +704,22 @@ PHP_ZLIB_ENCODE_FUNC(gzdeflate, PHP_ZLIB_ENCODING_RAW); Encode data with the gzip encoding */ PHP_ZLIB_ENCODE_FUNC(gzencode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzcompress(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_DEFLATE]) Encode data with the zlib encoding */ PHP_ZLIB_ENCODE_FUNC(gzcompress, PHP_ZLIB_ENCODING_DEFLATE); /* }}} */ + /* {{{ proto binary gzinflate(binary data[, int max_decoded_len]) Decode raw deflate encoded data */ PHP_ZLIB_DECODE_FUNC(gzinflate, PHP_ZLIB_ENCODING_RAW); /* }}} */ + /* {{{ proto binary gzdecode(binary data[, int max_decoded_len]) Decode gzip encoded data */ PHP_ZLIB_DECODE_FUNC(gzdecode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzuncompress(binary data[, int max_decoded_len]) Decode zlib encoded data */ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE); @@ -890,6 +897,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression) status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + ZLIBG(output_compression) = ZLIBG(output_compression_default); if (stage == PHP_INI_STAGE_RUNTIME && int_value) { if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) { php_zlib_output_compression_start(TSRMLS_C); @@ -914,7 +922,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_handler) /* {{{ INI */ PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) + STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression_default, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdateLong, output_compression_level, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) PHP_INI_END() @@ -958,19 +966,24 @@ static PHP_MSHUTDOWN_FUNCTION(zlib) static PHP_RINIT_FUNCTION(zlib) { ZLIBG(compression_coding) = 0; - - php_zlib_output_compression_start(TSRMLS_C); + if (!ZLIBG(handler_registered)) { + ZLIBG(output_compression) = ZLIBG(output_compression_default); + php_zlib_output_compression_start(TSRMLS_C); + } return SUCCESS; } /* }}} */ +/* {{{ PHP_RSHUTDOWN_FUNCTION */ static PHP_RSHUTDOWN_FUNCTION(zlib) { php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); + ZLIBG(handler_registered) = 0; return SUCCESS; } +/* }}} */ /* {{{ PHP_MINFO_FUNCTION */ static PHP_MINFO_FUNCTION(zlib) @@ -991,6 +1004,7 @@ static PHP_MINFO_FUNCTION(zlib) static ZEND_MODULE_GLOBALS_CTOR_D(zlib) { zlib_globals->ob_gzhandler = NULL; + zlib_globals->handler_registered = 0; } /* }}} */ diff --git a/main/main.c b/main/main.c index c34f952433..44c61c6005 100644 --- a/main/main.c +++ b/main/main.c @@ -597,6 +597,7 @@ PHPAPI int php_get_module_initialized(void) { return module_initialized; } +/* }}} */ /* {{{ php_log_err */ @@ -627,7 +628,15 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) char *error_time_str; time(&error_time); - error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); +#ifdef ZTS + if (!php_during_module_startup()) { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); + } else { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); + } +#else + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); +#endif len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); @@ -1080,7 +1089,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR ) { #ifdef PHP_WIN32 - fprintf(stderr, "%s: %s in %s on line%d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); fflush(stderr); #else fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); diff --git a/main/output.c b/main/output.c index d4eaa6701d..e100057ca9 100644 --- a/main/output.c +++ b/main/output.c @@ -214,7 +214,7 @@ PHPAPI void php_output_register_constants(TSRMLS_D) * Used by SAPIs to disable output */ PHPAPI void php_output_set_status(int status TSRMLS_DC) { - OG(flags) = status & 0xf; + OG(flags) = (OG(flags) & ~0xf) | (status & 0xf); } /* }}} */ diff --git a/main/php_version.h b/main/php_version.h index 6b49f40864..0efdef14a5 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 5 +#define PHP_RELEASE_VERSION 8 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.4.5-dev" -#define PHP_VERSION_ID 50404 +#define PHP_VERSION "5.4.8-dev" +#define PHP_VERSION_ID 50408 diff --git a/main/snprintf.c b/main/snprintf.c index cd038d018c..bda110d339 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -94,7 +94,7 @@ static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, *decpt = 0; c = *p; zend_freedtoa(p); - return(c == 'I' ? "INF" : "NAN"); + return strdup((c == 'I' ? "INF" : "NAN")); } /* Make a local copy and adjust rve to be in terms of s */ if (pad && fmode) { diff --git a/main/streams/streams.c b/main/streams/streams.c index db6e25f687..e9c2e07320 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2332,8 +2332,8 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_ php_stream *stream; php_stream_dirent sdp; char **vector = NULL; - int vector_size = 0; - int nfiles = 0; + unsigned int vector_size = 0; + unsigned int nfiles = 0; if (!namelist) { return FAILURE; @@ -2349,14 +2349,24 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_ if (vector_size == 0) { vector_size = 10; } else { + if(vector_size*2 < vector_size) { + /* overflow */ + efree(vector); + return FAILURE; + } vector_size *= 2; } - vector = (char **) erealloc(vector, vector_size * sizeof(char *)); + vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0); } vector[nfiles] = estrdup(sdp.d_name); nfiles++; + if(vector_size < 10 || nfiles == 0) { + /* overflow */ + efree(vector); + return FAILURE; + } } php_stream_closedir(stream); diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 96a5195ed3..3b277160d6 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -281,43 +281,22 @@ typedef struct _php_userstream_data php_userstream_data_t; }}} **/ -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +static zval *user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context TSRMLS_DC) { - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; - zval **args[4]; - int call_result; - php_stream *stream = NULL; - zend_bool old_in_user_include; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; + zval *object; + /* create an instance of our class */ + ALLOC_ZVAL(object); + object_init_ex(object, uwrap->ce); + Z_SET_REFCOUNT_P(object, 1); + Z_SET_ISREF_P(object); - /* if the user stream was registered as local and we are in include context, - we add allow_url_include restrictions to allow_url_fopen ones */ - /* we need only is_url == 0 here since if is_url == 1 and remote wrappers - were restricted we wouldn't get here */ - old_in_user_include = PG(in_user_include); - if(uwrap->wrapper.is_url == 0 && - (options & STREAM_OPEN_FOR_INCLUDE) && - !PG(allow_url_include)) { - PG(in_user_include) = 1; + if (context) { + add_property_resource(object, "context", context->rsrc_id); + zend_list_addref(context->rsrc_id); + } else { + add_property_null(object, "context"); } - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - Z_SET_REFCOUNT_P(us->object, 1); - Z_SET_ISREF_P(us->object); - if (uwrap->ce->constructor) { zend_fcall_info fci; zend_fcall_info_cache fcc; @@ -327,7 +306,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena fci.function_table = &uwrap->ce->function_table; fci.function_name = NULL; fci.symbol_table = NULL; - fci.object_ptr = us->object; + fci.object_ptr = object; fci.retval_ptr_ptr = &retval_ptr; fci.param_count = 0; fci.params = NULL; @@ -336,16 +315,13 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena fcc.initialized = 1; fcc.function_handler = uwrap->ce->constructor; fcc.calling_scope = EG(scope); - fcc.called_scope = Z_OBJCE_P(us->object); - fcc.object_ptr = us->object; + fcc.called_scope = Z_OBJCE_P(object); + fcc.object_ptr = object; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name, uwrap->ce->constructor->common.function_name); - zval_dtor(us->object); - FREE_ZVAL(us->object); - efree(us); - FG(user_stream_current_filename) = NULL; - PG(in_user_include) = old_in_user_include; + zval_dtor(object); + FREE_ZVAL(object); return NULL; } else { if (retval_ptr) { @@ -353,12 +329,46 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena } } } + return object; +} - if (context) { - add_property_resource(us->object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(us->object, "context"); +static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +{ + struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; + php_userstream_data_t *us; + zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; + zval **args[4]; + int call_result; + php_stream *stream = NULL; + zend_bool old_in_user_include; + + /* Try to catch bad usage without preventing flexibility */ + if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); + return NULL; + } + FG(user_stream_current_filename) = filename; + + /* if the user stream was registered as local and we are in include context, + we add allow_url_include restrictions to allow_url_fopen ones */ + /* we need only is_url == 0 here since if is_url == 1 and remote wrappers + were restricted we wouldn't get here */ + old_in_user_include = PG(in_user_include); + if(uwrap->wrapper.is_url == 0 && + (options & STREAM_OPEN_FOR_INCLUDE) && + !PG(allow_url_include)) { + PG(in_user_include) = 1; + } + + us = emalloc(sizeof(*us)); + us->wrapper = uwrap; + + us->object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(us->object == NULL) { + FG(user_stream_current_filename) = NULL; + PG(in_user_include) = old_in_user_include; + efree(us); + return NULL; } /* call it's stream_open method - set up params first */ @@ -447,17 +457,11 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filen us = emalloc(sizeof(*us)); us->wrapper = uwrap; - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - Z_SET_REFCOUNT_P(us->object, 1); - Z_SET_ISREF_P(us->object); - - if (context) { - add_property_resource(us->object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(us->object, "context"); + us->object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(us == NULL) { + FG(user_stream_current_filename) = NULL; + efree(us); + return NULL; } /* call it's dir_open method - set up params first */ @@ -1157,16 +1161,9 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int optio int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the unlink method */ @@ -1211,16 +1208,9 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the rename method */ @@ -1270,16 +1260,9 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the mkdir method */ @@ -1335,16 +1318,9 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int option int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the rmdir method */ @@ -1420,16 +1396,10 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, char *url, int opt } /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + zval_ptr_dtor(&zvalue); + return ret; } /* call the mkdir method */ @@ -1484,16 +1454,9 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int fla int ret = -1; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call it's stat_url method - set up params first */ @@ -69,9 +69,6 @@ echo "" cd $DIR || exit 5 -# The full ChangeLog is available separately from lxr.php.net -rm -f ChangeLog* - # hide away our own versions of libtool-generated files for i in $LT_TARGETS; do if test -f "$i"; then diff --git a/netware/start.c b/netware/start.c index 43510fc22c..b842749257 100644 --- a/netware/start.c +++ b/netware/start.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/php.ini-development b/php.ini-development index 298cb06a72..4ff4192f6f 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1020,6 +1020,8 @@ mail.add_x_header = On ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. ;mail.log = +; Log mail to syslog (Event Log on NT, not valid in Windows 95). +;mail.log = syslog [SQL] ; http://php.net/sql.safe-mode diff --git a/php.ini-production b/php.ini-production index d4c1261fcd..814455bbbb 100644 --- a/php.ini-production +++ b/php.ini-production @@ -1020,6 +1020,8 @@ mail.add_x_header = On ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. ;mail.log = +; Log mail to syslog (Event Log on NT, not valid in Windows 95). +;mail.log = syslog [SQL] ; http://php.net/sql.safe-mode diff --git a/run-tests.php b/run-tests.php index 2b37ec4f4a..cfc562ebc1 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php /* +----------------------------------------------------------------------+ @@ -1478,8 +1478,10 @@ TEST $file if ($leak_check) { $env['USE_ZEND_ALLOC'] = '0'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 1; } else { $env['USE_ZEND_ALLOC'] = '1'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 0; } junit_start_timer($shortname); @@ -1746,6 +1748,7 @@ TEST $file if ($leak_check) { $env['USE_ZEND_ALLOC'] = '0'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 1; if ($valgrind_version >= 330) { /* valgrind 3.3.0+ doesn't have --log-file-exactly option */ @@ -1756,6 +1759,7 @@ TEST $file } else { $env['USE_ZEND_ALLOC'] = '1'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 0; } if ($DETAILED) echo " @@ -2089,8 +2093,10 @@ $output if (isset($old_php)) { $php = $old_php; } + + $diff = empty($diff) ? '' : "<![CDATA[\n " . preg_replace('/\e/', '<esc>', $diff) . "\n]]>"; - junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, "<![CDATA[\n " . preg_replace('/\e/', '<esc>', $diff) . "\n]]>"); + junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, $diff); return $restype[0] . 'ED'; } @@ -2666,12 +2672,15 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag $time = null !== $time ? $time : junit_get_timer($file_name); junit_suite_record($suite, 'execution_time', $time); + $escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8'); + $escaped_test_name = basename($file_name) . ' - ' . htmlspecialchars($test_name, ENT_QUOTES); $JUNIT['files'][$file_name]['xml'] = "<testcase classname='$suite' name='$escaped_test_name' time='$time'>\n"; if (is_array($type)) { $output_type = $type[0] . 'ED'; - $type = reset(array_intersect(array('XFAIL', 'FAIL'), $type)); + $temp = array_intersect(array('XFAIL', 'FAIL'), $type); + $type = reset($temp); } else { $output_type = $type . 'ED'; } @@ -2686,10 +2695,10 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag $JUNIT['files'][$file_name]['xml'] .= "<skipped>$message</skipped>\n"; } elseif('FAIL' == $type) { junit_suite_record($suite, 'test_fail'); - $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$message'>$details</failure>\n"; + $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$message'>$escaped_details</failure>\n"; } else { junit_suite_record($suite, 'test_error'); - $JUNIT['files'][$file_name]['xml'] .= "<error type='$output_type' message='$message'>$details</error>\n"; + $JUNIT['files'][$file_name]['xml'] .= "<error type='$output_type' message='$message'>$escaped_details</error>\n"; } $JUNIT['files'][$file_name]['xml'] .= "</testcase>\n"; diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index e8116f9eba..0b51cfbe62 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -311,7 +311,7 @@ php_apache_disable_caching(ap_filter_t *f) static double php_apache_sapi_get_request_time(TSRMLS_D) { php_struct *ctx = SG(server_context); - return apr_time_as_msec(ctx->r->request_time); + return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; } extern zend_module_entry php_apache_module; diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt index 3dc3580c21..fd36e3024f 100644 --- a/sapi/cgi/tests/apache_request_headers.phpt +++ b/sapi/cgi/tests/apache_request_headers.phpt @@ -17,12 +17,12 @@ $file = dirname(__FILE__)."/012.test.php"; file_put_contents($file, '<?php print_r(apache_request_headers()); ?>'); -passthru("$php $file"); +passthru("$php -n $file"); $names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_'); foreach ($names as $name) { putenv($name."=".str_repeat("A", 256)); - passthru("$php -q $file"); + passthru("$php -n -q $file"); putenv($name); } unlink($file); @@ -31,7 +31,7 @@ echo "Done\n"; ?> --EXPECTF-- X-Powered-By: PHP/%s -Content-type: text/html; charset=UTF-8 +Content-type: text/%s Array ( diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h index 2c069c4491..3e9ca43084 100644 --- a/sapi/cli/cli.h +++ b/sapi/cli/cli.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 index 77fc5e9551..cdfa1f7daf 100644 --- a/sapi/cli/config.m4 +++ b/sapi/cli/config.m4 @@ -44,5 +44,7 @@ if test "$PHP_CLI" != "no"; then PHP_SUBST(BUILD_CLI) PHP_OUTPUT(sapi/cli/php.1) + + PHP_INSTALL_HEADERS([sapi/cli/cli.h]) fi AC_MSG_RESULT($PHP_CLI) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 205b9db3fe..f9bf3ee60b 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1167,12 +1167,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } zend_end_try(); out: - if (exit_status == 0) { - exit_status = EG(exit_status); - } if (request_started) { php_request_shutdown((void *) 0); } + if (translated_path) { + free(translated_path); + } + if (exit_status == 0) { + exit_status = EG(exit_status); + } return exit_status; err: sapi_deactivate(TSRMLS_C); diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 87ab7b48f4..4d15db44af 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -116,7 +116,7 @@ typedef struct php_cli_server_poller { } php_cli_server_poller; typedef struct php_cli_server_request { - enum php_http_method request_method; + enum php_http_method request_method; int protocol_version; char *request_uri; size_t request_uri_len; @@ -247,7 +247,8 @@ static php_cli_server_http_reponse_status_code_pair status_map[] = { static php_cli_server_http_reponse_status_code_pair template_map[] = { { 400, "<h1 class=\"h\">%s</h1><p>Your browser sent a request that this server could not understand.</p>" }, { 404, "<h1 class=\"h\">%s</h1><p>The requested resource %s was not found on this server.</p>" }, - { 500, "<h1 class=\"h\">%s</h1><p>The server is temporality unavaiable.</p>" } + { 500, "<h1 class=\"h\">%s</h1><p>The server is temporarily unavailable.</p>" }, + { 501, "<h1 class=\"h\">%s</h1><p>Request method not supported.</p>" } }; static php_cli_server_ext_mime_type_pair mime_type_map[] = { @@ -275,7 +276,7 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu ZEND_DECLARE_MODULE_GLOBALS(cli_server); -/* {{{ static char php_cli_server_css[] +/* {{{ static char php_cli_server_css[] * copied from ext/standard/info.c */ static const char php_cli_server_css[] = "<style type=\"text/css\">\n" \ @@ -543,7 +544,7 @@ static void sapi_cli_server_register_variable(zval *track_vars_array, const char } } /* }}} */ -static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { +static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zval *track_vars_array = va_arg(args, zval *); if (hash_key->nKeyLength) { char *real_key, *key; @@ -583,7 +584,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC) } else { sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC); } - } + } { char *tmp; spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION); @@ -681,7 +682,7 @@ sapi_module_struct cli_server_sapi_module = { sapi_cli_server_log_message, /* Log message */ NULL, /* Get request time */ NULL, /* Child terminate */ - + STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ @@ -778,7 +779,7 @@ static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, v } } } - + #else php_socket_t fd = 0; const php_socket_t max_fd = poller->max_fd; @@ -966,7 +967,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen } else if (nbytes_sent == chunk->data.immortal.len) { php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); - sender->buffer.first = next; + sender->buffer.first = next; if (!next) { sender->buffer.last = NULL; } @@ -1345,7 +1346,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque } } break; /* regular file */ - } + } if (prev_path) { pefree(prev_path, 1); *q = DEFAULT_SLASH; @@ -1384,7 +1385,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque if (request->vpath[i] == '\\') { request->vpath[i] = '/'; } - } + } } #endif request->sb = sb; @@ -1452,7 +1453,7 @@ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath } } } - + *decoded_vpath_end = '\0'; *retval = decoded_vpath; *retval_len = decoded_vpath_end - decoded_vpath; @@ -1618,7 +1619,11 @@ static int php_cli_server_client_read_request(php_cli_server_client *client, cha client->parser.data = client; nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read); if (nbytes_consumed != nbytes_read) { - *errstr = estrdup("Malformed HTTP request"); + if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { + *errstr = estrdup("Unsupported SSL request"); + } else { + *errstr = estrdup("Malformed HTTP request"); + } return -1; } if (client->current_header_name) { @@ -1808,7 +1813,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); - + chunk = php_cli_server_chunk_heap_new(buffer.c, buffer.c, buffer.len); if (!chunk) { smart_str_free_ex(&buffer, 1); @@ -1826,6 +1831,9 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server return SUCCESS; fail: + if (errstr) { + pefree(errstr, 1); + } efree(escaped_request_uri); return FAILURE; } /* }}} */ @@ -1910,7 +1918,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv } /* }}} */ -static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ +static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { @@ -1935,8 +1943,8 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve SG(server_context) = NULL; SG(rfc1867_uploaded_files) = NULL; return SUCCESS; -} -/* }}} */ +} +/* }}} */ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { @@ -1995,7 +2003,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client destroy_request_info(&SG(request_info)); return SUCCESS; } - } + } if (server->router) { if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) { @@ -2009,7 +2017,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client || SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) { php_cli_server_request_shutdown(server, client TSRMLS_CC); return SUCCESS; - } + } } else { if (server->router) { static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); @@ -2022,7 +2030,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client sapi_module.send_headers = send_header_func; SG(sapi_headers).send_default_content_type = 1; SG(rfc1867_uploaded_files) = NULL; - } + } if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) { php_cli_server_close_connection(server, client TSRMLS_CC); } @@ -2184,6 +2192,8 @@ static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cl efree(errstr); php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; + } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { + return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC); } else if (status == 1) { php_cli_server_poller_remove(&server->poller, POLLIN, client->sock); php_cli_server_dispatch(server, client TSRMLS_CC); @@ -2304,7 +2314,7 @@ static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rha static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */ { int retval = SUCCESS; - while (server->is_running) { + while (server->is_running) { static const struct timeval tv = { 1, 0 }; int n = php_cli_server_poller_poll(&server->poller, &tv); if (n > 0) { @@ -2400,7 +2410,7 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ php_localtime_r(&tv.tv_sec, &tm); php_asctime_r(&tm, buf); printf("PHP %s Development Server started at %s" - "Listening on %s\n" + "Listening on http://%s\n" "Document root is %s\n" "Press Ctrl-C to quit.\n", PHP_VERSION, buf, server_bind_address, document_root); diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c index 13b9ea12bc..d3bc496f4e 100644 --- a/sapi/cli/php_http_parser.c +++ b/sapi/cli/php_http_parser.c @@ -81,6 +81,7 @@ static const char *method_strings[] = , "HEAD" , "POST" , "PUT" + , "PATCH" , "CONNECT" , "OPTIONS" , "TRACE" @@ -99,6 +100,7 @@ static const char *method_strings[] = , "NOTIFY" , "SUBSCRIBE" , "UNSUBSCRIBE" + , "NOTIMPLEMENTED" }; @@ -589,7 +591,7 @@ size_t php_http_parser_execute (php_http_parser *parser, case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break; case 'T': parser->method = PHP_HTTP_TRACE; break; case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; - default: goto error; + default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break; } state = s_req_method; break; @@ -602,7 +604,7 @@ size_t php_http_parser_execute (php_http_parser *parser, goto error; matcher = method_strings[parser->method]; - if (ch == ' ' && matcher[index] == '\0') { + if (ch == ' ' && (matcher[index] == '\0' || parser->method == PHP_HTTP_NOT_IMPLEMENTED)) { state = s_req_spaces_before_url; } else if (ch == matcher[index]) { ; /* nada */ @@ -626,12 +628,14 @@ size_t php_http_parser_execute (php_http_parser *parser, parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */ } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') { parser->method = PHP_HTTP_PUT; + } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') { + parser->method = PHP_HTTP_PATCH; } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') { parser->method = PHP_HTTP_UNSUBSCRIBE; } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') { parser->method = PHP_HTTP_PROPPATCH; } else { - goto error; + parser->method = PHP_HTTP_NOT_IMPLEMENTED; } ++index; diff --git a/sapi/cli/php_http_parser.h b/sapi/cli/php_http_parser.h index b740a0995e..2bf2356725 100644 --- a/sapi/cli/php_http_parser.h +++ b/sapi/cli/php_http_parser.h @@ -32,7 +32,10 @@ extern "C" { # include "win32/php_stdint.h" # include "config.w32.h" #else -# include <stdint.h> +# include "php_config.h" +# ifdef HAVE_STDINT_H +# include <stdint.h> +# endif #endif /* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run @@ -77,6 +80,7 @@ enum php_http_method , PHP_HTTP_HEAD , PHP_HTTP_POST , PHP_HTTP_PUT + , PHP_HTTP_PATCH /* pathological */ , PHP_HTTP_CONNECT , PHP_HTTP_OPTIONS @@ -99,6 +103,8 @@ enum php_http_method , PHP_HTTP_NOTIFY , PHP_HTTP_SUBSCRIBE , PHP_HTTP_UNSUBSCRIBE + /* unknown, not implemented */ + , PHP_HTTP_NOT_IMPLEMENTED }; diff --git a/sapi/cli/tests/bug61679.phpt b/sapi/cli/tests/bug61679.phpt new file mode 100644 index 0000000000..819ce2fa89 --- /dev/null +++ b/sapi/cli/tests/bug61679.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #61679 (Error on non-standard HTTP methods) +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php +include "php_cli_server.inc"; +php_cli_server_start(<<<'PHP' +echo "This should never echo"; +PHP +); + +list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); +$port = intval($port)?:80; + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die("connect failed"); +} + +// Send a request with a fictitious request method, +// I like smurfs, the smurf everything. +if(fwrite($fp, <<<HEADER +SMURF / HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + echo fgets($fp); + // Only echo the first line from the response, + // the rest is not interesting + break; + } +} + +fclose($fp); +?> +--EXPECTF-- +HTTP/1.1 501 Not Implemented diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 3479cd0bd0..40c5361995 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -38,7 +38,7 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns $i = 0; - while (($i++ < 5) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { + while (($i++ < 30) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { usleep(10000); } diff --git a/sapi/cli/tests/php_cli_server_018.phpt b/sapi/cli/tests/php_cli_server_018.phpt new file mode 100644 index 0000000000..deb9348768 --- /dev/null +++ b/sapi/cli/tests/php_cli_server_018.phpt @@ -0,0 +1,44 @@ +--TEST-- +Implement Req #61679 (Support HTTP PATCH method) +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php +include "php_cli_server.inc"; +php_cli_server_start(<<<'PHP' +var_dump($_SERVER['REQUEST_METHOD']); +PHP +); + +list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); +$port = intval($port)?:80; + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die("connect failed"); +} + +if(fwrite($fp, <<<HEADER +PATCH / HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + echo fgets($fp); + } +} + +fclose($fp); +?> +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: %s +Content-type: text/html + +string(5) "PATCH" diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index e2e208aa7f..f77c9fb4d6 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h index 7a9f3ef363..f39559d256 100644 --- a/sapi/fpm/fpm/fastcgi.h +++ b/sapi/fpm/fpm/fastcgi.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 83b461b793..cdec235bdd 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 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 | @@ -1694,9 +1694,9 @@ int main(int argc, char *argv[]) SG(request_info).no_headers = 1; #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_request_shutdown((void *) 0); fcgi_shutdown(); diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c index cd97aebb33..d95d66a754 100644 --- a/sapi/fpm/fpm/fpm_php_trace.c +++ b/sapi/fpm/fpm/fpm_php_trace.c @@ -26,6 +26,7 @@ #include "fpm_children.h" #include "fpm_worker_pool.h" #include "fpm_process_ctl.h" +#include "fpm_scoreboard.h" #include "zlog.h" @@ -137,6 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC void fpm_php_trace(struct fpm_child_s *child) /* {{{ */ { TSRMLS_FETCH(); + fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard); FILE *slowlog; zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid); diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c index 7840d17f8b..76ea4d358e 100644 --- a/sapi/fpm/fpm/fpm_process_ctl.c +++ b/sapi/fpm/fpm/fpm_process_ctl.c @@ -353,7 +353,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ #endif } } - fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); + fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); /* this is specific to PM_STYLE_ONDEMAND */ if (wp->config->pm == PM_STYLE_ONDEMAND) { @@ -388,7 +388,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ if (idle < wp->config->pm_min_spare_servers) { if (wp->running_children >= wp->config->pm_max_children) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } @@ -407,7 +407,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children); if (children_to_fork <= 0) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } @@ -511,7 +511,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) / if (wp->running_children >= wp->config->pm_max_children) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c index 28332d0a92..bf431a08d0 100644 --- a/sapi/fpm/fpm/fpm_request.c +++ b/sapi/fpm/fpm/fpm_request.c @@ -54,7 +54,7 @@ void fpm_request_accepting() /* {{{ */ fpm_scoreboard_proc_release(proc); /* idle++, active-- */ - fpm_scoreboard_update(1, -1, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + fpm_scoreboard_update(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); } /* }}} */ @@ -98,7 +98,7 @@ void fpm_request_reading_headers() /* {{{ */ fpm_scoreboard_proc_release(proc); /* idle--, active++, request++ */ - fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); } /* }}} */ diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c index 4222f6037c..24463a90dd 100644 --- a/sapi/fpm/fpm/fpm_scoreboard.c +++ b/sapi/fpm/fpm/fpm_scoreboard.c @@ -73,7 +73,7 @@ int fpm_scoreboard_init_main() /* {{{ */ } /* }}} */ -void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */ +void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */ { if (!scoreboard) { scoreboard = fpm_scoreboard; @@ -110,6 +110,9 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request if (max_children_reached >= 0) { scoreboard->max_children_reached = max_children_reached; } + if (slow_rq > 0) { + scoreboard->slow_rq += slow_rq; + } } else { if (scoreboard->idle + idle > 0) { scoreboard->idle += idle; diff --git a/sapi/fpm/fpm/fpm_scoreboard.h b/sapi/fpm/fpm/fpm_scoreboard.h index 136ea481a4..f58a28737d 100644 --- a/sapi/fpm/fpm/fpm_scoreboard.h +++ b/sapi/fpm/fpm/fpm_scoreboard.h @@ -64,13 +64,14 @@ struct fpm_scoreboard_s { unsigned int lq_len; unsigned int nprocs; int free_proc; + unsigned long int slow_rq; struct fpm_scoreboard_proc_s *procs[]; }; int fpm_scoreboard_init_main(); int fpm_scoreboard_init_child(struct fpm_worker_pool_s *wp); -void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard); +void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard); struct fpm_scoreboard_s *fpm_scoreboard_get(); struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_get(struct fpm_scoreboard_s *scoreboard, int child_index); diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c index d24dcccc9a..76759e7f25 100644 --- a/sapi/fpm/fpm/fpm_sockets.c +++ b/sapi/fpm/fpm/fpm_sockets.c @@ -356,7 +356,7 @@ int fpm_sockets_init_main() /* {{{ */ } if (wp->listen_address_domain == FPM_AF_INET && fpm_socket_get_listening_queue(wp->listening_socket, NULL, &lq_len) >= 0) { - fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); + fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); } } @@ -455,11 +455,11 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq) #endif -int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* {{{ */ +int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* {{{ */ { int fd; - if (!sun || sun->sun_family != AF_UNIX) { + if (!sock || sock->sun_family != AF_UNIX) { return -1; } @@ -467,7 +467,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* {{{ return -1; } - if (connect(fd, (struct sockaddr *)sun, socklen) == -1) { + if (connect(fd, (struct sockaddr *)sock, socklen) == -1) { return -1; } diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c index 5f2c852c7d..b9b9a8c0b6 100644 --- a/sapi/fpm/fpm/fpm_status.c +++ b/sapi/fpm/fpm/fpm_status.c @@ -158,6 +158,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ "<tr><th>total processes</th><td>%d</td></tr>\n" "<tr><th>max active processes</th><td>%d</td></tr>\n" "<tr><th>max children reached</th><td>%u</td></tr>\n" + "<tr><th>slow requests</th><td>%lu</td></tr>\n" "</table>\n"; if (!full) { @@ -228,7 +229,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ "<active-processes>%d</active-processes>\n" "<total-processes>%d</total-processes>\n" "<max-active-processes>%d</max-active-processes>\n" - "<max-children-reached>%u</max-children-reached>\n"; + "<max-children-reached>%u</max-children-reached>\n" + "<slow-requests>%lu</slow-requests>\n"; if (!full) { short_post = "</status>"; @@ -277,7 +279,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ "\"active processes\":%d," "\"total processes\":%d," "\"max active processes\":%d," - "\"max children reached\":%u"; + "\"max children reached\":%u," + "\"slow requests\":%lu"; if (!full) { short_post = "}"; @@ -326,7 +329,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ "active processes: %d\n" "total processes: %d\n" "max active processes: %d\n" - "max children reached: %u\n"; + "max children reached: %u\n" + "slow requests: %lu\n"; if (full) { full_syntax = @@ -367,7 +371,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ scoreboard.active, scoreboard.idle + scoreboard.active, scoreboard.active_max, - scoreboard.max_children_reached); + scoreboard.max_children_reached, + scoreboard.slow_rq); PUTS(buffer); efree(buffer); diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index a197225b4b..bb532d8362 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 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 | @@ -719,9 +719,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h index 276c579b2c..68f73c4e25 100644 --- a/sapi/litespeed/lsapidef.h +++ b/sapi/litespeed/lsapidef.h @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index a3297346d6..fe89ebab28 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h index 8a604fbf1e..701b5284c9 100644 --- a/sapi/litespeed/lsapilib.h +++ b/sapi/litespeed/lsapilib.h @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/tests/lang/bug45392.phpt b/tests/lang/bug45392.phpt index ae84cd9d1d..78876c7c80 100644 --- a/tests/lang/bug45392.phpt +++ b/tests/lang/bug45392.phpt @@ -2,6 +2,11 @@ Bug #45392 (ob_start()/ob_end_clean() and memory_limit) --INI-- display_errors=stderr +--SKIPIF-- +<?php +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} --FILE-- <?php echo __LINE__ . "\n"; diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt index a2c34d06ad..7e4786cd28 100644 --- a/tests/lang/compare_objects_basic2.phpt +++ b/tests/lang/compare_objects_basic2.phpt @@ -20,9 +20,5 @@ var_dump($obj1 == $obj2); ===DONE=== --EXPECTF-- Simple test comparing two objects with different compare callback handler - -Notice: Object of class X could not be converted to int in %s on line %d - -Notice: Object of class DateTime could not be converted to int in %s on line %d -bool(true) -===DONE===
\ No newline at end of file +bool(false) +===DONE=== diff --git a/win32/build/deplister.c b/win32/build/deplister.c index bf91b96d52..f99da51228 100644 --- a/win32/build/deplister.c +++ b/win32/build/deplister.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 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 | diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index 39281d7387..922245d858 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -1,16 +1,16 @@ bz2-1.0.6
cclient-2007e
freetype-2.4.3
-icu-4.6.1
+icu-49.1.2
jpeglib-6b
-libcurl-7.24.0
-libiconv-1.11
+libcurl-7.27.0
+libiconv-1.14
libmcrypt-2.5.8
-libmpir-1.3.1
+libmpir-2.5.1
libpng-1.2.46
libpq-8.3.6
-libssh2-1.3.0
+libssh2-1.4.2
libtidy-20090325
-libxslt-1.1.23
-libxml-2.7.7
-openssl-0.9.8u
+libxslt-1.1.27
+libxml-2.7.8
+openssl-0.9.8x
diff --git a/win32/build/template.rc b/win32/build/template.rc index 2db8896497..606b08a244 100644 --- a/win32/build/template.rc +++ b/win32/build/template.rc @@ -65,7 +65,7 @@ BEGIN #endif VALUE "FileVersion", EXT_VERSION VALUE "InternalName", INTERNAL_NAME - VALUE "LegalCopyright", "Copyright © 1997-2010 The PHP Group" + VALUE "LegalCopyright", "Copyright © 1997-2012 The PHP Group" VALUE "LegalTrademarks", "PHP" VALUE "OriginalFilename", FILE_NAME VALUE "ProductName", "PHP" diff --git a/win32/registry.c b/win32/registry.c index 45e842b455..638d85ae52 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -77,12 +77,13 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ value_len = max_value+1; if (RegEnumValue(key, i, name, &name_len, NULL, &type, value, &value_len) == ERROR_SUCCESS) { if ((type == REG_SZ) || (type == REG_EXPAND_SZ)) { - ht = (HashTable*)malloc(sizeof(HashTable)); if (!ht) { - return ret; + ht = (HashTable*)malloc(sizeof(HashTable)); + if (!ht) { + return ret; + } + zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1); } - zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1); - data = (zval*)malloc(sizeof(zval)); if (!data) { return ret; diff --git a/win32/time.c b/win32/time.c index a376fd61be..391a8a81e9 100644 --- a/win32/time.c +++ b/win32/time.c @@ -1,4 +1,3 @@ - /***************************************************************************** * * * DH_TIME.C * @@ -35,12 +34,21 @@ int getfilesystemtime(struct timeval *time_Info) { -FILETIME ft; -__int64 ff; + FILETIME ft; + __int64 ff; + ULARGE_INTEGER convFromft; GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */ - /* resolution seems to be 0.01 sec */ - ff = *(__int64*)(&ft); + /* resolution seems to be 0.01 sec */ + /* + * Do not cast a pointer to a FILETIME structure to either a + * ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. + * via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx + */ + convFromft.HighPart = ft.dwHighDateTime; + convFromft.LowPart = ft.dwLowDateTime; + ff = convFromft.QuadPart; + time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600); time_Info->tv_usec = (int)(ff % 10000000)/10; return 0; |