mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-23 00:45:43 +00:00
Compare commits
151
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
532aa2d2ae | ||
|
|
30aeba2c33 | ||
|
|
1bf53c4d90 | ||
|
|
c3be49e07d | ||
|
|
d88ef8d7e1 | ||
|
|
dbfa0140ae | ||
|
|
f5358c0e23 | ||
|
|
8a3e2a6b14 | ||
|
|
164167f3da | ||
|
|
68c500421c | ||
|
|
fc169d2133 | ||
|
|
d8ccffa79a | ||
|
|
e78e839e53 | ||
|
|
528aa540b4 | ||
|
|
548798818b | ||
|
|
55d92413b9 | ||
|
|
5812f7a8d3 | ||
|
|
628a52d365 | ||
|
|
80191eebec | ||
|
|
cd66aad141 | ||
|
|
c1d98588a2 | ||
|
|
d23d4fd61b | ||
|
|
be0758b75a | ||
|
|
cfa885830a | ||
|
|
a308000ff2 | ||
|
|
7ea44da104 | ||
|
|
e305e8fb7a | ||
|
|
7bf2947016 | ||
|
|
c6e8c2bc9f | ||
|
|
591e811a35 | ||
|
|
bc410c2609 | ||
|
|
741efa7807 | ||
|
|
e6aea3dc78 | ||
|
|
123b1d79eb | ||
|
|
59d413ceb8 | ||
|
|
938f256ed9 | ||
|
|
51ea2cfbe1 | ||
|
|
15a71fe045 | ||
|
|
24b1bb0abd | ||
|
|
10dc1950f7 | ||
|
|
f0a42d9fe4 | ||
|
|
f6e8ce8121 | ||
|
|
9eb6f86765 | ||
|
|
98eee90734 | ||
|
|
502cfddf28 | ||
|
|
bc59289b7a | ||
|
|
eaeccc1d99 | ||
|
|
d2047503cb | ||
|
|
578ba71b3b | ||
|
|
e763a1cdc7 | ||
|
|
0fbb9f343f | ||
|
|
9fbf13a496 | ||
|
|
f600785f65 | ||
|
|
b53fb886a4 | ||
|
|
6125ce9d33 | ||
|
|
ad7ed6fe21 | ||
|
|
787e3a1ee4 | ||
|
|
9839d3a953 | ||
|
|
e19bf29b53 | ||
|
|
45ac5edbd9 | ||
|
|
68e27b0763 | ||
|
|
22c487616f | ||
|
|
8e3260376c | ||
|
|
75d0ba5179 | ||
|
|
fadcfc8149 | ||
|
|
7d06a5c89f | ||
|
|
968c8fc0d5 | ||
|
|
37acebcc8c | ||
|
|
5efbcd1882 | ||
|
|
a7815e63bd | ||
|
|
d37658be6c | ||
|
|
9fca585488 | ||
|
|
a645af4456 | ||
|
|
b2dfcb30eb | ||
|
|
1cb2079d6c | ||
|
|
9f00e26008 | ||
|
|
c9a14b3aee | ||
|
|
58dd892156 | ||
|
|
eead6bf97a | ||
|
|
25d40602cb | ||
|
|
34ed75fab7 | ||
|
|
314bef5d03 | ||
|
|
1d781fbdb1 | ||
|
|
44b3bc847b | ||
|
|
0b71ae7a15 | ||
|
|
5d85d967bd | ||
|
|
ede8cee9e6 | ||
|
|
f95063647c | ||
|
|
2198d38cbc | ||
|
|
e02c41fc72 | ||
|
|
7240d99838 | ||
|
|
877e0b04bc | ||
|
|
9071ff5c87 | ||
|
|
80c3b078b8 | ||
|
|
aa143515d6 | ||
|
|
4e85dd0346 | ||
|
|
5f7707cc8a | ||
|
|
d82805f097 | ||
|
|
9891f11f84 | ||
|
|
f955cff54c | ||
|
|
aad4544e95 | ||
|
|
7778106f40 | ||
|
|
8bfe748fb0 | ||
|
|
999fe36d40 | ||
|
|
5acb8381b2 | ||
|
|
fb09021432 | ||
|
|
816758eda2 | ||
|
|
397f5cb687 | ||
|
|
a55af1e271 | ||
|
|
23e97b0222 | ||
|
|
d432bdb4ab | ||
|
|
787bf7eaf7 | ||
|
|
b497b6edf9 | ||
|
|
c8eccf8451 | ||
|
|
d1fc9b425f | ||
|
|
51658bac35 | ||
|
|
f48abfa902 | ||
|
|
843e492c68 | ||
|
|
ec3d864784 | ||
|
|
6b9ccda936 | ||
|
|
74124de048 | ||
|
|
1195de87ff | ||
|
|
ee50fcfa27 | ||
|
|
24e595bf26 | ||
|
|
e995b7e475 | ||
|
|
6d1dd8b0af | ||
|
|
7b248a1b32 | ||
|
|
4d69587035 | ||
|
|
c8dea7ae1e | ||
|
|
9d9873b3b5 | ||
|
|
abefb6dfe7 | ||
|
|
d11fceab15 | ||
|
|
29e673f8ed | ||
|
|
6d0391b1a4 | ||
|
|
a680d701ce | ||
|
|
3752d18ffe | ||
|
|
b05ff14a9a | ||
|
|
db63367871 | ||
|
|
73d6456d7d | ||
|
|
da2f581833 | ||
|
|
418f97443a | ||
|
|
9a01fe712a | ||
|
|
eedc060c92 | ||
|
|
9641586efa | ||
|
|
7670590efd | ||
|
|
7910c1dee9 | ||
|
|
d7a10f0e32 | ||
|
|
83d8ebc991 | ||
|
|
2874fa8fb0 | ||
|
|
99b1a62d55 | ||
|
|
7674b5e574 |
No files matched your search
+1
-2
@@ -18,13 +18,12 @@ clone_depth: 64
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
- c:\build-cache\sdk -> .appveyor.yml
|
||||
|
||||
environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.10
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.12
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
+25
-6
@@ -1,16 +1,35 @@
|
||||
; http://editorconfig.org/
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.yml]
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,m4,sh}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
@@ -15,11 +15,8 @@ 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
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
@@ -32,7 +29,6 @@ UPGRADING.INTERNALS merge=NEWS
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
/ext/ereg/tests/eregi_basic_002.phpt -crlf
|
||||
/ext/iconv/tests/iconv004.phpt -crlf
|
||||
/ext/iconv/tests/iconv_basic.phpt -crlf
|
||||
/ext/iconv/tests/iconv_strpos.phpt -crlf
|
||||
|
||||
@@ -262,9 +262,7 @@ pear/phpize
|
||||
pear/run-tests
|
||||
pear/php-config
|
||||
pear/scripts
|
||||
sapi/apache/libphp7.module
|
||||
sapi/apache2handler/libphp7.module
|
||||
sapi/apache_hooks/libphp7.module
|
||||
sapi/cgi/php-cgi
|
||||
sapi/cgi/php-cgi.1
|
||||
sapi/cli/php.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
|
||||
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
|
||||
|
||||
all: $(all_targets)
|
||||
all: $(all_targets)
|
||||
@echo
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@@ -112,13 +112,13 @@ test: all
|
||||
clean:
|
||||
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
@@ -135,7 +135,7 @@ prof-gen:
|
||||
|
||||
prof-clean:
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
|
||||
@@ -1,8 +1,102 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017 PHP 7.0.25
|
||||
23 Nov 2017 PHP 7.0.26
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75420 (Crash when modifing property name in __isset for
|
||||
BP_VAR_IS). (Laruence)
|
||||
. Fixed bug #75368 (mmap/munmap trashing on unlucky allocations). (Nikita,
|
||||
Dmitry)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown
|
||||
function). (Laruence)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #53070 (enchant_broker_get_path crashes if no path is set). (jelle
|
||||
van der Waa, cmb)
|
||||
. Fixed bug #75365 (Enchant still reports version 1.1.0). (cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #75301 (Exif extension has built in revision version). (Peter
|
||||
Kokot)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #65148 (imagerotate may alter image dimensions). (cmb)
|
||||
. Fixed bug #75437 (Wrong reflection on imagewebp). (Fabien Villepinte)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #75317 (UConverter::setDestinationEncoding changes source instead
|
||||
of destination). (andrewnester)
|
||||
|
||||
- interbase:
|
||||
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #75434 (Wrong reflection for mysqli_fetch_all function). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- OCI8:
|
||||
. Fixed valgrind issue. (Tianfang Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75373 (Warning Internal error: wrong size calculation). (Laruence, Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
|
||||
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #75419 (Default link incorrectly cleared/linked by pg_close()). (Sara)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #75464 (Wrong reflection on SoapClient::__setSoapHeaders). (villfa)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #75299 (Wrong reflection on inflate_init and inflate_add). (Fabien
|
||||
Villepinte)
|
||||
|
||||
26 Oct 2017 PHP 7.0.25
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
|
||||
(Laruence)
|
||||
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
|
||||
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
|
||||
request). (Nikita)
|
||||
. Fixed bug #75220 (Segfault when calling is_callable on parent).
|
||||
(andrewnester)
|
||||
. Fixed bug #75290 (debug info of Closures of internal functions contain
|
||||
garbage argument names). (Andrea)
|
||||
|
||||
- Apache2Handler:
|
||||
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
|
||||
apache2handler). (mcarbonneaux)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
|
||||
optional). (cmb)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
|
||||
|
||||
- OCI8:
|
||||
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
|
||||
|
||||
- litespeed:
|
||||
. Fixed bug #75248 (Binary directory doesn't get created when building
|
||||
only litespeed SAPI). (petk)
|
||||
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
|
||||
(J. Jeising, cmb)
|
||||
|
||||
28 Sep 2017 PHP 7.0.24
|
||||
|
||||
@@ -51,6 +145,7 @@ PHP NEWS
|
||||
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
|
||||
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
|
||||
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
|
||||
. Fixed bug #75349 (NAN comparison). (Sara)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
|
||||
--FILE--
|
||||
<?php
|
||||
function eh(){}
|
||||
|
||||
set_error_handler('eh');
|
||||
|
||||
$d->d = &$d + $d->d/=0;
|
||||
var_dump($d);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(INF)
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #75252: Incorrect token formatting on two parse errors in one request
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$code = <<<'CODE'
|
||||
function test_missing_semicolon() : string {
|
||||
$x = []
|
||||
FOO
|
||||
}
|
||||
CODE;
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump((new ReflectionFunction('sin'))->getClosure());
|
||||
|
||||
var_dump(function ($someThing) {});
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$number"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$someThing"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #75420.1 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #75420.10 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.11 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #75420.12 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.13 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.14 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.15 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj[$name] = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.16 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj[$name] = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.2 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #75420.3 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #75420.4 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj->$name));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #75420.5 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #75420.6 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #75420.7 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj->$name = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #75420.8 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj->$name = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75420.9 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
@@ -896,6 +896,8 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
|
||||
/* this should be compatible with the standard zenderror */
|
||||
ZEND_COLD void zenderror(const char *error) /* {{{ */
|
||||
{
|
||||
CG(parse_error) = 0;
|
||||
|
||||
if (EG(exception)) {
|
||||
/* An exception was thrown in the lexer, don't throw another in the parser. */
|
||||
return;
|
||||
|
||||
+6
-3
@@ -3067,7 +3067,8 @@ get_function_via_handler:
|
||||
(!fcc->function_handler->common.scope ||
|
||||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
@@ -3237,7 +3238,8 @@ again:
|
||||
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
@@ -3324,7 +3326,8 @@ again:
|
||||
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
|
||||
+19
-1
@@ -267,6 +267,8 @@ struct _zend_mm_heap {
|
||||
int peak_chunks_count; /* peak number of allocated chunks for current request */
|
||||
int cached_chunks_count; /* number of cached chunks */
|
||||
double avg_chunks_count; /* average number of chunks allocated per request */
|
||||
int last_chunks_delete_boundary; /* numer of chunks after last deletion */
|
||||
int last_chunks_delete_count; /* number of deletion over the last boundary */
|
||||
#if ZEND_MM_CUSTOM
|
||||
union {
|
||||
struct {
|
||||
@@ -1122,7 +1124,9 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
|
||||
chunk->next->prev = chunk->prev;
|
||||
chunk->prev->next = chunk->next;
|
||||
heap->chunks_count--;
|
||||
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1) {
|
||||
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1
|
||||
|| (heap->chunks_count == heap->last_chunks_delete_boundary
|
||||
&& heap->last_chunks_delete_count >= 4)) {
|
||||
/* delay deletion */
|
||||
heap->cached_chunks_count++;
|
||||
chunk->next = heap->cached_chunks;
|
||||
@@ -1131,6 +1135,14 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size -= ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
if (!heap->cached_chunks) {
|
||||
if (heap->chunks_count != heap->last_chunks_delete_boundary) {
|
||||
heap->last_chunks_delete_boundary = heap->chunks_count;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
} else {
|
||||
heap->last_chunks_delete_count++;
|
||||
}
|
||||
}
|
||||
if (!heap->cached_chunks || chunk->num > heap->cached_chunks->num) {
|
||||
zend_mm_chunk_free(heap, chunk, ZEND_MM_CHUNK_SIZE);
|
||||
} else {
|
||||
@@ -1864,6 +1876,8 @@ static zend_mm_heap *zend_mm_init(void)
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->cached_chunks_count = 0;
|
||||
heap->avg_chunks_count = 1.0;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
@@ -2279,6 +2293,8 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent)
|
||||
p->map[0] = ZEND_MM_LRUN(ZEND_MM_FIRST_PAGE);
|
||||
heap->chunks_count = 1;
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
@@ -2811,6 +2827,8 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->cached_chunks_count = 0;
|
||||
heap->avg_chunks_count = 1.0;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
|
||||
+10
-3
@@ -414,6 +414,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
|
||||
zval val;
|
||||
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
|
||||
HashTable *debug_info;
|
||||
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
|
||||
|
||||
*is_temp = 1;
|
||||
|
||||
@@ -446,9 +447,15 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
|
||||
zend_string *name;
|
||||
zval info;
|
||||
if (arg_info->name) {
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
ZSTR_VAL(arg_info->name));
|
||||
if (zstr_args) {
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
ZSTR_VAL(arg_info->name));
|
||||
} else {
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
((zend_internal_arg_info*)arg_info)->name);
|
||||
}
|
||||
} else {
|
||||
name = zend_strpprintf(0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
|
||||
+60
-31
@@ -507,9 +507,10 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
|
||||
zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
|
||||
{
|
||||
zend_object *zobj;
|
||||
zval tmp_member;
|
||||
zval tmp_member, tmp_object;
|
||||
zval *retval;
|
||||
uint32_t property_offset;
|
||||
zend_long *guard = NULL;
|
||||
|
||||
zobj = Z_OBJ_P(object);
|
||||
|
||||
@@ -542,12 +543,18 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ZVAL_UNDEF(&tmp_object);
|
||||
|
||||
/* magic isset */
|
||||
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
|
||||
zval tmp_object, tmp_result;
|
||||
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
zval tmp_result;
|
||||
guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
|
||||
if (!((*guard) & IN_ISSET)) {
|
||||
if (Z_TYPE(tmp_member) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
ZVAL_UNDEF(&tmp_result);
|
||||
|
||||
@@ -562,19 +569,20 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
goto exit;
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_result);
|
||||
}
|
||||
}
|
||||
|
||||
/* magic get */
|
||||
if (zobj->ce->__get) {
|
||||
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
if (guard == NULL) {
|
||||
guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
}
|
||||
if (!((*guard) & IN_GET)) {
|
||||
zval tmp_object;
|
||||
|
||||
/* have getter - try with it! */
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
if (Z_TYPE(tmp_object) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
}
|
||||
*guard |= IN_GET; /* prevent circular getting */
|
||||
zend_std_call_getter(&tmp_object, member, rv);
|
||||
*guard &= ~IN_GET;
|
||||
@@ -594,6 +602,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
goto exit;
|
||||
} else {
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
if (Z_STRVAL_P(member)[0] == '\0') {
|
||||
if (Z_STRLEN_P(member) == 0) {
|
||||
zend_throw_error(NULL, "Cannot access empty property");
|
||||
@@ -607,6 +616,9 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
|
||||
if ((type != BP_VAR_IS)) {
|
||||
zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member));
|
||||
}
|
||||
@@ -722,34 +734,38 @@ exit:
|
||||
zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp;
|
||||
zval tmp_offset, tmp_object;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
if (offset == NULL) {
|
||||
/* [] construct */
|
||||
ZVAL_NULL(&tmp);
|
||||
offset = &tmp;
|
||||
ZVAL_NULL(&tmp_offset);
|
||||
} else {
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
}
|
||||
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
if (type == BP_VAR_IS) {
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", rv, &tmp_offset);
|
||||
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
return NULL;
|
||||
}
|
||||
if (!i_zend_is_true(rv)) {
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zval_ptr_dtor(rv);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
zval_ptr_dtor(rv);
|
||||
}
|
||||
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, offset);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", rv, &tmp_offset);
|
||||
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
|
||||
if (UNEXPECTED(!EG(exception))) {
|
||||
@@ -768,17 +784,19 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
|
||||
static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp;
|
||||
zval tmp_offset, tmp_object;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
if (!offset) {
|
||||
ZVAL_NULL(&tmp);
|
||||
offset = &tmp;
|
||||
ZVAL_NULL(&tmp_offset);
|
||||
} else {
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
}
|
||||
zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value);
|
||||
zval_ptr_dtor(offset);
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_2_params(&tmp_object, ce, NULL, "offsetset", NULL, &tmp_offset, value);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
@@ -788,17 +806,19 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /*
|
||||
static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval retval;
|
||||
zval retval, tmp_offset, tmp_object;
|
||||
int result;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", &retval, offset);
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset);
|
||||
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
||||
result = i_zend_is_true(&retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
if (check_empty && result && EXPECTED(!EG(exception))) {
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetget", &retval, offset);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
|
||||
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
||||
result = i_zend_is_true(&retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
@@ -807,7 +827,8 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
return 0;
|
||||
@@ -969,11 +990,15 @@ exit:
|
||||
static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp_offset, tmp_object;
|
||||
|
||||
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) {
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
|
||||
zval_ptr_dtor(offset);
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetunset", NULL, &tmp_offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
@@ -1507,6 +1532,10 @@ found:
|
||||
zval tmp_object;
|
||||
|
||||
/* have issetter - try with it! */
|
||||
if (Z_TYPE(tmp_member) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
(*guard) |= IN_ISSET; /* prevent circular getting */
|
||||
zend_std_call_issetter(&tmp_object, member, &rv);
|
||||
|
||||
@@ -221,8 +221,10 @@ try_again:
|
||||
if (Z_TYPE(holder) == IS_LONG) { \
|
||||
if (op == result) { \
|
||||
zval_ptr_dtor(op); \
|
||||
ZVAL_LONG(op, Z_LVAL(holder)); \
|
||||
} else { \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
|
||||
@@ -219,8 +219,10 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
|
||||
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
|
||||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
|
||||
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
|
||||
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
|
||||
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
|
||||
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
|
||||
|
||||
+15
-15
@@ -2692,21 +2692,21 @@ EOF
|
||||
else
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
|
||||
fi
|
||||
|
||||
for arg in $clean_configure_args; do
|
||||
if test `expr -- $arg : "'.*"` = 0; then
|
||||
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
|
||||
continue;
|
||||
fi
|
||||
echo "'[$]arg' \\" >> $1
|
||||
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'"
|
||||
else
|
||||
if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then
|
||||
continue;
|
||||
fi
|
||||
echo "[$]arg \\" >> $1
|
||||
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg"
|
||||
fi
|
||||
CONFIGURE_ARGS="$clean_configure_args"
|
||||
while test "X$CONFIGURE_ARGS" != "X";
|
||||
do
|
||||
if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"`
|
||||
then
|
||||
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"`
|
||||
elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"`
|
||||
then
|
||||
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"`
|
||||
CURRENT_ARG="'$CURRENT_ARG'"
|
||||
else
|
||||
break
|
||||
fi
|
||||
$as_echo "$CURRENT_ARG \\" >>$1
|
||||
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG"
|
||||
done
|
||||
echo '"[$]@"' >> $1
|
||||
chmod +x $1
|
||||
|
||||
+11
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
|
||||
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
|
||||
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
|
||||
|
||||
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
|
||||
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
|
||||
@@ -13,17 +14,25 @@ if not exist "%PHP_BUILD_OBJ_DIR%" (
|
||||
mkdir "%PHP_BUILD_OBJ_DIR%"
|
||||
)
|
||||
|
||||
if not exist "%SDK_RUNNER%" (
|
||||
if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
|
||||
)
|
||||
|
||||
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
|
||||
echo Cloning remote SDK repository
|
||||
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
|
||||
) else (
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
|
||||
echo Got SDK version %GOT_SDK_VER%
|
||||
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
|
||||
echo Switching to the configured SDK version %SDK_BRANCH:~8%
|
||||
echo Fetching remote SDK repository
|
||||
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
|
||||
echo Checkout SDK repository branch
|
||||
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
|
||||
)
|
||||
|
||||
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
|
||||
if not exist "%SDK_RUNNER%" (
|
||||
echo "%SDK_RUNNER%" doesn't exist
|
||||
exit /b 3
|
||||
|
||||
@@ -8,6 +8,8 @@ if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
cd /D %APPVEYOR_BUILD_FOLDER%
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=25
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=26
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
+2
-2
@@ -33,8 +33,8 @@ if test "$PHP_CURL" != "no"; then
|
||||
fi
|
||||
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -dnl
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
fi
|
||||
|
||||
CURL_CONFIG="curl-config"
|
||||
|
||||
+2424
-837
File diff suppressed because it is too large.
Load diff
@@ -917,8 +917,8 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
|
||||
firstdayof = 'first day of';
|
||||
lastdayof = 'last day of';
|
||||
backof = 'back of ' hour24 space? meridian?;
|
||||
frontof = 'front of ' hour24 space? meridian?;
|
||||
backof = 'back of ' hour24 (space? meridian)?;
|
||||
frontof = 'front of ' hour24 (space? meridian)?;
|
||||
|
||||
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
|
||||
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
|
||||
|
||||
+1009
-1078
File diff suppressed because it is too large.
Load diff
+44
-736
File diff suppressed because it is too large.
Load diff
+36
-1
@@ -647,6 +647,7 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
|
||||
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot);
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
|
||||
|
||||
@@ -2117,7 +2118,7 @@ static void date_register_classes(void) /* {{{ */
|
||||
date_object_handlers_interval.read_property = date_interval_read_property;
|
||||
date_object_handlers_interval.write_property = date_interval_write_property;
|
||||
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
|
||||
date_object_handlers_interval.get_property_ptr_ptr = NULL;
|
||||
date_object_handlers_interval.get_property_ptr_ptr = date_interval_get_property_ptr_ptr;
|
||||
date_object_handlers_interval.get_gc = date_object_get_gc_interval;
|
||||
|
||||
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
|
||||
@@ -4142,6 +4143,40 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_interval_get_property_ptr_ptr */
|
||||
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
|
||||
{
|
||||
zval tmp_member, *ret;
|
||||
|
||||
if (Z_TYPE_P(member) != IS_STRING) {
|
||||
tmp_member = *member;
|
||||
zval_copy_ctor(&tmp_member);
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
cache_slot = NULL;
|
||||
}
|
||||
|
||||
if(zend_binary_strcmp("y", sizeof("y") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("m", sizeof("m") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("d", sizeof("d") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
|
||||
/* Fallback to read_property. */
|
||||
ret = NULL;
|
||||
} else {
|
||||
ret = (zend_get_std_object_handlers())->get_property_ptr_ptr(object, member, type, cache_slot);
|
||||
}
|
||||
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto DateInterval::__construct([string interval_spec])
|
||||
Creates new DateInterval object.
|
||||
|
||||
+12
-21
@@ -8,17 +8,8 @@ date_default_timezone_set('UTC');
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(6) {
|
||||
array(5) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(0)
|
||||
["timezone_id"]=>
|
||||
string(16) "Antarctica/Troll"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
@@ -27,7 +18,7 @@ array(6) {
|
||||
["timezone_id"]=>
|
||||
string(13) "Etc/Universal"
|
||||
}
|
||||
[2]=>
|
||||
[1]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
@@ -36,7 +27,7 @@ array(6) {
|
||||
["timezone_id"]=>
|
||||
string(7) "Etc/UTC"
|
||||
}
|
||||
[3]=>
|
||||
[2]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
@@ -45,6 +36,15 @@ array(6) {
|
||||
["timezone_id"]=>
|
||||
string(8) "Etc/Zulu"
|
||||
}
|
||||
[3]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(0)
|
||||
["timezone_id"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
[4]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
@@ -54,14 +54,5 @@ array(6) {
|
||||
["timezone_id"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
[5]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(0)
|
||||
["timezone_id"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
}
|
||||
Done
|
||||
@@ -1,6 +1,5 @@
|
||||
--TEST--
|
||||
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone
|
||||
public array DateTimeZone::getLocation ( void ) ;
|
||||
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone public array DateTimeZone::getLocation ( void ) ;
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--SKIPIF--
|
||||
@@ -53,30 +52,9 @@ Array
|
||||
[comments] => %s
|
||||
)
|
||||
Array
|
||||
(
|
||||
[country_code] => %s
|
||||
[latitude] => %f
|
||||
[longitude] => %f
|
||||
[comments] =>
|
||||
)
|
||||
Array
|
||||
(
|
||||
[country_code] => %s
|
||||
[latitude] => %f
|
||||
[longitude] => %f
|
||||
[comments] => %s
|
||||
)
|
||||
Array
|
||||
(
|
||||
[country_code] => %s
|
||||
[latitude] => %f
|
||||
[longitude] => %f
|
||||
[comments] => %s
|
||||
)
|
||||
Array
|
||||
(
|
||||
[country_code] => %s
|
||||
[latitude] => %f
|
||||
[longitude] => %f
|
||||
[comments] =>
|
||||
)
|
||||
@@ -29,15 +29,15 @@ string(5) "array"
|
||||
int(%d)
|
||||
|
||||
-- Format a sample entry --
|
||||
array(11) {
|
||||
array(12) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(18) "America/Porto_Acre"
|
||||
string(18) "Australia/Adelaide"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
@@ -51,47 +51,47 @@ array(11) {
|
||||
[2]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(16) "America/Eirunepe"
|
||||
string(21) "Australia/Broken_Hill"
|
||||
}
|
||||
[3]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(18) "America/Rio_Branco"
|
||||
string(16) "Australia/Darwin"
|
||||
}
|
||||
[4]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(11) "Brazil/Acre"
|
||||
string(15) "Australia/North"
|
||||
}
|
||||
[5]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(13) "Asia/Jayapura"
|
||||
string(15) "Australia/South"
|
||||
}
|
||||
[6]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(21) "Australia/Broken_Hill"
|
||||
string(20) "Australia/Yancowinna"
|
||||
}
|
||||
[7]=>
|
||||
array(3) {
|
||||
@@ -100,7 +100,7 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(16) "Australia/Darwin"
|
||||
string(21) "Australia/Broken_Hill"
|
||||
}
|
||||
[8]=>
|
||||
array(3) {
|
||||
@@ -109,7 +109,7 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/North"
|
||||
string(16) "Australia/Darwin"
|
||||
}
|
||||
[9]=>
|
||||
array(3) {
|
||||
@@ -118,9 +118,18 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/South"
|
||||
string(15) "Australia/North"
|
||||
}
|
||||
[10]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/South"
|
||||
}
|
||||
[11]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
|
||||
@@ -5,7 +5,7 @@ date.timezone=Asia/Singapore
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
print strtotime('2008-05-23 00:00:00 SGT');
|
||||
print strtotime('2008-05-23 00:00:00 +08');
|
||||
print "\n";
|
||||
print strtotime('2008-05-23 00:00:00');
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ object(DateInterval)#%d (15) {
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(9)
|
||||
int(%d)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Test DateInterval props with dimension handling
|
||||
--FILE--
|
||||
<?php
|
||||
class Z extends DateInterval{}
|
||||
$z = new Z('P2Y4DT6H8M');
|
||||
$i = 0;
|
||||
$z->prop[1]=10;
|
||||
while ($i < 1026) {
|
||||
$z->prop[$i] = $i;
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
==NOCRASH==
|
||||
--EXPECT--
|
||||
==NOCRASH==
|
||||
@@ -26,18 +26,18 @@ var_dump( $abbr["acst"] );
|
||||
--EXPECTF--
|
||||
*** Testing timezone_abbreviations_list() : basic functionality ***
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
int(142)
|
||||
|
||||
-- Format a sample entry --
|
||||
array(11) {
|
||||
array(12) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(18) "America/Porto_Acre"
|
||||
string(18) "Australia/Adelaide"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
@@ -51,47 +51,47 @@ array(11) {
|
||||
[2]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(16) "America/Eirunepe"
|
||||
string(21) "Australia/Broken_Hill"
|
||||
}
|
||||
[3]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(18) "America/Rio_Branco"
|
||||
string(16) "Australia/Darwin"
|
||||
}
|
||||
[4]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(true)
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(-14400)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(11) "Brazil/Acre"
|
||||
string(15) "Australia/North"
|
||||
}
|
||||
[5]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(13) "Asia/Jayapura"
|
||||
string(15) "Australia/South"
|
||||
}
|
||||
[6]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
int(32400)
|
||||
["timezone_id"]=>
|
||||
string(21) "Australia/Broken_Hill"
|
||||
string(20) "Australia/Yancowinna"
|
||||
}
|
||||
[7]=>
|
||||
array(3) {
|
||||
@@ -100,7 +100,7 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(16) "Australia/Darwin"
|
||||
string(21) "Australia/Broken_Hill"
|
||||
}
|
||||
[8]=>
|
||||
array(3) {
|
||||
@@ -109,7 +109,7 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/North"
|
||||
string(16) "Australia/Darwin"
|
||||
}
|
||||
[9]=>
|
||||
array(3) {
|
||||
@@ -118,9 +118,18 @@ array(11) {
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/South"
|
||||
string(15) "Australia/North"
|
||||
}
|
||||
[10]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(34200)
|
||||
["timezone_id"]=>
|
||||
string(15) "Australia/South"
|
||||
}
|
||||
[11]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
|
||||
@@ -24,11 +24,6 @@ var_dump( timezone_name_from_abbr("EDT") );
|
||||
echo "-- Lookup with name and offset--\n";
|
||||
var_dump( timezone_name_from_abbr("ADT", -10800) );
|
||||
var_dump( timezone_name_from_abbr("ADT", 14400) );
|
||||
var_dump( timezone_name_from_abbr("AKTT", 14400) );
|
||||
var_dump( timezone_name_from_abbr("aktt", 18000) );
|
||||
var_dump( timezone_name_from_abbr("Aktt", 21600) );
|
||||
var_dump( timezone_name_from_abbr("AMST", -10800) );
|
||||
var_dump( timezone_name_from_abbr("amst", 180000) );
|
||||
|
||||
echo "-- Tests without valid name - uses gmtOffset and isdst to find match --\n";
|
||||
var_dump( timezone_name_from_abbr("", 3600, 1) );
|
||||
@@ -51,12 +46,7 @@ string(13) "Europe/Berlin"
|
||||
string(16) "America/New_York"
|
||||
-- Lookup with name and offset--
|
||||
string(15) "America/Halifax"
|
||||
string(12) "Asia/Baghdad"
|
||||
string(11) "Asia/Aqtobe"
|
||||
string(11) "Asia/Aqtobe"
|
||||
string(11) "Asia/Aqtobe"
|
||||
string(17) "America/Boa_Vista"
|
||||
string(12) "Asia/Yerevan"
|
||||
string(15) "America/Halifax"
|
||||
-- Tests without valid name - uses gmtOffset and isdst to find match --
|
||||
string(13) "Europe/London"
|
||||
string(17) "America/Sao_Paulo"
|
||||
@@ -65,4 +55,4 @@ string(15) "America/Halifax"
|
||||
-- Tests with invalid offsets --
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -323,7 +323,6 @@ PHP_MINFO_FUNCTION(enchant)
|
||||
#elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
|
||||
php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
|
||||
#endif
|
||||
php_info_print_table_row(2, "Revision", "$Id$");
|
||||
php_info_print_table_end();
|
||||
|
||||
php_info_print_table_start();
|
||||
@@ -483,6 +482,11 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (value == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "dict_path not set");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_STRING(value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
extern zend_module_entry enchant_module_entry;
|
||||
#define phpext_enchant_ptr &enchant_module_entry
|
||||
|
||||
#define PHP_ENCHANT_VERSION "1.1.0"
|
||||
#define PHP_ENCHANT_VERSION PHP_VERSION
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_ENCHANT_API __declspec(dllexport)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #53070 (enchant_broker_get_path crashes if no path is set)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('enchant')) die('skip, enchant not loader');
|
||||
if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$broker = enchant_broker_init();
|
||||
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_MYSPELL));
|
||||
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_ISPELL));
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
|
||||
bool(false)
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#if HAVE_EXIF
|
||||
|
||||
#include "php_version.h"
|
||||
#define PHP_EXIF_VERSION "1.4 $Id: 8bdc0c8f27c2c9dd1f7551f1f9fe3ab57a06a4b1 $"
|
||||
#define PHP_EXIF_VERSION PHP_VERSION
|
||||
|
||||
extern zend_module_entry exif_module_entry;
|
||||
#define phpext_exif_ptr &exif_module_entry
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
fileinfo
|
||||
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans
|
||||
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski
|
||||
@@ -377,6 +377,7 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewebp, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, im)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_ARG_INFO(0, quality)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1709,13 +1709,28 @@ gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, cons
|
||||
return im_scaled;
|
||||
}
|
||||
|
||||
static int gdRotatedImageSize(gdImagePtr src, const float angle, gdRectPtr bbox)
|
||||
{
|
||||
gdRect src_area;
|
||||
double m[6];
|
||||
|
||||
gdAffineRotate(m, angle);
|
||||
src_area.x = 0;
|
||||
src_area.y = 0;
|
||||
src_area.width = gdImageSX(src);
|
||||
src_area.height = gdImageSY(src);
|
||||
if (gdTransformAffineBoundingBox(&src_area, m, bbox) != GD_TRUE) {
|
||||
return GD_FALSE;
|
||||
}
|
||||
|
||||
return GD_TRUE;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, const int bgColor)
|
||||
{
|
||||
float _angle = ((float) (-degrees / 180.0f) * (float)M_PI);
|
||||
const int src_w = gdImageSX(src);
|
||||
const int src_h = gdImageSY(src);
|
||||
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
|
||||
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
|
||||
const gdFixed f_0_5 = gd_ftofx(0.5f);
|
||||
const gdFixed f_H = gd_itofx(src_h/2);
|
||||
const gdFixed f_W = gd_itofx(src_w/2);
|
||||
@@ -1726,6 +1741,12 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co
|
||||
unsigned int dst_offset_y = 0;
|
||||
unsigned int i;
|
||||
gdImagePtr dst;
|
||||
gdRect bbox;
|
||||
int new_height, new_width;
|
||||
|
||||
gdRotatedImageSize(src, degrees, &bbox);
|
||||
new_width = bbox.width;
|
||||
new_height = bbox.height;
|
||||
|
||||
if (new_width == 0 || new_height == 0) {
|
||||
return NULL;
|
||||
@@ -1768,8 +1789,6 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
|
||||
const int angle_rounded = (int)floor(degrees * 100);
|
||||
const int src_w = gdImageSX(src);
|
||||
const int src_h = gdImageSY(src);
|
||||
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
|
||||
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
|
||||
const gdFixed f_0_5 = gd_ftofx(0.5f);
|
||||
const gdFixed f_H = gd_itofx(src_h/2);
|
||||
const gdFixed f_W = gd_itofx(src_w/2);
|
||||
@@ -1780,6 +1799,8 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
|
||||
unsigned int dst_offset_y = 0;
|
||||
unsigned int i;
|
||||
gdImagePtr dst;
|
||||
int new_width, new_height;
|
||||
gdRect bbox;
|
||||
|
||||
const gdFixed f_slop_y = f_sin;
|
||||
const gdFixed f_slop_x = f_cos;
|
||||
@@ -1792,6 +1813,10 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdRotatedImageSize(src, degrees, &bbox);
|
||||
new_width = bbox.width;
|
||||
new_height = bbox.height;
|
||||
|
||||
dst = gdImageCreateTrueColor(new_width, new_height);
|
||||
if (!dst) {
|
||||
return NULL;
|
||||
@@ -1831,8 +1856,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
|
||||
float _angle = (float)((- degrees / 180.0f) * M_PI);
|
||||
const unsigned int src_w = gdImageSX(src);
|
||||
const unsigned int src_h = gdImageSY(src);
|
||||
unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
|
||||
unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
|
||||
unsigned int new_width, new_height;
|
||||
const gdFixed f_0_5 = gd_ftofx(0.5f);
|
||||
const gdFixed f_H = gd_itofx(src_h/2);
|
||||
const gdFixed f_W = gd_itofx(src_w/2);
|
||||
@@ -1844,6 +1868,12 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
|
||||
unsigned int dst_offset_y = 0;
|
||||
unsigned int src_offset_x, src_offset_y;
|
||||
gdImagePtr dst;
|
||||
gdRect bbox;
|
||||
|
||||
gdRotatedImageSize(src, degrees, &bbox);
|
||||
|
||||
new_width = bbox.width;
|
||||
new_height = bbox.height;
|
||||
|
||||
dst = gdImageCreateTrueColor(new_width, new_height);
|
||||
if (dst == NULL) {
|
||||
@@ -1863,7 +1893,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
|
||||
const unsigned int m = gd_fxtoi(f_m);
|
||||
const unsigned int n = gd_fxtoi(f_n);
|
||||
|
||||
if ((m > 0) && (m < src_h - 1) && (n > 0) && (n < src_w - 1)) {
|
||||
if ((m >= 0) && (m < src_h - 1) && (n >= 0) && (n < src_w - 1)) {
|
||||
const gdFixed f_f = f_m - gd_itofx(m);
|
||||
const gdFixed f_g = f_n - gd_itofx(n);
|
||||
const gdFixed f_w1 = gd_mulfx(f_1-f_f, f_1-f_g);
|
||||
@@ -1871,11 +1901,6 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
|
||||
const gdFixed f_w3 = gd_mulfx(f_f, f_1-f_g);
|
||||
const gdFixed f_w4 = gd_mulfx(f_f, f_g);
|
||||
|
||||
if (n < src_w - 1) {
|
||||
src_offset_x = n + 1;
|
||||
src_offset_y = m;
|
||||
}
|
||||
|
||||
if (m < src_h-1) {
|
||||
src_offset_x = n;
|
||||
src_offset_y = m + 1;
|
||||
@@ -1890,13 +1915,13 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
|
||||
register int pixel2, pixel3, pixel4;
|
||||
|
||||
if (src_offset_y + 1 >= src_h) {
|
||||
pixel2 = bgColor;
|
||||
pixel3 = bgColor;
|
||||
pixel4 = bgColor;
|
||||
pixel2 = pixel1;
|
||||
pixel3 = pixel1;
|
||||
pixel4 = pixel1;
|
||||
} else if (src_offset_x + 1 >= src_w) {
|
||||
pixel2 = bgColor;
|
||||
pixel3 = bgColor;
|
||||
pixel4 = bgColor;
|
||||
pixel2 = pixel1;
|
||||
pixel3 = pixel1;
|
||||
pixel4 = pixel1;
|
||||
} else {
|
||||
pixel2 = src->tpixels[src_offset_y][src_offset_x + 1];
|
||||
pixel3 = src->tpixels[src_offset_y + 1][src_offset_x];
|
||||
@@ -1946,8 +1971,7 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
|
||||
const float _angle = (float)((- degrees / 180.0f) * M_PI);
|
||||
const int src_w = gdImageSX(src);
|
||||
const int src_h = gdImageSY(src);
|
||||
const unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
|
||||
const unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
|
||||
unsigned int new_width, new_height;
|
||||
const gdFixed f_0_5 = gd_ftofx(0.5f);
|
||||
const gdFixed f_H = gd_itofx(src_h/2);
|
||||
const gdFixed f_W = gd_itofx(src_w/2);
|
||||
@@ -1963,7 +1987,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
|
||||
unsigned int dst_offset_y = 0;
|
||||
unsigned int i;
|
||||
gdImagePtr dst;
|
||||
gdRect bbox;
|
||||
|
||||
gdRotatedImageSize(src, degrees, &bbox);
|
||||
new_width = bbox.width;
|
||||
new_height = bbox.height;
|
||||
dst = gdImageCreateTrueColor(new_width, new_height);
|
||||
|
||||
if (dst == NULL) {
|
||||
@@ -2206,8 +2234,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
|
||||
|
||||
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
|
||||
{
|
||||
const int angle_rounded = (int)floor(angle * 100);
|
||||
|
||||
/* round to two decimals and keep the 100x multiplication to use it in the common square angles
|
||||
case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for
|
||||
slow animations, f.e. */
|
||||
const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100);
|
||||
|
||||
if (bgcolor < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -2224,6 +2255,18 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
|
||||
|
||||
/* no interpolation needed here */
|
||||
switch (angle_rounded) {
|
||||
case 0: {
|
||||
gdImagePtr dst = gdImageCreateTrueColor(src->sx, src->sy);
|
||||
if (dst == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
dst->transparent = src->transparent;
|
||||
dst->saveAlphaFlag = 1;
|
||||
dst->alphaBlendingFlag = gdEffectReplace;
|
||||
|
||||
gdImageCopy(dst, src, 0,0,0,0,src->sx,src->sy);
|
||||
return dst;
|
||||
}
|
||||
case -27000:
|
||||
case 9000:
|
||||
return gdImageRotate90(src, 0);
|
||||
|
||||
+4
-1
@@ -164,7 +164,10 @@ readwbmp (int (*getin) (void *in), void *in, Wbmp ** return_wbmp)
|
||||
}
|
||||
|
||||
if (skipheader (getin, in))
|
||||
return (-1);
|
||||
{
|
||||
gdFree (wbmp);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
wbmp->width = getmbi (getin, in);
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
--TEST--
|
||||
Bug #65148 (imagerotate may alter image dimensions)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interpolations = array(
|
||||
'IMG_BELL' => IMG_BELL,
|
||||
'IMG_BESSEL' => IMG_BESSEL,
|
||||
'IMG_BICUBIC' => IMG_BICUBIC,
|
||||
'IMG_BICUBIC_FIXED' => IMG_BICUBIC_FIXED,
|
||||
'IMG_BILINEAR_FIXED' => IMG_BILINEAR_FIXED,
|
||||
'IMG_BLACKMAN' => IMG_BLACKMAN,
|
||||
'IMG_BOX' => IMG_BOX,
|
||||
'IMG_BSPLINE' => IMG_BSPLINE,
|
||||
'IMG_CATMULLROM' => IMG_CATMULLROM,
|
||||
'IMG_GAUSSIAN' => IMG_GAUSSIAN,
|
||||
'IMG_GENERALIZED_CUBIC' => IMG_GENERALIZED_CUBIC,
|
||||
'IMG_HERMITE' => IMG_HERMITE,
|
||||
'IMG_HAMMING' => IMG_HAMMING,
|
||||
'IMG_HANNING' => IMG_HANNING,
|
||||
'IMG_MITCHELL' => IMG_MITCHELL,
|
||||
'IMG_POWER' => IMG_POWER,
|
||||
'IMG_QUADRATIC' => IMG_QUADRATIC,
|
||||
'IMG_SINC' => IMG_SINC,
|
||||
'IMG_NEAREST_NEIGHBOUR' => IMG_NEAREST_NEIGHBOUR,
|
||||
'IMG_WEIGHTED4' => IMG_WEIGHTED4,
|
||||
'IMG_TRIANGLE' => IMG_TRIANGLE,
|
||||
);
|
||||
|
||||
$img = imagecreate(40, 20);
|
||||
$results = array();
|
||||
|
||||
foreach ($interpolations as $name => $interpolation) {
|
||||
imagesetinterpolation($img, $interpolation);
|
||||
$t = imagecolorallocatealpha($img, 0, 0, 0, 127);
|
||||
$imgr = imagerotate($img, -5, $t);
|
||||
$results[$name] = array('x' => imagesx($imgr), 'y' => imagesy($imgr));
|
||||
imagedestroy($imgr);
|
||||
}
|
||||
|
||||
imagedestroy($img);
|
||||
print_r($results);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[IMG_BELL] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BESSEL] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BICUBIC] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BICUBIC_FIXED] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BILINEAR_FIXED] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BLACKMAN] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BOX] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_BSPLINE] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_CATMULLROM] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_GAUSSIAN] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_GENERALIZED_CUBIC] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_HERMITE] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_HAMMING] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_HANNING] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_MITCHELL] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_POWER] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_QUADRATIC] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_SINC] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_NEAREST_NEIGHBOUR] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_WEIGHTED4] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
[IMG_TRIANGLE] => Array
|
||||
(
|
||||
[x] => 40
|
||||
[y] => 23
|
||||
)
|
||||
|
||||
)
|
||||
===DONE===
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 741 B |
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75437 Wrong reflection on imagewebp
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) die('skip reflection not available');
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) die("skip test requires GD 2.2.0 or higher");
|
||||
if (!function_exists('imagewebp')) die('skip WebP support not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$rf = new ReflectionFunction('imagewebp');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(1)
|
||||
===DONE===
|
||||
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_ibase_errcode, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, database)
|
||||
ZEND_ARG_INFO(0, username)
|
||||
ZEND_ARG_INFO(0, password)
|
||||
@@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, role)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, database)
|
||||
ZEND_ARG_INFO(0, username)
|
||||
ZEND_ARG_INFO(0, password)
|
||||
@@ -1030,7 +1030,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto resource ibase_connect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
|
||||
/* {{{ proto resource ibase_connect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
|
||||
Open a connection to an InterBase database */
|
||||
PHP_FUNCTION(ibase_connect)
|
||||
{
|
||||
@@ -1038,7 +1038,7 @@ PHP_FUNCTION(ibase_connect)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto resource ibase_pconnect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
|
||||
/* {{{ proto resource ibase_pconnect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
|
||||
Open a persistent connection to an InterBase database */
|
||||
PHP_FUNCTION(ibase_pconnect)
|
||||
{
|
||||
|
||||
@@ -411,7 +411,7 @@ static zend_bool php_converter_set_encoding(php_converter_object *objval,
|
||||
ZEND_BEGIN_ARG_INFO_EX(php_converter_set_encoding_arginfo, 0, ZEND_RETURN_VALUE, 1)
|
||||
ZEND_ARG_INFO(0, encoding)
|
||||
ZEND_END_ARG_INFO();
|
||||
static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PARAMETERS) {
|
||||
static void php_converter_do_set_encoding(UConverter **pcnv, INTERNAL_FUNCTION_PARAMETERS) {
|
||||
php_converter_object *objval = CONV_GET(getThis());
|
||||
char *enc;
|
||||
size_t enc_len;
|
||||
@@ -423,21 +423,21 @@ static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PAR
|
||||
}
|
||||
intl_errors_reset(&objval->error);
|
||||
|
||||
RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len));
|
||||
RETURN_BOOL(php_converter_set_encoding(objval, pcnv, enc, enc_len));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool UConverter::setSourceEncoding(string encoding) */
|
||||
static PHP_METHOD(UConverter, setSourceEncoding) {
|
||||
php_converter_object *objval = CONV_GET(getThis());
|
||||
php_converter_do_set_encoding(objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
php_converter_do_set_encoding(&(objval->src), INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool UConverter::setDestinationEncoding(string encoding) */
|
||||
static PHP_METHOD(UConverter, setDestinationEncoding) {
|
||||
php_converter_object *objval = CONV_GET(getThis());
|
||||
php_converter_do_set_encoding(objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
php_converter_do_set_encoding(&(objval->dest), INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -897,7 +897,7 @@ static PHP_METHOD(UConverter, getAvailable) {
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array UConverter::getAliases(string name) */
|
||||
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 1)
|
||||
ZEND_ARG_INFO(0, name)
|
||||
ZEND_END_ARG_INFO();
|
||||
static PHP_METHOD(UConverter, getAliases) {
|
||||
|
||||
@@ -78,4 +78,8 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM >= 58
|
||||
#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_HIGHLY_RESTRICTIVE
|
||||
#endif
|
||||
|
||||
#endif // #ifndef SPOOFCHECKER_CLASS_H
|
||||
@@ -43,12 +43,23 @@ PHP_METHOD(Spoofchecker, __construct)
|
||||
co->uspoof = uspoof_open(SPOOFCHECKER_ERROR_CODE_P(co));
|
||||
INTL_METHOD_CHECK_STATUS(co, "spoofchecker: unable to open ICU Spoof Checker");
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM >= 58
|
||||
/* TODO save it into the object for further suspiction check comparison. */
|
||||
/* ICU 58 removes WSC and MSC handling. However there are restriction
|
||||
levels as defined in
|
||||
http://www.unicode.org/reports/tr39/tr39-15.html#Restriction_Level_Detection
|
||||
and the default is high restrictive. In further, we might want to utilize
|
||||
uspoof_check2 APIs when it became stable, to use extended check result APIs.
|
||||
Subsequent changes in the unicode security algos are to be watched.*/
|
||||
uspoof_setRestrictionLevel(co->uspoof, SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL);
|
||||
#else
|
||||
/* Single-script enforcement is on by default. This fails for languages
|
||||
like Japanese that legally use multiple scripts within a single word,
|
||||
so we turn it off.
|
||||
*/
|
||||
checks = uspoof_getChecks(co->uspoof, SPOOFCHECKER_ERROR_CODE_P(co));
|
||||
uspoof_setChecks(co->uspoof, checks & ~USPOOF_SINGLE_SCRIPT, SPOOFCHECKER_ERROR_CODE_P(co));
|
||||
#endif
|
||||
zend_restore_error_handling(&error_handling);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
--TEST--
|
||||
IntlBreakIterator::getPartsIterator(): basic test
|
||||
IntlBreakIterator::getPartsIterator(): basic test, ICU <= 57.1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -34,4 +36,4 @@ Array
|
||||
[2] => bar
|
||||
)
|
||||
int(0)
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
IntlBreakIterator::getPartsIterator(): basic test, ICU >= 58.1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU >= 58.1');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$pi = $bi->getPartsIterator();
|
||||
var_dump(get_class($pi));
|
||||
print_r(iterator_to_array($pi));
|
||||
|
||||
$bi->setText("foo bar");
|
||||
$pi = $bi->getPartsIterator();
|
||||
var_dump(get_class($pi->getBreakIterator()));
|
||||
print_r(iterator_to_array($pi));
|
||||
var_dump($pi->getRuleStatus());
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
string(17) "IntlPartsIterator"
|
||||
Array
|
||||
(
|
||||
)
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
Array
|
||||
(
|
||||
[0] => foo
|
||||
[1] =>
|
||||
[2] => bar
|
||||
)
|
||||
int(%d)
|
||||
==DONE==
|
||||
@@ -1,9 +1,11 @@
|
||||
--TEST--
|
||||
IntlBreakIterator::preceding(): basic test
|
||||
IntlBreakIterator::preceding(): basic test, ICU <= 57.1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -21,4 +23,4 @@ var_dump($bi->preceding(-1));
|
||||
int(4)
|
||||
int(21)
|
||||
int(0)
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
IntlBreakIterator::preceding(): basic test, ICU >= 58.1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU >= 58.1');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
var_dump($bi->preceding(5));
|
||||
var_dump($bi->preceding(50));
|
||||
var_dump($bi->preceding(-1));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
int(4)
|
||||
int(21)
|
||||
int(%i)
|
||||
==DONE==
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #75317 (UConverter::setDestinationEncoding changes source instead of destinatination)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$utf8 = UConverter::getAliases('utf-8')[0];
|
||||
$utf16 = UConverter::getAliases('utf-16')[0];
|
||||
$utf32 = UConverter::getAliases('utf-32')[0];
|
||||
$latin1 = UConverter::getAliases('latin1')[0];
|
||||
|
||||
function printResult($actual, $expected) {
|
||||
var_dump($actual === $expected ? true : "expected: $expected, actual: $actual");
|
||||
}
|
||||
|
||||
// test default values
|
||||
$c = new UConverter();
|
||||
printResult($c->getDestinationEncoding(), $utf8);
|
||||
printResult($c->getSourceEncoding(), $utf8);
|
||||
|
||||
// test constructor args
|
||||
$c = new UConverter('utf-16', 'latin1');
|
||||
printResult($c->getDestinationEncoding(), $utf16);
|
||||
printResult($c->getSourceEncoding(), $latin1);
|
||||
|
||||
// test setters
|
||||
var_dump($c->setDestinationEncoding('utf-8'));
|
||||
var_dump($c->setSourceEncoding('utf-32'));
|
||||
printResult($c->getDestinationEncoding(), $utf8);
|
||||
printResult($c->getSourceEncoding(), $utf32);
|
||||
|
||||
// test invalid inputs dont change values
|
||||
var_dump($c->setDestinationEncoding('foobar') === false);
|
||||
var_dump($c->setSourceEncoding('foobar') === false);
|
||||
printResult($c->getDestinationEncoding(), $utf8);
|
||||
printResult($c->getSourceEncoding(), $utf32);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #75318 (The parameter of UConverter::getAliases() is not optional)
|
||||
--SKIP--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$rm = new ReflectionMethod('UConverter', 'getAliases');
|
||||
var_dump($rm->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
===DONE===
|
||||
@@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the calendar arg
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: several forms of the calendar arg
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
$cal = new IntlGregorianCalendar('UTC', NULL);
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//override calendar's timezone
|
||||
$cal = new IntlGregorianCalendar('UTC', NULL);
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//default calendar is gregorian
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//try now with traditional
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//the timezone can be overridden when not specifying a calendar
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
domingo%S 1 de enero de 2012, 0:00:00 (%siempo %sniversal %sordinado)
|
||||
domingo%S 8 de %safar de 1433, 0:00:00 (%siempo %sniversal %sordinado)
|
||||
domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
|
||||
sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores)
|
||||
sábado, 7 de %safar de 1433 AH, 23:00:00 (hora estándar de las Azores)
|
||||
domingo%S 8 de %safar de 1433 AH, 0:00:00 (%siempo %sniversal %sordinado)
|
||||
domingo%S 1 de enero de 2012, 0:00:00 (%siempo %sniversal %sordinado)
|
||||
==DONE==
|
||||
@@ -4,6 +4,7 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
function d(IntlDateFormatter $df) {
|
||||
global $ts;
|
||||
echo $df->format($ts), "\n";
|
||||
var_dump($df->getCalendar(),
|
||||
$df->getCalendarObject()->getType(),
|
||||
$df->getCalendarObject()->getTimeZone()->getId());
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk');
|
||||
d($df);
|
||||
|
||||
|
||||
//changing the calendar with a cal type should not change tz
|
||||
$df->setCalendar(IntlDateFormatter::TRADITIONAL);
|
||||
d($df);
|
||||
|
||||
//but changing with an actual calendar should
|
||||
$cal = IntlCalendar::createInstance("UTC");
|
||||
$df->setCalendar($cal);
|
||||
d($df);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad
|
||||
int(1)
|
||||
string(9) "gregorian"
|
||||
string(12) "Europe/Minsk"
|
||||
|
||||
dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad
|
||||
int(0)
|
||||
string(7) "islamic"
|
||||
string(12) "Europe/Minsk"
|
||||
|
||||
dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 Temps universel coordonné
|
||||
bool(false)
|
||||
string(9) "gregorian"
|
||||
string(3) "UTC"
|
||||
|
||||
==DONE==
|
||||
@@ -3,6 +3,7 @@ numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU < 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get locale.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$locales = array(
|
||||
'en_UK',
|
||||
'en_US',
|
||||
'fr_CA',
|
||||
);
|
||||
|
||||
$loc_types = array(
|
||||
Locale::ACTUAL_LOCALE => 'actual',
|
||||
Locale::VALID_LOCALE => 'valid',
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
|
||||
$res_str .= "$locale: ";
|
||||
foreach( $loc_types as $loc_type => $loc_type_name )
|
||||
$res_str .= sprintf( " %s=%s",
|
||||
$loc_type_name,
|
||||
dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
|
||||
$res_str .= "\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
en_UK: actual='en' valid='en'
|
||||
en_US: actual='en' valid='en_US'
|
||||
fr_CA: actual='fr' valid='fr_CA'
|
||||
@@ -2,6 +2,7 @@
|
||||
spoofchecker suspicious character checker
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '57.1') >= 0)die('skip for ICU <= 57.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
spoofchecker suspicious character checker
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '57.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "paypal with Cyrillic spoof characters\n";
|
||||
$x = new Spoofchecker();
|
||||
var_dump($x->isSuspicious("http://www.payp\u{0430}l.com"));
|
||||
var_dump($x->isSuspicious("\u{041F}aypal.com"));
|
||||
|
||||
echo "certain all-uppercase Latin sequences can be spoof of Greek\n";
|
||||
$x = new Spoofchecker();
|
||||
$x->setAllowedLocales("gr_GR");
|
||||
var_dump($x->isSuspicious("NAPKIN PEZ"));
|
||||
var_dump($x->isSuspicious("napkin pez"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
paypal with Cyrillic spoof characters
|
||||
bool(true)
|
||||
bool(true)
|
||||
certain all-uppercase Latin sequences can be spoof of Greek
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -2,6 +2,7 @@
|
||||
UConverter::convert() w/ Callback Reasons
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyConverter extends UConverter {
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
UConverter::convert() w/ Callback Reasons
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '60.1') < 0) die('skip for ICU >= 60.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyConverter extends UConverter {
|
||||
/**
|
||||
* Called during conversion from source encoding to internal UChar representation
|
||||
*/
|
||||
public function toUCallback($reason, $source, $codeUnits, &$error) {
|
||||
echo "toUCallback(", UConverter::reasonText($reason), ", ...)\n";
|
||||
return parent::toUCallback($reason, $source, $codeUnits, $error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called during conversion from internal UChar to destination encoding
|
||||
*/
|
||||
public function fromUCallback($reason, $source, $codePoint, &$error) {
|
||||
echo "fromUCallback(", UConverter::reasonText($reason), ", ...)\n";
|
||||
return parent::fromUCallback($reason, $source, $codePoint, $error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$c = new MyConverter('ascii', 'utf-8');
|
||||
foreach(array("regular", "irregul\xC1\xA1r", "\xC2\xA1unsupported!") as $word) {
|
||||
$c->convert($word);
|
||||
}
|
||||
--EXPECT--
|
||||
toUCallback(REASON_RESET, ...)
|
||||
toUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
toUCallback(REASON_RESET, ...)
|
||||
toUCallback(REASON_ILLEGAL, ...)
|
||||
toUCallback(REASON_ILLEGAL, ...)
|
||||
toUCallback(REASON_RESET, ...)
|
||||
toUCallback(REASON_ILLEGAL, ...)
|
||||
toUCallback(REASON_ILLEGAL, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
toUCallback(REASON_RESET, ...)
|
||||
toUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
fromUCallback(REASON_RESET, ...)
|
||||
fromUCallback(REASON_UNASSIGNED, ...)
|
||||
toUCallback(REASON_CLOSE, ...)
|
||||
fromUCallback(REASON_CLOSE, ...)
|
||||
toUCallback(REASON_CLOSE, ...)
|
||||
fromUCallback(REASON_CLOSE, ...)
|
||||
@@ -132,7 +132,7 @@ IC_METHOD(getIntPropertyMinValue) {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int IntlChar::getIntPropertyMxValue(int $property) */
|
||||
/* {{{ proto int IntlChar::getIntPropertyMaxValue(int $property) */
|
||||
ZEND_BEGIN_ARG_INFO_EX(getIntPropertyMaxValue_arginfo, 0, ZEND_RETURN_VALUE, 1)
|
||||
ZEND_ARG_INFO(0, property)
|
||||
ZEND_END_ARG_INFO();
|
||||
@@ -179,7 +179,7 @@ static UBool enumCharType_callback(enumCharType_data *context,
|
||||
zval args[3];
|
||||
|
||||
ZVAL_NULL(&retval);
|
||||
/* Note that $start is INclusive, whiel $limit is EXclusive
|
||||
/* Note that $start is INclusive, while $limit is EXclusive
|
||||
* Therefore (0, 32, 15) means CPs 0..31 are of type 15
|
||||
*/
|
||||
ZVAL_LONG(&args[0], start);
|
||||
|
||||
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
|
||||
php_stream_bucket_delref(bucket);
|
||||
} else {
|
||||
/* Stream cipher */
|
||||
php_stream_bucket_make_writeable(bucket);
|
||||
bucket = php_stream_bucket_make_writeable(bucket);
|
||||
if (data->encrypt) {
|
||||
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #72535 arcfour encryption stream filter crashes php
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$passphrase = 'My secret';
|
||||
$plaintext = 'Secret secret secret data';
|
||||
|
||||
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
|
||||
$key = substr(md5('pass1' . $passphrase, true) .
|
||||
md5('pass2' . $passphrase, true), 0, 24);
|
||||
$opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
|
||||
|
||||
$expected = substr($plaintext . $plaintext, 0, 48);
|
||||
|
||||
$fp = fopen('php://memory', 'wb+');
|
||||
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
|
||||
fwrite($fp, $plaintext);
|
||||
?>
|
||||
==NOCRASH==
|
||||
--EXPECT--
|
||||
==NOCRASH==
|
||||
@@ -420,7 +420,7 @@ const zend_function_entry mysqli_functions[] = {
|
||||
PHP_FE(mysqli_fetch_field_direct, arginfo_mysqli_result_and_fieldnr)
|
||||
PHP_FE(mysqli_fetch_lengths, arginfo_mysqli_only_result)
|
||||
#ifdef MYSQLI_USE_MYSQLND
|
||||
PHP_FE(mysqli_fetch_all, arginfo_mysqli_only_result)
|
||||
PHP_FE(mysqli_fetch_all, arginfo_mysqli_fetch_array)
|
||||
#endif
|
||||
PHP_FE(mysqli_fetch_array, arginfo_mysqli_fetch_array)
|
||||
PHP_FE(mysqli_fetch_assoc, arginfo_mysqli_only_result)
|
||||
@@ -600,7 +600,7 @@ const zend_function_entry mysqli_result_methods[] = {
|
||||
PHP_FALIAS(fetch_fields, mysqli_fetch_fields, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(fetch_field_direct, mysqli_fetch_field_direct, arginfo_class_mysqli_result_and_fieldnr)
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_class_mysqli_fetch_array)
|
||||
#endif
|
||||
PHP_FALIAS(fetch_array, mysqli_fetch_array, arginfo_class_mysqli_fetch_array)
|
||||
PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #75434 Wrong reflection for mysqli_fetch_all function
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!extension_loaded("reflection")) die("skip reflection extension not available");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$rf = new ReflectionFunction('mysqli_fetch_all');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
|
||||
$rm = new ReflectionMethod('mysqli_result', 'fetch_all');
|
||||
var_dump($rm->getNumberOfParameters());
|
||||
var_dump($rm->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(1)
|
||||
int(1)
|
||||
int(0)
|
||||
===DONE===
|
||||
@@ -124,9 +124,16 @@ isInternal: yes
|
||||
isUserDefined: no
|
||||
returnsReference: no
|
||||
Modifiers: 256
|
||||
Number of Parameters: 0
|
||||
Number of Parameters: 1
|
||||
Number of Required Parameters: 0
|
||||
|
||||
Inspecting parameter 'result_type' of method 'fetch_all'
|
||||
isArray: no
|
||||
allowsNull: no
|
||||
isPassedByReference: no
|
||||
isOptional: yes
|
||||
isDefaultValueAvailable: no
|
||||
|
||||
Inspecting method 'fetch_array'
|
||||
isFinal: no
|
||||
isAbstract: no
|
||||
|
||||
+6
-4
@@ -1402,6 +1402,8 @@ void php_oci_define_hash_dtor(zval *data)
|
||||
define->name = NULL;
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&define->val);
|
||||
|
||||
efree(define);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1414,9 +1416,9 @@ void php_oci_bind_hash_dtor(zval *data)
|
||||
{
|
||||
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
|
||||
|
||||
if (!Z_ISUNDEF(bind->parameter)) {
|
||||
zval_ptr_dtor(&bind->parameter);
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
if (!Z_ISUNDEF(bind->val)) {
|
||||
zval_ptr_dtor(&bind->val);
|
||||
ZVAL_UNDEF(&bind->val);
|
||||
}
|
||||
|
||||
if (bind->array.elements) {
|
||||
@@ -2642,7 +2644,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
|
||||
if (placeholder == NULL) {
|
||||
placeholder = return_value;
|
||||
} else {
|
||||
zval_dtor(placeholder);
|
||||
zval_ptr_dtor(placeholder);
|
||||
}
|
||||
|
||||
array_init(placeholder);
|
||||
|
||||
@@ -75,10 +75,10 @@ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_even
|
||||
ZVAL_NULL(¶ms[0]);
|
||||
|
||||
/* Cleanup */
|
||||
zval_dtor(&retval);
|
||||
zval_dtor(¶ms[0]);
|
||||
zval_dtor(¶ms[1]);
|
||||
zval_dtor(¶ms[2]);
|
||||
zval_ptr_dtor(&retval);
|
||||
zval_ptr_dtor(¶ms[0]);
|
||||
zval_ptr_dtor(¶ms[1]);
|
||||
zval_ptr_dtor(¶ms[2]);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
+13
-11
@@ -117,7 +117,7 @@ PHP_FUNCTION(oci_define_by_name)
|
||||
php_oci_define *define;
|
||||
zend_string *zvtmp;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,8 @@ PHP_FUNCTION(oci_define_by_name)
|
||||
define->name[name_len] = '\0';
|
||||
define->name_len = (ub4) name_len;
|
||||
define->type = (ub4) type;
|
||||
define->zval = var;
|
||||
ZEND_ASSERT(Z_ISREF_P(var));
|
||||
ZVAL_COPY(&define->val, var);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
@@ -202,7 +203,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
|
||||
zval *bind_var = NULL;
|
||||
php_oci_statement *statement;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rszl|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1439,7 +1440,7 @@ PHP_FUNCTION(oci_fetch_all)
|
||||
|
||||
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
|
||||
|
||||
zval_dtor(array);
|
||||
zval_ptr_dtor(array);
|
||||
|
||||
while (skip--) {
|
||||
if (php_oci_statement_fetch(statement, nrows)) {
|
||||
@@ -1610,14 +1611,15 @@ PHP_FUNCTION(oci_close)
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
if (GC_REFCOUNT(connection->id) == 2) /* CHANGED VERSION::PHP7
|
||||
Changed the refCount to 2 since
|
||||
internally Zend engine increments
|
||||
RefCount value by 1 */
|
||||
if (GC_REFCOUNT(connection->id) == 2) { /* CHANGED VERSION::PHP7
|
||||
Changed the refCount to 2 since
|
||||
internally Zend engine increments
|
||||
RefCount value by 1 */
|
||||
/* Unregister Oracle TAF */
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
|
||||
zend_list_close(connection->id);
|
||||
|
||||
/* Unregister Oracle TAF */
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
}
|
||||
|
||||
/* ZVAL_NULL(z_connection); */
|
||||
|
||||
|
||||
+85
-66
@@ -364,8 +364,10 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
|
||||
continue;
|
||||
}
|
||||
|
||||
zval_dtor(column->define->zval);
|
||||
php_oci_column_to_zval(column, column->define->zval, 0);
|
||||
ZEND_ASSERT(Z_ISREF(column->define->val));
|
||||
zval_ptr_dtor(Z_REFVAL(column->define->val));
|
||||
ZVAL_NULL(Z_REFVAL(column->define->val));
|
||||
php_oci_column_to_zval(column, Z_REFVAL(column->define->val), 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -910,10 +912,12 @@ void php_oci_statement_free(php_oci_statement *statement)
|
||||
int php_oci_bind_pre_exec(zval *data, void *result)
|
||||
{
|
||||
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
|
||||
zval *zv = &bind->val;
|
||||
|
||||
*(int *)result = 0;
|
||||
|
||||
if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
|
||||
ZVAL_DEREF(zv);
|
||||
if (Z_TYPE_P(zv) == IS_ARRAY) {
|
||||
/* These checks are currently valid for oci_bind_by_name, not
|
||||
* oci_bind_array_by_name. Also bind->type and
|
||||
* bind->indicator are not used for oci_bind_array_by_name.
|
||||
@@ -927,7 +931,7 @@ int php_oci_bind_pre_exec(zval *data, void *result)
|
||||
case SQLT_CLOB:
|
||||
case SQLT_BLOB:
|
||||
case SQLT_RDD:
|
||||
if (Z_TYPE_P(bind->zval) != IS_OBJECT) {
|
||||
if (Z_TYPE_P(zv) != IS_OBJECT) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
|
||||
*(int *)result = 1;
|
||||
}
|
||||
@@ -943,14 +947,14 @@ int php_oci_bind_pre_exec(zval *data, void *result)
|
||||
case SQLT_LBI:
|
||||
case SQLT_BIN:
|
||||
case SQLT_LNG:
|
||||
if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) {
|
||||
if (Z_TYPE_P(zv) == IS_RESOURCE || Z_TYPE_P(zv) == IS_OBJECT) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
|
||||
*(int *)result = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case SQLT_RSET:
|
||||
if (Z_TYPE_P(bind->zval) != IS_RESOURCE) {
|
||||
if (Z_TYPE_P(zv) != IS_RESOURCE) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
|
||||
*(int *)result = 1;
|
||||
}
|
||||
@@ -971,30 +975,34 @@ int php_oci_bind_post_exec(zval *data)
|
||||
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
|
||||
php_oci_connection *connection = bind->parent_statement->connection;
|
||||
sword errstatus;
|
||||
zval *zv = &bind->val;
|
||||
|
||||
ZVAL_DEREF(zv);
|
||||
if (bind->indicator == -1) { /* NULL */
|
||||
zval *val = bind->zval;
|
||||
if (Z_TYPE_P(val) == IS_STRING) {
|
||||
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
|
||||
if (Z_TYPE_P(zv) == IS_STRING) {
|
||||
*Z_STRVAL_P(zv) = '\0'; /* XXX avoid warning in debug mode */
|
||||
}
|
||||
zval_dtor(val);
|
||||
ZVAL_NULL(val);
|
||||
} else if (Z_TYPE_P(bind->zval) == IS_STRING
|
||||
&& Z_STRLEN_P(bind->zval) > 0
|
||||
&& Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
|
||||
zval_ptr_dtor(zv);
|
||||
ZVAL_NULL(zv);
|
||||
} else if (Z_TYPE_P(zv) == IS_STRING
|
||||
&& Z_STRLEN_P(zv) > 0
|
||||
&& Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] != '\0') {
|
||||
/* The post- PHP 5.3 feature for "interned" strings disallows
|
||||
* their reallocation but (i) any IN binds either interned or
|
||||
* not should already be null terminated and (ii) for OUT
|
||||
* binds, php_oci_bind_out_callback() should have allocated a
|
||||
* new string that we can modify here.
|
||||
*/
|
||||
Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
|
||||
Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
|
||||
} else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
|
||||
SEPARATE_STRING(zv);
|
||||
Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0);
|
||||
Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0';
|
||||
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
|
||||
int i;
|
||||
zval *entry = NULL;
|
||||
HashTable *hash = HASH_OF(bind->zval);
|
||||
|
||||
HashTable *hash;
|
||||
|
||||
SEPARATE_ARRAY(zv);
|
||||
hash = HASH_OF(zv);
|
||||
zend_hash_internal_pointer_reset(hash);
|
||||
|
||||
switch (bind->array.type) {
|
||||
@@ -1003,22 +1011,22 @@ int php_oci_bind_post_exec(zval *data)
|
||||
case SQLT_LNG:
|
||||
for (i = 0; i < (int) bind->array.current_length; i++) {
|
||||
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
zval_dtor(entry);
|
||||
zval_ptr_dtor(entry);
|
||||
ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]);
|
||||
zend_hash_move_forward(hash);
|
||||
} else {
|
||||
add_next_index_long(bind->zval, ((oci_phpsized_int *)(bind->array.elements))[i]);
|
||||
add_next_index_long(zv, ((oci_phpsized_int *)(bind->array.elements))[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SQLT_FLT:
|
||||
for (i = 0; i < (int) bind->array.current_length; i++) {
|
||||
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
zval_dtor(entry);
|
||||
zval_ptr_dtor(entry);
|
||||
ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
|
||||
zend_hash_move_forward(hash);
|
||||
} else {
|
||||
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
|
||||
add_next_index_double(zv, ((double *)(bind->array.elements))[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1031,7 +1039,7 @@ int php_oci_bind_post_exec(zval *data)
|
||||
|
||||
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
|
||||
zval_dtor(entry);
|
||||
zval_ptr_dtor(entry);
|
||||
|
||||
if (errstatus != OCI_SUCCESS) {
|
||||
connection->errcode = php_oci_error(connection->err, errstatus);
|
||||
@@ -1047,10 +1055,10 @@ int php_oci_bind_post_exec(zval *data)
|
||||
if (errstatus != OCI_SUCCESS) {
|
||||
connection->errcode = php_oci_error(connection->err, errstatus);
|
||||
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
|
||||
add_next_index_null(bind->zval);
|
||||
add_next_index_null(zv);
|
||||
} else {
|
||||
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
|
||||
add_next_index_stringl(bind->zval, (char *)buff, buff_len);
|
||||
add_next_index_stringl(zv, (char *)buff, buff_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1066,20 +1074,21 @@ int php_oci_bind_post_exec(zval *data)
|
||||
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
|
||||
int curr_element_length = bind->array.element_lengths[i];
|
||||
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
zval_dtor(entry);
|
||||
zval_ptr_dtor(entry);
|
||||
ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
|
||||
zend_hash_move_forward(hash);
|
||||
} else {
|
||||
add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
|
||||
add_next_index_stringl(zv, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if ((Z_TYPE_P(bind->zval) == IS_TRUE) || (Z_TYPE_P(bind->zval) == IS_FALSE)) {
|
||||
if (Z_LVAL_P(bind->zval) == 0)
|
||||
ZVAL_BOOL(bind->zval, FALSE);
|
||||
else if (Z_LVAL_P(bind->zval) == 1)
|
||||
ZVAL_BOOL(bind->zval, TRUE);
|
||||
} else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) {
|
||||
/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temorary value) */
|
||||
if (Z_LVAL_P(zv) == 0)
|
||||
ZVAL_BOOL(zv, FALSE);
|
||||
else if (Z_LVAL_P(zv) == 1)
|
||||
ZVAL_BOOL(zv, TRUE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1103,11 +1112,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
|
||||
sword errstatus;
|
||||
zval *param = NULL;
|
||||
|
||||
if (!Z_ISREF_P(var)) {
|
||||
param = var;
|
||||
} else {
|
||||
param = Z_REFVAL_P(var);
|
||||
}
|
||||
ZEND_ASSERT(Z_ISREF_P(var));
|
||||
param = Z_REFVAL_P(var);
|
||||
|
||||
switch (type) {
|
||||
case SQLT_NTY:
|
||||
@@ -1242,9 +1248,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
|
||||
|
||||
if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
|
||||
bindp = old_bind;
|
||||
if (!Z_ISUNDEF(bindp->parameter)) {
|
||||
zval_ptr_dtor(&bindp->parameter);
|
||||
ZVAL_UNDEF(&bindp->parameter);
|
||||
if (!Z_ISUNDEF(bindp->val)) {
|
||||
zval_ptr_dtor(&bindp->val);
|
||||
ZVAL_UNDEF(&bindp->val);
|
||||
}
|
||||
} else {
|
||||
zend_string *zvtmp;
|
||||
@@ -1254,9 +1260,6 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
|
||||
zend_string_release(zvtmp);
|
||||
}
|
||||
|
||||
/* Keep a copy of bound variable in the bind hash */
|
||||
ZVAL_COPY(&bindp->parameter, var);
|
||||
|
||||
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
|
||||
* when both in/out parameters are bound with empty strings
|
||||
*/
|
||||
@@ -1266,7 +1269,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
|
||||
bindp->descriptor = oci_desc;
|
||||
bindp->statement = oci_stmt;
|
||||
bindp->parent_statement = statement;
|
||||
bindp->zval = param;
|
||||
ZVAL_COPY(&bindp->val, var);
|
||||
bindp->type = type;
|
||||
/* Storing max length set in OCIBindByName() to check it later in
|
||||
* php_oci_bind_in_callback() function to avoid ORA-1406 error while
|
||||
@@ -1360,11 +1363,14 @@ sb4 php_oci_bind_in_callback(
|
||||
php_oci_bind *phpbind;
|
||||
zval *val;
|
||||
|
||||
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) {
|
||||
if (!(phpbind=(php_oci_bind *)ictxp) || Z_ISUNDEF(phpbind->val)) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
|
||||
return OCI_ERROR;
|
||||
}
|
||||
|
||||
val = &phpbind->val;
|
||||
ZVAL_DEREF(val);
|
||||
|
||||
if (Z_ISNULL_P(val)) {
|
||||
/* we're going to insert a NULL column */
|
||||
phpbind->indicator = -1;
|
||||
@@ -1421,11 +1427,14 @@ sb4 php_oci_bind_out_callback(
|
||||
zval *val;
|
||||
sb4 retval = OCI_ERROR;
|
||||
|
||||
if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) {
|
||||
if (!(phpbind=(php_oci_bind *)octxp) || Z_ISUNDEF(phpbind->val)) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
|
||||
return retval;
|
||||
}
|
||||
|
||||
val = &phpbind->val;
|
||||
ZVAL_DEREF(val);
|
||||
|
||||
if (Z_TYPE_P(val) == IS_RESOURCE) {
|
||||
/* Processing for ref-cursor out binds */
|
||||
if (phpbind->statement != NULL) {
|
||||
@@ -1463,7 +1472,7 @@ sb4 php_oci_bind_out_callback(
|
||||
retval = OCI_CONTINUE;
|
||||
} else {
|
||||
convert_to_string(val);
|
||||
zval_dtor(val);
|
||||
zval_ptr_dtor(val);
|
||||
|
||||
{
|
||||
char *p = ecalloc(1, PHP_OCI_PIECE_SIZE);
|
||||
@@ -1474,12 +1483,12 @@ sb4 php_oci_bind_out_callback(
|
||||
Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
|
||||
Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(val) + 1);
|
||||
/* XXX is this right? */
|
||||
ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
|
||||
ZVAL_STRINGL(val, NULL, Z_STRLEN(val) + 1);
|
||||
#endif
|
||||
|
||||
/* XXX we assume that zend-zval len has 4 bytes */
|
||||
*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
|
||||
*bufpp = Z_STRVAL_P(phpbind->zval);
|
||||
*alenpp = (ub4*) &Z_STRLEN_P(val);
|
||||
*bufpp = Z_STRVAL_P(val);
|
||||
*piecep = OCI_ONE_PIECE;
|
||||
*rcodepp = &phpbind->retcode;
|
||||
*indpp = &phpbind->indicator;
|
||||
@@ -1527,10 +1536,10 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
|
||||
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
|
||||
if (!column) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", Z_LVAL(tmp));
|
||||
zval_dtor(&tmp);
|
||||
zval_ptr_dtor(&tmp);
|
||||
return NULL;
|
||||
}
|
||||
zval_dtor(&tmp);
|
||||
zval_ptr_dtor(&tmp);
|
||||
}
|
||||
return column;
|
||||
}
|
||||
@@ -1586,11 +1595,15 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
|
||||
Bind arrays to PL/SQL types */
|
||||
int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
|
||||
{
|
||||
php_oci_bind *bind, *bindp;
|
||||
php_oci_bind *bind;
|
||||
sword errstatus;
|
||||
zend_string *zvtmp;
|
||||
zval *val;
|
||||
|
||||
convert_to_array(var);
|
||||
ZEND_ASSERT(Z_ISREF_P(var));
|
||||
val = Z_REFVAL_P(var);
|
||||
SEPARATE_ZVAL_NOREF(val);
|
||||
convert_to_array(val);
|
||||
|
||||
if (maxlength < -1) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength);
|
||||
@@ -1601,11 +1614,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
|
||||
case SQLT_NUM:
|
||||
case SQLT_INT:
|
||||
case SQLT_LNG:
|
||||
bind = php_oci_bind_array_helper_number(var, max_table_length);
|
||||
bind = php_oci_bind_array_helper_number(val, max_table_length);
|
||||
break;
|
||||
|
||||
case SQLT_FLT:
|
||||
bind = php_oci_bind_array_helper_double(var, max_table_length);
|
||||
bind = php_oci_bind_array_helper_double(val, max_table_length);
|
||||
break;
|
||||
|
||||
case SQLT_AFC:
|
||||
@@ -1614,14 +1627,14 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
|
||||
case SQLT_AVC:
|
||||
case SQLT_STR:
|
||||
case SQLT_LVC:
|
||||
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
|
||||
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(val)) == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
|
||||
return 1;
|
||||
}
|
||||
bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
|
||||
bind = php_oci_bind_array_helper_string(val, max_table_length, maxlength);
|
||||
break;
|
||||
case SQLT_ODT:
|
||||
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
|
||||
bind = php_oci_bind_array_helper_date(val, max_table_length, statement->connection);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type);
|
||||
@@ -1638,7 +1651,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
|
||||
bind->statement = NULL;
|
||||
bind->parent_statement = statement;
|
||||
bind->bind = NULL;
|
||||
bind->zval = var;
|
||||
ZVAL_COPY(&bind->val, var);
|
||||
bind->array.type = type;
|
||||
bind->indicator = 0; /* not used for array binds */
|
||||
bind->type = 0; /* not used for array binds */
|
||||
@@ -1677,6 +1690,8 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
|
||||
efree(bind->array.indicators);
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&bind->val);
|
||||
|
||||
efree(bind);
|
||||
|
||||
statement->errcode = php_oci_error(statement->err, errstatus);
|
||||
@@ -1690,7 +1705,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
|
||||
}
|
||||
|
||||
zvtmp = zend_string_init(name, name_len, 0);
|
||||
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bind);
|
||||
zend_hash_update_ptr(statement->binds, zvtmp, bind);
|
||||
zend_string_release(zvtmp);
|
||||
|
||||
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
|
||||
@@ -1707,6 +1722,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
|
||||
HashTable *hash;
|
||||
zval *entry;
|
||||
|
||||
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
|
||||
hash = HASH_OF(var);
|
||||
|
||||
if (maxlength == -1) {
|
||||
@@ -1723,7 +1739,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
|
||||
}
|
||||
|
||||
bind = emalloc(sizeof(php_oci_bind));
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
ZVAL_UNDEF(&bind->val);
|
||||
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
|
||||
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
|
||||
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
|
||||
@@ -1780,10 +1796,11 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
|
||||
HashTable *hash;
|
||||
zval *entry;
|
||||
|
||||
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
|
||||
hash = HASH_OF(var);
|
||||
|
||||
bind = emalloc(sizeof(php_oci_bind));
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
ZVAL_UNDEF(&bind->val);
|
||||
bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0);
|
||||
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
|
||||
bind->array.old_length = bind->array.current_length;
|
||||
@@ -1820,10 +1837,11 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
|
||||
HashTable *hash;
|
||||
zval *entry;
|
||||
|
||||
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
|
||||
hash = HASH_OF(var);
|
||||
|
||||
bind = emalloc(sizeof(php_oci_bind));
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
ZVAL_UNDEF(&bind->val);
|
||||
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
|
||||
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
|
||||
bind->array.old_length = bind->array.current_length;
|
||||
@@ -1861,10 +1879,11 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
|
||||
zval *entry;
|
||||
sword errstatus;
|
||||
|
||||
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
|
||||
hash = HASH_OF(var);
|
||||
|
||||
bind = emalloc(sizeof(php_oci_bind));
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
ZVAL_UNDEF(&bind->val);
|
||||
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
|
||||
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
|
||||
bind->array.old_length = bind->array.current_length;
|
||||
|
||||
+19
-3
@@ -56,8 +56,8 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<time>12:00:00</time>
|
||||
|
||||
<version>
|
||||
<release>2.1.7</release>
|
||||
<api>2.1.7</api>
|
||||
<release>2.1.8</release>
|
||||
<api>2.1.8</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
@@ -66,7 +66,7 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Added oci_unregister_taf_callback()
|
||||
Fixed reference counting and memory issues. (Dmitry, Tianfang)
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
@@ -476,6 +476,22 @@ Added oci_unregister_taf_callback()
|
||||
</extsrcrelease>
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.7</release>
|
||||
<api>2.1.7</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Added oci_unregister_taf_callback()
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.6</release>
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
*/
|
||||
#undef PHP_OCI8_VERSION
|
||||
#endif
|
||||
#define PHP_OCI8_VERSION "2.1.7"
|
||||
#define PHP_OCI8_VERSION "2.1.8"
|
||||
|
||||
extern zend_module_entry oci8_module_entry;
|
||||
#define phpext_oci8_ptr &oci8_module_entry
|
||||
|
||||
@@ -209,7 +209,7 @@ typedef struct {
|
||||
|
||||
/* {{{ php_oci_define */
|
||||
typedef struct {
|
||||
zval *zval; /* zval used in define */
|
||||
zval val; /* zval used in define */
|
||||
text *name; /* placeholder's name */
|
||||
ub4 name_len; /* placeholder's name length */
|
||||
ub4 type; /* define type */
|
||||
@@ -244,8 +244,7 @@ typedef struct {
|
||||
/* {{{ php_oci_bind */
|
||||
typedef struct {
|
||||
OCIBind *bind; /* bind handle */
|
||||
zval *zval; /* value */
|
||||
zval parameter; /* a copy of bound variable used for oci_bind_by_name */
|
||||
zval val; /* value */
|
||||
dvoid *descriptor; /* used for binding of LOBS etc */
|
||||
OCIStmt *statement; /* used for binding REFCURSORs */
|
||||
php_oci_statement *parent_statement; /* pointer to the parent statement */
|
||||
|
||||
@@ -57,11 +57,11 @@ function get_attr($conn)
|
||||
?>
|
||||
--EXPECT--
|
||||
**Test 1.1 - Default values for the attribute **************
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
|
||||
|
||||
***Test 1.2 - Get the values from different connections **************
|
||||
Testing with oci_pconnect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
|
||||
Testing with oci_new_connect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
|
||||
Done
|
||||
@@ -1221,7 +1221,7 @@ static zend_persistent_script *cache_script_in_file_cache(zend_persistent_script
|
||||
zend_shared_alloc_init_xlat_table();
|
||||
|
||||
/* Calculate the required memory size */
|
||||
memory_used = zend_accel_script_persist_calc(new_persistent_script, NULL, 0);
|
||||
memory_used = zend_accel_script_persist_calc(new_persistent_script, NULL, 0, 0);
|
||||
|
||||
/* Allocate memory block */
|
||||
#ifdef __SSE2__
|
||||
@@ -1309,7 +1309,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
zend_shared_alloc_init_xlat_table();
|
||||
|
||||
/* Calculate the required memory size */
|
||||
memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length);
|
||||
memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length, 1);
|
||||
|
||||
/* Allocate shared memory */
|
||||
#ifdef __SSE2__
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#define ZEND_PERSIST_H
|
||||
|
||||
int zend_accel_script_persistable(zend_persistent_script *script);
|
||||
uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length);
|
||||
uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length, int for_shm);
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
|
||||
|
||||
#endif /* ZEND_PERSIST_H */
|
||||
@@ -381,7 +381,7 @@ static void zend_accel_persist_class_table_calc(HashTable *class_table)
|
||||
zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
|
||||
}
|
||||
|
||||
uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length)
|
||||
uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int for_shm)
|
||||
{
|
||||
new_persistent_script->mem = NULL;
|
||||
new_persistent_script->size = 0;
|
||||
@@ -390,12 +390,14 @@ uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_scrip
|
||||
new_persistent_script->corrupted = 0;
|
||||
ZCG(current_persistent_script) = new_persistent_script;
|
||||
|
||||
if (!for_shm) {
|
||||
/* script is not going to be saved in SHM */
|
||||
new_persistent_script->corrupted = 1;
|
||||
}
|
||||
|
||||
ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script));
|
||||
if (key) {
|
||||
ADD_DUP_SIZE(key, key_length + 1);
|
||||
} else {
|
||||
/* script is not going to be saved in SHM */
|
||||
new_persistent_script->corrupted = 1;
|
||||
}
|
||||
ADD_STRING(new_persistent_script->full_path);
|
||||
|
||||
|
||||
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user