mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
212
Commits
php-5.3.14
...
php-5.3.17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8244eea495 | ||
|
|
f9e407ec41 | ||
|
|
c1efbad899 | ||
|
|
8d987032b3 | ||
|
|
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 | ||
|
|
10642aa9e4 | ||
|
|
645f84e41b | ||
|
|
7e3e1837c8 | ||
|
|
9762609cec | ||
|
|
f419d614ba | ||
|
|
880a6cee00 | ||
|
|
14cebefb05 | ||
|
|
015ee3b2c8 | ||
|
|
068fc008c6 | ||
|
|
b477a84026 | ||
|
|
ef7286a42f | ||
|
|
5799ebdb0c | ||
|
|
ffa8461bfe | ||
|
|
777b6679a4 | ||
|
|
ead076bac6 | ||
|
|
cc30524c89 | ||
|
|
683b4f7a2b | ||
|
|
bd39495332 | ||
|
|
88f7f3c00f | ||
|
|
86b4252c8e | ||
|
|
63f3962a90 | ||
|
|
864575251a | ||
|
|
02b8362ec2 | ||
|
|
ad7eeba3c1 | ||
|
|
896d0fcd41 | ||
|
|
b383ddf1e5 | ||
|
|
bcf5853eaa | ||
|
|
c819cf9d6b | ||
|
|
b2b018d5f7 | ||
|
|
26b37f1792 | ||
|
|
157ddd9577 | ||
|
|
88f46b162b | ||
|
|
6b2b195267 | ||
|
|
bcc87ba68e | ||
|
|
d80ff39189 | ||
|
|
250393f925 | ||
|
|
5f31c81f07 | ||
|
|
75d8af715c | ||
|
|
8fe87e7fea | ||
|
|
1ac611f24f | ||
|
|
e6cf7d7745 | ||
|
|
f826ea093f | ||
|
|
7e8276ca68 | ||
|
|
974324676b | ||
|
|
b025b9d0cf | ||
|
|
4662151ea7 | ||
|
|
bc0972e78d | ||
|
|
ad2bee193d | ||
|
|
ce2082d24f | ||
|
|
e427182279 | ||
|
|
5b3f4d25ea | ||
|
|
84fe2cc890 | ||
|
|
cc90ac54be | ||
|
|
c3f34796a0 | ||
|
|
84b1c568f4 | ||
|
|
a62d4e2c43 | ||
|
|
b8e946b02e | ||
|
|
055ecbc628 | ||
|
|
d93892de7a | ||
|
|
5d81fe6f12 | ||
|
|
fed1f2d124 | ||
|
|
e793539678 | ||
|
|
f072662621 | ||
|
|
a8948d0808 | ||
|
|
592917f91f | ||
|
|
6176b96a23 | ||
|
|
d3780f1f90 | ||
|
|
26cb570615 | ||
|
|
f0d6059389 | ||
|
|
f464ffd780 | ||
|
|
cda14b995c | ||
|
|
17c0ff1194 | ||
|
|
fc74503792 | ||
|
|
7d04e0fb2e | ||
|
|
baacc2cb13 | ||
|
|
9ecb67d5a4 | ||
|
|
bde0e8c2a1 | ||
|
|
8ca457f64d | ||
|
|
e883892664 | ||
|
|
b8cdc731b8 | ||
|
|
a37e84e549 | ||
|
|
f4a44f18b8 | ||
|
|
a39bcfc5ee | ||
|
|
9a2365412e | ||
|
|
335a11b14b | ||
|
|
7cae4ff02c | ||
|
|
018a9b321f | ||
|
|
4e6f27f4db | ||
|
|
fed5923dbc | ||
|
|
c56ff39c05 | ||
|
|
6ecc9f1d9d | ||
|
|
d9810af45a | ||
|
|
c1ac325228 | ||
|
|
52d541a314 | ||
|
|
45b3fa4dee | ||
|
|
15213768e6 | ||
|
|
9b233b7e5e | ||
|
|
4fc49c04df | ||
|
|
d57b278ad1 | ||
|
|
e59b6dc0ae | ||
|
|
38ca8cb7a1 | ||
|
|
35abf3f20c | ||
|
|
59e0930d37 | ||
|
|
1f5327a602 | ||
|
|
fa05f038cb | ||
|
|
a331f43f8c | ||
|
|
aab49e934d | ||
|
|
8d5e953a19 | ||
|
|
ad0371ac7e | ||
|
|
b4b0aaae93 | ||
|
|
dbc727373c | ||
|
|
4054890b26 | ||
|
|
72911237b5 | ||
|
|
2f7bd57f93 | ||
|
|
e7ff3e839b | ||
|
|
0298b92b69 | ||
|
|
f6655b62d8 | ||
|
|
63e11f9025 | ||
|
|
a7761262f7 | ||
|
|
bf9120ecae | ||
|
|
c3547f1935 | ||
|
|
86d2fafded | ||
|
|
4aac4da673 | ||
|
|
d4d36fba28 | ||
|
|
8fc9df3f67 | ||
|
|
cfea8e5d04 | ||
|
|
6c9056ceb7 | ||
|
|
abe0f17e88 | ||
|
|
11b4f3becd | ||
|
|
bde86a6639 | ||
|
|
85c777d2f1 | ||
|
|
f1969d4b4c | ||
|
|
2da2de46a8 | ||
|
|
e08566c613 | ||
|
|
9205c4fd62 | ||
|
|
c449bf1443 | ||
|
|
1c19146f46 | ||
|
|
1eff3b01b8 | ||
|
|
86ea921291 | ||
|
|
07c0d714a5 | ||
|
|
51286bd8e5 | ||
|
|
5d61e56dd7 | ||
|
|
812d248193 | ||
|
|
f4c38016b6 | ||
|
|
629273d11b | ||
|
|
7b396c078c | ||
|
|
f733173b1f | ||
|
|
a7df6ce664 | ||
|
|
621fddab93 | ||
|
|
faca4e08b4 | ||
|
|
c973fef48d | ||
|
|
645d65f3e3 | ||
|
|
778d69ddfe | ||
|
|
79d52503a4 | ||
|
|
6d928fd26d | ||
|
|
72a9b595ca | ||
|
|
67039363cd | ||
|
|
d4afbd487a |
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
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
@@ -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,138 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.3.12
|
||||
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)
|
||||
|
||||
- DateTime:
|
||||
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
|
||||
(reeze.xia@gmail.com)
|
||||
|
||||
- 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
|
||||
with run-test.php). (Laruence)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
|
||||
(r.hampartsumyan@gmail.com, Laruence)
|
||||
|
||||
- DateTime:
|
||||
. Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
|
||||
result). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
|
||||
gives Segmentation fault). (Laruence, Gustavo)
|
||||
|
||||
19 Jul 2012, PHP 5.3.15
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
|
||||
includes a semi-colon). (Pierrick)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- Core:
|
||||
. Fixed potential overflow in _php_stream_scandir, CVE-2012-2688. (Jason
|
||||
Powell, Stas)
|
||||
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
|
||||
concurrent). (Johannes)
|
||||
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
|
||||
Salt). (Anthony Ferrara)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed magic file regex support. (Felipe)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
|
||||
. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
|
||||
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
|
||||
for non-root start). (fat)
|
||||
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
|
||||
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
|
||||
(fat)
|
||||
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
|
||||
can be launched without errors). (fat)
|
||||
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
|
||||
. Fixed bug #61218 (FPM drops connection while receiving some binary values
|
||||
in FastCGI requests). (fat)
|
||||
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
|
||||
. Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
|
||||
twice). (Gustavo)
|
||||
. Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
|
||||
. Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
|
||||
pattern). (Gustavo)
|
||||
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
|
||||
|
||||
- JSON:
|
||||
. Reverted fix for bug #61537. (Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62384 (Attempting to invoke a Closure more than once causes
|
||||
segfault). (Felipe)
|
||||
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
|
||||
with constant). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
|
||||
(Nikita Popov)
|
||||
|
||||
- SQLite:
|
||||
. Fixed open_basedir bypass, CVE-2012-3365. (Johannes, reported by Yury
|
||||
Maryshev)
|
||||
|
||||
- XML Writer:
|
||||
. Fixed bug #62064 (memory leak in the XML Writer module).
|
||||
(jean-pierre dot lozi at lip6 dot fr)
|
||||
|
||||
- Zip:
|
||||
. Upgraded libzip to 0.10.1 (Anatoliy)
|
||||
|
||||
14 Jun 2012, PHP 5.3.14
|
||||
|
||||
- CLI SAPI:
|
||||
. Fixed bug #61546 (functions related to current script failed when chdir()
|
||||
@@ -10,24 +142,40 @@ PHP NEWS
|
||||
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- Core:
|
||||
. Fixed CVE-2012-2143. (Solar Designer)
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed bug #62373 (serialize() generates wrong reference to the object).
|
||||
(Moriyoshi)
|
||||
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
|
||||
member of a null object). (Laruence)
|
||||
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
|
||||
reference). (Laruence)
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
|
||||
(Anatoliy)
|
||||
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Changed php://fd to be available only for CLI.
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #61812 (Uninitialised value used in libmagic).
|
||||
(Laruence, Gustavo)
|
||||
|
||||
- Iconv extension:
|
||||
. Fixed a bug that iconv extension fails to link to the correct library
|
||||
when another extension makes use of a library that links to the iconv
|
||||
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
|
||||
(Moriyoshi)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62082 (Memory corruption in internal function
|
||||
get_icu_disp_value_src_php()). (Gustavo)
|
||||
|
||||
- JSON
|
||||
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
|
||||
information). (Adam)
|
||||
@@ -39,12 +187,6 @@ PHP NEWS
|
||||
- Phar:
|
||||
. Fix bug #61065 (Secunia SA44335). (Rasmus)
|
||||
|
||||
- Iconv extension:
|
||||
. Fixed a bug that iconv extension fails to link to the correct library
|
||||
when another extension makes use of a library that links to the iconv
|
||||
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
|
||||
(Moriyoshi)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #61961 (file_get_contents leaks when access empty file with
|
||||
maxlen set). (Reeze)
|
||||
|
||||
@@ -479,6 +479,11 @@ UPGRADE NOTES - PHP 5.3
|
||||
- Firebird and SNMP support are no longer available on Windows. Firebird support
|
||||
may be reintroduced in the future.
|
||||
|
||||
- As of PHP 5.3.15 and above the COM extension isn't compiled statically in PHP
|
||||
anymore but shared. It'll still be delivered with the standard PHP release but
|
||||
must be activated manually with the "extension = php_com_dotnet.dll" directive
|
||||
in php.ini.
|
||||
|
||||
=====================
|
||||
11.1 New in PHP 5.3.4
|
||||
=====================
|
||||
|
||||
-22097
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,12 @@ Bug #55509 (segfault on x86_64 using more than 2G memory)
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die('skip Not for 32-bits OS');
|
||||
}
|
||||
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
// check the available memory
|
||||
if (PHP_OS == 'Linux') {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3)
|
||||
--XFAIL--
|
||||
see https://bugs.php.net/62680
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array("");
|
||||
var_dump(isset($array[0]["a"]["b"]));
|
||||
var_dump(isset($array[0]["a"]["b"]["c"]));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -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
|
||||
+5
-9
@@ -2342,16 +2342,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 +2424,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 +2445,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.
|
||||
|
||||
@@ -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; \
|
||||
|
||||
+1
-1
@@ -1336,7 +1336,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
if (CG(current_namespace)) {
|
||||
/* Prefix function name with current namespcae name */
|
||||
/* Prefix function name with current namespace name */
|
||||
znode tmp;
|
||||
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
|
||||
+1
-1
@@ -331,7 +331,7 @@ END_EXTERN_C()
|
||||
if (idx-1 > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
idx = (ulong)(-(long)idx); \
|
||||
idx = 0 - idx; \
|
||||
} else if (idx > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
|
||||
+1612
-1574
File diff suppressed because it is too large.
Load diff
+27
-6
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^\n\r;\000]
|
||||
RAW_VALUE_CHARS [^"\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
@@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
return '=';
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
/* Eat leading and trailing double quotes */
|
||||
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
<ST_RAW>["] {
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '\n':
|
||||
SCNG(lineno)++;
|
||||
break;
|
||||
case '\r':
|
||||
if (*YYCURSOR != '\n') {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
break;
|
||||
case '"':
|
||||
yyleng = YYCURSOR - SCNG(yy_text) - 2;
|
||||
SCNG(yy_text)++;
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
|
||||
/* Generated by re2c 0.13.5 on Thu Jun 7 17:37:03 2012 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */
|
||||
#line 1 "Zend/zend_language_scanner.l"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -287,7 +287,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
zend_multibyte_set_filter(NULL TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
@@ -445,7 +445,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
|
||||
@@ -285,7 +285,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
zend_multibyte_set_filter(NULL TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
@@ -443,7 +443,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1575,7 +1575,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
|
||||
Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
|
||||
zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
|
||||
@@ -2029,13 +2030,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
|
||||
|
||||
ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+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) {
|
||||
|
||||
@@ -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=14
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=17
|
||||
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
|
||||
|
||||
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -65,7 +65,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
z->value.obj.handlers = &php_com_object_handlers;
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -92,7 +92,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
|
||||
/* this is a convenience function for fetching a particular
|
||||
* element from a (possibly multi-dimensional) safe array */
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
{
|
||||
UINT dims;
|
||||
LONG lbound, ubound;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "php_com_dotnet_internal.h"
|
||||
|
||||
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
|
||||
@@ -65,7 +65,7 @@ PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int c
|
||||
return olestring;
|
||||
}
|
||||
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
char *string;
|
||||
uint length = 0;
|
||||
|
||||
@@ -271,7 +271,7 @@ static void istream_destructor(php_istream *stm)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
|
||||
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
|
||||
*/
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
{
|
||||
ITypeLib *TL = NULL;
|
||||
char *strtok_buf, *major, *minor;
|
||||
@@ -153,7 +153,7 @@ PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_D
|
||||
}
|
||||
|
||||
/* Given a type-library, merge it into the current engine state */
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
{
|
||||
int i, j, interfaces;
|
||||
TYPEKIND pTKind;
|
||||
@@ -224,7 +224,7 @@ void php_com_typelibrary_dtor(void *pDest)
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC)
|
||||
{
|
||||
ITypeLib **TLp;
|
||||
|
||||
@@ -98,7 +98,7 @@ bogus:
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -166,7 +166,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
int ret = SUCCESS;
|
||||
@@ -258,7 +258,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
|
||||
}
|
||||
|
||||
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
{
|
||||
int ret = SUCCESS;
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ static void disp_destructor(php_dispatchex *disp)
|
||||
CoTaskMemFree(disp);
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
HashTable *id_to_name TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
|
||||
@@ -625,7 +625,7 @@ PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
return (IDispatch*)disp;
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = NULL;
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ extern zend_module_entry com_dotnet_module_entry;
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# define PHP_COM_DOTNET_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_COM_DOTNET_API
|
||||
#endif
|
||||
|
||||
PHP_MINIT_FUNCTION(com_dotnet);
|
||||
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
|
||||
PHP_RINIT_FUNCTION(com_dotnet);
|
||||
|
||||
@@ -87,9 +87,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
|
||||
|
||||
/* com_olechar.c */
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
uint *string_len, int codepage TSRMLS_DC);
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
|
||||
uint string_len, int codepage TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
|
||||
|
||||
/* com_wrapper.c */
|
||||
int php_com_wrapper_minit(INIT_FUNC_ARGS);
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
|
||||
/* com_persist.c */
|
||||
int php_com_persist_minit(INIT_FUNC_ARGS);
|
||||
@@ -150,10 +150,10 @@ PHP_FUNCTION(variant_get_type);
|
||||
PHP_FUNCTION(variant_set_type);
|
||||
PHP_FUNCTION(variant_cast);
|
||||
|
||||
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
|
||||
/* com_dotnet.c */
|
||||
PHP_FUNCTION(com_dotnet_create_instance);
|
||||
@@ -162,17 +162,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
|
||||
|
||||
/* com_misc.c */
|
||||
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
|
||||
/* com_typeinfo.c */
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC);
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
int codepage TSRMLS_DC);
|
||||
void php_com_typelibrary_dtor(void *pDest);
|
||||
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
|
||||
|
||||
@@ -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) {
|
||||
@@ -2167,7 +2167,7 @@ string_copy:
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
|
||||
if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if ((Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="c:/tmp"
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
%a
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="/tmp"
|
||||
--FILE--
|
||||
@@ -13,7 +16,7 @@ open_basedir="/tmp"
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$curl = curl_init();
|
||||
|
||||
$fd = fopen('/tmp/test', 'wb');
|
||||
curl_setopt($curl, CURLOPT_FILE, $fd);
|
||||
|
||||
curl_copy_handle($curl);
|
||||
|
||||
echo 'DONE!';
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE!
|
||||
+33
-8
@@ -2035,7 +2035,7 @@ static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_date;
|
||||
@@ -2159,7 +2159,7 @@ static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *cl
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_timezone;
|
||||
@@ -2215,7 +2215,7 @@ static inline zend_object_value date_object_new_interval_ex(zend_class_entry *cl
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_interval, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_interval;
|
||||
@@ -2291,7 +2291,7 @@ static inline zend_object_value date_object_new_period_ex(zend_class_entry *clas
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_period, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_period;
|
||||
@@ -2544,6 +2544,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
|
||||
convert_to_long(*z_timezone_type);
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
|
||||
zend_error_handling error_handling;
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
convert_to_string(*z_timezone);
|
||||
|
||||
switch (Z_LVAL_PP(z_timezone_type)) {
|
||||
@@ -2551,9 +2554,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
case TIMELIB_ZONETYPE_ABBR: {
|
||||
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
|
||||
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
|
||||
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 1 TSRMLS_CC);
|
||||
efree(tmp);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
@@ -2567,10 +2570,15 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
tzobj->tzi.tz = tzi;
|
||||
tzobj->initialized = 1;
|
||||
|
||||
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 1 TSRMLS_CC);
|
||||
zval_ptr_dtor(&tmp_obj);
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return 0;
|
||||
}
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3511,6 +3519,14 @@ zval *date_interval_read_property(zval *object, zval *member, int type TSRMLS_DC
|
||||
|
||||
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
|
||||
|
||||
if (!obj->initialized) {
|
||||
retval = (zend_get_std_object_handlers())->read_property(object, member, type TSRMLS_CC);
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
#define GET_VALUE_FROM_STRUCT(n,m) \
|
||||
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
|
||||
value = obj->diff->n; \
|
||||
@@ -3560,8 +3576,17 @@ void date_interval_write_property(zval *object, zval *member, zval *value TSRMLS
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
|
||||
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
|
||||
|
||||
if (!obj->initialized) {
|
||||
(zend_get_std_object_handlers())->write_property(object, member, value TSRMLS_CC);
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#define SET_VALUE_FROM_STRUCT(n,m) \
|
||||
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
|
||||
if (value->type != IS_LONG) { \
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #62500 (Segfault in DateInterval class when extended)
|
||||
--INI--
|
||||
date.timezone=GMT
|
||||
--FILE--
|
||||
<?php
|
||||
class Crasher extends DateInterval {
|
||||
public $foo;
|
||||
public function __construct($time_spec) {
|
||||
var_dump($this->foo);
|
||||
$this->foo = 3;
|
||||
var_dump($this->foo);
|
||||
var_dump($this->{2});
|
||||
parent::__construct($time_spec);
|
||||
}
|
||||
}
|
||||
try {
|
||||
$c = new Crasher('blah');
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
--EXPECTF--
|
||||
NULL
|
||||
int(3)
|
||||
|
||||
Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d
|
||||
NULL
|
||||
string(%s) "DateInterval::__construct(): Unknown or bad format (blah)"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #62852 (Unserialize invalid DateTime causes crash)
|
||||
--INI--
|
||||
date.timezone=GMT
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$datetime = unserialize('O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}');
|
||||
var_dump($datetime);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "DateTime::__wakeup(): Failed to parse time string (%s) at position 12 (0): Double time specification"
|
||||
@@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
|
||||
if (buff != NULL) {
|
||||
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
|
||||
xmlOutputBufferFlush(buff);
|
||||
#ifdef LIBXML2_NEW_BUFFER
|
||||
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
|
||||
#else
|
||||
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
|
||||
#endif
|
||||
(void)xmlOutputBufferClose(buff);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+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();
|
||||
}
|
||||
|
||||
@@ -321,6 +321,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
xmlDoc *docp = NULL;
|
||||
xmlXPathContextPtr ctx;
|
||||
int ret;
|
||||
zval *tmp;
|
||||
|
||||
ctx = (xmlXPathContextPtr) obj->ptr;
|
||||
|
||||
@@ -329,10 +330,15 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(*retval);
|
||||
tmp = *retval;
|
||||
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
|
||||
FREE_ZVAL(tmp);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
|
||||
return FAILURE;
|
||||
}
|
||||
if (tmp != *retval) {
|
||||
FREE_ZVAL(tmp);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+5
-1
@@ -3278,7 +3278,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
|
||||
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
|
||||
if (length > 2+l1+1) {
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -3428,6 +3428,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
case M_SOF13:
|
||||
case M_SOF14:
|
||||
case M_SOF15:
|
||||
if ((itemlen - 2) < 6) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
exif_process_SOFn(Data, marker, &sof_info);
|
||||
ImageInfo->Width = sof_info.width;
|
||||
ImageInfo->Height = sof_info.height;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ
|
||||
memset(intern, 0, sizeof(struct finfo_object));
|
||||
|
||||
zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor,(void *) &tmp, sizeof(zval *));
|
||||
|
||||
intern->ptr = NULL;
|
||||
|
||||
@@ -271,7 +271,7 @@ ZEND_GET_MODULE(fileinfo)
|
||||
PHP_MINFO_FUNCTION(fileinfo)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "fileinfo support", "enabled");
|
||||
php_info_print_table_row(2, "fileinfo support", "enabled");
|
||||
php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION);
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
+50
-74
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/apprentice.c 2012-04-22 19:28:57.346309536 +0800
|
||||
--- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
m->str_flags = swap4(m->str_flags);
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800
|
||||
--- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -139,10 +139,8 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -755,8 +755,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
return rv;
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -819,8 +819,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
(void)fprintf(stderr, "timestamp %s\n", buf);
|
||||
} else {
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -857,8 +857,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_swap_header(cdf_header_t *);
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -916,8 +916,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
char *p, *q;
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800
|
||||
--- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1079,8 +1079,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
-#endif
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800
|
||||
--- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1252,8 +1252,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
+
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800
|
||||
--- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1577,8 +1577,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
|
||||
/*
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -1872,11 +1872,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+ return rep_cnt;
|
||||
}
|
||||
+
|
||||
Only in libmagic.orig: funcs.c.orig
|
||||
Only in libmagic.orig: funcs.c.rej
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2253,8 +2251,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2272,8 +2270,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
int magic_errno(magic_t);
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
|
||||
@@ -29,6 +29,9 @@
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
@@ -2467,8 +2465,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
|
||||
protected const char *
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2515,8 +2513,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if ((ec = strchr(c, '\n')) != NULL)
|
||||
*ec = '\0';
|
||||
diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
--- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800
|
||||
--- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -49,7 +49,7 @@
|
||||
off_t, int *, int);
|
||||
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
@@ -2672,8 +2670,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800
|
||||
+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800
|
||||
--- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -2860,7 +2858,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1669,6 +1642,65 @@
|
||||
@@ -1669,6 +1642,42 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -2876,29 +2874,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
+
|
||||
+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
+ switch (Z_STRVAL_P(pattern)[i]) {
|
||||
+ case '?':
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '*':
|
||||
+ t[j++] = '.';
|
||||
+ t[j] = '*';
|
||||
+ break;
|
||||
+ case '.':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '\\':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '\\';
|
||||
+ break;
|
||||
+ case '(':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '(';
|
||||
+ break;
|
||||
+ case ')':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = ')';
|
||||
+ break;
|
||||
+ case '~':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '~';
|
||||
@@ -2926,7 +2901,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1825,67 +1857,163 @@
|
||||
@@ -1825,67 +1834,163 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -2937,23 +2912,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- if (ms->search.s == NULL)
|
||||
- return 0;
|
||||
-
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
l = 0;
|
||||
- l = 0;
|
||||
- rc = regcomp(&rx, m->value.s,
|
||||
- REG_EXTENDED|REG_NEWLINE|
|
||||
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
|
||||
@@ -2970,6 +2929,23 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- size_t l = ms->search.s_len - 1;
|
||||
- char c = ms->search.s[l];
|
||||
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
+ l = v = 0;
|
||||
+#if (PHP_MAJOR_VERSION < 6)
|
||||
+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -1654,29 +1654,6 @@ convert_libmagic_pattern(zval *pattern, int options)
|
||||
|
||||
for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
switch (Z_STRVAL_P(pattern)[i]) {
|
||||
case '?':
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '*':
|
||||
t[j++] = '.';
|
||||
t[j] = '*';
|
||||
break;
|
||||
case '.':
|
||||
t[j++] = '\\';
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '\\':
|
||||
t[j++] = '\\';
|
||||
t[j] = '\\';
|
||||
break;
|
||||
case '(':
|
||||
t[j++] = '\\';
|
||||
t[j] = '(';
|
||||
break;
|
||||
case ')':
|
||||
t[j++] = '\\';
|
||||
t[j] = ')';
|
||||
break;
|
||||
case '~':
|
||||
t[j++] = '\\';
|
||||
t[j] = '~';
|
||||
@@ -1873,7 +1850,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
||||
|
||||
convert_libmagic_pattern(pattern, options);
|
||||
|
||||
l = 0;
|
||||
l = v = 0;
|
||||
#if (PHP_MAJOR_VERSION < 6)
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -18,9 +18,11 @@ ksort($results);
|
||||
var_dump($results);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(6) {
|
||||
array(7) {
|
||||
["%s/resources/dir.zip"]=>
|
||||
string(15) "application/zip"
|
||||
["%s/resources/test.awk"]=>
|
||||
string(10) "text/plain"
|
||||
["%s/resources/test.bmp"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
["%s/resources/test.gif"]=>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip.. only for Windows');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
// Windows uses libfileinfo 1.0.5-dev
|
||||
// this may be causing the slightly different output from the first
|
||||
// finfo_file() call
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(10) "text/plain"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(28) "text/plain; charset=us-ascii"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
* Description: Create a new fileinfo resource.
|
||||
* Source code: ext/fileinfo/fileinfo.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
|
||||
echo "*** Testing finfo_open() : error functionality ***\n";
|
||||
|
||||
var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
|
||||
var_dump( finfo_open( array(), $magicFile ) );
|
||||
var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
|
||||
var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
|
||||
var_dump( finfo_open( 'foobar' ) );
|
||||
|
||||
var_dump( new finfo('foobar') );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_open() : error functionality ***
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
|
||||
bool(false)
|
||||
resource(%d) of type (file_info)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
BEGIN { print "START" }
|
||||
@@ -0,0 +1,90 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_init("34293864345");
|
||||
$n1 = gmp_init("23434293864345");
|
||||
|
||||
$a = array(
|
||||
array(123,45),
|
||||
array(4341,9734),
|
||||
array(23487,333),
|
||||
array(-234234,-123123),
|
||||
array(-100,-2234),
|
||||
array(345,"34587345"),
|
||||
array(345,"0"),
|
||||
array("345556456",345873),
|
||||
array("34545345556456","323432445873"),
|
||||
array($n, $n1),
|
||||
);
|
||||
|
||||
foreach ($a as $val) {
|
||||
$r = gmp_gcdext($val[0],$val[1]);
|
||||
var_dump(gmp_strval($r['g']));
|
||||
var_dump(gmp_strval($r['s']));
|
||||
var_dump(gmp_strval($r['t']));
|
||||
}
|
||||
|
||||
var_dump(gmp_gcdext($val[0],array()));
|
||||
var_dump(gmp_gcdext(array(),array()));
|
||||
var_dump(gmp_gcdext(array(),array(),1));
|
||||
var_dump(gmp_gcdext(array()));
|
||||
var_dump(gmp_gcdext());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "3"
|
||||
string(2) "41"
|
||||
string(4) "-112"
|
||||
string(1) "1"
|
||||
string(4) "-805"
|
||||
string(3) "359"
|
||||
string(1) "3"
|
||||
string(2) "32"
|
||||
string(5) "-2257"
|
||||
string(4) "3003"
|
||||
string(3) "-10"
|
||||
string(2) "19"
|
||||
string(1) "2"
|
||||
string(2) "67"
|
||||
string(2) "-3"
|
||||
string(2) "15"
|
||||
string(7) "-601519"
|
||||
string(1) "6"
|
||||
string(3) "345"
|
||||
string(1) "1"
|
||||
string(1) "0"
|
||||
string(1) "1"
|
||||
string(5) "84319"
|
||||
string(9) "-84241831"
|
||||
string(1) "1"
|
||||
string(12) "167180205823"
|
||||
string(15) "-17856272782919"
|
||||
string(3) "195"
|
||||
string(15) "-23387298979862"
|
||||
string(11) "34225091793"
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_nextprime(-1);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(0);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(-1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(100000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(array());
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime("");
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(new stdclass());
|
||||
var_dump(gmp_strval($n));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "2"
|
||||
string(1) "2"
|
||||
string(4) "-997"
|
||||
string(4) "1009"
|
||||
string(6) "100003"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
string(1) "0"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+4
-5
@@ -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 ) \
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+1
-1
@@ -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);
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+3
-1
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* ucol_getSortKey is exception in that the key length includes the
|
||||
* NUL terminator*/
|
||||
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
|
||||
if(!key_len) {
|
||||
efree( ustr );
|
||||
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
if(!key_len) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL((char *)key, key_len, 0);
|
||||
RETURN_STRINGL((char *)key, key_len - 1, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+65
-21
@@ -99,17 +99,46 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT;
|
||||
|
||||
if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
|
||||
"invalid value for calendar type; it must be one of "
|
||||
"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
|
||||
"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
|
||||
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,
|
||||
"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( pattern_str && pattern_str_len>0 ){
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength,
|
||||
pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
/* object construction -> only set global error */
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting pattern to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* resources allocated from now on */
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( timezone_str && timezone_str_len >0 ){
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
|
||||
timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if(locale_len == 0) {
|
||||
@@ -122,24 +151,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
|
||||
}
|
||||
|
||||
/* Set the calendar if passed */
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
|
||||
ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
if (calendar != UCAL_TRADITIONAL) {
|
||||
ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
|
||||
calendar, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
|
||||
ucal_close(ucal_obj);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
|
||||
": error opening calendar", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(svalue)
|
||||
{
|
||||
efree(svalue);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
|
||||
"formatter creation failed", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
if(timezone_utf16)
|
||||
{
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
|
||||
|
||||
/* Set the class variables */
|
||||
dfo->date_type = date_type;
|
||||
@@ -148,6 +177,19 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if( timezone_str && timezone_str_len > 0){
|
||||
dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
|
||||
}
|
||||
|
||||
error:
|
||||
if (svalue) {
|
||||
efree(svalue);
|
||||
}
|
||||
if (timezone_utf16) {
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
|
||||
/* free_object handles partially constructed instances fine */
|
||||
zval_dtor(return_value);
|
||||
RETVAL_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -169,6 +211,8 @@ PHP_FUNCTION( datefmt_create )
|
||||
*/
|
||||
PHP_METHOD( IntlDateFormatter, __construct )
|
||||
{
|
||||
/* return_value param is being changed, therefore we will always return
|
||||
* NULL here */
|
||||
return_value = getThis();
|
||||
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
+3
-2
@@ -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"
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
+14
-7
@@ -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;
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC);
|
||||
new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
|
||||
/* clone standard parts */
|
||||
zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC);
|
||||
/* clone formatter object */
|
||||
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(new_dfo));
|
||||
if(U_FAILURE(INTL_DATA_ERROR_CODE(new_dfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_dfo), "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
|
||||
IntlDateFormatter_object_dtor(new_dfo, new_obj_val.handle TSRMLS_CC); /* free new object */
|
||||
zend_error(E_ERROR, "Failed to clone IntlDateFormatter object");
|
||||
if (dfo->datef_data.udatf != NULL) {
|
||||
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo),
|
||||
"Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
|
||||
zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC);
|
||||
}
|
||||
return new_obj_val;
|
||||
}
|
||||
|
||||
Executable → Regular
+9
-1
@@ -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
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Loaded 100 of 607 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user