mirror of
https://github.com/php/php-src.git
synced 2024-09-25 03:47:26 +00:00
Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
This commit is contained in:
commit
bc602495d7
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
202
INSTALL
202
INSTALL
@ -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
|
||||
|
79
NEWS
79
NEWS
@ -1,10 +1,75 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.4.6
|
||||
?? ??? 2012, PHP 5.4.7
|
||||
|
||||
- Core:
|
||||
. 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 #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
|
||||
|
||||
- DateTime:
|
||||
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
|
||||
(reeze.xia@gmail.com)
|
||||
|
||||
- Installation:
|
||||
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
|
||||
|
||||
- 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)
|
||||
|
||||
- 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)
|
||||
|
||||
|
||||
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).
|
||||
@ -24,6 +89,10 @@ PHP NEWS
|
||||
- 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)
|
||||
@ -32,6 +101,8 @@ PHP NEWS
|
||||
. 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)
|
||||
|
||||
@ -39,7 +110,11 @@ PHP NEWS
|
||||
. Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build).
|
||||
(Laruence)
|
||||
|
||||
?? ??? 2012, PHP 5.4.5
|
||||
- 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
|
||||
|
@ -347,6 +347,9 @@ PHP 5.4 UPGRADE NOTES
|
||||
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
|
||||
==============================
|
||||
|
@ -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
|
||||
|
@ -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') {
|
||||
|
32
Zend/tests/bug62358.phpt
Normal file
32
Zend/tests/bug62358.phpt
Normal file
@ -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
|
33
Zend/tests/bug62653.phpt
Normal file
33
Zend/tests/bug62653.phpt
Normal file
@ -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
|
||||
(
|
||||
)
|
11
Zend/tests/bug62680.phpt
Normal file
11
Zend/tests/bug62680.phpt
Normal file
@ -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)
|
23
Zend/tests/bug62763.phpt
Normal file
23
Zend/tests/bug62763.phpt
Normal file
@ -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
|
21
Zend/tests/bug62892.phpt
Normal file
21
Zend/tests/bug62892.phpt
Normal file
@ -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) {
|
||||
}
|
21
Zend/zend.c
21
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);
|
||||
|
||||
@ -1261,6 +1258,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 +1266,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 +1316,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;
|
||||
}
|
||||
|
@ -2531,6 +2531,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 +2542,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 +2553,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 +2635,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 +2657,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.
|
||||
|
@ -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; \
|
||||
|
@ -3801,9 +3801,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 */
|
||||
@ -4025,9 +4028,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,10 +5012,10 @@ 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;
|
||||
@ -6958,9 +6961,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));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
||||
|
@ -3947,7 +3947,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:
|
||||
|
@ -13917,7 +13917,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 +15920,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 +18133,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 +21169,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 +22508,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 +23667,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 +24826,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 +26251,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 +29506,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 +31380,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 +33463,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 +36230,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:
|
||||
|
@ -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=7
|
||||
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`
|
||||
|
@ -1606,9 +1606,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) {
|
||||
|
18
ext/curl/tests/bug62839.phpt
Normal file
18
ext/curl/tests/bug62839.phpt
Normal file
@ -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 = fopen('/tmp/test', 'wb');
|
||||
curl_setopt($curl, CURLOPT_FILE, $fd);
|
||||
|
||||
curl_copy_handle($curl);
|
||||
|
||||
echo 'DONE!';
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE!
|
@ -2467,6 +2467,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
|
||||
convert_to_long(*z_timezone_type);
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
|
||||
zend_error_handling error_handling;
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
convert_to_string(*z_timezone);
|
||||
|
||||
switch (Z_LVAL_PP(z_timezone_type)) {
|
||||
@ -2474,9 +2477,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
case TIMELIB_ZONETYPE_ABBR: {
|
||||
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
|
||||
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
|
||||
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 1 TSRMLS_CC);
|
||||
efree(tmp);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
@ -2490,10 +2493,15 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
tzobj->tzi.tz = tzi;
|
||||
tzobj->initialized = 1;
|
||||
|
||||
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 1 TSRMLS_CC);
|
||||
zval_ptr_dtor(&tmp_obj);
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return 0;
|
||||
}
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
ext/date/tests/bug62852.phpt
Normal file
15
ext/date/tests/bug62852.phpt
Normal file
@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #62852 (Unserialize invalid DateTime causes crash)
|
||||
--INI--
|
||||
date.timezone=GMT
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$datetime = unserialize('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";}');
|
||||
var_dump($datetime);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "DateTime::__wakeup(): Failed to parse time string (%s) at position 12 (0): Double time specification"
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
0
ext/intl/CREDITS
Executable file → Normal file
0
ext/intl/CREDITS
Executable file → Normal file
0
ext/intl/TODO
Executable file → Normal file
0
ext/intl/TODO
Executable file → Normal file
0
ext/intl/collator/collator.c
Executable file → Normal file
0
ext/intl/collator/collator.c
Executable file → Normal file
0
ext/intl/collator/collator.h
Executable file → Normal file
0
ext/intl/collator/collator.h
Executable file → Normal file
0
ext/intl/collator/collator_attr.c
Executable file → Normal file
0
ext/intl/collator/collator_attr.c
Executable file → Normal file
0
ext/intl/collator/collator_attr.h
Executable file → Normal file
0
ext/intl/collator/collator_attr.h
Executable file → Normal file
0
ext/intl/collator/collator_class.c
Executable file → Normal file
0
ext/intl/collator/collator_class.c
Executable file → Normal file
9
ext/intl/collator/collator_class.h
Executable file → Normal file
9
ext/intl/collator/collator_class.h
Executable file → Normal file
@ -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 ) \
|
||||
|
0
ext/intl/collator/collator_compare.c
Executable file → Normal file
0
ext/intl/collator/collator_compare.c
Executable file → Normal file
0
ext/intl/collator/collator_compare.h
Executable file → Normal file
0
ext/intl/collator/collator_compare.h
Executable file → Normal file
0
ext/intl/collator/collator_convert.c
Executable file → Normal file
0
ext/intl/collator/collator_convert.c
Executable file → Normal file
0
ext/intl/collator/collator_convert.h
Executable file → Normal file
0
ext/intl/collator/collator_convert.h
Executable file → Normal file
2
ext/intl/collator/collator_create.c
Executable file → Normal file
2
ext/intl/collator/collator_create.c
Executable file → Normal file
@ -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);
|
||||
|
0
ext/intl/collator/collator_create.h
Executable file → Normal file
0
ext/intl/collator/collator_create.h
Executable file → Normal file
0
ext/intl/collator/collator_error.c
Executable file → Normal file
0
ext/intl/collator/collator_error.c
Executable file → Normal file
0
ext/intl/collator/collator_error.h
Executable file → Normal file
0
ext/intl/collator/collator_error.h
Executable file → Normal file
0
ext/intl/collator/collator_is_numeric.c
Executable file → Normal file
0
ext/intl/collator/collator_is_numeric.c
Executable file → Normal file
0
ext/intl/collator/collator_is_numeric.h
Executable file → Normal file
0
ext/intl/collator/collator_is_numeric.h
Executable file → Normal file
0
ext/intl/collator/collator_locale.c
Executable file → Normal file
0
ext/intl/collator/collator_locale.c
Executable file → Normal file
0
ext/intl/collator/collator_locale.h
Executable file → Normal file
0
ext/intl/collator/collator_locale.h
Executable file → Normal file
0
ext/intl/collator/collator_sort.c
Executable file → Normal file
0
ext/intl/collator/collator_sort.c
Executable file → Normal file
0
ext/intl/collator/collator_sort.h
Executable file → Normal file
0
ext/intl/collator/collator_sort.h
Executable file → Normal file
0
ext/intl/common/common_error.c
Executable file → Normal file
0
ext/intl/common/common_error.c
Executable file → Normal file
0
ext/intl/common/common_error.h
Executable file → Normal file
0
ext/intl/common/common_error.h
Executable file → Normal file
0
ext/intl/config.m4
Executable file → Normal file
0
ext/intl/config.m4
Executable file → Normal file
0
ext/intl/config.w32
Executable file → Normal file
0
ext/intl/config.w32
Executable file → Normal file
2
ext/intl/dateformat/dateformat.c
Executable file → Normal file
2
ext/intl/dateformat/dateformat.c
Executable file → Normal file
@ -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,
|
||||
|
0
ext/intl/dateformat/dateformat.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat.h
Executable file → Normal file
5
ext/intl/dateformat/dateformat_attr.c
Executable file → Normal file
5
ext/intl/dateformat/dateformat_attr.c
Executable file → Normal file
@ -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"
|
||||
|
||||
|
0
ext/intl/dateformat/dateformat_attr.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_attr.h
Executable file → Normal file
21
ext/intl/dateformat/dateformat_class.c
Executable file → Normal file
21
ext/intl/dateformat/dateformat_class.c
Executable file → Normal file
@ -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;
|
||||
|
||||
@ -88,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;
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr 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;
|
||||
}
|
||||
|
10
ext/intl/dateformat/dateformat_class.h
Executable file → Normal file
10
ext/intl/dateformat/dateformat_class.h
Executable file → Normal file
@ -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
|
||||
|
0
ext/intl/dateformat/dateformat_data.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_data.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_data.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_data.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_format.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_format.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_format.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_format.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_parse.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_parse.c
Executable file → Normal file
0
ext/intl/dateformat/dateformat_parse.h
Executable file → Normal file
0
ext/intl/dateformat/dateformat_parse.h
Executable file → Normal file
0
ext/intl/doc/Tutorial.txt
Executable file → Normal file
0
ext/intl/doc/Tutorial.txt
Executable file → Normal file
0
ext/intl/doc/collator_api.php
Executable file → Normal file
0
ext/intl/doc/collator_api.php
Executable file → Normal file
0
ext/intl/doc/common_api.php
Executable file → Normal file
0
ext/intl/doc/common_api.php
Executable file → Normal file
0
ext/intl/doc/datefmt_api.php
Executable file → Normal file
0
ext/intl/doc/datefmt_api.php
Executable file → Normal file
0
ext/intl/doc/formatter_api.php
Executable file → Normal file
0
ext/intl/doc/formatter_api.php
Executable file → Normal file
0
ext/intl/doc/grapheme_api.php
Executable file → Normal file
0
ext/intl/doc/grapheme_api.php
Executable file → Normal file
0
ext/intl/doc/locale_api.php
Executable file → Normal file
0
ext/intl/doc/locale_api.php
Executable file → Normal file
0
ext/intl/doc/msgfmt_api.php
Executable file → Normal file
0
ext/intl/doc/msgfmt_api.php
Executable file → Normal file
0
ext/intl/doc/normalizer_api.php
Executable file → Normal file
0
ext/intl/doc/normalizer_api.php
Executable file → Normal file
0
ext/intl/formatter/formatter.c
Executable file → Normal file
0
ext/intl/formatter/formatter.c
Executable file → Normal file
0
ext/intl/formatter/formatter.h
Executable file → Normal file
0
ext/intl/formatter/formatter.h
Executable file → Normal file
0
ext/intl/formatter/formatter_attr.c
Executable file → Normal file
0
ext/intl/formatter/formatter_attr.c
Executable file → Normal file
0
ext/intl/formatter/formatter_attr.h
Executable file → Normal file
0
ext/intl/formatter/formatter_attr.h
Executable file → Normal file
23
ext/intl/formatter/formatter_class.c
Executable file → Normal file
23
ext/intl/formatter/formatter_class.c
Executable file → Normal file
@ -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;
|
||||
|
||||
@ -83,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;
|
||||
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr 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;
|
||||
}
|
||||
|
15
ext/intl/formatter/formatter_class.h
Executable file → Normal file
15
ext/intl/formatter/formatter_class.h
Executable file → Normal file
@ -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
|
||||
|
0
ext/intl/formatter/formatter_data.c
Executable file → Normal file
0
ext/intl/formatter/formatter_data.c
Executable file → Normal file
0
ext/intl/formatter/formatter_data.h
Executable file → Normal file
0
ext/intl/formatter/formatter_data.h
Executable file → Normal file
0
ext/intl/formatter/formatter_format.c
Executable file → Normal file
0
ext/intl/formatter/formatter_format.c
Executable file → Normal file
0
ext/intl/formatter/formatter_format.h
Executable file → Normal file
0
ext/intl/formatter/formatter_format.h
Executable file → Normal file
2
ext/intl/formatter/formatter_main.c
Executable file → Normal file
2
ext/intl/formatter/formatter_main.c
Executable file → Normal file
@ -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) {
|
||||
|
0
ext/intl/formatter/formatter_main.h
Executable file → Normal file
0
ext/intl/formatter/formatter_main.h
Executable file → Normal file
0
ext/intl/formatter/formatter_parse.c
Executable file → Normal file
0
ext/intl/formatter/formatter_parse.c
Executable file → Normal file
0
ext/intl/formatter/formatter_parse.h
Executable file → Normal file
0
ext/intl/formatter/formatter_parse.h
Executable file → Normal file
0
ext/intl/grapheme/grapheme.h
Executable file → Normal file
0
ext/intl/grapheme/grapheme.h
Executable file → Normal file
0
ext/intl/grapheme/grapheme_string.c
Executable file → Normal file
0
ext/intl/grapheme/grapheme_string.c
Executable file → Normal file
0
ext/intl/grapheme/grapheme_util.c
Executable file → Normal file
0
ext/intl/grapheme/grapheme_util.c
Executable file → Normal file
0
ext/intl/grapheme/grapheme_util.h
Executable file → Normal file
0
ext/intl/grapheme/grapheme_util.h
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user