mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-14 20:50:50 +00:00
Compare commits
314
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ff75ba858 | ||
|
|
26e492f2f3 | ||
|
|
92a46fe07e | ||
|
|
45351eaab4 | ||
|
|
0165eec1ea | ||
|
|
60a280936e | ||
|
|
4f860a4412 | ||
|
|
af0c22537a | ||
|
|
8e9805bb79 | ||
|
|
139ac42bec | ||
|
|
c95fd5f758 | ||
|
|
40bb9254c5 | ||
|
|
d3c37f0937 | ||
|
|
dd093ac12a | ||
|
|
79db2855f7 | ||
|
|
71c61921f3 | ||
|
|
189b99aee1 | ||
|
|
457844a226 | ||
|
|
bf064112b7 | ||
|
|
ad570991cf | ||
|
|
6ec6b208e8 | ||
|
|
491b1efacb | ||
|
|
f879e1162f | ||
|
|
dedbba4e5b | ||
|
|
175a9de47f | ||
|
|
752280d4d2 | ||
|
|
b3469560f3 | ||
|
|
613674c7a2 | ||
|
|
36c10242cd | ||
|
|
f495e93057 | ||
|
|
ec36192390 | ||
|
|
a2a8220127 | ||
|
|
936553d666 | ||
|
|
34c3985979 | ||
|
|
b530f53c67 | ||
|
|
4358e90a8f | ||
|
|
bb02fd5772 | ||
|
|
61cf929db3 | ||
|
|
9ef925b351 | ||
|
|
151b16cf7f | ||
|
|
be043ab6d0 | ||
|
|
72f3457161 | ||
|
|
e31553c204 | ||
|
|
64a0e7cdc2 | ||
|
|
2259a8f18b | ||
|
|
b2f4e686f0 | ||
|
|
851a04bb7b | ||
|
|
b5eb1456aa | ||
|
|
0bffdd723f | ||
|
|
75c63c5503 | ||
|
|
6a50a8640c | ||
|
|
592b232e83 | ||
|
|
a9db9efa0c | ||
|
|
8cdd6bc1e7 | ||
|
|
2cbc4053ae | ||
|
|
d9ad532050 | ||
|
|
923511d364 | ||
|
|
395d77c540 | ||
|
|
c8687ee63b | ||
|
|
2e8ab65270 | ||
|
|
734bda7a2d | ||
|
|
46458c2c65 | ||
|
|
b69068705e | ||
|
|
ed3a2eec9c | ||
|
|
4db74b7f19 | ||
|
|
6c1f5eb215 | ||
|
|
d59c1371c2 | ||
|
|
f037ddc859 | ||
|
|
2322be0fab | ||
|
|
ffa72707c8 | ||
|
|
dd6b7ea7bd | ||
|
|
188c124a57 | ||
|
|
4571d7824a | ||
|
|
fd0b3ea663 | ||
|
|
ee172ce3cc | ||
|
|
aa133ea282 | ||
|
|
1e1db9d9bb | ||
|
|
6752f38ccc | ||
|
|
bb276c6155 | ||
|
|
3ad033ffba | ||
|
|
e2d1eecf99 | ||
|
|
e66a5ce56f | ||
|
|
d0ab22e829 | ||
|
|
2e24d9a2b3 | ||
|
|
6096988704 | ||
|
|
eb881a1dd1 | ||
|
|
27542db4e7 | ||
|
|
56425ee610 | ||
|
|
84202c367e | ||
|
|
ee620e9673 | ||
|
|
4c6678d605 | ||
|
|
7609fb433a | ||
|
|
2eff69f402 | ||
|
|
1b13ff6ec7 | ||
|
|
e766f85405 | ||
|
|
3b38d14caf | ||
|
|
30981836fa | ||
|
|
9f44844d7c | ||
|
|
bbf5978e26 | ||
|
|
1677551386 | ||
|
|
d2bee32dfc | ||
|
|
9e91d621e3 | ||
|
|
1f9a1c1cf3 | ||
|
|
33fcec5c4f | ||
|
|
33bea8471c | ||
|
|
b93675d60b | ||
|
|
0cc0f73fc3 | ||
|
|
fa014e07bf | ||
|
|
c36d927331 | ||
|
|
328a3d9f13 | ||
|
|
0a25a0241e | ||
|
|
62d86209cf | ||
|
|
bdf2379400 | ||
|
|
58d6a42528 | ||
|
|
f66642aae1 | ||
|
|
57bebfcbdc | ||
|
|
6ba376f552 | ||
|
|
b29dc146b9 | ||
|
|
a43c45ea7d | ||
|
|
94582f9398 | ||
|
|
a3d078bd8f | ||
|
|
b9dec59b07 | ||
|
|
5f9023ca38 | ||
|
|
9d44ff640c | ||
|
|
d64d9e3351 | ||
|
|
954e7a3b3c | ||
|
|
6c0508f8d5 | ||
|
|
ff0aa24054 | ||
|
|
33db8c0ef6 | ||
|
|
0ab27c35a4 | ||
|
|
485c09a376 | ||
|
|
38476a1543 | ||
|
|
7e816c0921 | ||
|
|
a26390ef0c | ||
|
|
d371a306a2 | ||
|
|
133f610bb1 | ||
|
|
069c448623 | ||
|
|
89948c7fbe | ||
|
|
f7d51df5c6 | ||
|
|
f3108b5f81 | ||
|
|
863e7e0acb | ||
|
|
67d7d03f00 | ||
|
|
e658a91b3d | ||
|
|
66fad45724 | ||
|
|
5dc2cef370 | ||
|
|
dafad1e663 | ||
|
|
59263e386f | ||
|
|
8afb848e18 | ||
|
|
eb8d603d46 | ||
|
|
de884997e0 | ||
|
|
557200b472 | ||
|
|
677de8568a | ||
|
|
521ab78788 | ||
|
|
602bb125c3 | ||
|
|
55b3386a81 | ||
|
|
78cffe0c4d | ||
|
|
8b3c1a380a | ||
|
|
f82dd2c774 | ||
|
|
0410b4e60f | ||
|
|
c11106734d | ||
|
|
886a50a619 | ||
|
|
63a1801d19 | ||
|
|
72c807ad67 | ||
|
|
949f6cd473 | ||
|
|
1ce572ce2c | ||
|
|
8e7081f3ac | ||
|
|
e24194d157 | ||
|
|
383eafe482 | ||
|
|
d92a89fe52 | ||
|
|
4c83ecc754 | ||
|
|
2c74536e6e | ||
|
|
55d680e968 | ||
|
|
1701460867 | ||
|
|
7bedd275eb | ||
|
|
21f085720c | ||
|
|
13bcf685cb | ||
|
|
42f91d6ac6 | ||
|
|
9a72b52a1f | ||
|
|
e4a3696553 | ||
|
|
eca4fc6991 | ||
|
|
d212a5d391 | ||
|
|
87785c7d5a | ||
|
|
d39aa984ad | ||
|
|
6d1bebfcb0 | ||
|
|
64bd4551b4 | ||
|
|
6a8db0c081 | ||
|
|
b98fc4379f | ||
|
|
ca4dd76160 | ||
|
|
cd1f45b3be | ||
|
|
87803ace94 | ||
|
|
a5d0c1e21b | ||
|
|
fbacf9c237 | ||
|
|
b721ed57eb | ||
|
|
7a56ac00a0 | ||
|
|
22f55d5665 | ||
|
|
4e561055a4 | ||
|
|
e5bdd2c0ee | ||
|
|
b0dbf71466 | ||
|
|
85fa4d7747 | ||
|
|
cd34067aec | ||
|
|
3d4c9b7655 | ||
|
|
60ad16e11f | ||
|
|
d304527253 | ||
|
|
92153dcfe3 | ||
|
|
7b6ebd97e7 | ||
|
|
aaa2eee4c0 | ||
|
|
c1284f21a7 | ||
|
|
0cdc1f5626 | ||
|
|
8722173ad5 | ||
|
|
c54d73d54c | ||
|
|
cc5631eca3 | ||
|
|
b9a050100c | ||
|
|
12ea5c54e5 | ||
|
|
4ec29b945c | ||
|
|
36b88d77f2 | ||
|
|
675545f042 | ||
|
|
13768f8650 | ||
|
|
f4054afe40 | ||
|
|
d6e6db4501 | ||
|
|
3dd256a67b | ||
|
|
9d8d84ebdf | ||
|
|
50ab6c63a7 | ||
|
|
2497bb97e7 | ||
|
|
6cd0e446dd | ||
|
|
7a72405171 | ||
|
|
001966c754 | ||
|
|
6513ca85c2 | ||
|
|
dc1138b102 | ||
|
|
8693bae624 | ||
|
|
8b87c6df84 | ||
|
|
46a3f25772 | ||
|
|
ebefbdb76d | ||
|
|
15e31d5720 | ||
|
|
1a23d42909 | ||
|
|
14847af41d | ||
|
|
0b23da1c74 | ||
|
|
8ac61a3e60 | ||
|
|
9cf0139460 | ||
|
|
2e1d31d123 | ||
|
|
b5494c5f17 | ||
|
|
8649e4236b | ||
|
|
c9265b1acd | ||
|
|
3e0b33ed62 | ||
|
|
6524a530df | ||
|
|
2b934dfdf9 | ||
|
|
8c3bf96022 | ||
|
|
1a527397cc | ||
|
|
6bafbb9abf | ||
|
|
8848778a59 | ||
|
|
3ba07c2ca3 | ||
|
|
bec5e10155 | ||
|
|
a5a409ebff | ||
|
|
9be55beb91 | ||
|
|
b2fe342d04 | ||
|
|
da3660a4c4 | ||
|
|
49e91151c0 | ||
|
|
e1c610fb44 | ||
|
|
8091256948 | ||
|
|
da14cdd6f3 | ||
|
|
f19351b503 | ||
|
|
7aed239050 | ||
|
|
9bc1af1e58 | ||
|
|
212cfb95d1 | ||
|
|
be818e7ea7 | ||
|
|
dda0565b53 | ||
|
|
4970926e45 | ||
|
|
786670f536 | ||
|
|
7b307fb930 | ||
|
|
d4f9bbfae2 | ||
|
|
e1180b4f1a | ||
|
|
0239437903 | ||
|
|
5ae7540abd | ||
|
|
7130887719 | ||
|
|
c5a611b257 | ||
|
|
c4b26cc1b0 | ||
|
|
c98a51a169 | ||
|
|
128a4bbb0d | ||
|
|
4db70fd406 | ||
|
|
55b82abe00 | ||
|
|
ed793b2a3f | ||
|
|
01e414bb6f | ||
|
|
45f3322905 | ||
|
|
81c6a060a2 | ||
|
|
82bc8821f9 | ||
|
|
a65cff9151 | ||
|
|
a239658b9e | ||
|
|
2dbd3ac8cd | ||
|
|
07ee764e57 | ||
|
|
346b3ff094 | ||
|
|
228c288686 | ||
|
|
7ca0291b94 | ||
|
|
d289efb457 | ||
|
|
f4a315fce2 | ||
|
|
03a1fcabf3 | ||
|
|
d1f0662e4d | ||
|
|
170ee90bf9 | ||
|
|
3b5defd3b0 | ||
|
|
49b202f2cf | ||
|
|
cbf1db38f7 | ||
|
|
2b6ac9e1a0 | ||
|
|
417a817f6c | ||
|
|
6fb9a6922d | ||
|
|
9a690859f6 | ||
|
|
aa8eabddd6 | ||
|
|
53c8612fe7 | ||
|
|
80520d0903 | ||
|
|
cd896d69d9 | ||
|
|
242658c053 | ||
|
|
433089ccb4 | ||
|
|
ce92857131 | ||
|
|
36100060b3 | ||
|
|
7398029e06 | ||
|
|
2026e9040f | ||
|
|
10642aa9e4 |
No files matched your search
@@ -1,6 +1,19 @@
|
||||
define set_ts
|
||||
set $tsrm_ls = $arg0
|
||||
end
|
||||
|
||||
document set_ts
|
||||
set the ts resource, it is impossible for gdb to
|
||||
call ts_resource_ex while no process is running,
|
||||
but we could get the resource from the argument
|
||||
of frame info.
|
||||
end
|
||||
|
||||
define ____executor_globals
|
||||
if basic_functions_module.zts
|
||||
set $tsrm_ls = ts_resource_ex(0, 0)
|
||||
if !$tsrm_ls
|
||||
set $tsrm_ls = ts_resource_ex(0, 0)
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
else
|
||||
@@ -38,12 +51,53 @@ define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
printf "[%p] ", $t
|
||||
if $t->function_state.function->common.function_name
|
||||
if $t->function_state.arguments
|
||||
set $count = (int)*($t->function_state.arguments)
|
||||
printf "%s(", $t->function_state.function->common.function_name
|
||||
set $fst = $t->function_state
|
||||
if $fst.function->common.function_name
|
||||
if $fst.arguments
|
||||
set $count = (int)*($fst.arguments)
|
||||
|
||||
if $t->object
|
||||
if $fst.function.common.scope
|
||||
printf "%s->", $fst.function.common.scope->name
|
||||
else
|
||||
if !$eg
|
||||
____executor_globals
|
||||
end
|
||||
|
||||
set $known_class = 0
|
||||
if $eg
|
||||
set $handle = $t->object.value.obj.handle
|
||||
set $handlers = $t->object.value.obj.handlers
|
||||
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
|
||||
|
||||
if $handlers->get_class_entry == &zend_std_object_get_class
|
||||
set $known_class = 1
|
||||
|
||||
if $handlers.get_class_name
|
||||
if $handlers.get_class_name != &zend_std_object_get_class_name
|
||||
set $known_class = 0
|
||||
end
|
||||
end
|
||||
|
||||
if $known_class
|
||||
printf "%s->", $zobj->ce.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if !$known_class
|
||||
printf "(Unknown)->"
|
||||
end
|
||||
end
|
||||
else
|
||||
if $fst.function.common.scope
|
||||
printf "%s::", $fst.function.common.scope->name
|
||||
end
|
||||
end
|
||||
|
||||
printf "%s(", $fst.function->common.function_name
|
||||
while $count > 0
|
||||
set $zvalue = *(zval **)($t->function_state.arguments - $count)
|
||||
set $zvalue = *(zval **)($fst.arguments - $count)
|
||||
set $type = $zvalue->type
|
||||
if $type == 0
|
||||
printf "NULL"
|
||||
@@ -73,7 +127,7 @@ define dump_bt
|
||||
if $type == 7
|
||||
printf "resource(#%d)", $zvalue->value.lval
|
||||
end
|
||||
if $type == 8
|
||||
if $type == 8
|
||||
printf "constant"
|
||||
end
|
||||
if $type == 9
|
||||
@@ -89,7 +143,7 @@ define dump_bt
|
||||
end
|
||||
printf ") "
|
||||
else
|
||||
printf "%s() ", $t->function_state.function->common.function_name
|
||||
printf "%s() ", $fst.function->common.function_name
|
||||
end
|
||||
else
|
||||
printf "??? "
|
||||
@@ -600,7 +654,7 @@ define zmemcheck
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
|
||||
@@ -15,6 +15,7 @@ ext/dba/libflatfile/flatfile.c ident
|
||||
ext/dba/libcdb/cdb_make.c ident
|
||||
ext/dba/libcdb/cdb.c ident
|
||||
ext/filter/filter.c ident
|
||||
ext/zip/php_zip.c ident
|
||||
README.input_filter ident
|
||||
run-tests.php ident
|
||||
sapi/nsapi/nsapi.c ident
|
||||
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
PHP Coding Standards
|
||||
========================
|
||||
|
||||
This file lists several standards that any programmer, adding or changing
|
||||
code in PHP, should follow. Since this file was added at a very late
|
||||
This file lists several standards that any programmer adding or changing
|
||||
code in PHP should follow. Since this file was added at a very late
|
||||
stage of the development of PHP v3.0, the code base does not (yet) fully
|
||||
follow it, but it's going in that general direction. Since we are now
|
||||
well into the version 4 releases, many sections have been recoded to use
|
||||
well into version 5 releases, many sections have been recoded to use
|
||||
these rules.
|
||||
|
||||
Code Implementation
|
||||
|
||||
@@ -24,6 +24,7 @@ Installing PHP
|
||||
+ Installing a PHP extension on Windows
|
||||
+ Compiling shared PECL extensions with the pecl command
|
||||
+ Compiling shared PECL extensions with phpize
|
||||
+ php-config
|
||||
+ Compiling PECL extensions statically into PHP
|
||||
* Problems?
|
||||
+ Read the FAQ
|
||||
@@ -83,7 +84,7 @@ General Installation Considerations
|
||||
With PHP you can also write desktop GUI applications using the PHP-GTK
|
||||
extension. This is a completely different approach than writing web
|
||||
pages, as you do not output any HTML, but manage windows and objects
|
||||
within them. For more information about PHP-GTK, please » visit the
|
||||
within them. For more information about PHP-GTK, please » visit the
|
||||
site dedicated to this extension. PHP-GTK is not included in the
|
||||
official PHP distribution.
|
||||
|
||||
@@ -92,9 +93,9 @@ General Installation Considerations
|
||||
will also find information on the command line executable in the
|
||||
following sections.
|
||||
|
||||
PHP source code and binary distributions for Windows can be found at »
|
||||
http://www.php.net/downloads.php. We recommend you to choose a » mirror
|
||||
nearest to you for downloading the distributions.
|
||||
PHP source code and binary distributions for Windows can be found at
|
||||
» http://www.php.net/downloads.php. We recommend you to choose a
|
||||
» mirror nearest to you for downloading the distributions.
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
@@ -140,9 +141,9 @@ Table of Contents
|
||||
* A web server
|
||||
* Any module specific components (such as GD, PDF libs, etc.)
|
||||
|
||||
When building directly from SVN sources or after custom modifications
|
||||
When building directly from Git sources or after custom modifications
|
||||
you might also need:
|
||||
* autoconf: 2.13
|
||||
* autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0)
|
||||
* automake: 1.4+
|
||||
* libtool: 1.4.x+ (except 1.4.2)
|
||||
* re2c: Version 0.13.4 or newer
|
||||
@@ -375,12 +376,12 @@ Apache 2.x on Unix systems
|
||||
For information on why, read the related FAQ entry on using Apache2
|
||||
with a threaded MPM
|
||||
|
||||
The » Apache Documentation is the most authoritative source of
|
||||
The » Apache Documentation is the most authoritative source of
|
||||
information on the Apache 2.x server. More information about
|
||||
installation options for Apache may be found there.
|
||||
|
||||
The most recent version of Apache HTTP Server may be obtained from »
|
||||
Apache download site, and a fitting PHP version from the above
|
||||
The most recent version of Apache HTTP Server may be obtained from
|
||||
» Apache download site, and a fitting PHP version from the above
|
||||
mentioned places. This quick guide covers only the basics to get
|
||||
started with Apache 2.x and PHP. For more information read the » Apache
|
||||
Documentation. The version numbers have been omitted here, to ensure
|
||||
@@ -498,7 +499,7 @@ service httpd restart
|
||||
|
||||
This should not be undertaken without being aware of the consequences
|
||||
of this decision, and having at least a fair understanding of the
|
||||
implications. The Apache documentation regarding » MPM-Modules
|
||||
implications. The Apache documentation regarding » MPM-Modules
|
||||
discusses MPMs in a great deal more detail.
|
||||
|
||||
Note:
|
||||
@@ -520,7 +521,7 @@ Lighttpd 1.4 on Unix systems
|
||||
This section contains notes and hints specific to Lighttpd 1.4 installs
|
||||
of PHP on Unix systems.
|
||||
|
||||
Please use the » Lighttpd trac to learn how to install Lighttpd
|
||||
Please use the » Lighttpd trac to learn how to install Lighttpd
|
||||
properly before continuing.
|
||||
|
||||
Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is
|
||||
@@ -627,15 +628,15 @@ Sun, iPlanet and Netscape servers on Sun Solaris
|
||||
current web servers read the note about subrequests.
|
||||
|
||||
You can find more information about setting up PHP for the Netscape
|
||||
Enterprise Server (NES) here: »
|
||||
http://benoit.noss.free.fr/php/install-php4.html
|
||||
Enterprise Server (NES) here:
|
||||
» http://benoit.noss.free.fr/php/install-php4.html
|
||||
|
||||
To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
|
||||
enter the proper install directory for the --with-nsapi=[DIR] option.
|
||||
The default directory is usually /opt/netscape/suitespot/. Please also
|
||||
read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
|
||||
|
||||
1. Install the following packages from » http://www.sunfreeware.com/
|
||||
1. Install the following packages from » http://www.sunfreeware.com/
|
||||
or another download site:
|
||||
+ autoconf-2.13
|
||||
+ automake-1.4
|
||||
@@ -837,7 +838,7 @@ Testing
|
||||
Using Variables
|
||||
|
||||
Some server supplied environment variables are not defined in the
|
||||
current » CGI/1.1 specification. Only the following variables are
|
||||
current » CGI/1.1 specification. Only the following variables are
|
||||
defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE,
|
||||
GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING,
|
||||
REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD,
|
||||
@@ -855,20 +856,20 @@ HP-UX specific installation notes
|
||||
There are two main options for installing PHP on HP-UX systems. Either
|
||||
compile it, or install a pre-compiled binary.
|
||||
|
||||
Official pre-compiled packages are located here: »
|
||||
http://software.hp.com/
|
||||
Official pre-compiled packages are located here:
|
||||
» http://software.hp.com/
|
||||
|
||||
Until this manual section is rewritten, the documentation about
|
||||
compiling PHP (and related extensions) on HP-UX systems has been
|
||||
removed. For now, consider reading the following external resource: »
|
||||
Building Apache and PHP on HP-UX 11.11
|
||||
removed. For now, consider reading the following external resource:
|
||||
» Building Apache and PHP on HP-UX 11.11
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
OpenBSD installation notes
|
||||
|
||||
This section contains notes and hints specific to installing PHP on »
|
||||
OpenBSD 3.6.
|
||||
This section contains notes and hints specific to installing PHP on
|
||||
» OpenBSD 3.6.
|
||||
|
||||
Using Binary Packages
|
||||
|
||||
@@ -900,12 +901,12 @@ Using Binary Packages
|
||||
(install the PEAR libraries)
|
||||
# pkg_add php4-pear-4.3.8.tgz
|
||||
|
||||
Read the » packages(7) manual page for more information about binary
|
||||
Read the » packages(7) manual page for more information about binary
|
||||
packages on OpenBSD.
|
||||
|
||||
Using Ports
|
||||
|
||||
You can also compile up PHP from source using the » ports tree.
|
||||
You can also compile up PHP from source using the » ports tree.
|
||||
However, this is only recommended for users familiar with OpenBSD. The
|
||||
PHP 4 port is split into two sub-directories: core and extensions. The
|
||||
extensions directory generates sub-packages for all of the supported
|
||||
@@ -926,7 +927,7 @@ Common Problems
|
||||
automatically installs into the correct chroot directories, so no
|
||||
special modification is needed there. More information on the
|
||||
OpenBSD Apache is available in the » OpenBSD FAQ.
|
||||
* The OpenBSD 3.6 package for the » gd extension requires XFree86 to
|
||||
* The OpenBSD 3.6 package for the » gd extension requires XFree86 to
|
||||
be installed. If you do not wish to use some of the font features
|
||||
that require X11, install the php4-gd-4.3.8-no_x11.tgz package
|
||||
instead.
|
||||
@@ -951,18 +952,26 @@ Required software
|
||||
|
||||
Solaris installs often lack C compilers and their related tools. Read
|
||||
this FAQ for information on why using GNU versions for some of these
|
||||
tools is necessary. The required software is as follows:
|
||||
tools is necessary.
|
||||
|
||||
For unpacking the PHP distribution you need
|
||||
* tar
|
||||
* gzip or
|
||||
* bzip2
|
||||
|
||||
For compiling PHP you need
|
||||
* gcc (recommended, other C compilers may work)
|
||||
* make
|
||||
* flex
|
||||
* GNU sed
|
||||
|
||||
For building extra extensions or hacking the code of PHP you might also
|
||||
need
|
||||
* flex (up to PHP 5.2)
|
||||
* re2c
|
||||
* bison
|
||||
* m4
|
||||
* autoconf
|
||||
* automake
|
||||
* perl
|
||||
* gzip
|
||||
* tar
|
||||
* GNU sed
|
||||
|
||||
In addition, you will need to install (and possibly compile) any
|
||||
additional software specific to your configuration, such as Oracle or
|
||||
@@ -971,14 +980,16 @@ Required software
|
||||
Using Packages
|
||||
|
||||
You can simplify the Solaris install process by using pkgadd to install
|
||||
most of your needed components.
|
||||
most of your needed components. The Image Packaging System (IPS) for
|
||||
Solaris 11 Express also contains most of the required components for
|
||||
installation using the pkg command.
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
Debian GNU/Linux installation notes
|
||||
|
||||
This section contains notes and hints specific to installing PHP on »
|
||||
Debian GNU/Linux.
|
||||
This section contains notes and hints specific to installing PHP on
|
||||
» Debian GNU/Linux.
|
||||
Warning
|
||||
|
||||
Unofficial builds from third-parties are not supported here. Any bugs
|
||||
@@ -1205,6 +1216,7 @@ Table of Contents
|
||||
* Installing a PHP extension on Windows
|
||||
* Compiling shared PECL extensions with the pecl command
|
||||
* Compiling shared PECL extensions with phpize
|
||||
* php-config
|
||||
* Compiling PECL extensions statically into PHP
|
||||
__________________________________________________________________
|
||||
|
||||
@@ -1227,8 +1239,8 @@ Introduction to PECL Installations
|
||||
To this php.ini file, or through the use of the dl() function.
|
||||
|
||||
When building PHP modules, it's important to have known-good versions
|
||||
of the required tools (autoconf, automake, libtool, etc.) See the »
|
||||
Anonymous SVN Instructions for details on the required tools, and
|
||||
of the required tools (autoconf, automake, libtool, etc.) See the
|
||||
» Anonymous Git Instructions for details on the required tools, and
|
||||
required versions.
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
@@ -1247,7 +1259,7 @@ Downloading PECL extensions
|
||||
the PECL web site are available for download and installation using
|
||||
the » pecl command. Specific revisions may also be specified.
|
||||
* SVN Most PECL extensions also reside in SVN. A web-based view may
|
||||
be seen at » http://svn.php.net/viewvc/pecl/. To download straight
|
||||
be seen at » http://svn.php.net/viewvc/pecl/. To download straight
|
||||
from SVN, the following sequence of commands may be used:
|
||||
$ svn checkout http://svn.php.net/repository/pecl/extname/trunk
|
||||
extname
|
||||
@@ -1279,7 +1291,7 @@ Where to find an extension?
|
||||
|
||||
PHP extensions are usually called "php_*.dll" (where the star
|
||||
represents the name of the extension) and they are located under the
|
||||
"PHP\ext" ("PHP\extensions" in PHP4) folder.
|
||||
"PHP\ext" ("PHP\extensions" in PHP 4) folder.
|
||||
|
||||
PHP ships with the extensions most useful to the majority of
|
||||
developers. They are called "core" extensions.
|
||||
@@ -1365,7 +1377,7 @@ Resolving problems
|
||||
|
||||
Compiling shared PECL extensions with the pecl command
|
||||
|
||||
PECL makes it easy to create shared PHP extensions. Using the » pecl
|
||||
PECL makes it easy to create shared PHP extensions. Using the » pecl
|
||||
command, do the following:
|
||||
|
||||
$ pecl install extname
|
||||
@@ -1424,6 +1436,51 @@ $ make
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
php-config
|
||||
|
||||
php-config is a simple shell script for obtaining information about the
|
||||
installed PHP configuration.
|
||||
|
||||
When compiling extensions, if you have multiple PHP versions installed,
|
||||
you may specify for which installation you'd like to build by using the
|
||||
--with-php-config option during configuration, specifying the path of
|
||||
the respective php-config script.
|
||||
|
||||
The list of command line options provided by the php-config script can
|
||||
be queried anytime by running php-config with the -h switch:
|
||||
Usage: /usr/local/bin/php-config [OPTION]
|
||||
Options:
|
||||
--prefix [...]
|
||||
--includes [...]
|
||||
--ldflags [...]
|
||||
--libs [...]
|
||||
--extension-dir [...]
|
||||
--include-dir [...]
|
||||
--php-binary [...]
|
||||
--php-sapis [...]
|
||||
--configure-options [...]
|
||||
--version [...]
|
||||
--vernum [...]
|
||||
|
||||
CAPTION: Command line options
|
||||
|
||||
Option Description
|
||||
--prefix Directory prefix where PHP is installed, e.g. /usr/local
|
||||
--includes List of -I options with all include files
|
||||
--ldflags LD Flags which PHP was compiled with
|
||||
--libs Extra libraries which PHP was compiled with
|
||||
--extension-dir Directory where extensions are searched by default
|
||||
--include-dir Directory prefix where header files are installed by
|
||||
default
|
||||
--php-binary Full path to php CLI or CGI binary
|
||||
--php-sapis Show all SAPI modules available
|
||||
--configure-options Configure options to recreate configuration of
|
||||
current PHP installation
|
||||
--version PHP version
|
||||
--vernum PHP version as integer
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
Compiling PECL extensions statically into PHP
|
||||
|
||||
You might find that you need to build a PECL extension statically into
|
||||
@@ -1485,11 +1542,11 @@ Other problems
|
||||
If you are still stuck, someone on the PHP installation mailing list
|
||||
may be able to help you. You should check out the archive first, in
|
||||
case someone already answered someone else who had the same problem as
|
||||
you. The archives are available from the support page on »
|
||||
http://www.php.net/support.php. To subscribe to the PHP installation
|
||||
mailing list, send an empty mail to »
|
||||
php-install-subscribe@lists.php.net. The mailing list address is »
|
||||
php-install@lists.php.net.
|
||||
you. The archives are available from the support page on
|
||||
» http://www.php.net/support.php. To subscribe to the PHP installation
|
||||
mailing list, send an empty mail to
|
||||
» php-install-subscribe@lists.php.net. The mailing list address is
|
||||
» php-install@lists.php.net.
|
||||
|
||||
If you want to get help on the mailing list, please try to be precise
|
||||
and give the necessary details about your environment (which operating
|
||||
@@ -1504,11 +1561,11 @@ Bug reports
|
||||
If you think you have found a bug in PHP, please report it. The PHP
|
||||
developers probably don't know about it, and unless you report it,
|
||||
chances are it won't be fixed. You can report bugs using the
|
||||
bug-tracking system at » http://bugs.php.net/. Please do not send bug
|
||||
bug-tracking system at » http://bugs.php.net/. Please do not send bug
|
||||
reports in mailing list or personal letters. The bug system is also
|
||||
suitable to submit feature requests.
|
||||
|
||||
Read the » How to report a bug document before submitting any bug
|
||||
Read the » How to report a bug document before submitting any bug
|
||||
reports!
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
@@ -1528,14 +1585,14 @@ The configuration file
|
||||
|
||||
The configuration file (php.ini) is read when PHP starts up. For the
|
||||
server module versions of PHP, this happens only once when the web
|
||||
server is started. For the CGI and CLI version, it happens on every
|
||||
server is started. For the CGI and CLI versions, it happens on every
|
||||
invocation.
|
||||
|
||||
php.ini is searched in these locations (in order):
|
||||
php.ini is searched for in these locations (in order):
|
||||
* SAPI module specific location (PHPIniDir directive in Apache 2, -c
|
||||
command line option in CGI and CLI, php_ini parameter in NSAPI,
|
||||
PHP_INI_PATH environment variable in THTTPD)
|
||||
* The PHPRC environment variable. Before PHP 5.2.0 this was checked
|
||||
* The PHPRC environment variable. Before PHP 5.2.0, this was checked
|
||||
after the registry key mentioned below.
|
||||
* As of PHP 5.2.0, the location of the php.ini file can be set for
|
||||
different versions of PHP. The following registry keys are examined
|
||||
@@ -1543,33 +1600,33 @@ The configuration file
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP
|
||||
major, minor and release versions. If there is a value for
|
||||
IniFilePath in these keys, then the first one found will be used as
|
||||
the location of the php.ini (Windows only).
|
||||
IniFilePath in any of these keys, the first one found will be used
|
||||
as the location of the php.ini (Windows only).
|
||||
* [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows
|
||||
only).
|
||||
* Current working directory (except CLI)
|
||||
* Current working directory (except CLI).
|
||||
* The web server's directory (for SAPI modules), or directory of PHP
|
||||
(otherwise in Windows)
|
||||
(otherwise in Windows).
|
||||
* Windows directory (C:\windows or C:\winnt) (for Windows), or
|
||||
--with-config-file-path compile time option
|
||||
--with-config-file-path compile time option.
|
||||
|
||||
If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
|
||||
e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI
|
||||
name can be determined by php_sapi_name().
|
||||
If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example,
|
||||
php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI
|
||||
name can be determined with php_sapi_name().
|
||||
|
||||
Note:
|
||||
|
||||
The Apache web server changes the directory to root at startup
|
||||
The Apache web server changes the directory to root at startup,
|
||||
causing PHP to attempt to read php.ini from the root filesystem if
|
||||
it exists.
|
||||
|
||||
The php.ini directives handled by extensions are documented
|
||||
respectively on the pages of the extensions themselves. The list of the
|
||||
core directives is available in the appendix. Probably not all PHP
|
||||
directives are documented in the manual though. For a complete list of
|
||||
The php.ini directives handled by extensions are documented on the
|
||||
respective pages of the extensions themselves. A list of the core
|
||||
directives is available in the appendix. Not all PHP directives are
|
||||
necessarily documented in this manual: for a complete list of
|
||||
directives available in your PHP version, please read your well
|
||||
commented php.ini file. Alternatively, you may find the » the latest
|
||||
php.ini from SVN helpful too.
|
||||
commented php.ini file. Alternatively, you may find » the latest
|
||||
php.ini from Git helpful too.
|
||||
|
||||
Example #1 php.ini example
|
||||
; any text on a line after an unquoted semicolon (;) is ignored
|
||||
@@ -1635,12 +1692,13 @@ Where a configuration setting may be set
|
||||
|
||||
CAPTION: Definition of PHP_INI_* modes
|
||||
|
||||
Mode Value Meaning
|
||||
PHP_INI_USER 1 Entry can be set in user scripts (like with ini_set())
|
||||
or in the Windows registry
|
||||
PHP_INI_PERDIR 6 Entry can be set in php.ini, .htaccess or httpd.conf
|
||||
PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
|
||||
PHP_INI_ALL 7 Entry can be set anywhere
|
||||
Mode Meaning
|
||||
PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or
|
||||
in the Windows registry. Since PHP 5.3, entry can be set in .user.ini
|
||||
PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or
|
||||
.user.ini (since PHP 5.3)
|
||||
PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf
|
||||
PHP_INI_ALL Entry can be set anywhere
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
@@ -1788,13 +1846,9 @@ Installation
|
||||
each request to play in, further weaknesses are introduced into
|
||||
PHP's system.
|
||||
|
||||
If you feel you have to use a threaded MPM, look at a FastCGI
|
||||
If you want to use a threaded MPM, look at a FastCGI
|
||||
configuration where PHP is running in its own memory space.
|
||||
|
||||
And finally, this warning against using a threaded MPM is not as
|
||||
strong for Windows systems because most libraries on that
|
||||
platform tend to be threadsafe.
|
||||
|
||||
Unix/Windows: Where should my php.ini file be located?
|
||||
By default on Unix it should be in /usr/local/lib which is
|
||||
<install-path>/lib. Most people will want to change this at
|
||||
|
||||
@@ -1,6 +1,149 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.4.6
|
||||
04 Oct 2012, PHP 5.4.8 RC1
|
||||
|
||||
- CLI server:
|
||||
. Changed response to unknown HTTP method to 501 according to RFC.
|
||||
(Niklas Lindgren).
|
||||
. Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190.
|
||||
(Lars)
|
||||
|
||||
- Core:
|
||||
. Added optional second argument for assert() to specify custom message. Patch
|
||||
by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
|
||||
. Support building PHP with the native client toolchain. (Stuart Langley)
|
||||
. Added --offline option for tests. (Remi)
|
||||
. Fixed bug #63162 (parse_url does not match password component). (husman)
|
||||
. Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
|
||||
. Fixed bug #63093 (Segfault while load extension failed in zts-build).
|
||||
(Laruence)
|
||||
. Fixed bug #62976 (Notice: could not be converted to int when comparing
|
||||
some builtin classes). (Laruence)
|
||||
. Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
|
||||
Windows registry). (aserbulov at parallels dot com)
|
||||
. Fixed bug #62907 (Double free when use traits). (Dmitry)
|
||||
. Fixed bug #61767 (Shutdown functions not called in certain error
|
||||
situation). (Dmitry)
|
||||
. Fixed bug #60909 (custom error handler throwing Exception + fatal error
|
||||
= no shutdown function). (Dmitry)
|
||||
. Fixed bug #60723 (error_log error time has changed to UTC ignoring default
|
||||
timezone). (Laruence)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
|
||||
cause cpu Soaring). (Pierrick)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object)
|
||||
(Lonny Kapelushnik)
|
||||
. Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
|
||||
. Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
|
||||
. Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
|
||||
. Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
|
||||
. Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
|
||||
. Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
|
||||
|
||||
- OpenSSL:
|
||||
. Implemented FR #61421 (OpenSSL signature verification missing RMD160,
|
||||
SHA224, SHA256, SHA384, SHA512). (Mark Jones)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
|
||||
(Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Bug #62987 (Assigning to ArrayObject[null][something] overrides all
|
||||
undefined variables). (Laruence)
|
||||
|
||||
- mbstring:
|
||||
. Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
|
||||
by Alexander Moskaliov via GitHub PR #133. (Lars)
|
||||
|
||||
- Filter extension:
|
||||
. Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
|
||||
string or false. (Lars)
|
||||
|
||||
- Sockets
|
||||
. Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by
|
||||
Igor Wiedler). (Lars)
|
||||
|
||||
13 Sep 2012, PHP 5.4.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
|
||||
. Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
|
||||
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
|
||||
set). (Felipe)
|
||||
. Fixed bug #62763 (register_shutdown_function and extending class).
|
||||
(Laruence)
|
||||
. Fixed bug #62725 (Calling exit() in a shutdown function does not return
|
||||
the exit value). (Laruence)
|
||||
. Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
|
||||
. Fixed bug #62716 (munmap() is called with the incorrect length).
|
||||
(slangley@google.com)
|
||||
. Fixed bug #62358 (Segfault when using traits a lot). (Laruence)
|
||||
. Fixed bug #62328 (implementing __toString and a cast to string fails)
|
||||
(Laruence)
|
||||
. Fixed bug #51363 (Fatal error raised by var_export() not caught by error
|
||||
handler). (Lonny Kapelushnik)
|
||||
. Fixed bug #40459 (Stat and Dir stream wrapper methods do not call
|
||||
constructor). (Stas)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
|
||||
(Pierrick)
|
||||
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
|
||||
|
||||
- Intl:
|
||||
. Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo)
|
||||
. Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo)
|
||||
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
|
||||
|
||||
- Installation:
|
||||
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #55856 (preg_replace should fail on trailing garbage).
|
||||
(reg dot php at alf dot nu)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing
|
||||
trait methods as private). (Felipe)
|
||||
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
|
||||
result). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug (segfault due to retval is not initialized). (Laruence)
|
||||
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
|
||||
when close handler call exit). (Laruence)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
|
||||
(Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
|
||||
(Laruence)
|
||||
. Implemented FR #62840 (Add sort flag to ArrayObject::ksort). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #62836 (Seg fault or broken object references on unserialize()).
|
||||
(Laruence)
|
||||
|
||||
- FPM:
|
||||
. Merged PR 121 by minitux to add support for slow request counting on PHP
|
||||
FPM status page. (Lars)
|
||||
|
||||
16 Aug 2012, PHP 5.4.6
|
||||
|
||||
- CLI Server:
|
||||
. Implemented FR #62700 (have the console output 'Listening on
|
||||
@@ -133,7 +276,7 @@ PHP NEWS
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
|
||||
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
|
||||
dot files). (Laruence)
|
||||
|
||||
+15
-22
@@ -127,33 +127,34 @@ Rolling a stable release
|
||||
|
||||
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
|
||||
3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections)
|
||||
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
|
||||
|
||||
4. Commit those changes
|
||||
|
||||
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
|
||||
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for).
|
||||
When making 5.X release, you need to tag the Zend directory separately!!
|
||||
|
||||
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
|
||||
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
|
||||
was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
|
||||
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
|
||||
8. Commit those changes
|
||||
|
||||
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
|
||||
branch if you're rolling 4.4.x releases).
|
||||
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
|
||||
branch if you're rolling 5.5.x releases).
|
||||
|
||||
10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
|
||||
10. You do not have to update the tree, but of course you can with "``git pull
|
||||
origin <branch>``".
|
||||
|
||||
11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
12. Commit those two tarballs to CVS (phpweb/distributions)
|
||||
12. Commit those two tarballs to Git (php-distributions.git)
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
@@ -171,6 +172,9 @@ Getting the stable release announced
|
||||
|
||||
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
|
||||
|
||||
b. In case multiple PHP minor versions are in active development you have
|
||||
to manually copy the old information to include/releases.inc
|
||||
|
||||
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
|
||||
|
||||
a. ``$PHP_X_VERSION`` to the correct version
|
||||
@@ -187,7 +191,7 @@ Getting the stable release announced
|
||||
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
|
||||
3. Update the ChangeLog file for the given major version
|
||||
f.e. ``ChangeLog-4.php`` from the NEWS file
|
||||
f.e. ``ChangeLog-5.php`` from the NEWS file
|
||||
|
||||
a. go over the list and put every element on one line
|
||||
|
||||
@@ -207,9 +211,9 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
|
||||
|
||||
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
|
||||
|
||||
4. ``cp releases/4_4_0.php releases/4_4_1.php``
|
||||
4. ``cp releases/5_4_0.php releases/5_4_1.php``
|
||||
|
||||
5. ``cvs add releases/4_4_1.php``
|
||||
5. ``git add releases/5_4_1.php``
|
||||
|
||||
6. Update the ``releases/*.php`` file with relevant data. The release
|
||||
announcement file should list in detail:
|
||||
@@ -232,17 +236,6 @@ to upgrade.
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
http://news.php.net/php.internals/17222.
|
||||
|
||||
10. Update ``php-bugs-web/include/functions.php`` to include the new version
|
||||
number, and remove the RC from there.
|
||||
|
||||
11. Update ``qaweb/include/release-qa.php``
|
||||
|
||||
- Update $QA_RELEASES with the appropriate information, which means bumping
|
||||
the version number to an upcoming version.
|
||||
|
||||
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
|
||||
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
|
||||
|
||||
@@ -347,6 +347,9 @@ PHP 5.4 UPGRADE NOTES
|
||||
allows for toggling if the list of namespaces starts from the document root
|
||||
or from the node you call the method on
|
||||
|
||||
- Since 5.4.7, ctor is always called when new user stream wrapper object is created.
|
||||
Before, it was called only when stream_open was called.
|
||||
|
||||
==============================
|
||||
5. Changes to existing classes
|
||||
==============================
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -13,4 +13,10 @@ function eh()
|
||||
set_error_handler("eh");
|
||||
$a = $empty($b);
|
||||
--EXPECTF--
|
||||
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
|
||||
Stack trace:
|
||||
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug51394.php on line 4
|
||||
|
||||
Fatal error: Function name must be a string in %sbug51394.php on line 9
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
|
||||
--FILE--
|
||||
<?php
|
||||
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
|
||||
set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
echo "error($errstr)";
|
||||
throw new Exception("Foo");
|
||||
});
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
#1 %sbug60909_1.php(8): require()
|
||||
#2 {main}
|
||||
thrown in %sbug60909_1.php on line 5
|
||||
|
||||
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
|
||||
--FILE--
|
||||
<?php
|
||||
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
|
||||
set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
|
||||
|
||||
class Bad {
|
||||
public function __toString() {
|
||||
throw new Exception('Oops, I cannot do this');
|
||||
}
|
||||
}
|
||||
|
||||
$bad = new Bad();
|
||||
echo "$bad";
|
||||
--EXPECTF--
|
||||
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -14,5 +14,6 @@ class B extends A
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d
|
||||
==DONE==
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #61767 (Shutdown functions not called in certain error situation)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function($code, $msg, $file = null, $line = null) {
|
||||
echo "Error handler called ($msg)\n";
|
||||
throw new \ErrorException($msg, $code, 0, $file, $line);
|
||||
});
|
||||
|
||||
register_shutdown_function(function(){
|
||||
echo "Shutting down\n";
|
||||
print_r(error_get_last());
|
||||
});
|
||||
|
||||
//$undefined = null; // defined variable does not cause problems
|
||||
$undefined->foo();
|
||||
--EXPECTF--
|
||||
Error handler called (Undefined variable: undefined)
|
||||
|
||||
Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
|
||||
Stack trace:
|
||||
#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug61767.php on line 13
|
||||
|
||||
Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
|
||||
Shutting down
|
||||
Array
|
||||
(
|
||||
[type] => 1
|
||||
[message] => Call to a member function foo() on a non-object
|
||||
[file] => %sbug61767.php
|
||||
[line] => 13
|
||||
)
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #62358 (Segfault when using traits a lot)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("USE_ZEND_ALLOC") !== "0") {
|
||||
die("skip Need Zend MM enabled");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
public function foo() {
|
||||
echo "from T";
|
||||
}
|
||||
}
|
||||
|
||||
interface I {
|
||||
public function foo();
|
||||
}
|
||||
|
||||
abstract class A implements I{
|
||||
use T;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function foo($var) {
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of B::foo() should be compatible with A::foo() in %sbug62358.php on line %d
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #62763 (register_shutdown_function and extending class)
|
||||
--FILE--
|
||||
<?php
|
||||
class test1 {
|
||||
public function __construct() {
|
||||
register_shutdown_function(array($this, 'shutdown'));
|
||||
}
|
||||
public function shutdown() {
|
||||
exit(__METHOD__);
|
||||
}
|
||||
}
|
||||
|
||||
class test2 extends test1 {
|
||||
public function __destruct() {
|
||||
exit (__METHOD__);
|
||||
}
|
||||
}
|
||||
new test1;
|
||||
new test2;
|
||||
?>
|
||||
--EXPECT--
|
||||
test1::shutdowntest2::__destruct
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait myTrait {
|
||||
public function run() {}
|
||||
}
|
||||
|
||||
class myClass {
|
||||
use myTrait {
|
||||
MyTrait::run as private;
|
||||
}
|
||||
}
|
||||
$class = new \ReflectionClass('myClass');
|
||||
var_dump($class->getTraitAliases());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(0) {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #62907 (Double free when use traits)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($name) {
|
||||
if ($name == "B") {
|
||||
eval ("abstract class B extends A { }");
|
||||
} else if ($name == "A") {
|
||||
eval ("abstract class A { use T { T::__construct as __asconstruct; }}");
|
||||
} else if ($name == "T") {
|
||||
eval ("trait T { public function __construct() { } }");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function __construct() {
|
||||
}
|
||||
}
|
||||
echo "okey";
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT
|
||||
--FILE--
|
||||
<?php
|
||||
class Base
|
||||
{
|
||||
private function test()
|
||||
{}
|
||||
}
|
||||
|
||||
class Extension extends Base
|
||||
{
|
||||
private function test($arg)
|
||||
{}
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #63111 (is_callable() lies for abstract static method)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Foo {
|
||||
abstract static function bar();
|
||||
}
|
||||
interface MyInterface {
|
||||
static function bar();
|
||||
}
|
||||
abstract class Bar {
|
||||
static function foo() {
|
||||
echo "ok\n";
|
||||
}
|
||||
}
|
||||
var_dump(is_callable(array("Foo", "bar")));
|
||||
var_dump(is_callable("Foo::bar"));
|
||||
var_dump(is_callable(array("MyInterface", "bar")));
|
||||
var_dump(is_callable("MyInterface::bar"));
|
||||
var_dump(is_callable(array("Bar", "foo")));
|
||||
var_dump(is_callable("Bar::foo"));
|
||||
Bar::foo();
|
||||
Foo::bar();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
ok
|
||||
|
||||
Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #63173: Crash when invoking invalid array callback
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// the important part here are the indexes 1 and 2
|
||||
$callback = [1 => 0, 2 => 0];
|
||||
$callback();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d
|
||||
+26
-6
@@ -258,6 +258,9 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
|
||||
zval *val;
|
||||
|
||||
@@ -270,12 +273,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
}
|
||||
zval_ptr_dtor(&val);
|
||||
}
|
||||
/* Standard PHP objects */
|
||||
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) {
|
||||
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
|
||||
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
|
||||
|
||||
@@ -1031,6 +1028,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
zend_stack context_stack;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* Report about uncaught exception in case of fatal errors */
|
||||
if (EG(exception)) {
|
||||
switch (type) {
|
||||
case E_CORE_ERROR:
|
||||
case E_ERROR:
|
||||
case E_RECOVERABLE_ERROR:
|
||||
case E_PARSE:
|
||||
case E_COMPILE_ERROR:
|
||||
case E_USER_ERROR:
|
||||
if (zend_is_executing(TSRMLS_C)) {
|
||||
error_lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
|
||||
EG(exception) = NULL;
|
||||
if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
|
||||
active_opline->lineno = error_lineno;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Obtain relevant filename and lineno */
|
||||
switch (type) {
|
||||
case E_CORE_ERROR:
|
||||
|
||||
+22
-11
@@ -2265,7 +2265,9 @@ void module_destructor(zend_module_entry *module) /* {{{ */
|
||||
/* Deinitilaise module globals */
|
||||
if (module->globals_size) {
|
||||
#ifdef ZTS
|
||||
ts_free_id(*module->globals_id_ptr);
|
||||
if (*module->globals_id_ptr) {
|
||||
ts_free_id(*module->globals_id_ptr);
|
||||
}
|
||||
#else
|
||||
if (module->globals_dtor) {
|
||||
module->globals_dtor(module->globals_ptr TSRMLS_CC);
|
||||
@@ -2531,6 +2533,9 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#pragma optimize("", off)
|
||||
#endif
|
||||
static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_object_value retval;
|
||||
@@ -2539,6 +2544,9 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name);
|
||||
return retval;
|
||||
}
|
||||
#ifdef ZEND_WIN32
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
static const zend_function_entry disabled_class_new[] = {
|
||||
@@ -2547,16 +2555,15 @@ static const zend_function_entry disabled_class_new[] = {
|
||||
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry disabled_class;
|
||||
zend_class_entry **disabled_class;
|
||||
|
||||
zend_str_tolower(class_name, class_name_length);
|
||||
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
|
||||
if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL);
|
||||
disabled_class.create_object = display_disabled_class;
|
||||
disabled_class.name_length = class_name_length;
|
||||
zend_register_internal_class(&disabled_class TSRMLS_CC);
|
||||
INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
|
||||
(*disabled_class)->create_object = display_disabled_class;
|
||||
zend_hash_clean(&((*disabled_class)->function_table));
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2630,7 +2637,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce_org = fcc->calling_scope;
|
||||
@@ -2653,11 +2659,9 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
/* Skip leading \ */
|
||||
if (Z_STRVAL_P(callable)[0] == '\\') {
|
||||
mlen = Z_STRLEN_P(callable) - 1;
|
||||
mname = Z_STRVAL_P(callable) + 1;
|
||||
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen);
|
||||
} else {
|
||||
mlen = Z_STRLEN_P(callable);
|
||||
mname = Z_STRVAL_P(callable);
|
||||
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen);
|
||||
}
|
||||
/* Check if function with given name exists.
|
||||
@@ -2809,7 +2813,14 @@ get_function_via_handler:
|
||||
|
||||
if (retval) {
|
||||
if (fcc->calling_scope && !call_via_handler) {
|
||||
if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (error) {
|
||||
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
|
||||
retval = 0;
|
||||
} else {
|
||||
zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
|
||||
}
|
||||
} else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
int severity;
|
||||
char *verb;
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
|
||||
@@ -175,6 +175,11 @@ typedef struct _zend_fcall_info_cache {
|
||||
class_container.name = zend_strndup(cl_name, _len); \
|
||||
} \
|
||||
class_container.name_length = _len; \
|
||||
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
}
|
||||
|
||||
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
{ \
|
||||
class_container.constructor = NULL; \
|
||||
class_container.destructor = NULL; \
|
||||
class_container.clone = NULL; \
|
||||
|
||||
+3
-3
@@ -664,7 +664,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
|
||||
|
||||
static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
|
||||
unsigned int n;
|
||||
|
||||
__asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
@@ -690,7 +690,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
|
||||
static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
|
||||
unsigned int n;
|
||||
|
||||
__asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
@@ -2454,7 +2454,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_
|
||||
return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
|
||||
|
||||
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
|
||||
|
||||
/* {{{ proto Closure Closure::bind(Closure $old, object $to [, mixed $scope = "static" ] )
|
||||
Create a closure from another one and bind to another object and scope */
|
||||
ZEND_METHOD(Closure, bind) /* {{{ */
|
||||
ZEND_METHOD(Closure, bind)
|
||||
{
|
||||
zval *newthis, *zclosure, *scope_arg = NULL;
|
||||
zend_closure *closure;
|
||||
|
||||
+24
-15
@@ -2935,6 +2935,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If both methods are private do not enforce a signature */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check number of arguments */
|
||||
if (proto->common.required_num_args < fe->common.required_num_args
|
||||
|| proto->common.num_args > fe->common.num_args) {
|
||||
@@ -3801,9 +3806,12 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
if (prototype) {
|
||||
do_inheritance_check_on_method(fn, prototype TSRMLS_CC);
|
||||
}
|
||||
|
||||
/* one more thing: make sure we properly implement an abstract method */
|
||||
if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
prototype = fn->common.prototype;
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
fn->common.prototype = prototype;
|
||||
}
|
||||
|
||||
/* delete inherited fn if the function to be added is not abstract */
|
||||
@@ -3831,9 +3839,9 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
|
||||
}
|
||||
|
||||
|
||||
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
|
||||
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
zend_function_dtor(fn);
|
||||
@@ -3870,10 +3878,10 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
/* this function_name is never destroyed, because its refcount
|
||||
greater than 1 and classes are always destoyed before the
|
||||
traits they use */
|
||||
/* this function_name is never destroyed, because ZEND_ACC_ALIAS
|
||||
flag is set */
|
||||
fn_copy.common.function_name = aliases[i]->alias;
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
if (aliases[i]->modifiers) {
|
||||
@@ -3906,6 +3914,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* apply aliases which are not qualified by a class name, or which have not
|
||||
* alias name, just setting visibility */
|
||||
@@ -4025,9 +4034,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
|
||||
/** And, ensure that the referenced method is resolvable, too. */
|
||||
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
|
||||
cur_method_ref->mname_len);
|
||||
cur_method_ref->mname_len);
|
||||
method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
|
||||
lcname, cur_method_ref->mname_len + 1);
|
||||
lcname, cur_method_ref->mname_len + 1);
|
||||
efree(lcname);
|
||||
|
||||
if (!method_exists) {
|
||||
@@ -5009,11 +5018,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
|
||||
opline->op2_type = IS_CONST;
|
||||
|
||||
if (doing_inheritance) {
|
||||
/* Make sure a trait does not try to extend a class */
|
||||
if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
|
||||
}
|
||||
|
||||
/* Make sure a trait does not try to extend a class */
|
||||
if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
|
||||
}
|
||||
|
||||
opline->extended_value = parent_class_name->u.op.var;
|
||||
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
|
||||
} else {
|
||||
@@ -6958,9 +6967,9 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name));
|
||||
|
||||
if (((Z_STRLEN_P(name) == sizeof("self")-1) &&
|
||||
!memcmp(lcname, "self", sizeof("self")-1)) ||
|
||||
((Z_STRLEN_P(name) == sizeof("parent")-1) &&
|
||||
!memcmp(lcname, "parent", sizeof("parent")-1))) {
|
||||
!memcmp(lcname, "self", sizeof("self")-1)) ||
|
||||
((Z_STRLEN_P(name) == sizeof("parent")-1) &&
|
||||
!memcmp(lcname, "parent", sizeof("parent")-1))) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name));
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,8 @@ typedef struct _zend_try_catch_element {
|
||||
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
|
||||
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
|
||||
|
||||
#define ZEND_ACC_ALIAS 0x10000000
|
||||
|
||||
char *zend_visibility_string(zend_uint fn_flags);
|
||||
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include "zend_vm.h"
|
||||
#include "zend_dtrace.h"
|
||||
|
||||
zend_class_entry *default_exception_ce;
|
||||
zend_class_entry *error_exception_ce;
|
||||
static zend_class_entry *default_exception_ce;
|
||||
static zend_class_entry *error_exception_ce;
|
||||
static zend_object_handlers default_exception_handlers;
|
||||
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -1490,6 +1490,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
|
||||
if (retval) {
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
EG(exception) = NULL;
|
||||
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
+14
-1
@@ -267,6 +267,15 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
|
||||
}
|
||||
}
|
||||
|
||||
static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
|
||||
efree(op_array->function_name);
|
||||
op_array->function_name = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ZEND_API void destroy_zend_class(zend_class_entry **pce)
|
||||
{
|
||||
zend_class_entry *ce = *pce;
|
||||
@@ -298,6 +307,10 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
|
||||
}
|
||||
zend_hash_destroy(&ce->properties_info);
|
||||
str_efree(ce->name);
|
||||
if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
TSRMLS_FETCH();
|
||||
zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC);
|
||||
}
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->constants_table);
|
||||
if (ce->num_interfaces > 0 && ce->interfaces) {
|
||||
@@ -387,7 +400,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
|
||||
}
|
||||
efree(op_array->opcodes);
|
||||
|
||||
if (op_array->function_name) {
|
||||
if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
|
||||
efree((char*)op_array->function_name);
|
||||
}
|
||||
if (op_array->doc_comment) {
|
||||
|
||||
@@ -1519,6 +1519,9 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
|
||||
ret = compare_function(result, op1, op_free TSRMLS_CC);
|
||||
zend_free_obj_get_result(op_free TSRMLS_CC);
|
||||
return ret;
|
||||
} else if (Z_TYPE_P(op1) == IS_OBJECT) {
|
||||
ZVAL_LONG(result, 1);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
if (!converted) {
|
||||
|
||||
+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) {
|
||||
|
||||
@@ -2412,6 +2412,10 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
|
||||
@@ -1256,6 +1256,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -1558,6 +1562,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -1722,6 +1730,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -1919,6 +1931,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||
DCL_OPLINE
|
||||
zend_execute_data *execute_data;
|
||||
zend_bool nested = 0;
|
||||
zend_bool original_in_execution = EG(in_execution);
|
||||
{%HELPER_VARS%}
|
||||
{%EXECUTION_STATUS%}
|
||||
|
||||
{%INTERNAL_LABELS%}
|
||||
|
||||
|
||||
@@ -927,6 +927,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
|
||||
skip_blanks($f, $m[1], $m[3]."\n");
|
||||
}
|
||||
break;
|
||||
case "EXECUTION_STATUS":
|
||||
if ($kind != ZEND_VM_KIND_GOTO) {
|
||||
out($f, $m[1] . "zend_bool original_in_execution = EG(in_execution);\n");
|
||||
} else {
|
||||
out($f, $m[1] . "zend_bool original_in_execution = op_array? EG(in_execution) : 0;\n");
|
||||
}
|
||||
break;
|
||||
case "INTERNAL_LABELS":
|
||||
if ($kind == ZEND_VM_KIND_GOTO) {
|
||||
// Emit array of labels of opcode handlers and code for
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=5
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=8
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
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`
|
||||
|
||||
|
||||
+15
-5
@@ -713,6 +713,14 @@ PHP_MINIT_FUNCTION(curl)
|
||||
#if LIBCURL_VERSION_NUM >= 0x071202
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP);
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
|
||||
#endif
|
||||
|
||||
|
||||
/* cURL protocol constants (curl_version) */
|
||||
@@ -1606,9 +1614,9 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
dupch->uses = 0;
|
||||
ch->uses++;
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_ADDREF_P(dupch->handlers->write->stream);
|
||||
dupch->handlers->write->stream = ch->handlers->write->stream;
|
||||
Z_ADDREF_P(ch->handlers->write->stream);
|
||||
}
|
||||
dupch->handlers->write->stream = ch->handlers->write->stream;
|
||||
dupch->handlers->write->method = ch->handlers->write->method;
|
||||
dupch->handlers->write->type = ch->handlers->write->type;
|
||||
if (ch->handlers->read->stream) {
|
||||
@@ -2447,6 +2455,8 @@ PHP_FUNCTION(curl_getinfo)
|
||||
create_certinfo(ci, listcode TSRMLS_CC);
|
||||
CAAZ("certinfo", listcode);
|
||||
}
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) {
|
||||
CAAS("primary_ip", s_code);
|
||||
}
|
||||
@@ -2473,10 +2483,10 @@ PHP_FUNCTION(curl_getinfo)
|
||||
} else {
|
||||
switch (option) {
|
||||
/* string variable types */
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500
|
||||
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
|
||||
case CURLINFO_PRIMARY_IP:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
|
||||
case CURLINFO_LOCAL_IP:
|
||||
#endif
|
||||
case CURLINFO_PRIVATE:
|
||||
@@ -2496,7 +2506,7 @@ PHP_FUNCTION(curl_getinfo)
|
||||
break;
|
||||
}
|
||||
/* Long variable types */
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
|
||||
case CURLINFO_PRIMARY_PORT:
|
||||
case CURLINFO_LOCAL_PORT:
|
||||
#endif
|
||||
|
||||
@@ -191,6 +191,9 @@ PHP_FUNCTION(curl_multi_select)
|
||||
FD_ZERO(&exceptfds);
|
||||
|
||||
curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd);
|
||||
if (maxfd == -1) {
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
|
||||
}
|
||||
|
||||
do {
|
||||
FD_ZERO(&curlstream->readfds);
|
||||
FD_ZERO(&curlstream->writefds);
|
||||
FD_ZERO(&curlstream->excfds);
|
||||
|
||||
/* get the descriptors from curl */
|
||||
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$curl = curl_init();
|
||||
|
||||
$fd = tmpfile();
|
||||
curl_setopt($curl, CURLOPT_FILE, $fd);
|
||||
|
||||
curl_copy_handle($curl);
|
||||
|
||||
echo 'DONE!';
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE!
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+52
-50
@@ -1,10 +1,10 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */
|
||||
/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -995,7 +995,7 @@ std:
|
||||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1082 "ext/date/lib/parse_date.re"
|
||||
#line 1083 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -1034,7 +1034,7 @@ yy3:
|
||||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1676 "ext/date/lib/parse_date.re"
|
||||
#line 1677 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -1358,7 +1358,7 @@ yy12:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1771 "ext/date/lib/parse_date.re"
|
||||
#line 1772 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
@@ -2420,7 +2420,7 @@ yy49:
|
||||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1760 "ext/date/lib/parse_date.re"
|
||||
#line 1761 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
@@ -2433,7 +2433,7 @@ yy52:
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1765 "ext/date/lib/parse_date.re"
|
||||
#line 1766 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
@@ -2825,7 +2825,7 @@ yy72:
|
||||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1744 "ext/date/lib/parse_date.re"
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -3602,7 +3602,7 @@ yy166:
|
||||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1607 "ext/date/lib/parse_date.re"
|
||||
#line 1608 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -4139,7 +4139,7 @@ yy193:
|
||||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1666 "ext/date/lib/parse_date.re"
|
||||
#line 1667 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4199,7 +4199,7 @@ yy198:
|
||||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1412 "ext/date/lib/parse_date.re"
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4481,7 +4481,7 @@ yy222:
|
||||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1714 "ext/date/lib/parse_date.re"
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -5208,7 +5208,7 @@ yy278:
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1690 "ext/date/lib/parse_date.re"
|
||||
#line 1691 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5409,7 +5409,7 @@ yy294:
|
||||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1384 "ext/date/lib/parse_date.re"
|
||||
#line 1385 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -6642,7 +6642,7 @@ yy362:
|
||||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1528 "ext/date/lib/parse_date.re"
|
||||
#line 1529 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -7293,7 +7293,7 @@ yy392:
|
||||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1586 "ext/date/lib/parse_date.re"
|
||||
#line 1587 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -9063,7 +9063,7 @@ yy454:
|
||||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1289 "ext/date/lib/parse_date.re"
|
||||
#line 1290 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9634,7 +9634,7 @@ yy475:
|
||||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1426 "ext/date/lib/parse_date.re"
|
||||
#line 1427 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9786,7 +9786,7 @@ yy488:
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1144 "ext/date/lib/parse_date.re"
|
||||
#line 1145 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9815,7 +9815,7 @@ yy490:
|
||||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1181 "ext/date/lib/parse_date.re"
|
||||
#line 1182 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -10150,7 +10150,7 @@ yy523:
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1161 "ext/date/lib/parse_date.re"
|
||||
#line 1162 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10275,7 +10275,7 @@ yy534:
|
||||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1343 "ext/date/lib/parse_date.re"
|
||||
#line 1344 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -11026,7 +11026,7 @@ yy605:
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1358 "ext/date/lib/parse_date.re"
|
||||
#line 1359 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11073,7 +11073,7 @@ yy611:
|
||||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1370 "ext/date/lib/parse_date.re"
|
||||
#line 1371 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11727,7 +11727,7 @@ yy656:
|
||||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1329 "ext/date/lib/parse_date.re"
|
||||
#line 1330 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11846,7 +11846,7 @@ yy666:
|
||||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1273 "ext/date/lib/parse_date.re"
|
||||
#line 1274 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -12094,7 +12094,7 @@ yy700:
|
||||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1556 "ext/date/lib/parse_date.re"
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12666,7 +12666,7 @@ yy763:
|
||||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1301 "ext/date/lib/parse_date.re"
|
||||
#line 1302 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12718,7 +12718,7 @@ yy771:
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1542 "ext/date/lib/parse_date.re"
|
||||
#line 1543 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12869,7 +12869,7 @@ yy783:
|
||||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1577 "ext/date/lib/parse_date.re"
|
||||
#line 1578 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -13028,7 +13028,7 @@ yy793:
|
||||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1398 "ext/date/lib/parse_date.re"
|
||||
#line 1399 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -13256,7 +13256,7 @@ yy814:
|
||||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1509 "ext/date/lib/parse_date.re"
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13284,7 +13284,7 @@ yy817:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1490 "ext/date/lib/parse_date.re"
|
||||
#line 1491 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13366,7 +13366,7 @@ yy821:
|
||||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1476 "ext/date/lib/parse_date.re"
|
||||
#line 1477 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13482,7 +13482,7 @@ yy842:
|
||||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1450 "ext/date/lib/parse_date.re"
|
||||
#line 1451 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13769,7 +13769,7 @@ yy848:
|
||||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1438 "ext/date/lib/parse_date.re"
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -14700,7 +14700,7 @@ yy973:
|
||||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1315 "ext/date/lib/parse_date.re"
|
||||
#line 1316 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -15722,7 +15722,7 @@ yy1066:
|
||||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1207 "ext/date/lib/parse_date.re"
|
||||
#line 1208 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15836,7 +15836,7 @@ yy1075:
|
||||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1253 "ext/date/lib/parse_date.re"
|
||||
#line 1254 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -16753,7 +16753,7 @@ yy1117:
|
||||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1649 "ext/date/lib/parse_date.re"
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16820,7 +16820,7 @@ yy1126:
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1122 "ext/date/lib/parse_date.re"
|
||||
#line 1123 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16949,7 +16949,7 @@ yy1141:
|
||||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1625 "ext/date/lib/parse_date.re"
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -19649,7 +19649,7 @@ yy1294:
|
||||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1099 "ext/date/lib/parse_date.re"
|
||||
#line 1100 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -21382,11 +21382,12 @@ yy1387:
|
||||
s->time->is_localtime = 1;
|
||||
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
|
||||
s->time->z = 0;
|
||||
s->time->dst = 0;
|
||||
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21390 "ext/date/lib/parse_date.c"
|
||||
#line 21391 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21833,7 +21834,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21837 "ext/date/lib/parse_date.c"
|
||||
#line 21838 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21877,7 +21878,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21881 "ext/date/lib/parse_date.c"
|
||||
#line 21882 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23897,7 +23898,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23901 "ext/date/lib/parse_date.c"
|
||||
#line 23902 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -24047,7 +24048,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24051 "ext/date/lib/parse_date.c"
|
||||
#line 24052 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24591,7 +24592,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24595 "ext/date/lib/parse_date.c"
|
||||
#line 24596 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24764,7 +24765,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1775 "ext/date/lib/parse_date.re"
|
||||
#line 1776 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -25070,6 +25071,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
s->time->is_localtime = 1;
|
||||
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
|
||||
s->time->z = 0;
|
||||
s->time->dst = 0;
|
||||
break;
|
||||
|
||||
case 'e': /* timezone */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1073,6 +1073,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
s->time->is_localtime = 1;
|
||||
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
|
||||
s->time->z = 0;
|
||||
s->time->dst = 0;
|
||||
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
@@ -2077,6 +2078,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
s->time->is_localtime = 1;
|
||||
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
|
||||
s->time->z = 0;
|
||||
s->time->dst = 0;
|
||||
break;
|
||||
|
||||
case 'e': /* timezone */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT)
|
||||
--FILE--
|
||||
<?php
|
||||
$tz = new DateTimeZone('America/New_York');
|
||||
$ts = new DateTime('@1341115200', $tz);
|
||||
$int = new DateInterval('P1D');
|
||||
$dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York'));
|
||||
$dayFromTs->add($int);
|
||||
|
||||
echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n";
|
||||
echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ts: 2012-07-01 04:00:00
|
||||
day from ts: 2012-07-02 04:00:00
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #62852 (Unserialize invalid DateTime causes crash)
|
||||
--INI--
|
||||
date.timezone=GMT
|
||||
--XFAIL--
|
||||
bug is not fixed yet
|
||||
--FILE--
|
||||
<?php
|
||||
$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
|
||||
$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
|
||||
|
||||
global $foo;
|
||||
|
||||
class Foo extends DateTime {
|
||||
function __wakeup() {
|
||||
global $foo;
|
||||
$foo = $this;
|
||||
parent::__wakeup();
|
||||
}
|
||||
}
|
||||
|
||||
// Old test case
|
||||
try {
|
||||
unserialize( $s1 );
|
||||
} catch ( Exception $e ) {}
|
||||
|
||||
// My test case
|
||||
try {
|
||||
unserialize( $s2 );
|
||||
} catch ( Exception $e ) {}
|
||||
var_dump( $foo );
|
||||
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
okey
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #62896 Unixtimestamp may take on local times DST flag (this test will only be valid during CEST)
|
||||
--FILE--
|
||||
<?php
|
||||
$tz = new DateTimeZone('Europe/Berlin');
|
||||
|
||||
echo "FROM TIMESTAMP, NO TZ:\n";
|
||||
|
||||
$date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
|
||||
$date->modify('+0 days');
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
|
||||
echo "FROM TIMESTAMP, WITH TZ:\n";
|
||||
|
||||
$date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
|
||||
$date->setTimezone($tz);
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
|
||||
$date->modify('+0 days');
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
|
||||
echo "FROM STRING:\n";
|
||||
|
||||
$date = new DateTime('2012-08-22 00:00:00 CEST', $tz);
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
|
||||
$date->modify('+0 days');
|
||||
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
|
||||
--EXPECT--
|
||||
FROM TIMESTAMP, NO TZ:
|
||||
2012-08-21 22:00:00 GMT+0000 (offset 0)
|
||||
2012-08-21 22:00:00 GMT+0000 (offset 0)
|
||||
FROM TIMESTAMP, WITH TZ:
|
||||
2012-08-22 00:00:00 CEST (offset 7200)
|
||||
2012-08-22 00:00:00 CEST (offset 7200)
|
||||
FROM STRING:
|
||||
2012-08-22 00:00:00 CEST (offset 7200)
|
||||
2012-08-22 00:00:00 CEST (offset 7200)
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
|
||||
if (buff != NULL) {
|
||||
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
|
||||
xmlOutputBufferFlush(buff);
|
||||
#ifdef LIBXML2_NEW_BUFFER
|
||||
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
|
||||
#else
|
||||
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
|
||||
#endif
|
||||
(void)xmlOutputBufferClose(buff);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
/* {{{ arginfo */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
|
||||
ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0)
|
||||
ZEND_END_ARG_INFO();
|
||||
/* }}} */
|
||||
|
||||
|
||||
+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();
|
||||
}
|
||||
|
||||
@@ -730,6 +730,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
PHP_ENCHANT_GET_DICT;
|
||||
@@ -743,8 +744,6 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(sugg);
|
||||
|
||||
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
|
||||
memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));
|
||||
if (suggs && n_sugg) {
|
||||
|
||||
@@ -12,7 +12,7 @@ var_dump(exif_read_data($infile));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(x%x + x%x = x%x > x%x) in %s on line %d
|
||||
Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(%s) in %s on line %d
|
||||
|
||||
Warning: exif_read_data(bug60150.jpg): Error reading from file: got=x%x(=%d) != itemlen-%d=x%x(=%d) in %s on line %d
|
||||
|
||||
|
||||
+55
-250
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.origin/apprentice.c 2012-07-15 18:17:24.802087661 +0800
|
||||
+++ libmagic/apprentice.c 2012-07-15 18:22:49.650087425 +0800
|
||||
--- libmagic.origin/apprentice.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/apprentice.c 2012-09-11 11:36:51.000000000 +0800
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -317,13 +317,13 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
const char *fn, int action)
|
||||
{
|
||||
- int errs = 0;
|
||||
+ int errs = 0, mflen = 0;
|
||||
+ int errs = 0;
|
||||
struct magic_entry *marray;
|
||||
uint32_t marraycount, i, mentrycount = 0, starttest;
|
||||
- size_t slen, files = 0, maxfiles = 0;
|
||||
- char **filearr = NULL, *mfn;
|
||||
+ size_t files = 0, maxfiles = 0;
|
||||
+ char **filearr = NULL, mfn[MAXPATHLEN];
|
||||
+ char **filearr = NULL;
|
||||
struct stat st;
|
||||
DIR *dir;
|
||||
struct dirent *d;
|
||||
@@ -341,7 +341,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
marraycount = 0;
|
||||
|
||||
/* print silly verbose header for USG compat. */
|
||||
@@ -778,14 +773,16 @@
|
||||
@@ -778,14 +773,18 @@
|
||||
(void)fprintf(stderr, "%s\n", usg_hdr);
|
||||
|
||||
/* load directory or file */
|
||||
@@ -349,6 +349,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
+ /* FIXME: Read file names and sort them to prevent
|
||||
+ non-determinism. See Debian bug #488562. */
|
||||
+ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
+ int mflen;
|
||||
+ char mfn[MAXPATHLEN];
|
||||
dir = opendir(fn);
|
||||
if (!dir) {
|
||||
errs++;
|
||||
@@ -360,7 +362,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
file_oomem(ms,
|
||||
strlen(fn) + strlen(d->d_name) + 2);
|
||||
errs++;
|
||||
@@ -793,7 +790,6 @@
|
||||
@@ -793,7 +792,6 @@
|
||||
goto out;
|
||||
}
|
||||
if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
|
||||
@@ -368,7 +370,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
continue;
|
||||
}
|
||||
if (files >= maxfiles) {
|
||||
@@ -803,20 +799,19 @@
|
||||
@@ -803,20 +801,19 @@
|
||||
if ((filearr = CAST(char **,
|
||||
realloc(filearr, mlen))) == NULL) {
|
||||
file_oomem(ms, mlen);
|
||||
@@ -379,7 +381,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
}
|
||||
- filearr[files++] = mfn;
|
||||
+ filearr[files++] = estrndup(mfn, mflen);
|
||||
+ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
|
||||
}
|
||||
closedir(dir);
|
||||
qsort(filearr, files, sizeof(*filearr), cmpstrp);
|
||||
@@ -391,7 +393,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
free(filearr);
|
||||
} else
|
||||
@@ -882,12 +877,7 @@
|
||||
@@ -882,12 +879,7 @@
|
||||
for (i = 0; i < marraycount; i++)
|
||||
mentrycount += marray[i].cont_count;
|
||||
|
||||
@@ -405,7 +407,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
|
||||
mentrycount = 0;
|
||||
for (i = 0; i < marraycount; i++) {
|
||||
@@ -896,9 +886,14 @@
|
||||
@@ -896,9 +888,14 @@
|
||||
mentrycount += marray[i].cont_count;
|
||||
}
|
||||
out:
|
||||
@@ -423,7 +425,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
if (errs) {
|
||||
*magicp = NULL;
|
||||
*nmagicp = 0;
|
||||
@@ -1175,14 +1170,13 @@
|
||||
@@ -1175,14 +1172,13 @@
|
||||
return -1;
|
||||
}
|
||||
me = &(*mentryp)[*nmentryp - 1];
|
||||
@@ -442,7 +444,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
me->mp = m = nm;
|
||||
me->max_count = CAST(uint32_t, cnt);
|
||||
}
|
||||
@@ -1194,23 +1188,13 @@
|
||||
@@ -1194,23 +1190,13 @@
|
||||
struct magic_entry *mp;
|
||||
|
||||
maxmagic += ALLOC_INCR;
|
||||
@@ -469,7 +471,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
me->mp = m;
|
||||
me->max_count = ALLOC_CHUNK;
|
||||
} else
|
||||
@@ -1353,6 +1337,10 @@
|
||||
@@ -1353,6 +1339,10 @@
|
||||
if (m->type == FILE_INVALID) {
|
||||
if (ms->flags & MAGIC_CHECK)
|
||||
file_magwarn(ms, "type `%s' invalid", l);
|
||||
@@ -480,7 +482,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1361,7 +1349,7 @@
|
||||
@@ -1361,7 +1351,7 @@
|
||||
|
||||
m->mask_op = 0;
|
||||
if (*l == '~') {
|
||||
@@ -489,7 +491,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
m->mask_op |= FILE_OPINVERSE;
|
||||
else if (ms->flags & MAGIC_CHECK)
|
||||
file_magwarn(ms, "'~' invalid for string types");
|
||||
@@ -1370,7 +1358,7 @@
|
||||
@@ -1370,7 +1360,7 @@
|
||||
m->str_range = 0;
|
||||
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
|
||||
if ((op = get_op(*l)) != -1) {
|
||||
@@ -498,7 +500,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
uint64_t val;
|
||||
++l;
|
||||
m->mask_op |= op;
|
||||
@@ -1558,11 +1546,6 @@
|
||||
@@ -1558,11 +1548,6 @@
|
||||
if (check_format(ms, m) == -1)
|
||||
return -1;
|
||||
}
|
||||
@@ -510,7 +512,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
m->mimetype[0] = '\0'; /* initialise MIME type to none */
|
||||
if (m->cont_level == 0)
|
||||
++(*nmentryp); /* make room for next */
|
||||
@@ -2195,56 +2178,69 @@
|
||||
@@ -2195,56 +2180,69 @@
|
||||
|
||||
/*
|
||||
* handle a compiled file.
|
||||
@@ -603,7 +605,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
ptr = (uint32_t *)(void *)*magicp;
|
||||
if (*ptr != MAGICNO) {
|
||||
if (swap4(*ptr) != MAGICNO) {
|
||||
@@ -2259,35 +2255,55 @@
|
||||
@@ -2259,35 +2257,55 @@
|
||||
else
|
||||
version = ptr[1];
|
||||
if (version != VERSIONNO) {
|
||||
@@ -675,7 +677,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2301,42 +2317,49 @@
|
||||
@@ -2301,42 +2319,49 @@
|
||||
apprentice_compile(struct magic_set *ms, struct magic **magicp,
|
||||
uint32_t *nmagicp, const char *fn)
|
||||
{
|
||||
@@ -736,7 +738,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -2349,6 +2372,7 @@
|
||||
@@ -2349,6 +2374,7 @@
|
||||
{
|
||||
const char *p, *q;
|
||||
char *buf;
|
||||
@@ -744,7 +746,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
|
||||
if (strip) {
|
||||
if ((p = strrchr(fn, '/')) != NULL)
|
||||
@@ -2370,14 +2394,14 @@
|
||||
@@ -2370,14 +2396,14 @@
|
||||
q++;
|
||||
/* Compatibility with old code that looked in .mime */
|
||||
if (ms->flags & MAGIC_MIME) {
|
||||
@@ -763,7 +765,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
|
||||
/* Compatibility with old code that looked in .mime */
|
||||
if (strstr(p, ".mime") != NULL)
|
||||
@@ -2467,7 +2491,7 @@
|
||||
@@ -2467,7 +2493,7 @@
|
||||
m->offset = swap4((uint32_t)m->offset);
|
||||
m->in_offset = swap4((uint32_t)m->in_offset);
|
||||
m->lineno = swap4((uint32_t)m->lineno);
|
||||
@@ -773,8 +775,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
|
||||
m->str_flags = swap4(m->str_flags);
|
||||
}
|
||||
diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.origin/ascmagic.c 2012-07-15 18:17:24.762087659 +0800
|
||||
+++ libmagic/ascmagic.c 2012-07-15 18:20:42.730087520 +0800
|
||||
--- libmagic.origin/ascmagic.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/ascmagic.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -139,10 +139,8 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -799,8 +801,8 @@ diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
|
||||
return rv;
|
||||
}
|
||||
diff -u libmagic.origin/cdf.c libmagic/cdf.c
|
||||
--- libmagic.origin/cdf.c 2012-07-15 18:17:24.822087659 +0800
|
||||
+++ libmagic/cdf.c 2012-07-15 18:20:42.730087520 +0800
|
||||
--- libmagic.origin/cdf.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/cdf.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -863,8 +865,8 @@ diff -u libmagic.origin/cdf.c libmagic/cdf.c
|
||||
(void)fprintf(stderr, "timestamp %s\n", buf);
|
||||
} else {
|
||||
diff -u libmagic.origin/cdf.h libmagic/cdf.h
|
||||
--- libmagic.origin/cdf.h 2012-07-15 18:17:25.046087660 +0800
|
||||
+++ libmagic/cdf.h 2012-07-15 18:20:42.730087520 +0800
|
||||
--- libmagic.origin/cdf.h 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/cdf.h 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -901,8 +903,8 @@ diff -u libmagic.origin/cdf.h libmagic/cdf.h
|
||||
void cdf_swap_header(cdf_header_t *);
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.origin/cdf_time.c 2012-07-15 18:17:24.734087660 +0800
|
||||
+++ libmagic/cdf_time.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/cdf_time.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/cdf_time.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -960,8 +962,8 @@ diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
char *p, *q;
|
||||
diff -u libmagic.origin/compress.c libmagic/compress.c
|
||||
--- libmagic.origin/compress.c 2012-07-15 18:17:24.730087657 +0800
|
||||
+++ libmagic/compress.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/compress.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/compress.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1122,9 +1124,10 @@ diff -u libmagic.origin/compress.c libmagic/compress.c
|
||||
}
|
||||
-#endif
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
Only in libmagic: diff
|
||||
diff -u libmagic.origin/file.h libmagic/file.h
|
||||
--- libmagic.origin/file.h 2012-07-15 18:17:25.046087660 +0800
|
||||
+++ libmagic/file.h 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/file.h 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/file.h 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1296,8 +1299,8 @@ diff -u libmagic.origin/file.h libmagic/file.h
|
||||
+
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.origin/fsmagic.c 2012-07-15 18:17:24.730087657 +0800
|
||||
+++ libmagic/fsmagic.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/fsmagic.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/fsmagic.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1508,10 +1511,10 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
|
||||
-#else
|
||||
- if (file_printf(ms, "block special") == -1)
|
||||
- return -1;
|
||||
#endif
|
||||
-#endif
|
||||
- }
|
||||
- return 1;
|
||||
-#endif
|
||||
#endif
|
||||
- /* TODO add code to handle V7 MUX and Blit MUX files */
|
||||
+
|
||||
#ifdef S_IFIFO
|
||||
@@ -1621,8 +1624,8 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
|
||||
|
||||
/*
|
||||
diff -u libmagic.origin/funcs.c libmagic/funcs.c
|
||||
--- libmagic.origin/funcs.c 2012-07-15 18:17:25.046087660 +0800
|
||||
+++ libmagic/funcs.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/funcs.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/funcs.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -1916,10 +1919,9 @@ diff -u libmagic.origin/funcs.c libmagic/funcs.c
|
||||
+ return rep_cnt;
|
||||
}
|
||||
+
|
||||
Common subdirectories: libmagic.origin/.libs and libmagic/.libs
|
||||
diff -u libmagic.origin/magic.c libmagic/magic.c
|
||||
--- libmagic.origin/magic.c 2012-07-15 18:17:25.046087660 +0800
|
||||
+++ libmagic/magic.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/magic.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/magic.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2296,8 +2298,8 @@ diff -u libmagic.origin/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.origin/magic.h libmagic/magic.h
|
||||
--- libmagic.origin/magic.h 2012-07-15 18:17:24.734087660 +0800
|
||||
+++ libmagic/magic.h 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/magic.h 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/magic.h 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2315,8 +2317,8 @@ diff -u libmagic.origin/magic.h libmagic/magic.h
|
||||
int magic_errno(magic_t);
|
||||
|
||||
diff -u libmagic.origin/print.c libmagic/print.c
|
||||
--- libmagic.origin/print.c 2012-07-15 18:21:02.846087501 +0800
|
||||
+++ libmagic/print.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/print.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/print.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -29,6 +29,9 @@
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
@@ -2509,206 +2511,9 @@ diff -u libmagic.origin/print.c libmagic/print.c
|
||||
}
|
||||
|
||||
protected const char *
|
||||
diff -u libmagic.origin/print.c.rej libmagic/print.c.rej
|
||||
--- libmagic.origin/print.c.rej 2012-07-15 18:17:24.762087659 +0800
|
||||
+++ libmagic/print.c.rej 2012-07-15 18:20:27.186087168 +0800
|
||||
@@ -1,12 +1,184 @@
|
||||
---- libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
|
||||
-+++ libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
|
||||
-@@ -29,9 +29,6 @@
|
||||
- * print.c - debugging printout routines
|
||||
- */
|
||||
+--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
|
||||
++++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
|
||||
+@@ -48,174 +51,21 @@
|
||||
|
||||
--#include "php.h"
|
||||
--#include "main/snprintf.h"
|
||||
+ #define SZOF(a) (sizeof(a) / sizeof(a[0]))
|
||||
+
|
||||
+-#ifndef COMPILE_ONLY
|
||||
+-protected void
|
||||
+-file_mdump(struct magic *m)
|
||||
+-{
|
||||
+- private const char optyp[] = { FILE_OPS };
|
||||
+-
|
||||
+- (void) fprintf(stderr, "%u: %.*s %u", m->lineno,
|
||||
+- (m->cont_level & 7) + 1, ">>>>>>>>", m->offset);
|
||||
+-
|
||||
+- if (m->flag & INDIR) {
|
||||
+- (void) fprintf(stderr, "(%s,",
|
||||
+- /* Note: type is unsigned */
|
||||
+- (m->in_type < file_nnames) ?
|
||||
+- file_names[m->in_type] : "*bad*");
|
||||
+- if (m->in_op & FILE_OPINVERSE)
|
||||
+- (void) fputc('~', stderr);
|
||||
+- (void) fprintf(stderr, "%c%u),",
|
||||
+- ((size_t)(m->in_op & FILE_OPS_MASK) <
|
||||
+- SZOF(optyp)) ?
|
||||
+- optyp[m->in_op & FILE_OPS_MASK] : '?',
|
||||
+- m->in_offset);
|
||||
+- }
|
||||
+- (void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
|
||||
+- /* Note: type is unsigned */
|
||||
+- (m->type < file_nnames) ? file_names[m->type] : "*bad*");
|
||||
+- if (m->mask_op & FILE_OPINVERSE)
|
||||
+- (void) fputc('~', stderr);
|
||||
+-
|
||||
+- if (IS_STRING(m->type)) {
|
||||
+- if (m->str_flags) {
|
||||
+- (void) fputc('/', stderr);
|
||||
+- if (m->str_flags & STRING_COMPACT_WHITESPACE)
|
||||
+- (void) fputc(CHAR_COMPACT_WHITESPACE, stderr);
|
||||
+- if (m->str_flags & STRING_COMPACT_OPTIONAL_WHITESPACE)
|
||||
+- (void) fputc(CHAR_COMPACT_OPTIONAL_WHITESPACE,
|
||||
+- stderr);
|
||||
+- if (m->str_flags & STRING_IGNORE_LOWERCASE)
|
||||
+- (void) fputc(CHAR_IGNORE_LOWERCASE, stderr);
|
||||
+- if (m->str_flags & STRING_IGNORE_UPPERCASE)
|
||||
+- (void) fputc(CHAR_IGNORE_UPPERCASE, stderr);
|
||||
+- if (m->str_flags & REGEX_OFFSET_START)
|
||||
+- (void) fputc(CHAR_REGEX_OFFSET_START, stderr);
|
||||
+- if (m->str_flags & STRING_TEXTTEST)
|
||||
+- (void) fputc(CHAR_TEXTTEST, stderr);
|
||||
+- if (m->str_flags & STRING_BINTEST)
|
||||
+- (void) fputc(CHAR_BINTEST, stderr);
|
||||
+- if (m->str_flags & PSTRING_1_BE)
|
||||
+- (void) fputc(CHAR_PSTRING_1_BE, stderr);
|
||||
+- if (m->str_flags & PSTRING_2_BE)
|
||||
+- (void) fputc(CHAR_PSTRING_2_BE, stderr);
|
||||
+- if (m->str_flags & PSTRING_2_LE)
|
||||
+- (void) fputc(CHAR_PSTRING_2_LE, stderr);
|
||||
+- if (m->str_flags & PSTRING_4_BE)
|
||||
+- (void) fputc(CHAR_PSTRING_4_BE, stderr);
|
||||
+- if (m->str_flags & PSTRING_4_LE)
|
||||
+- (void) fputc(CHAR_PSTRING_4_LE, stderr);
|
||||
+- if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF)
|
||||
+- (void) fputc(
|
||||
+- CHAR_PSTRING_LENGTH_INCLUDES_ITSELF,
|
||||
+- stderr);
|
||||
+- }
|
||||
+- if (m->str_range)
|
||||
+- (void) fprintf(stderr, "/%u", m->str_range);
|
||||
+- }
|
||||
+- else {
|
||||
+- if ((size_t)(m->mask_op & FILE_OPS_MASK) < SZOF(optyp))
|
||||
+- (void) fputc(optyp[m->mask_op & FILE_OPS_MASK], stderr);
|
||||
+- else
|
||||
+- (void) fputc('?', stderr);
|
||||
+-
|
||||
+- if (m->num_mask) {
|
||||
+- (void) fprintf(stderr, "%.8llx",
|
||||
+- (unsigned long long)m->num_mask);
|
||||
+- }
|
||||
+- }
|
||||
+- (void) fprintf(stderr, ",%c", m->reln);
|
||||
+-
|
||||
+- if (m->reln != 'x') {
|
||||
+- switch (m->type) {
|
||||
+- case FILE_BYTE:
|
||||
+- case FILE_SHORT:
|
||||
+- case FILE_LONG:
|
||||
+- case FILE_LESHORT:
|
||||
+- case FILE_LELONG:
|
||||
+- case FILE_MELONG:
|
||||
+- case FILE_BESHORT:
|
||||
+- case FILE_BELONG:
|
||||
+- (void) fprintf(stderr, "%d", m->value.l);
|
||||
+- break;
|
||||
+- case FILE_BEQUAD:
|
||||
+- case FILE_LEQUAD:
|
||||
+- case FILE_QUAD:
|
||||
+- (void) fprintf(stderr, "%" INT64_T_FORMAT "d",
|
||||
+- (unsigned long long)m->value.q);
|
||||
+- break;
|
||||
+- case FILE_PSTRING:
|
||||
+- case FILE_STRING:
|
||||
+- case FILE_REGEX:
|
||||
+- case FILE_BESTRING16:
|
||||
+- case FILE_LESTRING16:
|
||||
+- case FILE_SEARCH:
|
||||
+- file_showstr(stderr, m->value.s, (size_t)m->vallen);
|
||||
+- break;
|
||||
+- case FILE_DATE:
|
||||
+- case FILE_LEDATE:
|
||||
+- case FILE_BEDATE:
|
||||
+- case FILE_MEDATE:
|
||||
+- (void)fprintf(stderr, "%s,",
|
||||
+- file_fmttime(m->value.l, 1));
|
||||
+- break;
|
||||
+- case FILE_LDATE:
|
||||
+- case FILE_LELDATE:
|
||||
+- case FILE_BELDATE:
|
||||
+- case FILE_MELDATE:
|
||||
+- (void)fprintf(stderr, "%s,",
|
||||
+- file_fmttime(m->value.l, 0));
|
||||
+- break;
|
||||
+- case FILE_QDATE:
|
||||
+- case FILE_LEQDATE:
|
||||
+- case FILE_BEQDATE:
|
||||
+- (void)fprintf(stderr, "%s,",
|
||||
+- file_fmttime((uint32_t)m->value.q, 1));
|
||||
+- break;
|
||||
+- case FILE_QLDATE:
|
||||
+- case FILE_LEQLDATE:
|
||||
+- case FILE_BEQLDATE:
|
||||
+- (void)fprintf(stderr, "%s,",
|
||||
+- file_fmttime((uint32_t)m->value.q, 0));
|
||||
+- break;
|
||||
+- case FILE_FLOAT:
|
||||
+- case FILE_BEFLOAT:
|
||||
+- case FILE_LEFLOAT:
|
||||
+- (void) fprintf(stderr, "%G", m->value.f);
|
||||
+- break;
|
||||
+- case FILE_DOUBLE:
|
||||
+- case FILE_BEDOUBLE:
|
||||
+- case FILE_LEDOUBLE:
|
||||
+- (void) fprintf(stderr, "%G", m->value.d);
|
||||
+- break;
|
||||
+- case FILE_DEFAULT:
|
||||
+- /* XXX - do anything here? */
|
||||
+- break;
|
||||
+- default:
|
||||
+- (void) fputs("*bad*", stderr);
|
||||
+- break;
|
||||
+- }
|
||||
+- }
|
||||
+- (void) fprintf(stderr, ",\"%s\"]\n", m->desc);
|
||||
+-}
|
||||
+-#endif
|
||||
+-
|
||||
+ /*VARARGS*/
|
||||
+ protected void
|
||||
+ file_magwarn(struct magic_set *ms, const char *f, ...)
|
||||
+ {
|
||||
+ va_list va;
|
||||
++ char *expanded_format;
|
||||
++ TSRMLS_FETCH();
|
||||
+
|
||||
+- /* cuz we use stdout for most, stderr here */
|
||||
+- (void) fflush(stdout);
|
||||
-
|
||||
- #include "file.h"
|
||||
+- if (ms->file)
|
||||
+- (void) fprintf(stderr, "%s, %lu: ", ms->file,
|
||||
+- (unsigned long)ms->line);
|
||||
+- (void) fprintf(stderr, "Warning: ");
|
||||
+ va_start(va, f);
|
||||
+- (void) vfprintf(stderr, f, va);
|
||||
++ vasprintf(&expanded_format, f, va);
|
||||
+ va_end(va);
|
||||
+- (void) fputc('\n', stderr);
|
||||
++
|
||||
++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
|
||||
++
|
||||
++ free(expanded_format);
|
||||
+ }
|
||||
|
||||
- #ifndef lint
|
||||
+ protected const char *
|
||||
diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.origin/readcdf.c 2012-07-15 18:17:24.734087660 +0800
|
||||
+++ libmagic/readcdf.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/readcdf.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/readcdf.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2755,8 +2560,8 @@ diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
|
||||
if ((ec = strchr(c, '\n')) != NULL)
|
||||
*ec = '\0';
|
||||
diff -u libmagic.origin/readelf.c libmagic/readelf.c
|
||||
--- libmagic.origin/readelf.c 2012-07-15 18:17:25.046087660 +0800
|
||||
+++ libmagic/readelf.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/readelf.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/readelf.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -49,7 +49,7 @@
|
||||
off_t, int *, int);
|
||||
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
@@ -2912,8 +2717,8 @@ diff -u libmagic.origin/readelf.c libmagic/readelf.c
|
||||
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.origin/softmagic.c 2012-07-15 18:17:24.722087658 +0800
|
||||
+++ libmagic/softmagic.c 2012-07-15 18:20:42.734087519 +0800
|
||||
--- libmagic.origin/softmagic.c 2012-09-11 11:09:26.000000000 +0800
|
||||
+++ libmagic/softmagic.c 2012-09-11 11:33:55.000000000 +0800
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -753,11 +753,11 @@ private int
|
||||
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
|
||||
const char *fn, int action)
|
||||
{
|
||||
int errs = 0, mflen = 0;
|
||||
int errs = 0;
|
||||
struct magic_entry *marray;
|
||||
uint32_t marraycount, i, mentrycount = 0, starttest;
|
||||
size_t files = 0, maxfiles = 0;
|
||||
char **filearr = NULL, mfn[MAXPATHLEN];
|
||||
char **filearr = NULL;
|
||||
struct stat st;
|
||||
DIR *dir;
|
||||
struct dirent *d;
|
||||
@@ -776,6 +776,8 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
|
||||
/* FIXME: Read file names and sort them to prevent
|
||||
non-determinism. See Debian bug #488562. */
|
||||
if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
int mflen;
|
||||
char mfn[MAXPATHLEN];
|
||||
dir = opendir(fn);
|
||||
if (!dir) {
|
||||
errs++;
|
||||
@@ -804,7 +806,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
filearr[files++] = estrndup(mfn, mflen);
|
||||
filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
|
||||
}
|
||||
closedir(dir);
|
||||
qsort(filearr, files, sizeof(*filearr), cmpstrp);
|
||||
|
||||
@@ -99,12 +99,14 @@
|
||||
} \
|
||||
return; \
|
||||
|
||||
#define PHP_FILTER_TRIM_DEFAULT(p, len) { \
|
||||
#define PHP_FILTER_TRIM_DEFAULT(p, len) PHP_FILTER_TRIM_DEFAULT_EX(p, len, 1);
|
||||
|
||||
#define PHP_FILTER_TRIM_DEFAULT_EX(p, len, return_if_empty) { \
|
||||
while ((len > 0) && (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v' || *p == '\n')) { \
|
||||
p++; \
|
||||
len--; \
|
||||
} \
|
||||
if (len < 1) { \
|
||||
if (len < 1 && return_if_empty) { \
|
||||
RETURN_VALIDATION_FAILED \
|
||||
} \
|
||||
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
|
||||
|
||||
@@ -235,12 +235,15 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
int len = Z_STRLEN_P(value);
|
||||
int ret;
|
||||
|
||||
PHP_FILTER_TRIM_DEFAULT(str, len);
|
||||
PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0);
|
||||
|
||||
/* returns true for "1", "true", "on" and "yes"
|
||||
* returns false for "0", "false", "off", "no", and ""
|
||||
* null otherwise. */
|
||||
switch (len) {
|
||||
case 0:
|
||||
ret = 0;
|
||||
break;
|
||||
case 1:
|
||||
if (*str == '1') {
|
||||
ret = 1;
|
||||
@@ -286,7 +289,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
if (ret == -1) {
|
||||
if (ret == -1) {
|
||||
RETURN_VALIDATION_FAILED
|
||||
} else {
|
||||
zval_dtor(value);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
#49510 boolean validation fails with FILTER_NULL_ON_FAILURE
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
|
||||
var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
|
||||
var_dump(filter_var("invalid", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
NULL
|
||||
==DONE==
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_init("34293864345");
|
||||
$n1 = gmp_init("23434293864345");
|
||||
|
||||
$a = array(
|
||||
array(123,45),
|
||||
array(4341,9734),
|
||||
array(23487,333),
|
||||
array(-234234,-123123),
|
||||
array(-100,-2234),
|
||||
array(345,"34587345"),
|
||||
array(345,"0"),
|
||||
array("345556456",345873),
|
||||
array("34545345556456","323432445873"),
|
||||
array($n, $n1),
|
||||
);
|
||||
|
||||
foreach ($a as $val) {
|
||||
$r = gmp_gcdext($val[0],$val[1]);
|
||||
var_dump(gmp_strval($r['g']));
|
||||
var_dump(gmp_strval($r['s']));
|
||||
var_dump(gmp_strval($r['t']));
|
||||
}
|
||||
|
||||
var_dump(gmp_gcdext($val[0],array()));
|
||||
var_dump(gmp_gcdext(array(),array()));
|
||||
var_dump(gmp_gcdext(array(),array(),1));
|
||||
var_dump(gmp_gcdext(array()));
|
||||
var_dump(gmp_gcdext());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "3"
|
||||
string(2) "41"
|
||||
string(4) "-112"
|
||||
string(1) "1"
|
||||
string(4) "-805"
|
||||
string(3) "359"
|
||||
string(1) "3"
|
||||
string(2) "32"
|
||||
string(5) "-2257"
|
||||
string(4) "3003"
|
||||
string(3) "-10"
|
||||
string(2) "19"
|
||||
string(1) "2"
|
||||
string(2) "67"
|
||||
string(2) "-3"
|
||||
string(2) "15"
|
||||
string(7) "-601519"
|
||||
string(1) "6"
|
||||
string(3) "345"
|
||||
string(1) "1"
|
||||
string(1) "0"
|
||||
string(1) "1"
|
||||
string(5) "84319"
|
||||
string(9) "-84241831"
|
||||
string(1) "1"
|
||||
string(12) "167180205823"
|
||||
string(15) "-17856272782919"
|
||||
string(3) "195"
|
||||
string(15) "-23387298979862"
|
||||
string(11) "34225091793"
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_nextprime(-1);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(0);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(-1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(100000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(array());
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime("");
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(new stdclass());
|
||||
var_dump(gmp_strval($n));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "2"
|
||||
string(1) "2"
|
||||
string(4) "-997"
|
||||
string(4) "1009"
|
||||
string(6) "100003"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
string(1) "0"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
Done
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
#include <php.h>
|
||||
|
||||
#include "intl_common.h"
|
||||
#include "intl_error.h"
|
||||
#include "../intl_common.h"
|
||||
#include "../intl_error.h"
|
||||
#include "../intl_data.h"
|
||||
|
||||
#include <unicode/ucol.h>
|
||||
|
||||
@@ -54,9 +55,7 @@ extern zend_class_entry *Collator_ce_ptr;
|
||||
Collator_object* co = NULL; \
|
||||
intl_error_reset( NULL TSRMLS_CC ); \
|
||||
|
||||
#define COLLATOR_METHOD_FETCH_OBJECT \
|
||||
co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC ); \
|
||||
intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC ); \
|
||||
#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(Collator, co)
|
||||
|
||||
// Macro to check return value of a ucol_* function call.
|
||||
#define COLLATOR_CHECK_STATUS( co, msg ) \
|
||||
|
||||
@@ -45,7 +45,7 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC );
|
||||
COLLATOR_METHOD_FETCH_OBJECT;
|
||||
|
||||
if(locale_len == 0) {
|
||||
locale = INTL_G(default_locale);
|
||||
|
||||
@@ -240,7 +240,9 @@ void intl_expose_icu_error_codes( INIT_FUNC_ARGS )
|
||||
INTL_EXPOSE_CONST( U_IDNA_ACE_PREFIX_ERROR );
|
||||
INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR );
|
||||
INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR );
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 6
|
||||
INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR );
|
||||
#endif
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 8
|
||||
INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR );
|
||||
#endif
|
||||
|
||||
@@ -108,7 +108,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
goto error;
|
||||
}
|
||||
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT;
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
|
||||
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php_intl.h"
|
||||
#include "intl_convert.h"
|
||||
#include "../php_intl.h"
|
||||
#include "dateformat_class.h"
|
||||
#include "../intl_convert.h"
|
||||
#include "dateformat_class.h"
|
||||
#include "dateformat_attr.h"
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "dateformat.h"
|
||||
#include "dateformat_attr.h"
|
||||
|
||||
#include <zend_exceptions.h>
|
||||
|
||||
zend_class_entry *IntlDateFormatter_ce_ptr = NULL;
|
||||
static zend_object_handlers IntlDateFormatter_handlers;
|
||||
|
||||
@@ -88,18 +90,23 @@ zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC)
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
|
||||
IntlDateFormatter_object *dfo, *new_dfo;
|
||||
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT;
|
||||
new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC);
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
|
||||
/* clone standard parts */
|
||||
zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC);
|
||||
/* clone formatter object */
|
||||
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(new_dfo));
|
||||
if(U_FAILURE(INTL_DATA_ERROR_CODE(new_dfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_dfo), "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
|
||||
IntlDateFormatter_object_dtor(new_dfo, new_obj_val.handle TSRMLS_CC); /* free new object */
|
||||
zend_error(E_ERROR, "Failed to clone IntlDateFormatter object");
|
||||
if (dfo->datef_data.udatf != NULL) {
|
||||
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo),
|
||||
"Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
|
||||
zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC);
|
||||
}
|
||||
return new_obj_val;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,15 @@ extern zend_class_entry *IntlDateFormatter_ce_ptr;
|
||||
/* Auxiliary macros */
|
||||
|
||||
#define DATE_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlDateFormatter, dfo)
|
||||
#define DATE_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo)
|
||||
#define DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo)
|
||||
#define DATE_FORMAT_METHOD_FETCH_OBJECT \
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
|
||||
if (dfo->datef_data.udatf == NULL) \
|
||||
{ \
|
||||
intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define DATE_FORMAT_OBJECT(dfo) (dfo)->datef_data.udatf
|
||||
|
||||
#endif // #ifndef DATE_FORMAT_CLASS_H
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "formatter_main.h"
|
||||
#include "formatter_attr.h"
|
||||
|
||||
#include <zend_exceptions.h>
|
||||
|
||||
zend_class_entry *NumberFormatter_ce_ptr = NULL;
|
||||
static zend_object_handlers NumberFormatter_handlers;
|
||||
|
||||
@@ -83,18 +85,23 @@ zend_object_value NumberFormatter_object_clone(zval *object TSRMLS_DC)
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
|
||||
NumberFormatter_object *nfo, *new_nfo;
|
||||
|
||||
FORMATTER_METHOD_FETCH_OBJECT;
|
||||
new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC);
|
||||
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
|
||||
/* clone standard parts */
|
||||
zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC);
|
||||
/* clone formatter object */
|
||||
FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), &INTL_DATA_ERROR_CODE(new_nfo));
|
||||
if(U_FAILURE(INTL_DATA_ERROR_CODE(new_nfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_nfo), "Failed to clone NumberFormatter object", 0 TSRMLS_CC );
|
||||
NumberFormatter_object_dtor(new_nfo, new_obj_val.handle TSRMLS_CC); /* free new object */
|
||||
zend_error(E_ERROR, "Failed to clone NumberFormatter object");
|
||||
/* clone formatter object. It may fail, the destruction code must handle this case */
|
||||
if (FORMATTER_OBJECT(nfo) != NULL) {
|
||||
FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo),
|
||||
&INTL_DATA_ERROR_CODE(nfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo),
|
||||
"Failed to clone NumberFormatter object", 0 TSRMLS_CC);
|
||||
zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC);
|
||||
}
|
||||
return new_obj_val;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,17 @@ extern zend_class_entry *NumberFormatter_ce_ptr;
|
||||
|
||||
/* Auxiliary macros */
|
||||
|
||||
#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo)
|
||||
#define FORMATTER_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo)
|
||||
#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum
|
||||
#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo)
|
||||
#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum
|
||||
#define FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo)
|
||||
#define FORMATTER_METHOD_FETCH_OBJECT \
|
||||
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; \
|
||||
if (FORMATTER_OBJECT(nfo) == NULL) \
|
||||
{ \
|
||||
intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Found unconstructed NumberFormatter", 0 TSRMLS_CC); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
|
||||
#endif // #ifndef FORMATTER_CLASS_H
|
||||
@@ -47,7 +47,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
object = return_value;
|
||||
FORMATTER_METHOD_FETCH_OBJECT;
|
||||
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if(pattern && pattern_len) {
|
||||
|
||||
@@ -49,7 +49,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
MSG_FORMAT_METHOD_FETCH_OBJECT;
|
||||
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if(pattern && pattern_len) {
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "msgformat.h"
|
||||
#include "msgformat_attr.h"
|
||||
|
||||
#include <zend_exceptions.h>
|
||||
|
||||
zend_class_entry *MessageFormatter_ce_ptr = NULL;
|
||||
static zend_object_handlers MessageFormatter_handlers;
|
||||
|
||||
@@ -81,18 +83,24 @@ zend_object_value MessageFormatter_object_clone(zval *object TSRMLS_DC)
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
|
||||
MessageFormatter_object *mfo, *new_mfo;
|
||||
|
||||
MSG_FORMAT_METHOD_FETCH_OBJECT;
|
||||
new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC);
|
||||
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
|
||||
/* clone standard parts */
|
||||
zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC);
|
||||
|
||||
/* clone formatter object */
|
||||
MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), &INTL_DATA_ERROR_CODE(new_mfo));
|
||||
if(U_FAILURE(INTL_DATA_ERROR_CODE(new_mfo))) {
|
||||
/* set up error in case error handler is interested */
|
||||
intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_mfo), "Failed to clone MessageFormatter object", 0 TSRMLS_CC );
|
||||
MessageFormatter_object_dtor(new_mfo, new_obj_val.handle TSRMLS_CC); /* free new object */
|
||||
zend_error(E_ERROR, "Failed to clone MessageFormatter object");
|
||||
if (MSG_FORMAT_OBJECT(mfo) != NULL) {
|
||||
MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo),
|
||||
&INTL_DATA_ERROR_CODE(mfo));
|
||||
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
|
||||
intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo),
|
||||
"Failed to clone MessageFormatter object", 0 TSRMLS_CC);
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object");
|
||||
}
|
||||
} else {
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter");
|
||||
}
|
||||
return new_obj_val;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,15 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
|
||||
/* Auxiliary macros */
|
||||
|
||||
#define MSG_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(MessageFormatter, mfo)
|
||||
#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
|
||||
#define MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
|
||||
#define MSG_FORMAT_METHOD_FETCH_OBJECT \
|
||||
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
|
||||
if (MSG_FORMAT_OBJECT(mfo) == NULL) { \
|
||||
intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Found unconstructed MessageFormatter", 0 TSRMLS_CC); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@
|
||||
|
||||
#include "idn/idn.h"
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
|
||||
# include "spoofchecker/spoofchecker_class.h"
|
||||
# include "spoofchecker/spoofchecker.h"
|
||||
# include "spoofchecker/spoofchecker_create.h"
|
||||
@@ -646,7 +646,7 @@ PHP_MINIT_FUNCTION( intl )
|
||||
/* Expose IDN constants to PHP scripts. */
|
||||
idn_register_constants(INIT_FUNC_ARGS_PASSTHRU);
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
|
||||
/* Register 'Spoofchecker' PHP class */
|
||||
spoofchecker_register_Spoofchecker_class( TSRMLS_C );
|
||||
|
||||
|
||||
@@ -261,7 +261,14 @@ PHP_FUNCTION( resourcebundle_get )
|
||||
/* {{{ resourcebundle_array_count */
|
||||
int resourcebundle_array_count(zval *object, long *count TSRMLS_DC)
|
||||
{
|
||||
ResourceBundle_object *rb = (ResourceBundle_object *) zend_object_store_get_object( object TSRMLS_CC);
|
||||
ResourceBundle_object *rb;
|
||||
RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK;
|
||||
|
||||
if (rb->me == NULL) {
|
||||
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"Found unconstructed ResourceBundle", 0 TSRMLS_CC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*count = ures_getSize( rb->me );
|
||||
|
||||
|
||||
@@ -33,7 +33,16 @@ typedef struct {
|
||||
} ResourceBundle_object;
|
||||
|
||||
#define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb)
|
||||
#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
|
||||
#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
|
||||
#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \
|
||||
INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \
|
||||
if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
|
||||
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Found unconstructed ResourceBundle", 0 TSRMLS_CC); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
|
||||
#define RESOURCEBUNDLE_OBJECT(rb) (rb)->me
|
||||
|
||||
void resourcebundle_register_class( TSRMLS_D );
|
||||
|
||||
@@ -127,7 +127,7 @@ static zend_object_value spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ *
|
||||
sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC);
|
||||
|
||||
new_obj_val = Spoofchecker_ce_ptr->create_object(Spoofchecker_ce_ptr TSRMLS_CC);
|
||||
new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
|
||||
/* clone standard parts */
|
||||
zend_objects_clone_members(&new_sfo->zo, new_obj_val, &sfo->zo, handle TSRMLS_CC);
|
||||
|
||||
Loaded 100 of 278 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user