mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 19:50:50 +00:00
Compare commits
99
Commits
PHP-5.3.16
...
PHP-5.3.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0e3cbb8b6 | ||
|
|
45ac467b2c | ||
|
|
92a46fe07e | ||
|
|
0165eec1ea | ||
|
|
4f860a4412 | ||
|
|
af0c22537a | ||
|
|
ec36192390 | ||
|
|
936553d666 | ||
|
|
4358e90a8f | ||
|
|
bb02fd5772 | ||
|
|
151b16cf7f | ||
|
|
e31553c204 | ||
|
|
2259a8f18b | ||
|
|
851a04bb7b | ||
|
|
75c63c5503 | ||
|
|
a9db9efa0c | ||
|
|
2cbc4053ae | ||
|
|
923511d364 | ||
|
|
2e8ab65270 | ||
|
|
46458c2c65 | ||
|
|
4db74b7f19 | ||
|
|
d59c1371c2 | ||
|
|
fd0b3ea663 | ||
|
|
6752f38ccc | ||
|
|
3ad033ffba | ||
|
|
e66a5ce56f | ||
|
|
eb881a1dd1 | ||
|
|
4c6678d605 | ||
|
|
1b13ff6ec7 | ||
|
|
e766f85405 | ||
|
|
30981836fa | ||
|
|
9f44844d7c | ||
|
|
bbf5978e26 | ||
|
|
9e91d621e3 | ||
|
|
33fcec5c4f | ||
|
|
0cc0f73fc3 | ||
|
|
f66642aae1 | ||
|
|
b29dc146b9 | ||
|
|
94582f9398 | ||
|
|
5f9023ca38 | ||
|
|
d64d9e3351 | ||
|
|
485c09a376 | ||
|
|
7e816c0921 | ||
|
|
67d7d03f00 | ||
|
|
5dc2cef370 | ||
|
|
8afb848e18 | ||
|
|
de884997e0 | ||
|
|
557200b472 | ||
|
|
0410b4e60f | ||
|
|
d92a89fe52 | ||
|
|
55d680e968 | ||
|
|
7bedd275eb | ||
|
|
13bcf685cb | ||
|
|
eca4fc6991 | ||
|
|
6a8db0c081 | ||
|
|
ca4dd76160 | ||
|
|
a5d0c1e21b | ||
|
|
e5bdd2c0ee | ||
|
|
85fa4d7747 | ||
|
|
60ad16e11f | ||
|
|
92153dcfe3 | ||
|
|
0cdc1f5626 | ||
|
|
b9a050100c | ||
|
|
f4054afe40 | ||
|
|
3dd256a67b | ||
|
|
50ab6c63a7 | ||
|
|
6cd0e446dd | ||
|
|
001966c754 | ||
|
|
dc1138b102 | ||
|
|
8b87c6df84 | ||
|
|
46a3f25772 | ||
|
|
1a23d42909 | ||
|
|
9cf0139460 | ||
|
|
8649e4236b | ||
|
|
3e0b33ed62 | ||
|
|
6524a530df | ||
|
|
8c3bf96022 | ||
|
|
8848778a59 | ||
|
|
a5a409ebff | ||
|
|
e1c610fb44 | ||
|
|
da14cdd6f3 | ||
|
|
7aed239050 | ||
|
|
9bc1af1e58 | ||
|
|
4970926e45 | ||
|
|
e1180b4f1a | ||
|
|
0239437903 | ||
|
|
7130887719 | ||
|
|
c4b26cc1b0 | ||
|
|
ed793b2a3f | ||
|
|
a239658b9e | ||
|
|
07ee764e57 | ||
|
|
228c288686 | ||
|
|
f4a315fce2 | ||
|
|
03a1fcabf3 | ||
|
|
49b202f2cf | ||
|
|
2b6ac9e1a0 | ||
|
|
9a690859f6 | ||
|
|
cd896d69d9 | ||
|
|
433089ccb4 |
No files matched your search
@@ -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
|
||||
|
||||
+3
-3
@@ -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,80 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.3.16
|
||||
18 Oct 2012, PHP 5.3.18
|
||||
|
||||
- Core:
|
||||
. 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 #61767 (Shutdown functions not called in certain error
|
||||
situation). (Dmitry)
|
||||
. Fixed bug #61442 (exception threw in __autoload can not be catched).
|
||||
(Laruence)
|
||||
. Fixed bug #60909 (custom error handler throwing Exception + fatal error
|
||||
= no shutdown function). (Dmitry)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
|
||||
cause cpu Soaring). (Pierrick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
|
||||
. Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
|
||||
. Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
|
||||
. Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
|
||||
. Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
|
||||
. Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
|
||||
|
||||
- Intl:
|
||||
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
|
||||
|
||||
- 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)
|
||||
|
||||
13 Sep 2012, PHP 5.3.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
|
||||
. Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
|
||||
Windows registry). (aserbulov at parallels dot com)
|
||||
. Fixed bug #62763 (register_shutdown_function and extending class).
|
||||
(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 ##62460 (php binaries installed as binary.dSYM). (Reeze Xia)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
|
||||
|
||||
- Intl:
|
||||
. Fix null pointer dereferences in some classes of ext/intl. (Gustavo)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug (segfault due to retval is not initialized). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
|
||||
(Laruence)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #62838 (enchant_dict_quick_check() destroys zval, but fails to
|
||||
initialize it). (Tony, Mateusz Goik).
|
||||
|
||||
16 Aug 2012, PHP 5.3.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
|
||||
@@ -21,6 +95,7 @@ PHP NEWS
|
||||
. Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
|
||||
gives Segmentation fault). (Laruence, Gustavo)
|
||||
|
||||
|
||||
19 Jul 2012, PHP 5.3.15
|
||||
|
||||
- Zend Engine:
|
||||
|
||||
+15
-22
@@ -135,33 +135,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
|
||||
@@ -179,6 +180,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
|
||||
@@ -195,7 +199,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
|
||||
|
||||
@@ -215,9 +219,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:
|
||||
@@ -240,17 +244,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)
|
||||
--------------------------------------
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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!!!
|
||||
@@ -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!!!
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #61442 (exception threw in __autoload can not be catched)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($name) {
|
||||
throw new Exception("Unable to load $name");
|
||||
}
|
||||
|
||||
try {
|
||||
$obj = new NonLoadableClass();
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$obj = NonLoadableClass::a();
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$obj = NonLoadableClass::UNDEFINED_CONST;
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
--EXPECTF--
|
||||
string(31) "Unable to load NonLoadableClass"
|
||||
string(31) "Unable to load NonLoadableClass"
|
||||
string(31) "Unable to load NonLoadableClass"
|
||||
@@ -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
|
||||
)
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
+23
@@ -997,6 +997,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
zend_stack labels_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:
|
||||
|
||||
+16
-11
@@ -2122,7 +2122,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);
|
||||
@@ -2342,16 +2344,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;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2425,7 +2426,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;
|
||||
@@ -2447,11 +2447,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.
|
||||
@@ -2605,7 +2603,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) {
|
||||
|
||||
@@ -170,6 +170,11 @@ typedef struct _zend_fcall_info_cache {
|
||||
int _len = class_name_len; \
|
||||
class_container.name = zend_strndup(class_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.builtin_functions = functions; \
|
||||
class_container.constructor = NULL; \
|
||||
class_container.destructor = NULL; \
|
||||
|
||||
@@ -1272,6 +1272,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(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -1489,6 +1489,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) {
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
@@ -1990,6 +1990,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -3043,6 +3046,9 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
|
||||
}
|
||||
|
||||
@@ -2688,6 +2688,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
|
||||
if (IS_CONST == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -2836,6 +2839,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
if (IS_CONST == IS_CONST) {
|
||||
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
|
||||
}
|
||||
@@ -3259,6 +3265,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
|
||||
if (IS_CONST == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -3725,6 +3734,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
|
||||
if (IS_CONST == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -3947,6 +3959,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
|
||||
if (IS_CONST == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -4381,6 +4396,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
|
||||
if (IS_CONST == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -10498,6 +10516,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
|
||||
if (IS_VAR == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -10646,6 +10667,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
if (IS_VAR == IS_CONST) {
|
||||
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
|
||||
}
|
||||
@@ -12305,6 +12329,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
|
||||
if (IS_VAR == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -14107,6 +14134,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
|
||||
if (IS_VAR == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -15003,6 +15033,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
|
||||
if (IS_VAR == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -16496,6 +16529,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
|
||||
if (IS_VAR == IS_CONST) {
|
||||
/* no function found. try a static method in class */
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
|
||||
}
|
||||
@@ -17860,6 +17896,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
if (IS_UNUSED == IS_CONST) {
|
||||
|
||||
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
if (!ce) {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
zend_execute_data *execute_data;
|
||||
zend_bool nested = 0;
|
||||
zend_bool original_in_execution = EG(in_execution);
|
||||
{%HELPER_VARS%}
|
||||
{%EXECUTION_STATUS%}
|
||||
|
||||
{%INTERNAL_LABELS%}
|
||||
|
||||
|
||||
@@ -850,6 +850,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
|
||||
|
||||
+4
-4
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=16
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=18
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -1335,10 +1335,10 @@ PHP_CONFIGURE_PART(Configuring libtool)
|
||||
|
||||
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
|
||||
|
||||
dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
|
||||
dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5, 10.6, 10.7 and 10.8.
|
||||
dnl This hack works around it. Ugly.
|
||||
case $host_alias in
|
||||
*darwin9*|*darwin10*)
|
||||
*darwin9*|*darwin10*|*darwin11*|*darwin12*)
|
||||
ac_cv_exeext=
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1610,9 +1610,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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
|
||||
}
|
||||
|
||||
do {
|
||||
FD_ZERO(&curlstream->readfds);
|
||||
FD_ZERO(&curlstream->writefds);
|
||||
FD_ZERO(&curlstream->excfds);
|
||||
|
||||
/* get the descriptors from curl */
|
||||
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
|
||||
|
||||
|
||||
@@ -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!
|
||||
@@ -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 |
|
||||
|
||||
+1
-1
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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();
|
||||
}
|
||||
|
||||
@@ -729,6 +729,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
PHP_ENCHANT_GET_DICT;
|
||||
@@ -742,8 +743,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
|
||||
|
||||
|
||||
+1
-1
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 ) \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -87,18 +89,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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -82,18 +84,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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -80,18 +82,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;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,15 @@ 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
|
||||
|
||||
@@ -252,7 +252,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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -15,7 +15,6 @@ $value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
|
||||
var_dump($value);
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
--EXPECT--
|
||||
int(2147483647)
|
||||
int(2147483650)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--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");
|
||||
}
|
||||
|
||||
foreach (range('A', 'C') 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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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 ==
|
||||
@@ -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
|
||||
Warning: mcrypt_cfb(): Attempt to use an empty IV, which is NOT recommend in %s on line %d
|
||||
@@ -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
|
||||
@@ -2,13 +2,12 @@
|
||||
LOAD DATA INFILE - open_basedir
|
||||
--SKIPIF--
|
||||
<?php
|
||||
@include_once("connect.inc");
|
||||
include_once('skipif.inc');
|
||||
|
||||
if (!isset($db)) {
|
||||
die("skip open_basedir setting prevents inclusing of required files");
|
||||
}
|
||||
|
||||
include_once('skipif.inc');
|
||||
include_once('skipifconnectfailure.inc');
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
----------------------------------------------------------------------
|
||||
| PHP Version 6 |
|
||||
| PHP Version 5 |
|
||||
----------------------------------------------------------------------
|
||||
| Copyright (c) 2007 The PHP Group |
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Loaded 100 of 301 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user