From a3117998648c61f6094d0feaac02f108c8c58f6a Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 20 Sep 2018 11:53:27 -0400 Subject: [PATCH 01/42] Fix --- UPGRADING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index 634b10deab3..d632a23b2d6 100644 --- a/UPGRADING +++ b/UPGRADING @@ -58,7 +58,7 @@ Core: } . Array accesses of type $obj["123"], where $obj implements ArrayAccess and - "123" is an integral string literal will no longer result in an implicit + "123" is an integer string literal will no longer result in an implicit conversion to integer, i.e., $obj->offsetGet("123") will be called instead of $obj->offsetGet(123). This matches existing behavior for non-literals. The behavior of arrays is not affected in any way, they continue to From 72231ed74746f09fb3096761b77cb5130309ca1e Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 20 Sep 2018 12:01:34 -0400 Subject: [PATCH 02/42] Fix --- UPGRADING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index d632a23b2d6..ba0fc4a2c21 100644 --- a/UPGRADING +++ b/UPGRADING @@ -254,7 +254,7 @@ phpdbg: PHPDBG_FUNC have been removed. FPM: - . The getallheaders function is now also available. + . The getallheaders() function is now also available. ======================================== 4. Deprecated Functionality From a1b5698d4e3aa8514752b1fdc9a001952f984398 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 18 Sep 2018 19:26:19 +0200 Subject: [PATCH 03/42] Remove HAVE_TIME_H The `` header file is part of the standard C89 headers [1] and on current systems can be included unconditionally. Since PHP requires at least C89 or greater, the `HAVE_TIME_H` symbol defined by Autoconf in ext/pdo_sqlite/config.m4 [2] can be ommitted and simplifed. Additionally, since PHP didn't define `HAVE_TIME_H` prior in the configure.ac the occurrence of this symbol in cli can be removed. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 --- ext/pdo_sqlite/config.m4 | 1 - sapi/cli/php_cli_server.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 index fcaef27eecb..b5aa342eaf5 100644 --- a/ext/pdo_sqlite/config.m4 +++ b/ext/pdo_sqlite/config.m4 @@ -102,7 +102,6 @@ if test "$PHP_PDO_SQLITE" != "no"; then PHP_ADD_INCLUDE($abs_srcdir/ext/sqlite3/libsqlite) AC_CHECK_FUNCS(usleep nanosleep) - AC_CHECK_HEADERS(time.h) fi dnl Solaris fix diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 5386aa54c64..bcbbab3c01a 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -37,10 +37,6 @@ #include #endif - -#if HAVE_TIME_H -#include -#endif #if HAVE_SYS_TIME_H #include #endif From bfa2c7158ffb8af0ad9d71028992485059c7027d Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 18 Sep 2018 22:46:20 +0200 Subject: [PATCH 04/42] Fix permissions Certain files don't need to be executables. --- Zend/tests/bug39542/bug39542.php | 0 Zend/tests/constants/fixtures/folder1/fixture.inc | 0 .../fixtures/folder1/subfolder1/fixture.inc | 0 .../fixtures/folder1/subfolder2/fixture.inc | 0 .../fixtures/folder1/subfolder3/fixture.inc | 0 .../fixtures/folder1/subfolder4/fixture.inc | 0 Zend/tests/constants/fixtures/folder2/fixture.inc | 0 .../fixtures/folder2/subfolder1/fixture.inc | 0 .../fixtures/folder2/subfolder2/fixture.inc | 0 .../fixtures/folder2/subfolder3/fixture.inc | 0 .../fixtures/folder2/subfolder4/fixture.inc | 0 Zend/tests/constants/fixtures/folder3/fixture.inc | 0 .../fixtures/folder3/subfolder1/fixture.inc | 0 .../fixtures/folder3/subfolder2/fixture.inc | 0 .../fixtures/folder3/subfolder3/fixture.inc | 0 .../fixtures/folder3/subfolder4/fixture.inc | 0 Zend/tests/constants/fixtures/folder4/fixture.inc | 0 .../fixtures/folder4/subfolder1/fixture.inc | 0 .../fixtures/folder4/subfolder2/fixture.inc | 0 .../fixtures/folder4/subfolder3/fixture.inc | 0 .../fixtures/folder4/subfolder4/fixture.inc | 0 ext/dom/tests/book-non-conforming-schema.xsd | 0 ext/dom/tests/book-not-a-schema.xsd | 0 ext/dom/tests/book.xsd | 0 ext/exif/tests/bug34704.jpg | Bin ext/exif/tests/bug68113.jpg | Bin ext/gd/tests/Tuffy.ttf | Bin ext/pgsql/tests/29nb_async_connect.phpt | 0 ext/pgsql/tests/30nb_async_query_params.phpt | 0 ext/pgsql/tests/31nb_async_query_prepared.phpt | 0 ext/phar/tests/bug70433.zip | Bin ext/simplexml/tests/000.xml | 0 ext/simplexml/tests/sxe.dtd | 0 ext/simplexml/tests/sxe.ent | 0 ext/simplexml/tests/sxe.xml | 0 ext/soap/tests/bugs/bug32941.wsdl | 0 ext/soap/tests/bugs/bug34453.wsdl | 0 ext/soap/tests/bugs/bug34643.wsdl | 0 ext/soap/tests/bugs/bug35142.wsdl | 0 ext/soap/tests/bugs/bug36226-2.wsdl | 0 ext/soap/tests/bugs/bug36575.wsdl | 0 ext/soap/tests/bugs/bug36614.wsdl | 0 ext/soap/tests/bugs/bug36908.wsdl | 0 ext/soap/tests/bugs/bug36999.wsdl | 0 ext/soap/tests/bugs/bug37013.wsdl | 0 ext/soap/tests/bugs/bug37083.wsdl | 0 ext/soap/tests/bugs/bug38004.wsdl | 0 ext/soap/tests/bugs/bug38055.wsdl | 0 ext/soap/tests/bugs/bug38067.wsdl | 0 ext/soap/tests/bugs/bug38536.wsdl | 0 ext/soap/tests/bugs/bug39832.wsdl | 0 ext/soap/tests/bugs/bug40609.wsdl | 0 ext/soap/tests/bugs/bug41004.wsdl | 0 ext/soap/tests/bugs/bug41337.wsdl | 0 ext/soap/tests/bugs/bug41337_2.wsdl | 0 ext/soap/tests/bugs/bug41337_2_1.wsdl | 0 ext/soap/tests/bugs/bug42086.wsdl | 0 ext/soap/tests/bugs/bug42326.wsdl | 0 ext/soap/tests/bugs/bug42359.wsdl | 0 ext/soap/tests/bugs/bug42692.wsdl | 0 ext/soap/tests/bugs/xml2.xsd | 0 ext/soap/tests/classmap003.wsdl | 0 ext/soap/tests/server025.wsdl | 0 ext/spl/spl.php | 0 ext/spl/tests/fileobject_001a.txt | 0 ext/spl/tests/fileobject_001b.txt | 0 ext/spl/tests/testclass | 0 ext/standard/tests/file/fputcsv_variation15.phpt | 0 ext/standard/tests/file/stream_rfc2397_003.gif | Bin ext/standard/tests/image/test13pix.swf | Bin ext/standard/tests/image/test4pix.swf | Bin .../tests/serialize/autoload_implements.p5c | 0 ext/standard/tests/serialize/autoload_interface.p5c | 0 ext/xmlreader/tests/012.dtd | 0 ext/xmlreader/tests/012.xml | 0 ext/xmlreader/tests/013.xsd | 0 tests/classes/autoload_derived.p5c | 0 tests/classes/autoload_implements.p5c | 0 tests/classes/autoload_interface.p5c | 0 tests/classes/autoload_root.p5c | 0 80 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Zend/tests/bug39542/bug39542.php mode change 100755 => 100644 Zend/tests/constants/fixtures/folder1/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder1/subfolder1/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder1/subfolder2/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder1/subfolder3/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder1/subfolder4/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder2/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder2/subfolder1/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder2/subfolder2/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder2/subfolder3/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder2/subfolder4/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder3/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder3/subfolder1/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder3/subfolder2/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder3/subfolder3/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder3/subfolder4/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder4/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder4/subfolder1/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder4/subfolder2/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder4/subfolder3/fixture.inc mode change 100755 => 100644 Zend/tests/constants/fixtures/folder4/subfolder4/fixture.inc mode change 100755 => 100644 ext/dom/tests/book-non-conforming-schema.xsd mode change 100755 => 100644 ext/dom/tests/book-not-a-schema.xsd mode change 100755 => 100644 ext/dom/tests/book.xsd mode change 100755 => 100644 ext/exif/tests/bug34704.jpg mode change 100755 => 100644 ext/exif/tests/bug68113.jpg mode change 100755 => 100644 ext/gd/tests/Tuffy.ttf mode change 100755 => 100644 ext/pgsql/tests/29nb_async_connect.phpt mode change 100755 => 100644 ext/pgsql/tests/30nb_async_query_params.phpt mode change 100755 => 100644 ext/pgsql/tests/31nb_async_query_prepared.phpt mode change 100755 => 100644 ext/phar/tests/bug70433.zip mode change 100755 => 100644 ext/simplexml/tests/000.xml mode change 100755 => 100644 ext/simplexml/tests/sxe.dtd mode change 100755 => 100644 ext/simplexml/tests/sxe.ent mode change 100755 => 100644 ext/simplexml/tests/sxe.xml mode change 100755 => 100644 ext/soap/tests/bugs/bug32941.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug34453.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug34643.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug35142.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug36226-2.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug36575.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug36614.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug36908.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug36999.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug37013.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug37083.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug38004.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug38055.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug38067.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug38536.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug39832.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug40609.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug41004.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug41337.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug41337_2.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug41337_2_1.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug42086.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug42326.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug42359.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/bug42692.wsdl mode change 100755 => 100644 ext/soap/tests/bugs/xml2.xsd mode change 100755 => 100644 ext/soap/tests/classmap003.wsdl mode change 100755 => 100644 ext/soap/tests/server025.wsdl mode change 100755 => 100644 ext/spl/spl.php mode change 100755 => 100644 ext/spl/tests/fileobject_001a.txt mode change 100755 => 100644 ext/spl/tests/fileobject_001b.txt mode change 100755 => 100644 ext/spl/tests/testclass mode change 100755 => 100644 ext/standard/tests/file/fputcsv_variation15.phpt mode change 100755 => 100644 ext/standard/tests/file/stream_rfc2397_003.gif mode change 100755 => 100644 ext/standard/tests/image/test13pix.swf mode change 100755 => 100644 ext/standard/tests/image/test4pix.swf mode change 100755 => 100644 ext/standard/tests/serialize/autoload_implements.p5c mode change 100755 => 100644 ext/standard/tests/serialize/autoload_interface.p5c mode change 100755 => 100644 ext/xmlreader/tests/012.dtd mode change 100755 => 100644 ext/xmlreader/tests/012.xml mode change 100755 => 100644 ext/xmlreader/tests/013.xsd mode change 100755 => 100644 tests/classes/autoload_derived.p5c mode change 100755 => 100644 tests/classes/autoload_implements.p5c mode change 100755 => 100644 tests/classes/autoload_interface.p5c mode change 100755 => 100644 tests/classes/autoload_root.p5c diff --git a/Zend/tests/bug39542/bug39542.php b/Zend/tests/bug39542/bug39542.php old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder1/fixture.inc b/Zend/tests/constants/fixtures/folder1/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder1/subfolder1/fixture.inc b/Zend/tests/constants/fixtures/folder1/subfolder1/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder1/subfolder2/fixture.inc b/Zend/tests/constants/fixtures/folder1/subfolder2/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder1/subfolder3/fixture.inc b/Zend/tests/constants/fixtures/folder1/subfolder3/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder1/subfolder4/fixture.inc b/Zend/tests/constants/fixtures/folder1/subfolder4/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder2/fixture.inc b/Zend/tests/constants/fixtures/folder2/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder2/subfolder1/fixture.inc b/Zend/tests/constants/fixtures/folder2/subfolder1/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder2/subfolder2/fixture.inc b/Zend/tests/constants/fixtures/folder2/subfolder2/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder2/subfolder3/fixture.inc b/Zend/tests/constants/fixtures/folder2/subfolder3/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder2/subfolder4/fixture.inc b/Zend/tests/constants/fixtures/folder2/subfolder4/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder3/fixture.inc b/Zend/tests/constants/fixtures/folder3/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder3/subfolder1/fixture.inc b/Zend/tests/constants/fixtures/folder3/subfolder1/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder3/subfolder2/fixture.inc b/Zend/tests/constants/fixtures/folder3/subfolder2/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder3/subfolder3/fixture.inc b/Zend/tests/constants/fixtures/folder3/subfolder3/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder3/subfolder4/fixture.inc b/Zend/tests/constants/fixtures/folder3/subfolder4/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder4/fixture.inc b/Zend/tests/constants/fixtures/folder4/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder4/subfolder1/fixture.inc b/Zend/tests/constants/fixtures/folder4/subfolder1/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder4/subfolder2/fixture.inc b/Zend/tests/constants/fixtures/folder4/subfolder2/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder4/subfolder3/fixture.inc b/Zend/tests/constants/fixtures/folder4/subfolder3/fixture.inc old mode 100755 new mode 100644 diff --git a/Zend/tests/constants/fixtures/folder4/subfolder4/fixture.inc b/Zend/tests/constants/fixtures/folder4/subfolder4/fixture.inc old mode 100755 new mode 100644 diff --git a/ext/dom/tests/book-non-conforming-schema.xsd b/ext/dom/tests/book-non-conforming-schema.xsd old mode 100755 new mode 100644 diff --git a/ext/dom/tests/book-not-a-schema.xsd b/ext/dom/tests/book-not-a-schema.xsd old mode 100755 new mode 100644 diff --git a/ext/dom/tests/book.xsd b/ext/dom/tests/book.xsd old mode 100755 new mode 100644 diff --git a/ext/exif/tests/bug34704.jpg b/ext/exif/tests/bug34704.jpg old mode 100755 new mode 100644 diff --git a/ext/exif/tests/bug68113.jpg b/ext/exif/tests/bug68113.jpg old mode 100755 new mode 100644 diff --git a/ext/gd/tests/Tuffy.ttf b/ext/gd/tests/Tuffy.ttf old mode 100755 new mode 100644 diff --git a/ext/pgsql/tests/29nb_async_connect.phpt b/ext/pgsql/tests/29nb_async_connect.phpt old mode 100755 new mode 100644 diff --git a/ext/pgsql/tests/30nb_async_query_params.phpt b/ext/pgsql/tests/30nb_async_query_params.phpt old mode 100755 new mode 100644 diff --git a/ext/pgsql/tests/31nb_async_query_prepared.phpt b/ext/pgsql/tests/31nb_async_query_prepared.phpt old mode 100755 new mode 100644 diff --git a/ext/phar/tests/bug70433.zip b/ext/phar/tests/bug70433.zip old mode 100755 new mode 100644 diff --git a/ext/simplexml/tests/000.xml b/ext/simplexml/tests/000.xml old mode 100755 new mode 100644 diff --git a/ext/simplexml/tests/sxe.dtd b/ext/simplexml/tests/sxe.dtd old mode 100755 new mode 100644 diff --git a/ext/simplexml/tests/sxe.ent b/ext/simplexml/tests/sxe.ent old mode 100755 new mode 100644 diff --git a/ext/simplexml/tests/sxe.xml b/ext/simplexml/tests/sxe.xml old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug32941.wsdl b/ext/soap/tests/bugs/bug32941.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug34453.wsdl b/ext/soap/tests/bugs/bug34453.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug34643.wsdl b/ext/soap/tests/bugs/bug34643.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug35142.wsdl b/ext/soap/tests/bugs/bug35142.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug36226-2.wsdl b/ext/soap/tests/bugs/bug36226-2.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug36575.wsdl b/ext/soap/tests/bugs/bug36575.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug36614.wsdl b/ext/soap/tests/bugs/bug36614.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug36908.wsdl b/ext/soap/tests/bugs/bug36908.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug36999.wsdl b/ext/soap/tests/bugs/bug36999.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug37013.wsdl b/ext/soap/tests/bugs/bug37013.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug37083.wsdl b/ext/soap/tests/bugs/bug37083.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug38004.wsdl b/ext/soap/tests/bugs/bug38004.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug38055.wsdl b/ext/soap/tests/bugs/bug38055.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug38067.wsdl b/ext/soap/tests/bugs/bug38067.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug38536.wsdl b/ext/soap/tests/bugs/bug38536.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug39832.wsdl b/ext/soap/tests/bugs/bug39832.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug40609.wsdl b/ext/soap/tests/bugs/bug40609.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug41004.wsdl b/ext/soap/tests/bugs/bug41004.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug41337.wsdl b/ext/soap/tests/bugs/bug41337.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug41337_2.wsdl b/ext/soap/tests/bugs/bug41337_2.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug41337_2_1.wsdl b/ext/soap/tests/bugs/bug41337_2_1.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug42086.wsdl b/ext/soap/tests/bugs/bug42086.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug42326.wsdl b/ext/soap/tests/bugs/bug42326.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug42359.wsdl b/ext/soap/tests/bugs/bug42359.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/bug42692.wsdl b/ext/soap/tests/bugs/bug42692.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/bugs/xml2.xsd b/ext/soap/tests/bugs/xml2.xsd old mode 100755 new mode 100644 diff --git a/ext/soap/tests/classmap003.wsdl b/ext/soap/tests/classmap003.wsdl old mode 100755 new mode 100644 diff --git a/ext/soap/tests/server025.wsdl b/ext/soap/tests/server025.wsdl old mode 100755 new mode 100644 diff --git a/ext/spl/spl.php b/ext/spl/spl.php old mode 100755 new mode 100644 diff --git a/ext/spl/tests/fileobject_001a.txt b/ext/spl/tests/fileobject_001a.txt old mode 100755 new mode 100644 diff --git a/ext/spl/tests/fileobject_001b.txt b/ext/spl/tests/fileobject_001b.txt old mode 100755 new mode 100644 diff --git a/ext/spl/tests/testclass b/ext/spl/tests/testclass old mode 100755 new mode 100644 diff --git a/ext/standard/tests/file/fputcsv_variation15.phpt b/ext/standard/tests/file/fputcsv_variation15.phpt old mode 100755 new mode 100644 diff --git a/ext/standard/tests/file/stream_rfc2397_003.gif b/ext/standard/tests/file/stream_rfc2397_003.gif old mode 100755 new mode 100644 diff --git a/ext/standard/tests/image/test13pix.swf b/ext/standard/tests/image/test13pix.swf old mode 100755 new mode 100644 diff --git a/ext/standard/tests/image/test4pix.swf b/ext/standard/tests/image/test4pix.swf old mode 100755 new mode 100644 diff --git a/ext/standard/tests/serialize/autoload_implements.p5c b/ext/standard/tests/serialize/autoload_implements.p5c old mode 100755 new mode 100644 diff --git a/ext/standard/tests/serialize/autoload_interface.p5c b/ext/standard/tests/serialize/autoload_interface.p5c old mode 100755 new mode 100644 diff --git a/ext/xmlreader/tests/012.dtd b/ext/xmlreader/tests/012.dtd old mode 100755 new mode 100644 diff --git a/ext/xmlreader/tests/012.xml b/ext/xmlreader/tests/012.xml old mode 100755 new mode 100644 diff --git a/ext/xmlreader/tests/013.xsd b/ext/xmlreader/tests/013.xsd old mode 100755 new mode 100644 diff --git a/tests/classes/autoload_derived.p5c b/tests/classes/autoload_derived.p5c old mode 100755 new mode 100644 diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c old mode 100755 new mode 100644 diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c old mode 100755 new mode 100644 diff --git a/tests/classes/autoload_root.p5c b/tests/classes/autoload_root.p5c old mode 100755 new mode 100644 From 7b9b398daad24d8829df487131bdf5d266e34f74 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 21 Sep 2018 15:00:07 +0200 Subject: [PATCH 05/42] Update NEWS and UPGRADING wrt. PR 2760 --- NEWS | 3 +++ UPGRADING | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 0db3bdb234f..49d5716d876 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ PHP NEWS . Changed default of $variant parameter of idn_to_ascii() and idn_to_utf8(). (cmb) +- PDO_SQLite: + . Implemented sqlite_stmt_readonly in PDO_SQLite. (BohwaZ) + - SQLite3: . Updated to SQLite 3.25.1. (cmb) diff --git a/UPGRADING b/UPGRADING index 9affb5b1297..629b51b9126 100644 --- a/UPGRADING +++ b/UPGRADING @@ -27,6 +27,11 @@ PHP 7.4 UPGRADE NOTES 2. New Features ======================================== +- PDO_SQLite: + . PDOStatement::getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT) allows to + check whether this statement is read-only, i.e. whether it doesn't modify + the database. + ======================================== 3. Changes in SAPI modules ======================================== From 91b2b6c65d544f39c45498ebafbab84b81d465b5 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Sep 2018 14:16:06 +0200 Subject: [PATCH 06/42] Upgrade PCRE2 to 10.32 (cherry picked from commit d918e0776b5168aed2707b0ca500589844f0faa8) --- ext/pcre/pcre2lib/pcre2.h | 30 +- ext/pcre/pcre2lib/pcre2_auto_possess.c | 7 +- ext/pcre/pcre2lib/pcre2_compile.c | 336 +- ext/pcre/pcre2lib/pcre2_convert.c | 12 +- ext/pcre/pcre2lib/pcre2_dfa_match.c | 271 +- ext/pcre/pcre2lib/pcre2_error.c | 15 +- ext/pcre/pcre2lib/pcre2_extuni.c | 8 +- ext/pcre/pcre2lib/pcre2_find_bracket.c | 3 +- ext/pcre/pcre2lib/pcre2_internal.h | 131 +- ext/pcre/pcre2lib/pcre2_intmodedep.h | 17 + ext/pcre/pcre2lib/pcre2_jit_compile.c | 37 +- ext/pcre/pcre2lib/pcre2_maketables.c | 9 +- ext/pcre/pcre2lib/pcre2_match.c | 54 +- ext/pcre/pcre2lib/pcre2_pattern_info.c | 3 +- ext/pcre/pcre2lib/pcre2_printint.c | 3 +- ext/pcre/pcre2lib/pcre2_serialize.c | 22 +- ext/pcre/pcre2lib/pcre2_string_utils.c | 38 +- ext/pcre/pcre2lib/pcre2_study.c | 6 +- ext/pcre/pcre2lib/pcre2_substitute.c | 47 +- ext/pcre/pcre2lib/pcre2_tables.c | 378 +- ext/pcre/pcre2lib/pcre2_ucd.c | 6751 +++++++++-------- ext/pcre/pcre2lib/pcre2_ucp.h | 48 +- ext/pcre/pcre2lib/sljit/sljitConfigInternal.h | 29 +- ext/pcre/pcre2lib/sljit/sljitExecAllocator.c | 9 +- ext/pcre/pcre2lib/sljit/sljitLir.c | 10 +- ext/pcre/pcre2lib/sljit/sljitLir.h | 20 +- ext/pcre/pcre2lib/sljit/sljitNativeARM_64.c | 250 +- .../pcre2lib/sljit/sljitNativeARM_T2_32.c | 112 +- ext/pcre/pcre2lib/sljit/sljitNativeMIPS_32.c | 4 +- ext/pcre/pcre2lib/sljit/sljitNativeMIPS_64.c | 4 +- .../pcre2lib/sljit/sljitNativeMIPS_common.c | 48 +- .../pcre2lib/sljit/sljitNativePPC_common.c | 2 +- .../pcre2lib/sljit/sljitNativeSPARC_common.c | 2 +- ext/pcre/pcre2lib/sljit/sljitNativeX86_32.c | 79 +- ext/pcre/pcre2lib/sljit/sljitNativeX86_64.c | 120 +- .../pcre2lib/sljit/sljitNativeX86_common.c | 17 - 36 files changed, 4882 insertions(+), 4050 deletions(-) diff --git a/ext/pcre/pcre2lib/pcre2.h b/ext/pcre/pcre2lib/pcre2.h index fffcc307d08..3d2feb7a6bd 100644 --- a/ext/pcre/pcre2lib/pcre2.h +++ b/ext/pcre/pcre2lib/pcre2.h @@ -5,7 +5,7 @@ /* This is the public header file for the PCRE library, second API, to be #included by applications that call PCRE2 functions. - Copyright (c) 2016-2017 University of Cambridge + Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -41,10 +41,16 @@ POSSIBILITY OF SUCH DAMAGE. /* The current PCRE version information. */ -#define PCRE2_MAJOR 10 -#define PCRE2_MINOR 31 -#define PCRE2_PRERELEASE -#define PCRE2_DATE 2018-02-12 +#define PCRE2_MAJOR 10 +#define PCRE2_MINOR 32 +#define PCRE2_PRERELEASE +#define PCRE2_DATE 2018-09-10 + +/* For the benefit of systems without stdint.h, an alternative is to use +inttypes.h. The existence of these headers is checked by configure or CMake. */ + +#define PCRE2_HAVE_STDINT_H 1 +#define PCRE2_HAVE_INTTYPES_H 1 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE2, the appropriate @@ -81,12 +87,18 @@ set, we ensure here that it has no effect. */ #define PCRE2_CALL_CONVENTION #endif -/* Have to include limits.h, stdlib.h and stdint.h to ensure that size_t and -uint8_t, UCHAR_MAX, etc are defined. */ +/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure +that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither +header, the relevant values must be provided by some other means. */ #include #include + +#if PCRE2_HAVE_STDINT_H #include +#elif PCRE2_HAVE_INTTYPES_H +#include +#endif /* Allow for C++ users compiling this directly. */ @@ -269,6 +281,7 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE 156 #define PCRE2_ERROR_BACKSLASH_G_SYNTAX 157 #define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158 +/* Error 159 is obsolete and should now never occur */ #define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED 159 #define PCRE2_ERROR_VERB_UNKNOWN 160 #define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG 161 @@ -303,6 +316,8 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP 190 #define PCRE2_ERROR_NO_SURROGATES_IN_UTF16 191 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192 +#define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193 +#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194 /* "Expected" matching error codes: no match and partial match. */ @@ -387,6 +402,7 @@ released, the numbers must not be changed. */ #define PCRE2_ERROR_BADSERIALIZEDDATA (-62) #define PCRE2_ERROR_HEAPLIMIT (-63) #define PCRE2_ERROR_CONVERT_SYNTAX (-64) +#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) /* Request types for pcre2_pattern_info() */ diff --git a/ext/pcre/pcre2lib/pcre2_auto_possess.c b/ext/pcre/pcre2lib/pcre2_auto_possess.c index 23275a2e39c..2ce152e9522 100644 --- a/ext/pcre/pcre2lib/pcre2_auto_possess.c +++ b/ext/pcre/pcre2lib/pcre2_auto_possess.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -505,7 +505,7 @@ Arguments: utf TRUE in UTF mode cb compile data block base_list the data list of the base opcode - base_end the end of the data list + base_end the end of the base opcode rec_limit points to recursion depth counter Returns: TRUE if the auto-possessification is possible @@ -730,7 +730,7 @@ for(;;) if ((*xclass_flags & XCL_MAP) == 0) { /* No bits are set for characters < 256. */ - if (list[1] == 0) return TRUE; + if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0; /* Might be an empty repeat. */ continue; } @@ -1235,6 +1235,7 @@ for (;;) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/ext/pcre/pcre2lib/pcre2_compile.c b/ext/pcre/pcre2lib/pcre2_compile.c index 87530fb5844..6bb1de36100 100644 --- a/ext/pcre/pcre2lib/pcre2_compile.c +++ b/ext/pcre/pcre2lib/pcre2_compile.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -63,8 +63,8 @@ POSSIBILITY OF SUCH DAMAGE. /* Other debugging code can be enabled by these defines. */ -// #define DEBUG_SHOW_CAPTURES -// #define DEBUG_SHOW_PARSED +/* #define DEBUG_SHOW_CAPTURES */ +/* #define DEBUG_SHOW_PARSED */ /* There are a few things that vary with different code unit sizes. Handle them by defining macros in order to minimize #if usage. */ @@ -250,34 +250,35 @@ is present where expected in a conditional group. */ #define META_LOOKBEHINDNOT 0x80250000u /* (? 0 => must have an argument */ { 4, META_MARK, +1 }, - { 6, META_ACCEPT, -1 }, /* < 0 => must not have an argument */ - { 6, META_COMMIT, -1 }, + { 6, META_ACCEPT, -1 }, /* < 0 => Optional argument, convert to pre-MARK */ { 1, META_FAIL, -1 }, { 4, META_FAIL, -1 }, - { 5, META_PRUNE, 0 }, /* Argument is optional; bump META code if found */ + { 6, META_COMMIT, 0 }, + { 5, META_PRUNE, 0 }, /* Optional argument; bump META code if found */ { 4, META_SKIP, 0 }, { 4, META_THEN, 0 } }; @@ -610,8 +612,8 @@ static const int verbcount = sizeof(verbs)/sizeof(verbitem); /* Verb opcodes, indexed by their META code offset from META_MARK. */ static const uint32_t verbops[] = { - OP_MARK, OP_ACCEPT, OP_COMMIT, OP_FAIL, OP_PRUNE, OP_PRUNE_ARG, OP_SKIP, - OP_SKIP_ARG, OP_THEN, OP_THEN_ARG }; + OP_MARK, OP_ACCEPT, OP_FAIL, OP_COMMIT, OP_COMMIT_ARG, OP_PRUNE, + OP_PRUNE_ARG, OP_SKIP, OP_SKIP_ARG, OP_THEN, OP_THEN_ARG }; /* Offsets from OP_STAR for case-independent and negative repeat opcodes. */ @@ -729,7 +731,7 @@ enum { ERR0 = COMPILE_ERROR_BASE, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90, - ERR91, ERR92}; + ERR91, ERR92, ERR93, ERR94 }; /* This is a table of start-of-pattern options such as (*UTF) and settings such as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward @@ -976,8 +978,8 @@ for (;;) case META_POSIX_NEG: fprintf(stderr, "META_POSIX_NEG %d", *pptr++); break; case META_ACCEPT: fprintf(stderr, "META (*ACCEPT)"); break; - case META_COMMIT: fprintf(stderr, "META (*COMMIT)"); break; case META_FAIL: fprintf(stderr, "META (*FAIL)"); break; + case META_COMMIT: fprintf(stderr, "META (*COMMIT)"); break; case META_PRUNE: fprintf(stderr, "META (*PRUNE)"); break; case META_SKIP: fprintf(stderr, "META (*SKIP)"); break; case META_THEN: fprintf(stderr, "META (*THEN)"); break; @@ -1067,6 +1069,10 @@ for (;;) fprintf(stderr, "META (*MARK:"); goto SHOWARG; + case META_COMMIT_ARG: + fprintf(stderr, "META (*COMMIT:"); + goto SHOWARG; + case META_PRUNE_ARG: fprintf(stderr, "META (*PRUNE:"); goto SHOWARG; @@ -1435,6 +1441,48 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0) escape = -i; /* Else return a special escape */ if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X)) cb->external_flags |= PCRE2_HASBKPORX; /* Note \P, \p, or \X */ + + /* Perl supports \N{name} for character names and \N{U+dddd} for numerical + Unicode code points, as well as plain \N for "not newline". PCRE does not + support \N{name}. However, it does support quantification such as \N{2,3}, + so if \N{ is not followed by U+dddd we check for a quantifier. */ + + if (escape == ESC_N && ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET) + { + PCRE2_SPTR p = ptr + 1; + + /* \N{U+ can be handled by the \x{ code. However, this construction is + not valid in EBCDIC environments because it specifies a Unicode + character, not a codepoint in the local code. For example \N{U+0041} + must be "A" in all environments. Also, in Perl, \N{U+ forces Unicode + casing semantics for the entire pattern, so allow it only in UTF (i.e. + Unicode) mode. */ + + if (ptrend - p > 1 && *p == CHAR_U && p[1] == CHAR_PLUS) + { +#ifdef EBCDIC + *errorcodeptr = ERR93; +#else + if (utf) + { + ptr = p + 1; + escape = 0; /* Not a fancy escape after all */ + goto COME_FROM_NU; + } + else *errorcodeptr = ERR93; +#endif + } + + /* Give an error if what follows is not a quantifier, but don't override + an error set by the quantifier reader (e.g. number overflow). */ + + else + { + if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) && + *errorcodeptr == 0) + *errorcodeptr = ERR37; + } + } } } @@ -1462,6 +1510,7 @@ else /* A number of Perl escapes are not handled by PCRE. We give an explicit error. */ + case CHAR_F: case CHAR_l: case CHAR_L: *errorcodeptr = ERR37; @@ -1719,6 +1768,9 @@ else { if (ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET) { +#ifndef EBCDIC + COME_FROM_NU: +#endif if (++ptr >= ptrend || *ptr == CHAR_RIGHT_CURLY_BRACKET) { *errorcodeptr = ERR78; @@ -1852,19 +1904,6 @@ else } } -/* Perl supports \N{name} for character names, as well as plain \N for "not -newline". PCRE does not support \N{name}. However, it does support -quantification such as \N{2,3}. */ - -if (escape == ESC_N && ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET && - ptrend - ptr > 2) - { - PCRE2_SPTR p = ptr + 1; - if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) && - *errorcodeptr == 0) - *errorcodeptr = ERR37; - } - /* Set the pointer to the next character before returning. */ *ptrptr = ptr; @@ -2251,11 +2290,14 @@ typedef struct nest_save { #define NSF_RESET 0x0001u #define NSF_CONDASSERT 0x0002u -/* Of the options that are changeable within the pattern, these are tracked -during parsing. The rest are used from META_OPTIONS items when compiling. */ +/* Options that are changeable within the pattern must be tracked during +parsing. Some (e.g. PCRE2_EXTENDED) are implemented entirely during parsing, +but all must be tracked so that META_OPTIONS items set the correct values for +the main compiling phase. */ -#define PARSE_TRACKED_OPTIONS \ - (PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_NO_AUTO_CAPTURE) +#define PARSE_TRACKED_OPTIONS (PCRE2_CASELESS|PCRE2_DOTALL|PCRE2_DUPNAMES| \ + PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| \ + PCRE2_UNGREEDY) /* States used for analyzing ranges in character classes. The two OK values must be last. */ @@ -2290,6 +2332,7 @@ uint32_t *previous_callout = NULL; uint32_t *parsed_pattern = cb->parsed_pattern; uint32_t *parsed_pattern_end = cb->parsed_pattern_end; uint32_t meta_quantifier = 0; +uint32_t add_after_mark = 0; uint16_t nest_depth = 0; int after_manual_callout = 0; int expect_cond_assert = 0; @@ -2434,11 +2477,17 @@ while (ptr < ptrend) /* EITHER: not both options set */ ((options & (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) != (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) || - /* OR: character > 255 */ - c > 255 || - /* OR: not a # comment or white space */ - (c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0) - )) +#ifdef SUPPORT_UNICODE + /* OR: character > 255 AND not Unicode Pattern White Space */ + (c > 255 && (c|1) != 0x200f && (c|1) != 0x2029) || +#endif + /* OR: not a # comment or isspace() white space */ + (c < 256 && c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0 +#ifdef SUPPORT_UNICODE + /* and not CHAR_NEL when Unicode is supported */ + && c != CHAR_NEL +#endif + ))) { PCRE2_SIZE verbnamelength; @@ -2461,6 +2510,16 @@ while (ptr < ptrend) goto FAILED; } *verblengthptr = (uint32_t)verbnamelength; + + /* If this name was on a verb such as (*ACCEPT) which does not continue, + a (*MARK) was generated for the name. We now add the original verb as the + next item. */ + + if (add_after_mark != 0) + { + *parsed_pattern++ = add_after_mark; + add_after_mark = 0; + } break; case CHAR_BACKSLASH: @@ -2510,11 +2569,18 @@ while (ptr < ptrend) /* Skip over whitespace and # comments in extended mode. Note that c is a character, not a code unit, so we must not use MAX_255 to test its size - because MAX_255 tests code units and is assumed TRUE in 8-bit mode. */ + because MAX_255 tests code units and is assumed TRUE in 8-bit mode. The + whitespace characters are those designated as "Pattern White Space" by + Unicode, which are the isspace() characters plus CHAR_NEL (newline), which is + U+0085 in Unicode, plus U+200E, U+200F, U+2028, and U+2029. These are a + subset of space characters that match \h and \v. */ if ((options & PCRE2_EXTENDED) != 0) { if (c < 256 && (cb->ctypes[c] & ctype_space) != 0) continue; +#ifdef SUPPORT_UNICODE + if (c == CHAR_NEL || (c|1) == 0x200f || (c|1) == 0x2029) continue; +#endif if (c == CHAR_NUMBER_SIGN) { while (ptr < ptrend) @@ -3206,7 +3272,6 @@ while (ptr < ptrend) tempptr = ptr; escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, TRUE, cb); - if (errorcode != 0) { CLASS_ESCAPE_FAILED: @@ -3454,13 +3519,25 @@ while (ptr < ptrend) if (*ptr++ == CHAR_COLON) /* Skip past : or ) */ { - if (verbs[i].has_arg < 0) /* Argument is forbidden */ + /* Some optional arguments can be treated as a preceding (*MARK) */ + + if (verbs[i].has_arg < 0) { - errorcode = ERR59; - goto FAILED; + add_after_mark = verbs[i].meta; + *parsed_pattern++ = META_MARK; } - *parsed_pattern++ = verbs[i].meta + - ((verbs[i].meta != META_MARK)? 0x00010000u:0); + + /* The remaining verbs with arguments (except *MARK) need a different + opcode. */ + + else + { + *parsed_pattern++ = verbs[i].meta + + ((verbs[i].meta != META_MARK)? 0x00010000u:0); + } + + /* Set up for reading the name in the main loop. */ + verblengthptr = parsed_pattern++; verbnamestart = ptr; inverbname = TRUE; @@ -3521,17 +3598,39 @@ while (ptr < ptrend) else { + BOOL hyphenok = TRUE; + uint32_t oldoptions = options; + top_nest->reset_group = 0; top_nest->max_group = 0; set = unset = 0; optset = &set; + /* ^ at the start unsets imnsx and disables the subsequent use of - */ + + if (ptr < ptrend && *ptr == CHAR_CIRCUMFLEX_ACCENT) + { + options &= ~(PCRE2_CASELESS|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| + PCRE2_DOTALL|PCRE2_EXTENDED|PCRE2_EXTENDED_MORE); + hyphenok = FALSE; + ptr++; + } + while (ptr < ptrend && *ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON) { switch (*ptr++) { - case CHAR_MINUS: optset = &unset; break; + case CHAR_MINUS: + if (!hyphenok) + { + errorcode = ERR94; + ptr--; /* Correct the offset */ + goto FAILED; + } + optset = &unset; + hyphenok = FALSE; + break; case CHAR_J: /* Record that it changed in the external options */ *optset |= PCRE2_DUPNAMES; @@ -3591,7 +3690,7 @@ while (ptr < ptrend) /* If nothing changed, no need to record. */ - if (set != 0 || unset != 0) + if (options != oldoptions) { *parsed_pattern++ = META_OPTIONS; *parsed_pattern++ = options; @@ -3896,9 +3995,8 @@ while (ptr < ptrend) if (*ptr == CHAR_DOT) { if (++ptr >= ptrend || !IS_DIGIT(*ptr)) goto BAD_VERSION_CONDITION; - if (!read_number(&ptr, ptrend, -1, 99 , ERR79, &minor, &errorcode)) - goto FAILED; - if (minor < 10) minor *= 10; + minor = (*ptr++ - CHAR_0) * 10; + if (IS_DIGIT(*ptr)) minor += *ptr++ - CHAR_0; if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) goto BAD_VERSION_CONDITION; } @@ -4261,11 +4359,11 @@ goto FAILED; /************************************************* -* Find first significant op code * +* Find first significant opcode * *************************************************/ /* This is called by several functions that scan a compiled expression looking -for a fixed first character, or an anchoring op code etc. It skips over things +for a fixed first character, or an anchoring opcode etc. It skips over things that do not influence this. For some calls, it makes sense to skip negative forward and all backward assertions, and also the \b assertion; for others it does not. @@ -5472,7 +5570,7 @@ for (;; pptr++) set xclass = TRUE. Then, in the pre-compile phase, accumulate the length of the extra data and reset the pointer. This is so that very large classes that contain a zillion wide characters or Unicode property tests - do not overwrite the work space (which is on the stack). */ + do not overwrite the workspace (which is on the stack). */ if (class_uchardata > class_uchardata_base) { @@ -5563,7 +5661,7 @@ for (;; pptr++) if (class_has_8bitchar > 0) { *code++ |= XCL_MAP; - memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, + (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, CU2BYTES(class_uchardata - code)); if (negate_class && !xclass_has_prop) for (i = 0; i < 32; i++) classbits[i] = ~classbits[i]; @@ -5655,6 +5753,7 @@ for (;; pptr++) cb->had_pruneorskip = TRUE; /* Fall through */ case META_MARK: + case META_COMMIT_ARG: VERB_ARG: *code++ = verbops[(meta - META_MARK) >> 16]; /* The length is in characters. */ @@ -6509,7 +6608,7 @@ for (;; pptr++) /* Wrap the recursion call in OP_BRA brackets. */ - memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE)); + (void)memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE)); op_previous = *previous = OP_BRA; PUT(previous, 1, 2 + 2*LINK_SIZE); previous[2 + 2*LINK_SIZE] = OP_KET; @@ -6589,7 +6688,7 @@ for (;; pptr++) if (repeat_max <= 1 || repeat_max == REPEAT_UNLIMITED) { - memmove(previous + 1, previous, CU2BYTES(len)); + (void)memmove(previous + 1, previous, CU2BYTES(len)); code++; if (repeat_max == 0) { @@ -6610,7 +6709,7 @@ for (;; pptr++) else { int linkoffset; - memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len)); + (void)memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len)); code += 2 + LINK_SIZE; *previous++ = OP_BRAZERO + repeat_type; *previous++ = OP_BRA; @@ -6811,7 +6910,7 @@ for (;; pptr++) if (*bracode == OP_COND || *bracode == OP_SCOND) { int nlen = (int)(code - bracode); - memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen)); + (void)memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen)); code += 1 + LINK_SIZE; nlen += 1 + LINK_SIZE; *bracode = (*bracode == OP_COND)? OP_BRAPOS : OP_SBRAPOS; @@ -7082,7 +7181,7 @@ for (;; pptr++) else { - memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len)); + (void)memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len)); code += 1 + LINK_SIZE; len += 1 + LINK_SIZE; tempcode[0] = OP_ONCE; @@ -7460,7 +7559,7 @@ length of the BRA and KET and any extra code units that are required at the beginning. We accumulate in a local variable to save frequent testing of lengthptr for NULL. We cannot do this by looking at the value of 'code' at the start and end of each alternative, because compiled items are discarded during -the pre-compile phase so that the work space is not exceeded. */ +the pre-compile phase so that the workspace is not exceeded. */ length = 2 + 2*LINK_SIZE + skipunits; @@ -7622,7 +7721,7 @@ for (;;) { if (cb->open_caps->flag) { - memmove(start_bracket + 1 + LINK_SIZE, start_bracket, + (void)memmove(start_bracket + 1 + LINK_SIZE, start_bracket, CU2BYTES(code - start_bracket)); *start_bracket = OP_ONCE; code += 1 + LINK_SIZE; @@ -7765,10 +7864,11 @@ do { if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; } - /* Condition */ + /* Condition. If there is no second branch, it can't be anchored. */ - else if (op == OP_COND) + else if (op == OP_COND || op == OP_SCOND) { + if (scode[GET(scode,1)] != OP_ALT) return FALSE; if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) return FALSE; } @@ -8003,6 +8103,7 @@ for (;;) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -8221,7 +8322,7 @@ for (i = 0; i < tablecount; i++) if (crc < 0) { - memmove(slot + cb->name_entry_size, slot, + (void)memmove(slot + cb->name_entry_size, slot, CU2BYTES((tablecount - i) * cb->name_entry_size)); break; } @@ -8311,6 +8412,7 @@ for (;; pptr++) break; case META_MARK: /* Add the length of the name. */ + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: @@ -8501,6 +8603,7 @@ for (;; pptr++) goto EXIT; case META_MARK: + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: @@ -8572,6 +8675,32 @@ for (;; pptr++) case META_LOOKAHEADNOT: pptr = parsed_skip(pptr + 1, PSKIP_KET); if (pptr == NULL) goto PARSED_SKIP_FAILED; + + /* Also ignore any qualifiers that follow a lookahead assertion. */ + + switch (pptr[1]) + { + case META_ASTERISK: + case META_ASTERISK_PLUS: + case META_ASTERISK_QUERY: + case META_PLUS: + case META_PLUS_PLUS: + case META_PLUS_QUERY: + case META_QUERY: + case META_QUERY_PLUS: + case META_QUERY_QUERY: + pptr++; + break; + + case META_MINMAX: + case META_MINMAX_PLUS: + case META_MINMAX_QUERY: + pptr += 3; + break; + + default: + break; + } break; /* Lookbehinds can be ignored, but must themselves be checked. */ @@ -8942,6 +9071,7 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++) break; case META_MARK: + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: diff --git a/ext/pcre/pcre2lib/pcre2_convert.c b/ext/pcre/pcre2lib/pcre2_convert.c index bdf9b86df60..1dd5c337dc3 100644 --- a/ext/pcre/pcre2lib/pcre2_convert.c +++ b/ext/pcre/pcre2lib/pcre2_convert.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -1066,11 +1066,12 @@ BOOL utf = (options & PCRE2_CONVERT_UTF) != 0; uint32_t pattype = options & TYPE_OPTIONS; if (pattern == NULL || bufflenptr == NULL) return PCRE2_ERROR_NULL; + if ((options & ~ALL_OPTIONS) != 0 || /* Undefined bit set */ (pattype & (~pattype+1)) != pattype || /* More than one type set */ pattype == 0) /* No type set */ { - *bufflenptr = 0; /* Error offset */ + *bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_BADOPTION; } @@ -1081,7 +1082,11 @@ if (ccontext == NULL) ccontext = /* Check UTF if required. */ #ifndef SUPPORT_UNICODE -if (utf) return PCRE2_ERROR_UNICODE_NOT_SUPPORTED; +if (utf) + { + *bufflenptr = 0; /* Error offset */ + return PCRE2_ERROR_UNICODE_NOT_SUPPORTED; + } #else if (utf && (options & PCRE2_CONVERT_NO_UTF_CHECK) == 0) { @@ -1126,6 +1131,7 @@ for (i = 0; i < 2; i++) break; default: + *bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_INTERNAL; } diff --git a/ext/pcre/pcre2lib/pcre2_dfa_match.c b/ext/pcre/pcre2lib/pcre2_dfa_match.c index c6184ff5e9e..9b43237da75 100644 --- a/ext/pcre/pcre2lib/pcre2_dfa_match.c +++ b/ext/pcre/pcre2lib/pcre2_dfa_match.c @@ -181,7 +181,8 @@ static const uint8_t coptable[] = { 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ - 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ + 0, 0, /* COMMIT, COMMIT_ARG */ + 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ }; @@ -254,7 +255,8 @@ static const uint8_t poptable[] = { 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ - 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ + 0, 0, /* COMMIT, COMMIT_ARG */ + 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ }; @@ -292,6 +294,35 @@ typedef struct stateblock { #define INTS_PER_STATEBLOCK (int)(sizeof(stateblock)/sizeof(int)) +/* Before version 10.32 the recursive calls of internal_dfa_match() were passed +local working space and output vectors that were created on the stack. This has +caused issues for some patterns, especially in small-stack environments such as +Windows. A new scheme is now in use which sets up a vector on the stack, but if +this is too small, heap memory is used, up to the heap_limit. The main +parameters are all numbers of ints because the workspace is a vector of ints. + +The size of the starting stack vector, DFA_START_RWS_SIZE, is in bytes, and is +defined in pcre2_internal.h so as to be available to pcre2test when it is +finding the minimum heap requirement for a match. */ + +#define OVEC_UNIT (sizeof(PCRE2_SIZE)/sizeof(int)) + +#define RWS_BASE_SIZE (DFA_START_RWS_SIZE/sizeof(int)) /* Stack vector */ +#define RWS_RSIZE 1000 /* Work size for recursion */ +#define RWS_OVEC_RSIZE (1000*OVEC_UNIT) /* Ovector for recursion */ +#define RWS_OVEC_OSIZE (2*OVEC_UNIT) /* Ovector in other cases */ + +/* This structure is at the start of each workspace block. */ + +typedef struct RWS_anchor { + struct RWS_anchor *next; + unsigned int size; /* Number of ints */ + unsigned int free; /* Number of ints */ +} RWS_anchor; + +#define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int)) + + /************************************************* * Process a callout * @@ -353,6 +384,61 @@ return (mb->callout)(cb, mb->callout_data); +/************************************************* +* Expand local workspace memory * +*************************************************/ + +/* This function is called when internal_dfa_match() is about to be called +recursively and there is insufficient working space left in the current +workspace block. If there's an existing next block, use it; otherwise get a new +block unless the heap limit is reached. + +Arguments: + rwsptr pointer to block pointer (updated) + ovecsize space needed for an ovector + mb the match block + +Returns: 0 rwsptr has been updated + !0 an error code +*/ + +static int +more_workspace(RWS_anchor **rwsptr, unsigned int ovecsize, dfa_match_block *mb) +{ +RWS_anchor *rws = *rwsptr; +RWS_anchor *new; + +if (rws->next != NULL) + { + new = rws->next; + } + +/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in +kibibytes. */ + +else + { + unsigned int newsize = rws->size * 2; + unsigned int heapleft = (unsigned int) + (((1024/sizeof(int))*mb->heap_limit - mb->heap_used)); + if (newsize > heapleft) newsize = heapleft; + if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE) + return PCRE2_ERROR_HEAPLIMIT; + new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); + if (new == NULL) return PCRE2_ERROR_NOMEMORY; + mb->heap_used += newsize; + new->next = NULL; + new->size = newsize; + rws->next = new; + } + +new->free = new->size - RWS_ANCHOR_SIZE; +*rwsptr = new; +return 0; +} + + + /************************************************* * Match a Regular Expression - DFA engine * *************************************************/ @@ -431,7 +517,8 @@ internal_dfa_match( uint32_t offsetcount, int *workspace, int wscount, - uint32_t rlevel) + uint32_t rlevel, + int *RWS) { stateblock *active_states, *new_states, *temp_states; stateblock *next_active_state, *next_new_state; @@ -788,7 +875,7 @@ for (;;) else if (match_count > 0 && ++match_count * 2 > (int)offsetcount) match_count = 0; count = ((match_count == 0)? (int)offsetcount : match_count * 2) - 2; - if (count > 0) memmove(offsets + 2, offsets, + if (count > 0) (void)memmove(offsets + 2, offsets, (size_t)count * sizeof(PCRE2_SIZE)); if (offsetcount >= 2) { @@ -2587,10 +2674,22 @@ for (;;) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: { - PCRE2_SPTR endasscode = code + GET(code, 1); - PCRE2_SIZE local_offsets[2]; int rc; - int local_workspace[1000]; + int *local_workspace; + PCRE2_SIZE *local_offsets; + PCRE2_SPTR endasscode = code + GET(code, 1); + RWS_anchor *rws = (RWS_anchor *)RWS; + + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2600,10 +2699,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc; if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK)) @@ -2615,8 +2717,6 @@ for (;;) case OP_COND: case OP_SCOND: { - PCRE2_SIZE local_offsets[1000]; - int local_workspace[1000]; int codelink = (int)GET(code, 1); PCRE2_UCHAR condcode; @@ -2673,8 +2773,22 @@ for (;;) else { int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; PCRE2_SPTR asscode = code + LINK_SIZE + 1; PCRE2_SPTR endasscode = asscode + GET(asscode, 1); + RWS_anchor *rws = (RWS_anchor *)RWS; + + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2684,10 +2798,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc; if ((rc >= 0) == @@ -2702,13 +2819,25 @@ for (;;) /*-----------------------------------------------------------------*/ case OP_RECURSE: { + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; + RWS_anchor *rws = (RWS_anchor *)RWS; dfa_recursion_info *ri; - PCRE2_SIZE local_offsets[1000]; - int local_workspace[1000]; PCRE2_SPTR callpat = start_code + GET(code, 1); uint32_t recno = (callpat == mb->start_code)? 0 : GET2(callpat, 1 + LINK_SIZE); - int rc; + + if (rws->free < RWS_RSIZE + RWS_OVEC_RSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_RSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_RSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_RSIZE; /* Check for repeating a recursion without advancing the subject pointer. This should catch convoluted mutual recursions. (Some simple @@ -2732,11 +2861,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_RSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + rws->free += RWS_RSIZE + RWS_OVEC_RSIZE; mb->recursive = new_recursive.prevrec; /* Done this recursion */ /* Ran out of internal offsets */ @@ -2782,10 +2913,25 @@ for (;;) case OP_SCBRAPOS: case OP_BRAPOSZERO: { + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; PCRE2_SIZE charcount, matched_count; PCRE2_SPTR local_ptr = ptr; + RWS_anchor *rws = (RWS_anchor *)RWS; BOOL allow_zero; + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; + if (codevalue == OP_BRAPOSZERO) { allow_zero = TRUE; @@ -2798,19 +2944,17 @@ for (;;) for (matched_count = 0;; matched_count++) { - PCRE2_SIZE local_offsets[2]; - int local_workspace[1000]; - - int rc = internal_dfa_match( + rc = internal_dfa_match( mb, /* fixed match data */ code, /* this subexpression's code */ local_ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ /* Failed to match */ @@ -2827,6 +2971,8 @@ for (;;) local_ptr += charcount; /* Advance temporary position ptr */ } + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; + /* At this point we have matched the subpattern matched_count times, and local_ptr is pointing to the character after the end of the last match. */ @@ -2869,19 +3015,35 @@ for (;;) /*-----------------------------------------------------------------*/ case OP_ONCE: { - PCRE2_SIZE local_offsets[2]; - int local_workspace[1000]; + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; + RWS_anchor *rws = (RWS_anchor *)RWS; - int rc = internal_dfa_match( + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; + + rc = internal_dfa_match( mb, /* fixed match data */ code, /* this subexpression's code */ ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc >= 0) { @@ -3063,6 +3225,7 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE start_offset, uint32_t options, pcre2_match_data *match_data, pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount) { +int rc; const pcre2_real_code *re = (const pcre2_real_code *)code; PCRE2_SPTR start_match; @@ -3071,9 +3234,9 @@ PCRE2_SPTR bumpalong_limit; PCRE2_SPTR req_cu_ptr; BOOL utf, anchored, startline, firstline; - BOOL has_first_cu = FALSE; BOOL has_req_cu = FALSE; + PCRE2_UCHAR first_cu = 0; PCRE2_UCHAR first_cu2 = 0; PCRE2_UCHAR req_cu = 0; @@ -3088,6 +3251,17 @@ pcre2_callout_block cb; dfa_match_block actual_match_block; dfa_match_block *mb = &actual_match_block; +/* Set up a starting block of memory for use during recursive calls to +internal_dfa_match(). By putting this on the stack, it minimizes resource use +in the case when it is not needed. If this is too small, more memory is +obtained from the heap. At the start of each block is an anchor structure.*/ + +int base_recursion_workspace[RWS_BASE_SIZE]; +RWS_anchor *rws = (RWS_anchor *)base_recursion_workspace; +rws->next = NULL; +rws->size = RWS_BASE_SIZE; +rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE; + /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated subject string. */ @@ -3184,6 +3358,7 @@ if (mcontext == NULL) mb->memctl = re->memctl; mb->match_limit = PRIV(default_match_context).match_limit; mb->match_limit_depth = PRIV(default_match_context).depth_limit; + mb->heap_limit = PRIV(default_match_context).heap_limit; } else { @@ -3198,6 +3373,7 @@ else mb->memctl = mcontext->memctl; mb->match_limit = mcontext->match_limit; mb->match_limit_depth = mcontext->depth_limit; + mb->heap_limit = mcontext->heap_limit; } if (mb->match_limit > re->limit_match) @@ -3206,6 +3382,9 @@ if (mb->match_limit > re->limit_match) if (mb->match_limit_depth > re->limit_depth) mb->match_limit_depth = re->limit_depth; +if (mb->heap_limit > re->limit_heap) + mb->heap_limit = re->limit_heap; + mb->start_code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + re->name_count * re->name_entry_size; mb->tables = re->tables; @@ -3215,6 +3394,7 @@ mb->start_offset = start_offset; mb->moptions = options; mb->poptions = re->overall_options; mb->match_call_count = 0; +mb->heap_used = 0; /* Process the \R and newline settings. */ @@ -3351,8 +3531,6 @@ a match. */ for (;;) { - int rc; - /* ----------------- Start of match optimizations ---------------- */ /* There are some optimizations that avoid running the match if a known @@ -3544,7 +3722,7 @@ for (;;) in characters, we treat it as code units to avoid spending too much time in this optimization. */ - if (end_subject - start_match < re->minlength) return PCRE2_ERROR_NOMATCH; + if (end_subject - start_match < re->minlength) goto NOMATCH_EXIT; /* If req_cu is set, we know that that code unit must appear in the subject for the match to succeed. If the first code unit is set, req_cu @@ -3621,7 +3799,8 @@ for (;;) (uint32_t)match_data->oveccount * 2, /* actual size of same */ workspace, /* workspace vector */ (int)wscount, /* size of same */ - 0); /* function recurse level */ + 0, /* function recurse level */ + base_recursion_workspace); /* initial workspace for recursion */ /* Anything other than "no match" means we are done, always; otherwise, carry on only if not anchored. */ @@ -3637,7 +3816,7 @@ for (;;) match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject); match_data->startchar = (PCRE2_SIZE)(start_match - subject); match_data->rc = rc; - return rc; + goto EXIT; } /* Advance to the next subject character unless we are at the end of a line @@ -3668,8 +3847,18 @@ for (;;) } /* "Bumpalong" loop */ +NOMATCH_EXIT: +rc = PCRE2_ERROR_NOMATCH; -return PCRE2_ERROR_NOMATCH; +EXIT: +while (rws->next != NULL) + { + RWS_anchor *next = rws->next; + rws->next = next->next; + mb->memctl.free(next, mb->memctl.memory_data); + } + +return rc; } /* End of pcre2_dfa_match.c */ diff --git a/ext/pcre/pcre2lib/pcre2_error.c b/ext/pcre/pcre2lib/pcre2_error.c index d98cae99636..4b3b3f1bc0d 100644 --- a/ext/pcre/pcre2lib/pcre2_error.c +++ b/ext/pcre/pcre2lib/pcre2_error.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -107,7 +107,7 @@ static const unsigned char compile_error_texts[] = /* 35 */ "lookbehind is too complicated\0" "\\C is not allowed in a lookbehind assertion in UTF-" XSTRING(PCRE2_CODE_UNIT_WIDTH) " mode\0" - "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0" + "PCRE2 does not support \\F, \\L, \\l, \\N{name}, \\U, or \\u\0" "number after (?C is greater than 255\0" "closing parenthesis for (?C expected\0" /* 40 */ @@ -133,7 +133,8 @@ static const unsigned char compile_error_texts[] = "internal error: unknown newline setting\0" "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0" "(?R (recursive pattern call) must be followed by a closing parenthesis\0" - "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0" + /* "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0" */ + "obsolete error (should not occur)\0" /* Was the above */ /* 60 */ "(*VERB) not recognized or malformed\0" "group number is too big\0" @@ -160,7 +161,7 @@ static const unsigned char compile_error_texts[] = "using UCP is disabled by the application\0" "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0" "character code point value in \\u.... sequence is too large\0" - "digits missing in \\x{} or \\o{}\0" + "digits missing in \\x{} or \\o{} or \\N{U+}\0" "syntax error or number too big in (?(VERSION condition\0" /* 80 */ "internal error: unknown opcode in auto_possessify()\0" @@ -178,6 +179,8 @@ static const unsigned char compile_error_texts[] = "internal error: bad code value in parsed_skip()\0" "PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode\0" "invalid option bits with PCRE2_LITERAL\0" + "\\N{U+dddd} is supported only in Unicode (UTF) mode\0" + "invalid hyphen in option setting\0" ; /* Match-time and UTF error texts are in the same format. */ @@ -255,11 +258,13 @@ static const unsigned char match_error_texts[] = "expected closing curly bracket in replacement string\0" "bad substitution in replacement string\0" /* 60 */ - "match with end before start is not supported\0" + "match with end before start or start moved backwards is not supported\0" "too many replacements (more than INT_MAX)\0" "bad serialized data\0" "heap limit exceeded\0" "invalid syntax\0" + /* 65 */ + "internal error - duplicate substitution match\0" ; diff --git a/ext/pcre/pcre2lib/pcre2_extuni.c b/ext/pcre/pcre2lib/pcre2_extuni.c index 11a0bfbdd67..237211abf7f 100644 --- a/ext/pcre/pcre2lib/pcre2_extuni.c +++ b/ext/pcre/pcre2lib/pcre2_extuni.c @@ -129,11 +129,11 @@ while (eptr < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || - (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; eptr += len; diff --git a/ext/pcre/pcre2lib/pcre2_find_bracket.c b/ext/pcre/pcre2lib/pcre2_find_bracket.c index 357385a11cc..70baa1394f5 100644 --- a/ext/pcre/pcre2lib/pcre2_find_bracket.c +++ b/ext/pcre/pcre2lib/pcre2_find_bracket.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -131,6 +131,7 @@ for (;;) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/ext/pcre/pcre2lib/pcre2_internal.h b/ext/pcre/pcre2lib/pcre2_internal.h index 3db9d604f47..8750f2f1746 100644 --- a/ext/pcre/pcre2lib/pcre2_internal.h +++ b/ext/pcre/pcre2lib/pcre2_internal.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -165,6 +165,16 @@ by "configure". */ #define INT64_OR_DOUBLE double #endif +/* External (in the C sense) functions and tables that are private to the +libraries are always referenced using the PRIV macro. This makes it possible +for pcre2test.c to include some of the source files from the libraries using a +different PRIV definition to avoid name clashes. It also makes it clear in the +code that a non-static object is being referenced. */ + +#ifndef PRIV +#define PRIV(name) _pcre2_##name +#endif + /* When compiling for use with the Virtual Pascal compiler, these functions need to have their names changed. PCRE2 must be compiled with the -DVPCOMPAT option on the command line. */ @@ -178,50 +188,15 @@ option on the command line. */ #define memset(s,c,n) _memset(s,c,n) #else /* VPCOMPAT */ -/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), -define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY -is set. Otherwise, include an emulating function for those systems that have -neither (there some non-Unix environments where this is the case). */ +/* Otherwise, to cope with SunOS4 and other systems that lack memmove(), define +a macro that calls an emulating function. */ #ifndef HAVE_MEMMOVE -#undef memmove /* some systems may have a macro */ -#ifdef HAVE_BCOPY -#define memmove(a, b, c) bcopy(b, a, c) -#else /* HAVE_BCOPY */ -static void * -pcre2_memmove(void *d, const void *s, size_t n) -{ -size_t i; -unsigned char *dest = (unsigned char *)d; -const unsigned char *src = (const unsigned char *)s; -if (dest > src) - { - dest += n; - src += n; - for (i = 0; i < n; ++i) *(--dest) = *(--src); - return (void *)dest; - } -else - { - for (i = 0; i < n; ++i) *dest++ = *src++; - return (void *)(dest - n); - } -} -#define memmove(a, b, c) pcre2_memmove(a, b, c) -#endif /* not HAVE_BCOPY */ +#undef memmove /* Some systems may have a macro */ +#define memmove(a, b, c) PRIV(memmove)(a, b, c) #endif /* not HAVE_MEMMOVE */ #endif /* not VPCOMPAT */ -/* External (in the C sense) functions and tables that are private to the -libraries are always referenced using the PRIV macro. This makes it possible -for pcre2test.c to include some of the source files from the libraries using a -different PRIV definition to avoid name clashes. It also makes it clear in the -code that a non-static object is being referenced. */ - -#ifndef PRIV -#define PRIV(name) _pcre2_##name -#endif - /* This is an unsigned int value that no UTF character can ever have, as Unicode doesn't go beyond 0x0010ffff. */ @@ -247,12 +222,17 @@ not rely on this. */ pcre2_match() is allocated on the system stack, of this size (bytes). The size must be a multiple of sizeof(PCRE2_SPTR) in all environments, so making it a multiple of 8 is best. Typical frame sizes are a few hundred bytes (it depends -on the number of capturing parentheses) so 20K handles quite a few frames. A +on the number of capturing parentheses) so 20KiB handles quite a few frames. A larger vector on the heap is obtained for patterns that need more frames. The maximum size of this can be limited. */ #define START_FRAMES_SIZE 20480 +/* Similarly, for DFA matching, an initial internal workspace vector is +allocated on the stack. */ + +#define DFA_START_RWS_SIZE 30720 + /* Define the default BSR convention. */ #ifdef BSR_ANYCRLF @@ -585,14 +565,15 @@ these tables. */ #define cbit_cntrl 288 /* [:cntrl:] */ #define cbit_length 320 /* Length of the cbits table */ -/* Bit definitions for entries in the ctypes table. */ +/* Bit definitions for entries in the ctypes table. Do not change these values +without checking pcre2_jit_compile.c, which has an assertion to ensure that +ctype_word has the value 16. */ #define ctype_space 0x01 #define ctype_letter 0x02 #define ctype_digit 0x04 -#define ctype_xdigit 0x08 +#define ctype_xdigit 0x08 /* not actually used any more */ #define ctype_word 0x10 /* alphanumeric or '_' */ -#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ /* Offsets of the various tables from the base tables pointer, and total length of the tables. */ @@ -1267,36 +1248,6 @@ contain characters with values greater than 255. */ #define XCL_PROP 3 /* Unicode property (2-byte property code follows) */ #define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ -/* Escape items that are just an encoding of a particular data value. These -appear in the escapes[] table in pcre2_compile.c as positive numbers. */ - -#ifndef ESC_a -#define ESC_a CHAR_BEL -#endif - -#ifndef ESC_e -#define ESC_e CHAR_ESC -#endif - -#ifndef ESC_f -#define ESC_f CHAR_FF -#endif - -#ifndef ESC_n -#define ESC_n CHAR_LF -#endif - -#ifndef ESC_r -#define ESC_r CHAR_CR -#endif - -/* We can't officially use ESC_t because it is a POSIX reserved identifier -(presumably because of all the others like size_t). */ - -#ifndef ESC_tee -#define ESC_tee CHAR_HT -#endif - /* These are escaped items that aren't just an encoding of a particular data value such as \n. They must have non-zero values, as check_escape() returns 0 for a data character. In the escapes[] table in pcre2_compile.c their values @@ -1578,23 +1529,26 @@ enum { OP_THEN, /* 155 */ OP_THEN_ARG, /* 156 same, but with argument */ OP_COMMIT, /* 157 */ + OP_COMMIT_ARG, /* 158 same, but with argument */ - /* These are forced failure and success verbs */ + /* These are forced failure and success verbs. FAIL and ACCEPT do accept an + argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) + without the need for a special opcode. */ - OP_FAIL, /* 158 */ - OP_ACCEPT, /* 159 */ - OP_ASSERT_ACCEPT, /* 160 Used inside assertions */ - OP_CLOSE, /* 161 Used before OP_ACCEPT to close open captures */ + OP_FAIL, /* 159 */ + OP_ACCEPT, /* 160 */ + OP_ASSERT_ACCEPT, /* 161 Used inside assertions */ + OP_CLOSE, /* 162 Used before OP_ACCEPT to close open captures */ /* This is used to skip a subpattern with a {0} quantifier */ - OP_SKIPZERO, /* 162 */ + OP_SKIPZERO, /* 163 */ /* This is used to identify a DEFINE group during compilation so that it can be checked for having only one branch. It is changed to OP_FALSE before compilation finishes. */ - OP_DEFINE, /* 163 */ + OP_DEFINE, /* 164 */ /* This is not an opcode, but is used to check that tables indexed by opcode are the correct length, in order to catch updating errors - there have been @@ -1650,7 +1604,7 @@ some cases doesn't actually use these names at all). */ "Cond false", "Cond true", \ "Brazero", "Braminzero", "Braposzero", \ "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ - "*THEN", "*THEN", "*COMMIT", "*FAIL", \ + "*THEN", "*THEN", "*COMMIT", "*COMMIT", "*FAIL", \ "*ACCEPT", "*ASSERT_ACCEPT", \ "Close", "Skip zero", "Define" @@ -1742,7 +1696,8 @@ in UTF-8 mode. The code that uses this table must know about such things. */ 3, 1, 3, /* MARK, PRUNE, PRUNE_ARG */ \ 1, 3, /* SKIP, SKIP_ARG */ \ 1, 3, /* THEN, THEN_ARG */ \ - 1, 1, 1, 1, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ \ + 1, 3, /* COMMIT, COMMIT_ARG */ \ + 1, 1, 1, /* FAIL, ACCEPT, ASSERT_ACCEPT */ \ 1+IMM2_SIZE, 1, /* CLOSE, SKIPZERO */ \ 1 /* DEFINE */ @@ -1896,7 +1851,7 @@ extern const ucd_record PRIV(ucd_records)[]; #if PCRE2_CODE_UNIT_WIDTH == 32 extern const ucd_record PRIV(dummy_ucd_record)[]; #endif -extern const uint8_t PRIV(ucd_stage1)[]; +extern const uint16_t PRIV(ucd_stage1)[]; extern const uint16_t PRIV(ucd_stage2)[]; extern const uint32_t PRIV(ucp_gbtable)[]; extern const uint32_t PRIV(ucp_gentype)[]; @@ -1976,6 +1931,14 @@ extern int _pcre2_valid_utf(PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE *); extern BOOL _pcre2_was_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, uint32_t *, BOOL); extern BOOL _pcre2_xclass(uint32_t, PCRE2_SPTR, BOOL); + +/* This function is needed only when memmove() is not available. */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +#define _pcre2_memmove PCRE2_SUFFIX(_pcre2_memmove) +extern void * _pcre2_memmove(void *, const void *, size_t); +#endif + #endif /* PCRE2_CODE_UNIT_WIDTH */ #endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */ diff --git a/ext/pcre/pcre2lib/pcre2_intmodedep.h b/ext/pcre/pcre2lib/pcre2_intmodedep.h index c4c4c3adb9d..62626d0a8a7 100644 --- a/ext/pcre/pcre2lib/pcre2_intmodedep.h +++ b/ext/pcre/pcre2lib/pcre2_intmodedep.h @@ -793,11 +793,23 @@ typedef struct heapframe { uint8_t return_id; /* Where to go on in internal "return" */ uint8_t op; /* Processing opcode */ + /* At this point, the structure is 16-bit aligned. On most architectures + the alignment requirement for a pointer will ensure that the eptr field below + is 32-bit or 64-bit aligned. However, on m68k it is fine to have a pointer + that is 16-bit aligned. We must therefore ensure that what comes between here + and eptr is an odd multiple of 16 bits so as to get back into 32-bit + alignment. This happens naturally when PCRE2_UCHAR is 8 bits wide, but needs + fudges in the other cases. In the 32-bit case the padding comes first so that + the occu field itself is 32-bit aligned. Without the padding, this structure + is no longer a multiple of PCRE2_SIZE on m68k, and the check below fails. */ + #if PCRE2_CODE_UNIT_WIDTH == 8 PCRE2_UCHAR occu[6]; /* Used for other case code units */ #elif PCRE2_CODE_UNIT_WIDTH == 16 PCRE2_UCHAR occu[2]; /* Used for other case code units */ + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ #else + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ PCRE2_UCHAR occu[1]; /* Used for other case code units */ #endif @@ -818,6 +830,9 @@ typedef struct heapframe { PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ } heapframe; +/* This typedef is a check that the size of the heapframe structure is a +multiple of PCRE2_SIZE. See various comments above. */ + typedef char check_heapframe_size[ ((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0)? (+1):(-1)]; @@ -881,6 +896,8 @@ typedef struct dfa_match_block { PCRE2_SPTR last_used_ptr; /* Latest consulted character */ const uint8_t *tables; /* Character tables */ PCRE2_SIZE start_offset; /* The start offset value */ + PCRE2_SIZE heap_limit; /* As it says */ + PCRE2_SIZE heap_used; /* As it says */ uint32_t match_limit; /* As it says */ uint32_t match_limit_depth; /* As it says */ uint32_t match_call_count; /* Number of calls of internal function */ diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index 80ed1c4ca6a..32e985b7938 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -839,6 +839,7 @@ switch(*cc) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -939,6 +940,7 @@ while (cc < ccend) common->control_head_ptr = 1; /* Fall through. */ + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_MARK: if (common->mark_ptr == 0) @@ -1553,6 +1555,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -1733,6 +1736,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -2041,6 +2045,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -2428,6 +2433,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -3666,7 +3672,8 @@ if (!common->utf) #endif OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); -OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); +OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); @@ -5894,6 +5901,8 @@ for (i = 0; i < 32; i++) } } +if (len == 0) return FALSE; /* Should never occur, but stops analyzers complaining. */ + i = 0; j = 0; @@ -6627,7 +6636,8 @@ if (needstype || needsscript) #endif OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); - OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); + OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); @@ -7254,10 +7264,11 @@ while (cc < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; prevcc = cc; @@ -7309,10 +7320,11 @@ while (cc < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; cc++; @@ -10346,7 +10358,8 @@ backtrack_common *backtrack; PCRE2_UCHAR opcode = *cc; PCRE2_SPTR ccend = cc + 1; -if (opcode == OP_PRUNE_ARG || opcode == OP_SKIP_ARG || opcode == OP_THEN_ARG) +if (opcode == OP_COMMIT_ARG || opcode == OP_PRUNE_ARG || + opcode == OP_SKIP_ARG || opcode == OP_THEN_ARG) ccend += 2 + cc[1]; PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); @@ -10358,7 +10371,7 @@ if (opcode == OP_SKIP) return ccend; } -if (opcode == OP_PRUNE_ARG || opcode == OP_THEN_ARG) +if (opcode == OP_COMMIT_ARG || opcode == OP_PRUNE_ARG || opcode == OP_THEN_ARG) { OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2)); @@ -10677,6 +10690,7 @@ while (cc < ccend) case OP_THEN: case OP_THEN_ARG: case OP_COMMIT: + case OP_COMMIT_ARG: cc = compile_control_verb_matchingpath(common, cc, parent); break; @@ -11751,6 +11765,7 @@ while (current) break; case OP_COMMIT: + case OP_COMMIT_ARG: if (!common->local_quit_available) OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH); if (common->quit_label == NULL) diff --git a/ext/pcre/pcre2lib/pcre2_maketables.c b/ext/pcre/pcre2lib/pcre2_maketables.c index 2c7ae84d864..537edba8c32 100644 --- a/ext/pcre/pcre2lib/pcre2_maketables.c +++ b/ext/pcre/pcre2lib/pcre2_maketables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -141,13 +141,6 @@ for (i = 0; i < 256; i++) if (isdigit(i)) x += ctype_digit; if (isxdigit(i)) x += ctype_xdigit; if (isalnum(i) || i == '_') x += ctype_word; - - /* Note: strchr includes the terminating zero in the characters it considers. - In this instance, that is ok because we want binary zero to be flagged as a - meta-character, which in this sense is any character that terminates a run - of data characters. */ - - if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; } diff --git a/ext/pcre/pcre2lib/pcre2_match.c b/ext/pcre/pcre2lib/pcre2_match.c index 79cc93f9180..8741e1432d6 100644 --- a/ext/pcre/pcre2lib/pcre2_match.c +++ b/ext/pcre/pcre2lib/pcre2_match.c @@ -43,11 +43,11 @@ POSSIBILITY OF SUCH DAMAGE. #include "config.h" #endif -/* These defines enables debugging code */ +/* These defines enable debugging code */ -//#define DEBUG_FRAMES_DISPLAY -//#define DEBUG_SHOW_OPS -//#define DEBUG_SHOW_RMATCH +/* #define DEBUG_FRAMES_DISPLAY */ +/* #define DEBUG_SHOW_OPS */ +/* #define DEBUG_SHOW_RMATCH */ #ifdef DEBUG_FRAME_DISPLAY #include @@ -149,7 +149,7 @@ changed, the code at RETURN_SWITCH below must be updated in sync. */ enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10, RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20, RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30, - RM31, RM32, RM33, RM34, RM35 }; + RM31, RM32, RM33, RM34, RM35, RM36 }; #ifdef SUPPORT_WIDE_CHARS enum { RM100=100, RM101 }; @@ -770,7 +770,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ /* Real or forced end of the pattern, assertion, or recursion. In an assertion ACCEPT, update the last used pointer and remember the current - frame so that the captures can be fished out of it. */ + frame so that the captures and mark can be fished out of it. */ case OP_ASSERT_ACCEPT: if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; @@ -1776,7 +1776,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ - /* Match a bit-mapped character class, possibly repeatedly. These op codes + /* Match a bit-mapped character class, possibly repeatedly. These opcodes are used when all the characters in the class have values in the range 0-255, and either the matching is caseful, or the characters are in the range 0-127 when UTF processing is enabled. The only difference between @@ -1962,11 +1962,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ + /* After \C in UTF mode, Lstart_eptr might be in the middle of a + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ + for (;;) { RMATCH(Fecode, RM201); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (Feptr-- == Lstart_eptr) break; /* Tried at original position */ + if (Feptr-- <= Lstart_eptr) break; /* Tried at original position */ BACKCHAR(Feptr); } } @@ -2126,11 +2130,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ + /* After \C in UTF mode, Lstart_eptr might be in the middle of a + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ + for(;;) { RMATCH(Fecode, RM101); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (Feptr-- == Lstart_eptr) break; /* Tried at original position */ + if (Feptr-- <= Lstart_eptr) break; /* Tried at original position */ #ifdef SUPPORT_UNICODE if (utf) BACKCHAR(Feptr); #endif @@ -2456,7 +2464,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ /* Match a single character type repeatedly. Note that the property type - does not need to be in a stack frame as it not used within an RMATCH() + does not need to be in a stack frame as it is not used within an RMATCH() loop. */ #define Lstart_eptr F->temp_sptr[0] @@ -4002,8 +4010,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ /* After \C in UTF mode, Lstart_eptr might be in the middle of a - Unicode character. Use <= pp to ensure backtracking doesn't go too far. - */ + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ for(;;) { @@ -4135,7 +4143,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); } break; - /* The "byte" (i.e. "code unit") case is the same as non-UTF */ + /* The "byte" (i.e. "code unit") case is the same as non-UTF */ case OP_ANYBYTE: fc = Lmax - Lmin; @@ -5111,7 +5119,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* Positive assertions are like other groups except that PCRE doesn't allow the effect of (*THEN) to escape beyond an assertion; it is therefore treated as NOMATCH. (*ACCEPT) is treated as successful assertion, with its - captures retained. Any other return is an error. */ + captures and mark retained. Any other return is an error. */ #define Lframe_type F->temp_32[0] @@ -5128,6 +5136,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); (char *)assert_accept_frame + offsetof(heapframe, ovector), assert_accept_frame->offset_top * sizeof(PCRE2_SIZE)); Foffset_top = assert_accept_frame->offset_top; + Fmark = assert_accept_frame->mark; break; } if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); @@ -5416,7 +5425,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); Feptr -= number; } - /* Save the earliest consulted character, then skip to next op code */ + /* Save the earliest consulted character, then skip to next opcode */ if (Feptr < mb->start_used_ptr) mb->start_used_ptr = Feptr; Fecode += 1 + LINK_SIZE; @@ -5501,7 +5510,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); frame so that it points to the final branch. */ case OP_ONCE: - Fback_frame = ((char *)F - (char *)P) + frame_size; + Fback_frame = ((char *)F - (char *)P); for (;;) { uint32_t y = GET(P->ecode,1); @@ -5829,6 +5838,13 @@ fprintf(stderr, "++ op=%d\n", *Fecode); mb->verb_current_recurse = Fcurrent_recurse; RRETURN(MATCH_COMMIT); + case OP_COMMIT_ARG: + Fmark = mb->nomatch_mark = Fecode + 2; + RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM36); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + mb->verb_current_recurse = Fcurrent_recurse; + RRETURN(MATCH_COMMIT); + case OP_PRUNE: RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM14); if (rrc != MATCH_NOMATCH) RRETURN(rrc); @@ -5921,7 +5937,7 @@ in rrc. */ RETURN_SWITCH: if (Frdepth == 0) return rrc; /* Exit from the top level */ -F = (heapframe *)((char *)F - Fback_frame); /* Back track */ +F = (heapframe *)((char *)F - Fback_frame); /* Backtrack */ mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */ #ifdef DEBUG_SHOW_RMATCH @@ -5934,7 +5950,7 @@ switch (Freturn_id) LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16) LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24) LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32) - LBL(33) LBL(34) LBL(35) + LBL(33) LBL(34) LBL(35) LBL(36) #ifdef SUPPORT_WIDE_CHARS LBL(100) LBL(101) @@ -6275,7 +6291,7 @@ mb->match_limit_depth = (mcontext->depth_limit < re->limit_depth)? /* If a pattern has very many capturing parentheses, the frame size may be very large. Ensure that there are at least 10 available frames by getting an initial vector on the heap if necessary, except when the heap limit prevents this. Get -fewer if possible. (The heap limit is in kilobytes.) */ +fewer if possible. (The heap limit is in kibibytes.) */ if (frame_size <= START_FRAMES_SIZE/10) { diff --git a/ext/pcre/pcre2lib/pcre2_pattern_info.c b/ext/pcre/pcre2lib/pcre2_pattern_info.c index 906e9198f59..a29f5eff673 100644 --- a/ext/pcre/pcre2lib/pcre2_pattern_info.c +++ b/ext/pcre/pcre2lib/pcre2_pattern_info.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -390,6 +390,7 @@ while (TRUE) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/ext/pcre/pcre2lib/pcre2_printint.c b/ext/pcre/pcre2lib/pcre2_printint.c index e4dd53fe8ca..bd10c6b1da3 100644 --- a/ext/pcre/pcre2lib/pcre2_printint.c +++ b/ext/pcre/pcre2lib/pcre2_printint.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -799,6 +799,7 @@ for(;;) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/ext/pcre/pcre2lib/pcre2_serialize.c b/ext/pcre/pcre2lib/pcre2_serialize.c index d2cc603cbb5..cec1a035d19 100644 --- a/ext/pcre/pcre2lib/pcre2_serialize.c +++ b/ext/pcre/pcre2lib/pcre2_serialize.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -127,7 +127,25 @@ dst_bytes += tables_length; for (i = 0; i < number_of_codes; i++) { re = (const pcre2_real_code *)(codes[i]); - memcpy(dst_bytes, (char *)re, re->blocksize); + (void)memcpy(dst_bytes, (char *)re, re->blocksize); + + /* Certain fields in the compiled code block are re-set during + deserialization. In order to ensure that the serialized data stream is always + the same for the same pattern, set them to zero here. We can't assume the + copy of the pattern is correctly aligned for accessing the fields as part of + a structure. Note the use of sizeof(void *) in the second of these, to + specify the size of a pointer. If sizeof(uint8_t *) is used (tables is a + pointer to uint8_t), gcc gives a warning because the first argument is also a + pointer to uint8_t. Casting the first argument to (void *) can stop this, but + it didn't stop Coverity giving the same complaint. */ + + (void)memset(dst_bytes + offsetof(pcre2_real_code, memctl), 0, + sizeof(pcre2_memctl)); + (void)memset(dst_bytes + offsetof(pcre2_real_code, tables), 0, + sizeof(void *)); + (void)memset(dst_bytes + offsetof(pcre2_real_code, executable_jit), 0, + sizeof(void *)); + dst_bytes += re->blocksize; } diff --git a/ext/pcre/pcre2lib/pcre2_string_utils.c b/ext/pcre/pcre2lib/pcre2_string_utils.c index 2a1f282629a..d6be01acf55 100644 --- a/ext/pcre/pcre2lib/pcre2_string_utils.c +++ b/ext/pcre/pcre2lib/pcre2_string_utils.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -50,6 +50,42 @@ functions work only on 8-bit data. */ #include "pcre2_internal.h" +/************************************************* +* Emulated memmove() for systems without it * +*************************************************/ + +/* This function can make use of bcopy() if it is available. Otherwise do it by +steam, as there some non-Unix environments that lack both memmove() and +bcopy(). */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +void * +PRIV(memmove)(void *d, const void *s, size_t n) +{ +#ifdef HAVE_BCOPY +bcopy(s, d, n); +return d; +#else +size_t i; +unsigned char *dest = (unsigned char *)d; +const unsigned char *src = (const unsigned char *)s; +if (dest > src) + { + dest += n; + src += n; + for (i = 0; i < n; ++i) *(--dest) = *(--src); + return (void *)dest; + } +else + { + for (i = 0; i < n; ++i) *dest++ = *src++; + return (void *)(dest - n); + } +#endif /* not HAVE_BCOPY */ +} +#endif /* not VPCOMPAT && not HAVE_MEMMOVE */ + + /************************************************* * Compare two zero-terminated PCRE2 strings * *************************************************/ diff --git a/ext/pcre/pcre2lib/pcre2_study.c b/ext/pcre/pcre2lib/pcre2_study.c index b92686759da..acbf98b41b5 100644 --- a/ext/pcre/pcre2lib/pcre2_study.c +++ b/ext/pcre/pcre2lib/pcre2_study.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -707,6 +707,7 @@ for (;;) /* Skip these, but we need to add in the name length. */ case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -956,6 +957,7 @@ do case OP_CIRCM: case OP_CLOSE: case OP_COMMIT: + case OP_COMMIT_ARG: case OP_COND: case OP_CREF: case OP_FALSE: @@ -1274,7 +1276,7 @@ do break; /* Single character types set the bits and stop. Note that if PCRE2_UCP - is set, we do not see these op codes because \d etc are converted to + is set, we do not see these opcodes because \d etc are converted to properties. Therefore, these apply in the case when only characters less than 256 are recognized to match the types. */ diff --git a/ext/pcre/pcre2lib/pcre2_substitute.c b/ext/pcre/pcre2lib/pcre2_substitute.c index 8da951fc6e2..ab8d10908aa 100644 --- a/ext/pcre/pcre2lib/pcre2_substitute.c +++ b/ext/pcre/pcre2lib/pcre2_substitute.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -238,10 +238,12 @@ PCRE2_SPTR repend; PCRE2_SIZE extra_needed = 0; PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength; PCRE2_SIZE *ovector; +PCRE2_SIZE ovecsave[3]; buff_offset = 0; lengthleft = buff_length = *blength; *blength = PCRE2_UNSET; +ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET; /* Partial matching is not valid. */ @@ -361,13 +363,33 @@ do } /* Handle a successful match. Matches that use \K to end before they start - are not supported. */ - - if (ovector[1] < ovector[0]) + or start before the current point in the subject are not supported. */ + + if (ovector[1] < ovector[0] || ovector[0] < start_offset) { rc = PCRE2_ERROR_BADSUBSPATTERN; goto EXIT; } + + /* Check for the same match as previous. This is legitimate after matching an + empty string that starts after the initial match offset. We have tried again + at the match point in case the pattern is one like /(?<=\G.)/ which can never + match at its starting point, so running the match achieves the bumpalong. If + we do get the same (null) match at the original match point, it isn't such a + pattern, so we now do the empty string magic. In all other cases, a repeat + match should never occur. */ + + if (ovecsave[0] == ovector[0] && ovecsave[1] == ovector[1]) + { + if (ovector[0] == ovector[1] && ovecsave[2] != start_offset) + { + goptions = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED; + ovecsave[2] = start_offset; + continue; /* Back to the top of the loop */ + } + rc = PCRE2_ERROR_INTERNAL_DUPMATCH; + goto EXIT; + } /* Count substitutions with a paranoid check for integer overflow; surely no real call to this function would ever hit this! */ @@ -799,13 +821,18 @@ do } /* End handling a literal code unit */ } /* End of loop for scanning the replacement. */ - /* The replacement has been copied to the output. Update the start offset to - point to the rest of the subject string. If we matched an empty string, - do the magic for global matches. */ - - start_offset = ovector[1]; - goptions = (ovector[0] != ovector[1])? 0 : + /* The replacement has been copied to the output. Save the details of this + match. See above for how this data is used. If we matched an empty string, do + the magic for global matches. Finally, update the start offset to point to + the rest of the subject string. */ + + ovecsave[0] = ovector[0]; + ovecsave[1] = ovector[1]; + ovecsave[2] = start_offset; + + goptions = (ovector[0] != ovector[1] || ovector[0] > start_offset)? 0 : PCRE2_ANCHORED|PCRE2_NOTEMPTY_ATSTART; + start_offset = ovector[1]; } while ((suboptions & PCRE2_SUBSTITUTE_GLOBAL) != 0); /* Repeat "do" loop */ /* Copy the rest of the subject. */ diff --git a/ext/pcre/pcre2lib/pcre2_tables.c b/ext/pcre/pcre2lib/pcre2_tables.c index 9f8dc293aa2..83d6f9de55e 100644 --- a/ext/pcre/pcre2lib/pcre2_tables.c +++ b/ext/pcre/pcre2lib/pcre2_tables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -137,9 +137,10 @@ const uint32_t PRIV(ucp_gentype)[] = { /* This table encodes the rules for finding the end of an extended grapheme cluster. Every code point has a grapheme break property which is one of the -ucp_gbXX values defined in pcre2_ucp.h. The 2-dimensional table is indexed by -the properties of two adjacent code points. The left property selects a word -from the table, and the right property selects a bit from that word like this: +ucp_gbXX values defined in pcre2_ucp.h. These changed between Unicode versions +10 and 11. The 2-dimensional table is indexed by the properties of two adjacent +code points. The left property selects a word from the table, and the right +property selects a bit from that word like this: PRIV(ucp_gbtable)[left-property] & (1 << right-property) @@ -166,49 +167,41 @@ are implementing). 6. Do not break after Prepend characters. -7. Do not break within emoji modifier sequences (E_Base or E_Base_GAZ followed - by E_Modifier). Extend characters are allowed before the modifier; this - cannot be represented in this table, the code has to deal with it. +7. Do not break within emoji modifier sequences or emoji zwj sequences. That + is, do not break between characters with the Extended_Pictographic property. + Extend and ZWJ characters are allowed between the characters; this cannot be + represented in this table, the code has to deal with it. -8. Do not break within emoji zwj sequences (ZWJ followed by Glue_After_Zwj or - E_Base_GAZ). - -9. Do not break within emoji flag sequences. That is, do not break between +8. Do not break within emoji flag sequences. That is, do not break between regional indicator (RI) symbols if there are an odd number of RI characters before the break point. This table encodes "join RI characters"; the code has to deal with checking for previous adjoining RIs. -10. Otherwise, break everywhere. +9. Otherwise, break everywhere. */ #define ESZ (1<= 7 && defined(_M_ARMT)) || defined(__thumb2__) +#define SLJIT_CONFIG_ARM_THUMB2 1 +#elif (defined(_M_ARM) && _M_ARM >= 7) +#define SLJIT_CONFIG_ARM_V7 1 #elif defined(_ARM_) #define SLJIT_CONFIG_ARM_V5 1 +#elif defined(_M_ARM64) || defined(__aarch64__) +#define SLJIT_CONFIG_ARM_64 1 #else #define SLJIT_CONFIG_X86_32 1 #endif -#endif /* !WIN32 */ +#endif /* !_WIN32 */ #endif /* SLJIT_CONFIG_AUTO */ #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) @@ -324,6 +330,11 @@ sparc_cache_flush((from), (to)) #define SLJIT_CACHE_FLUSH_OWN_IMPL 1 +#elif defined _WIN32 + +#define SLJIT_CACHE_FLUSH(from, to) \ + FlushInstructionCache(GetCurrentProcess(), (char*)(from), (char*)(to) - (char*)(from)) + #else /* Calls __ARM_NR_cacheflush on ARM-Linux. */ @@ -371,12 +382,18 @@ typedef int sljit_sw; #define SLJIT_64BIT_ARCHITECTURE 1 #define SLJIT_WORD_SHIFT 3 #ifdef _WIN32 +#ifdef __GNUC__ +/* These types do not require windows.h */ +typedef unsigned long long sljit_uw; +typedef long long sljit_sw; +#else typedef unsigned __int64 sljit_uw; typedef __int64 sljit_sw; -#else +#endif +#else /* !_WIN32 */ typedef unsigned long int sljit_uw; typedef long int sljit_sw; -#endif +#endif /* _WIN32 */ #endif typedef sljit_uw sljit_p; @@ -590,7 +607,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void* ptr); #define SLJIT_NUMBER_OF_REGISTERS 26 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 10 -#define SLJIT_LOCALS_OFFSET_BASE (2 * sizeof(sljit_sw)) +#define SLJIT_LOCALS_OFFSET_BASE 0 #elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) diff --git a/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c b/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c index f5009788f62..7c18578618c 100644 --- a/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c +++ b/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c @@ -99,7 +99,14 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) void *retval; #ifdef MAP_ANON - retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); + + int flags = MAP_PRIVATE | MAP_ANON; + +#ifdef MAP_JIT + flags |= MAP_JIT; +#endif + + retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0); #else if (dev_zero < 0) { if (open_dev_zero()) diff --git a/ext/pcre/pcre2lib/sljit/sljitLir.c b/ext/pcre/pcre2lib/sljit/sljitLir.c index 5e435f0154d..5bdddc10cff 100644 --- a/ext/pcre/pcre2lib/sljit/sljitLir.c +++ b/ext/pcre/pcre2lib/sljit/sljitLir.c @@ -26,6 +26,13 @@ #include "sljitLir.h" +#ifdef _WIN32 + +/* For SLJIT_CACHE_FLUSH, which can expand to FlushInstructionCache. */ +#include + +#endif /* _WIN32 */ + #if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED) /* These libraries are needed for the macros below. */ @@ -2178,7 +2185,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil #endif -#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) +#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \ + && !(defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset) { diff --git a/ext/pcre/pcre2lib/sljit/sljitLir.h b/ext/pcre/pcre2lib/sljit/sljitLir.h index 920f6d4f783..e71890cf7bc 100644 --- a/ext/pcre/pcre2lib/sljit/sljitLir.h +++ b/ext/pcre/pcre2lib/sljit/sljitLir.h @@ -138,7 +138,7 @@ of sljitConfigInternal.h */ be specified as scratch registers and the fifth one as saved register on the CPU above and any user code which requires four scratch registers can run unmodified. The SLJIT compiler automatically saves - the content of the two extra scrath register on the stack. Scratch + the content of the two extra scratch register on the stack. Scratch registers can also be preserved by saving their value on the stack but this needs to be done manually. @@ -746,7 +746,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler be mixed. The only exception is SLJIT_MOV32 and SLJIT_MOVU32 whose source register can hold any 32 or 64 bit value, and it is converted to a 32 bit compatible format first. This conversion is free (no instructions are - emitted) on most CPUs. A 32 bit value can also be coverted to a 64 bit + emitted) on most CPUs. A 32 bit value can also be converted to a 64 bit value by SLJIT_MOV_S32 (sign extension) or SLJIT_MOV_U32 (zero extension). Note: memory addressing always uses 64 bit values on 64 bit systems so @@ -773,8 +773,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler */ #define SLJIT_F32_OP SLJIT_I32_OP -/* Many CPUs (x86, ARM, PPC) has status flags which can be set according - to the result of an operation. Other CPUs (MIPS) does not have status +/* Many CPUs (x86, ARM, PPC) have status flags which can be set according + to the result of an operation. Other CPUs (MIPS) do not have status flags, and results must be stored in registers. To cover both architecture types efficiently only two flags are defined by SLJIT: @@ -810,14 +810,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler Using these flags can reduce the number of emitted instructions. E.g. a fast loop can be implemented by decreasing a counter register and set the - zero flag to jump back if the counter register is not reached zero. + zero flag to jump back if the counter register has not reached zero. Motivation: although CPUs can set a large number of flags, usually their values are ignored or only one of them is used. Emulating a large number of flags on systems without flag register is complicated so SLJIT instructions must specify the flag they want to use and only that flag will be emulated. The last arithmetic instruction can be repeated if - multiple flags needs to be checked. + multiple flags need to be checked. */ /* Set Zero status flag. */ @@ -884,7 +884,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile /* Starting index of opcodes for sljit_emit_op1. */ #define SLJIT_OP1_BASE 32 -/* The MOV instruction transfer data from source to destination. +/* The MOV instruction transfers data from source to destination. MOV instruction suffixes: @@ -1156,7 +1156,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi #define SLJIT_FAST_CALL 25 /* Called function must be declared with the SLJIT_FUNC attribute. */ #define SLJIT_CALL 26 - /* Called function must be decalred with cdecl attribute. + /* Called function must be declared with cdecl attribute. This is the default attribute for C functions. */ #define SLJIT_CALL_CDECL 27 @@ -1210,7 +1210,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_label(struct sljit_jump *jump, struct sl /* Set the destination address of the jump to this label. */ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target); -/* Emit an indirect jump or fast call. Both direct and indirect form +/* Emit an indirect jump or fast call. Direct form: set src to SLJIT_IMM() and srcw to the address Indirect form: any other valid addressing mode type must be between SLJIT_JUMP and SLJIT_FAST_CALL @@ -1274,7 +1274,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil #define SLJIT_MEM_POST 0x1000 /* Emit a single memory load or store with update instruction. When the - requested instruction from is not supported by the CPU, it returns + requested instruction form is not supported by the CPU, it returns with SLJIT_ERR_UNSUPPORTED instead of emulating the instruction. This allows specializing tight loops based on the supported instruction forms (see SLJIT_MEM_SUPP flag). diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeARM_64.c b/ext/pcre/pcre2lib/sljit/sljitNativeARM_64.c index 8a437bd6a03..27af7414877 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeARM_64.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeARM_64.c @@ -37,14 +37,14 @@ typedef sljit_u32 sljit_ins; #define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2) #define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3) #define TMP_LR (SLJIT_NUMBER_OF_REGISTERS + 4) -#define TMP_SP (SLJIT_NUMBER_OF_REGISTERS + 5) +#define TMP_FP (SLJIT_NUMBER_OF_REGISTERS + 5) #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) #define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2) /* r18 - platform register, currently not used */ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 8] = { - 31, 0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 8, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 29, 9, 10, 30, 31 + 31, 0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 8, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 31, 9, 10, 30, 29 }; static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { @@ -68,6 +68,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define ADC 0x9a000000 #define ADD 0x8b000000 +#define ADDE 0x8b200000 #define ADDI 0x91000000 #define AND 0x8a000000 #define ANDI 0x92000000 @@ -96,7 +97,8 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define FSUB 0x1e603800 #define LDRI 0xf9400000 #define LDP 0xa9400000 -#define LDP_PST 0xa8c00000 +#define LDP_PRE 0xa9c00000 +#define LDR_PRE 0xf8400c00 #define LSLV 0x9ac02000 #define LSRV 0x9ac02400 #define MADD 0x9b000000 @@ -873,73 +875,51 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); - saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0); - local_size += saved_regs_size + SLJIT_LOCALS_OFFSET; - local_size = (local_size + 15) & ~0xf; - compiler->local_size = local_size; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); - if (local_size <= (63 * sizeof(sljit_sw))) { - FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) - | RN(TMP_SP) | ((-(local_size >> 3) & 0x7f) << 15))); - FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); - offs = (local_size - saved_regs_size) << (15 - 3); - } else { - offs = 0 << 15; - if (saved_regs_size & 0x8) { - offs = 1 << 15; - saved_regs_size += sizeof(sljit_sw); - } - local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; - if (saved_regs_size > 0) - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); - } + local_size = (local_size + 15) & ~0xf; + compiler->local_size = local_size + saved_regs_size; + + FAIL_IF(push_inst(compiler, STP_PRE | RT(TMP_FP) | RT2(TMP_LR) + | RN(SLJIT_SP) | ((-(saved_regs_size >> 3) & 0x7f) << 15))); + +#ifdef _WIN32 + if (local_size >= 4096) + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); + else if (local_size > 256) + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(SLJIT_SP) | (local_size << 10))); +#endif tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG; prev = -1; + offs = 2 << 15; for (i = SLJIT_S0; i >= tmp; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } for (i = scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } - SLJIT_ASSERT(prev == -1); + if (prev != -1) + FAIL_IF(push_inst(compiler, STRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5))); - if (compiler->local_size > (63 * sizeof(sljit_sw))) { - /* The local_size is already adjusted by the saved registers. */ - if (local_size > 0xfff) { - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); - local_size &= 0xfff; - } - if (local_size) - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10))); - FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) - | RN(TMP_SP) | ((-(16 >> 3) & 0x7f) << 15))); - FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); - } + + FAIL_IF(push_inst(compiler, ADDI | RD(TMP_FP) | RN(SLJIT_SP) | (0 << 10))); args = get_arg_count(arg_types); @@ -950,6 +930,64 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi if (args >= 3) FAIL_IF(push_inst(compiler, ORR | RD(SLJIT_S2) | RN(TMP_ZERO) | RM(SLJIT_R2))); +#ifdef _WIN32 + if (local_size >= 4096) { + if (local_size < 4 * 4096) { + /* No need for a loop. */ + if (local_size >= 2 * 4096) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + local_size -= 4096; + } + + if (local_size >= 2 * 4096) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + local_size -= 4096; + } + + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + local_size -= 4096; + } + else { + FAIL_IF(push_inst(compiler, MOVZ | RD(TMP_REG2) | (((local_size >> 12) - 1) << 5))); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + FAIL_IF(push_inst(compiler, SUBI | (1 << 29) | RD(TMP_REG2) | RN(TMP_REG2) | (1 << 10))); + FAIL_IF(push_inst(compiler, B_CC | ((((sljit_ins) -3) & 0x7ffff) << 5) | 0x1 /* not-equal */)); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + + local_size &= 0xfff; + } + + if (local_size > 256) { + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (local_size << 10))); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + } + else if (local_size > 0) + FAIL_IF(push_inst(compiler, LDR_PRE | RT(TMP_ZERO) | RN(TMP_REG1) | ((-local_size & 0x1ff) << 12))); + + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_REG1) | (0 << 10))); + } + else if (local_size > 256) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_REG1) | (0 << 10))); + } + else if (local_size > 0) + FAIL_IF(push_inst(compiler, LDR_PRE | RT(TMP_ZERO) | RN(SLJIT_SP) | ((-local_size & 0x1ff) << 12))); + +#else /* !_WIN32 */ + + /* The local_size does not include saved registers size. */ + if (local_size > 0xfff) { + FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((local_size >> 12) << 10) | (1 << 22))); + local_size &= 0xfff; + } + if (local_size != 0) + FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (local_size << 10))); + +#endif /* _WIN32 */ + return SLJIT_SUCCESS; } @@ -957,13 +995,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp sljit_s32 options, sljit_s32 arg_types, sljit_s32 scratches, sljit_s32 saveds, sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size) { + sljit_s32 saved_regs_size; + CHECK_ERROR(); CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); - local_size += GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0) + SLJIT_LOCALS_OFFSET; - local_size = (local_size + 15) & ~0xf; - compiler->local_size = local_size; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); + + compiler->local_size = saved_regs_size + ((local_size + 15) & ~0xf); return SLJIT_SUCCESS; } @@ -977,71 +1019,59 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp FAIL_IF(emit_mov_before_return(compiler, op, src, srcw)); - local_size = compiler->local_size; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); - saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 0); - if (local_size <= (63 * sizeof(sljit_sw))) - offs = (local_size - saved_regs_size) << (15 - 3); + local_size = compiler->local_size - saved_regs_size; + + /* Load LR as early as possible. */ + if (local_size == 0) + FAIL_IF(push_inst(compiler, LDP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); + else if (local_size < 63 * sizeof(sljit_sw)) { + FAIL_IF(push_inst(compiler, LDP_PRE | RT(TMP_FP) | RT2(TMP_LR) + | RN(SLJIT_SP) | (local_size << (15 - 3)))); + } else { - FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) - | RN(TMP_SP) | (((16 >> 3) & 0x7f) << 15))); - offs = 0 << 15; - if (saved_regs_size & 0x8) { - offs = 1 << 15; - saved_regs_size += sizeof(sljit_sw); - } - local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; if (local_size > 0xfff) { - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((local_size >> 12) << 10) | (1 << 22))); local_size &= 0xfff; } if (local_size) - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | (local_size << 10))); + + FAIL_IF(push_inst(compiler, LDP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); } tmp = compiler->saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG; prev = -1; + offs = 2 << 15; for (i = SLJIT_S0; i >= tmp; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } - SLJIT_ASSERT(prev == -1); + if (prev != -1) + FAIL_IF(push_inst(compiler, LDRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5))); - if (compiler->local_size <= (63 * sizeof(sljit_sw))) { - FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) - | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15))); - } else if (saved_regs_size > 0) { - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); - } - - FAIL_IF(push_inst(compiler, RET | RN(TMP_LR))); - return SLJIT_SUCCESS; + /* These two can be executed in parallel. */ + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | (saved_regs_size << 10))); + return push_inst(compiler, RET | RN(TMP_LR)); } /* --------------------------------------------------------------------- */ @@ -1856,6 +1886,46 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil return push_inst(compiler, inst | VT(freg) | RN(mem & REG_MASK) | ((memw & 0x1ff) << 12)); } +SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset) +{ + sljit_s32 dst_reg; + sljit_ins ins; + + CHECK_ERROR(); + CHECK(check_sljit_get_local_base(compiler, dst, dstw, offset)); + + SLJIT_ASSERT (SLJIT_LOCALS_OFFSET_BASE == 0); + + dst_reg = FAST_IS_REG(dst) ? dst : TMP_REG1; + + if (offset <= 0xffffff && offset >= -0xffffff) { + ins = ADDI; + if (offset < 0) { + offset = -offset; + ins = SUBI; + } + + if (offset <= 0xfff) + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | (offset << 10))); + else { + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | ((offset & 0xfff000) >> (12 - 10)) | (1 << 22))); + + offset &= 0xfff; + if (offset != 0) + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(dst_reg) | (offset << 10))); + } + } + else { + FAIL_IF(load_immediate (compiler, dst_reg, offset)); + /* Add extended register form. */ + FAIL_IF(push_inst(compiler, ADDE | (0x3 << 13) | RD(dst_reg) | RN(SLJIT_SP) | RM(dst_reg))); + } + + if (SLJIT_UNLIKELY(dst & SLJIT_MEM)) + return emit_op_mem(compiler, WORD_SIZE | STORE, dst_reg, dst, dstw, TMP_REG1); + return SLJIT_SUCCESS; +} + SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value) { struct sljit_const *const_; diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeARM_T2_32.c b/ext/pcre/pcre2lib/sljit/sljitNativeARM_T2_32.c index 75e7a38b5fd..d7024b6d7d4 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeARM_T2_32.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeARM_T2_32.c @@ -110,6 +110,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define ASRSI 0x1000 #define ASR_W 0xfa40f000 #define ASR_WI 0xea4f0020 +#define BCC 0xd000 #define BICI 0xf0200000 #define BKPT 0xbe00 #define BLX 0x4780 @@ -125,6 +126,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define EORS 0x4040 #define EOR_W 0xea800000 #define IT 0xbf00 +#define LDRI 0xf8500800 #define LSLS 0x4080 #define LSLSI 0x0000 #define LSL_W 0xfa00f000 @@ -158,6 +160,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define SBCI 0xf1600000 #define SBCS 0x4180 #define SBC_W 0xeb600000 +#define SDIV 0xfb90f0f0 #define SMULL 0xfb800000 #define STR_SP 0x9000 #define SUBS 0x1a00 @@ -172,6 +175,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define SXTH 0xb200 #define SXTH_W 0xfa0ff080 #define TST 0x4200 +#define UDIV 0xfbb0f0f0 #define UMULL 0xfba00000 #define UXTB 0xb2c0 #define UXTB_W 0xfa5ff080 @@ -339,8 +343,8 @@ static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw /* Really complex instruction form for branches. */ s = (diff >> 23) & 0x1; - j1 = (~(diff >> 21) ^ s) & 0x1; - j2 = (~(diff >> 22) ^ s) & 0x1; + j1 = (~(diff >> 22) ^ s) & 0x1; + j2 = (~(diff >> 21) ^ s) & 0x1; jump_inst[0] = 0xf000 | (s << 10) | COPY_BITS(diff, 11, 0, 10); jump_inst[1] = (j1 << 13) | (j2 << 11) | (diff & 0x7ff); @@ -520,6 +524,8 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, { sljit_uw tmp; + /* MOVS cannot be used since it destroy flags. */ + if (imm >= 0x10000) { tmp = get_imm(imm); if (tmp != INVALID_IMM) @@ -1032,6 +1038,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi { sljit_s32 args, size, i, tmp; sljit_ins push = 0; +#ifdef _WIN32 + sljit_uw imm; +#endif CHECK_ERROR(); CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); @@ -1052,12 +1061,25 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1); local_size = ((size + local_size + 7) & ~7) - size; compiler->local_size = local_size; + +#ifdef _WIN32 + if (local_size >= 256) { + if (local_size > 4096) + imm = get_imm(4096); + else + imm = get_imm(local_size & ~0xff); + + SLJIT_ASSERT(imm != INVALID_IMM); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(SLJIT_SP) | imm)); + } +#else if (local_size > 0) { if (local_size <= (127 << 2)) FAIL_IF(push_inst16(compiler, SUB_SP | (local_size >> 2))); else FAIL_IF(emit_op_imm(compiler, SLJIT_SUB | ARG2_IMM, SLJIT_SP, SLJIT_SP, local_size)); } +#endif args = get_arg_count(arg_types); @@ -1068,6 +1090,61 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi if (args >= 3) FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_S2, SLJIT_R2))); +#ifdef _WIN32 + if (local_size >= 256) { + if (local_size > 4096) { + imm = get_imm(4096); + SLJIT_ASSERT(imm != INVALID_IMM); + + if (local_size < 4 * 4096) { + if (local_size > 2 * 4096) { + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + local_size -= 4096; + } + + if (local_size > 2 * 4096) { + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + local_size -= 4096; + } + + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + local_size -= 4096; + + SLJIT_ASSERT(local_size > 0); + } + else { + FAIL_IF(load_immediate(compiler, SLJIT_R3, (local_size >> 12) - 1)); + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + SLJIT_ASSERT(reg_map[SLJIT_R3] < 7); + FAIL_IF(push_inst16(compiler, SUBSI8 | RDN3(SLJIT_R3) | 1)); + FAIL_IF(push_inst16(compiler, BCC | (0x1 << 8) /* not-equal */ | (-7 & 0xff))); + + local_size &= 0xfff; + + if (local_size != 0) + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + } + + if (local_size >= 256) { + imm = get_imm(local_size & ~0xff); + SLJIT_ASSERT(imm != INVALID_IMM); + + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + } + } + + local_size &= 0xff; + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | (local_size > 0 ? 0x100 : 0) | RT4(TMP_REG2) | RN4(TMP_REG1) | local_size)); + + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_SP, TMP_REG1))); + } + else if (local_size > 0) + FAIL_IF(push_inst32(compiler, LDRI | 0x500 | RT4(TMP_REG1) | RN4(SLJIT_SP) | local_size)); +#endif + return SLJIT_SUCCESS; } @@ -1119,11 +1196,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp /* Operators */ /* --------------------------------------------------------------------- */ +#if !(defined __ARM_FEATURE_IDIV) && !(defined __ARM_ARCH_EXT_IDIV__) + #ifdef __cplusplus extern "C" { #endif -#if defined(__GNUC__) +#ifdef _WIN32 +extern unsigned long long __rt_udiv(unsigned int denominator, unsigned int numerator); +extern long long __rt_sdiv(int denominator, int numerator); +#elif defined(__GNUC__) extern unsigned int __aeabi_uidivmod(unsigned int numerator, int unsigned denominator); extern int __aeabi_idivmod(int numerator, int denominator); #else @@ -1134,10 +1216,14 @@ extern int __aeabi_idivmod(int numerator, int denominator); } #endif +#endif /* !__ARM_FEATURE_IDIV && !__ARM_ARCH_EXT_IDIV__ */ + SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) { +#if !(defined __ARM_FEATURE_IDIV) && !(defined __ARM_ARCH_EXT_IDIV__) sljit_sw saved_reg_list[3]; sljit_sw saved_reg_count; +#endif CHECK_ERROR(); CHECK(check_sljit_emit_op0(compiler, op)); @@ -1155,6 +1241,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile | (reg_map[SLJIT_R0] << 12) | (reg_map[SLJIT_R0] << 16) | reg_map[SLJIT_R1]); +#if (defined __ARM_FEATURE_IDIV) || (defined __ARM_ARCH_EXT_IDIV__) + case SLJIT_DIVMOD_UW: + case SLJIT_DIVMOD_SW: + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); + FAIL_IF(push_inst32(compiler, (op == SLJIT_DIVMOD_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0) | RM4(SLJIT_R1))); + FAIL_IF(push_inst32(compiler, MUL | RD4(SLJIT_R1) | RN4(SLJIT_R0) | RM4(SLJIT_R1))); + return push_inst32(compiler, SUB_W | RD4(SLJIT_R1) | RN4(TMP_REG1) | RM4(SLJIT_R1)); + case SLJIT_DIV_UW: + case SLJIT_DIV_SW: + return push_inst32(compiler, (op == SLJIT_DIV_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0) | RM4(SLJIT_R1)); +#else /* !__ARM_FEATURE_IDIV && !__ARM_ARCH_EXT_IDIV__ */ case SLJIT_DIVMOD_UW: case SLJIT_DIVMOD_SW: case SLJIT_DIV_UW: @@ -1183,7 +1280,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile } } -#if defined(__GNUC__) +#ifdef _WIN32 + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R0, SLJIT_R1))); + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R1, TMP_REG1))); + FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, + ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__rt_udiv) : SLJIT_FUNC_OFFSET(__rt_sdiv)))); +#elif defined(__GNUC__) FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod)))); #else @@ -1203,6 +1306,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile | (saved_reg_list[0] << 12) /* ldr rX, [sp], #8/16 */); } return SLJIT_SUCCESS; +#endif /* __ARM_FEATURE_IDIV || __ARM_ARCH_EXT_IDIV__ */ } return SLJIT_SUCCESS; diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_32.c b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_32.c index 9f9e157a050..094c9923bcd 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_32.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_32.c @@ -448,7 +448,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t sljit_ins ins = NOP; sljit_u8 offsets[4]; - SLJIT_ASSERT(reg_map[TMP_REG3] == 4 && freg_map[TMP_FREG1] == 12); + SLJIT_ASSERT(reg_map[TMP_REG1] == 4 && freg_map[TMP_FREG1] == 12); arg_types >>= SLJIT_DEF_SHIFT; @@ -516,7 +516,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t else if (arg_count != word_arg_count) ins = ADDU | S(word_arg_count) | TA(0) | DA(4 + (offsets[arg_count - 1] >> 2)); else if (arg_count == 1) - ins = ADDU | S(SLJIT_R0) | TA(0) | D(TMP_REG3); + ins = ADDU | S(SLJIT_R0) | TA(0) | DA(4); arg_count--; word_arg_count--; diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_64.c b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_64.c index ff6f0486591..f841aef5ddc 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_64.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_64.c @@ -547,7 +547,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t sljit_ins prev_ins = NOP; sljit_ins ins = NOP; - SLJIT_ASSERT(reg_map[TMP_REG3] == 4 && freg_map[TMP_FREG1] == 12); + SLJIT_ASSERT(reg_map[TMP_REG1] == 4 && freg_map[TMP_FREG1] == 12); arg_types >>= SLJIT_DEF_SHIFT; @@ -591,7 +591,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t if (arg_count != word_arg_count) ins = DADDU | S(word_arg_count) | TA(0) | D(arg_count); else if (arg_count == 1) - ins = DADDU | S(SLJIT_R0) | TA(0) | D(TMP_REG3); + ins = DADDU | S(SLJIT_R0) | TA(0) | DA(4); arg_count--; word_arg_count--; break; diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_common.c b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_common.c index e108433f700..894e21304bb 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_common.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeMIPS_common.c @@ -57,14 +57,14 @@ typedef sljit_u32 sljit_ins; #define RETURN_ADDR_REG 31 /* Flags are kept in volatile registers. */ -#define EQUAL_FLAG 31 +#define EQUAL_FLAG 3 #define OTHER_FLAG 1 #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) #define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2) static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = { - 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 3, 25, 4 + 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 4, 25, 31 }; #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) @@ -612,16 +612,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi /* Frequent case. */ FAIL_IF(push_inst(compiler, ADDIU_W | S(SLJIT_SP) | T(SLJIT_SP) | IMM(-local_size), DR(SLJIT_SP))); base = S(SLJIT_SP); + offs = local_size - (sljit_sw)sizeof(sljit_sw); } else { - FAIL_IF(load_immediate(compiler, DR(TMP_REG1), local_size)); + FAIL_IF(load_immediate(compiler, DR(OTHER_FLAG), local_size)); FAIL_IF(push_inst(compiler, ADDU_W | S(SLJIT_SP) | TA(0) | D(TMP_REG2), DR(TMP_REG2))); - FAIL_IF(push_inst(compiler, SUBU_W | S(SLJIT_SP) | T(TMP_REG1) | D(SLJIT_SP), DR(SLJIT_SP))); + FAIL_IF(push_inst(compiler, SUBU_W | S(SLJIT_SP) | T(OTHER_FLAG) | D(SLJIT_SP), DR(SLJIT_SP))); base = S(TMP_REG2); local_size = 0; + offs = -(sljit_sw)sizeof(sljit_sw); } - offs = local_size - (sljit_sw)(sizeof(sljit_sw)); FAIL_IF(push_inst(compiler, STACK_STORE | base | TA(RETURN_ADDR_REG) | IMM(offs), MOVABLE_INS)); tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG; @@ -805,7 +806,8 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl if ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) { tmp_ar = reg_ar; delay_slot = reg_ar; - } else { + } + else { tmp_ar = DR(TMP_REG1); delay_slot = MOVABLE_INS; } @@ -881,11 +883,39 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar, sljit_s32 arg, sljit_sw argw) { + sljit_s32 tmp_ar, base, delay_slot; + if (getput_arg_fast(compiler, flags, reg_ar, arg, argw)) return compiler->error; - compiler->cache_arg = 0; - compiler->cache_argw = 0; - return getput_arg(compiler, flags, reg_ar, arg, argw, 0, 0); + + if ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) { + tmp_ar = reg_ar; + delay_slot = reg_ar; + } + else { + tmp_ar = DR(TMP_REG1); + delay_slot = MOVABLE_INS; + } + base = arg & REG_MASK; + + if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) { + argw &= 0x3; + + if (SLJIT_UNLIKELY(argw)) { + FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | DA(tmp_ar) | SH_IMM(argw), tmp_ar)); + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | TA(tmp_ar) | DA(tmp_ar), tmp_ar)); + } + else + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(OFFS_REG(arg)) | DA(tmp_ar), tmp_ar)); + return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot); + } + + FAIL_IF(load_immediate(compiler, tmp_ar, argw)); + + if (base != 0) + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | TA(tmp_ar) | DA(tmp_ar), tmp_ar)); + + return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot); } static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg1, sljit_sw arg1w, sljit_s32 arg2, sljit_sw arg2w) diff --git a/ext/pcre/pcre2lib/sljit/sljitNativePPC_common.c b/ext/pcre/pcre2lib/sljit/sljitNativePPC_common.c index 8998d8a7468..5ef4ac96c4a 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativePPC_common.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativePPC_common.c @@ -2122,7 +2122,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil CHECK_ERROR(); CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); - return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw); + return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);; } SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeSPARC_common.c b/ext/pcre/pcre2lib/sljit/sljitNativeSPARC_common.c index 97170f82c7e..669ecd81528 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeSPARC_common.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeSPARC_common.c @@ -1457,7 +1457,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) - return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw); + return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);; #else #error "Implementation required" #endif diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeX86_32.c b/ext/pcre/pcre2lib/sljit/sljitNativeX86_32.c index 8a83e273a4d..074e64b9f2b 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeX86_32.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeX86_32.c @@ -123,34 +123,38 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) if (args > 0) { - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | reg_map[SLJIT_R2]; + inst[0] = MOV_r_rm; + inst[1] = MOD_REG | (reg_map[SLJIT_S0] << 3) | reg_map[SLJIT_R2]; + inst += 2; } if (args > 1) { - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S1] << 3) | reg_map[SLJIT_R1]; + inst[0] = MOV_r_rm; + inst[1] = MOD_REG | (reg_map[SLJIT_S1] << 3) | reg_map[SLJIT_R1]; + inst += 2; } if (args > 2) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | 0x4 /* esp */; - *inst++ = 0x24; - *inst++ = sizeof(sljit_sw) * (3 + 2); /* saveds >= 3 as well. */ + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | 0x4 /* esp */; + inst[2] = 0x24; + inst[3] = sizeof(sljit_sw) * (3 + 2); /* saveds >= 3 as well. */ } #else if (args > 0) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S0] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 2; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S0] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 2; + inst += 3; } if (args > 1) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S1] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 3; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S1] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 3; + inst += 3; } if (args > 2) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 4; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 4; } #endif @@ -170,17 +174,36 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi compiler->local_size = local_size; #ifdef _WIN32 - if (local_size > 1024) { -#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) - FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); -#else - /* Space for a single argument. This amount is excluded when the stack is allocated below. */ - local_size -= sizeof(sljit_sw); - FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); - FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), - SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, sizeof(sljit_sw))); -#endif - FAIL_IF(sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARG1(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack))); + if (local_size > 0) { + if (local_size <= 4 * 4096) { + if (local_size > 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096); + if (local_size > 2 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 2); + if (local_size > 3 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 3); + } + else { + EMIT_MOV(compiler, SLJIT_R0, 0, SLJIT_SP, 0); + EMIT_MOV(compiler, SLJIT_R1, 0, SLJIT_IMM, (local_size - 1) >> 12); + + SLJIT_ASSERT (reg_map[SLJIT_R0] == 0); + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_R0), -4096); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, 4096)); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 1)); + + inst = (sljit_u8*)ensure_buf(compiler, 1 + 2); + FAIL_IF(!inst); + + INC_SIZE(2); + inst[0] = JNE_i8; + inst[1] = (sljit_s8) -16; + } + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -local_size); } #endif diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeX86_64.c b/ext/pcre/pcre2lib/sljit/sljitNativeX86_64.c index 635ebd087c4..85065656144 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeX86_64.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeX86_64.c @@ -83,6 +83,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); + compiler->mode32 = 0; + #ifdef _WIN64 /* Two/four register slots for parameters plus space for xmm6 register if needed. */ if (fscratches >= 6 || fsaveds >= 1) @@ -126,35 +128,39 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi #ifndef _WIN64 if (args > 0) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x7 /* rdi */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x7 /* rdi */; + inst += 3; } if (args > 1) { - *inst++ = REX_W | REX_R; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_lmap[SLJIT_S1] << 3) | 0x6 /* rsi */; + inst[0] = REX_W | REX_R; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_lmap[SLJIT_S1] << 3) | 0x6 /* rsi */; + inst += 3; } if (args > 2) { - *inst++ = REX_W | REX_R; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_lmap[SLJIT_S2] << 3) | 0x2 /* rdx */; + inst[0] = REX_W | REX_R; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_lmap[SLJIT_S2] << 3) | 0x2 /* rdx */; } #else if (args > 0) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x1 /* rcx */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x1 /* rcx */; + inst += 3; } if (args > 1) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S1] << 3) | 0x2 /* rdx */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S1] << 3) | 0x2 /* rdx */; + inst += 3; } if (args > 2) { - *inst++ = REX_W | REX_B; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S2] << 3) | 0x0 /* r8 */; + inst[0] = REX_W | REX_B; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S2] << 3) | 0x0 /* r8 */; } #endif } @@ -163,58 +169,42 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi compiler->local_size = local_size; #ifdef _WIN64 - if (local_size > 1024) { - /* Allocate stack for the callback, which grows the stack. */ - inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 + (3 + sizeof(sljit_s32))); - FAIL_IF(!inst); - INC_SIZE(4 + (3 + sizeof(sljit_s32))); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_83; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - /* Allocated size for registers must be divisible by 8. */ - SLJIT_ASSERT(!(saved_register_size & 0x7)); - /* Aligned to 16 byte. */ - if (saved_register_size & 0x8) { - *inst++ = 5 * sizeof(sljit_sw); - local_size -= 5 * sizeof(sljit_sw); - } else { - *inst++ = 4 * sizeof(sljit_sw); - local_size -= 4 * sizeof(sljit_sw); + if (local_size > 0) { + if (local_size <= 4 * 4096) { + if (local_size > 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096); + if (local_size > 2 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 2); + if (local_size > 3 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 3); } - /* Second instruction */ - SLJIT_ASSERT(reg_map[SLJIT_R0] < 8); - *inst++ = REX_W; - *inst++ = MOV_rm_i32; - *inst++ = MOD_REG | reg_lmap[SLJIT_R0]; - sljit_unaligned_store_s32(inst, local_size); -#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \ - || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS) - compiler->skip_checks = 1; -#endif - FAIL_IF(sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARG1(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack))); + else { + EMIT_MOV(compiler, SLJIT_R0, 0, SLJIT_SP, 0); + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, (local_size - 1) >> 12); + + SLJIT_ASSERT (reg_map[SLJIT_R0] == 0); + + EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_MEM1(SLJIT_R0), -4096); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, 4096)); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + TMP_REG1, 0, TMP_REG1, 0, SLJIT_IMM, 1)); + + inst = (sljit_u8*)ensure_buf(compiler, 1 + 2); + FAIL_IF(!inst); + + INC_SIZE(2); + inst[0] = JNE_i8; + inst[1] = (sljit_s8) -19; + } + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -local_size); } #endif if (local_size > 0) { - if (local_size <= 127) { - inst = (sljit_u8*)ensure_buf(compiler, 1 + 4); - FAIL_IF(!inst); - INC_SIZE(4); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_83; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - *inst++ = local_size; - } - else { - inst = (sljit_u8*)ensure_buf(compiler, 1 + 7); - FAIL_IF(!inst); - INC_SIZE(7); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_81; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - sljit_unaligned_store_s32(inst, local_size); - inst += sizeof(sljit_s32); - } + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, local_size)); } #ifdef _WIN64 diff --git a/ext/pcre/pcre2lib/sljit/sljitNativeX86_common.c b/ext/pcre/pcre2lib/sljit/sljitNativeX86_common.c index ab7b36adb2e..6f02ee3e8b4 100644 --- a/ext/pcre/pcre2lib/sljit/sljitNativeX86_common.c +++ b/ext/pcre/pcre2lib/sljit/sljitNativeX86_common.c @@ -669,23 +669,6 @@ static SLJIT_INLINE sljit_s32 emit_sse2_store(struct sljit_compiler *compiler, static SLJIT_INLINE sljit_s32 emit_sse2_load(struct sljit_compiler *compiler, sljit_s32 single, sljit_s32 dst, sljit_s32 src, sljit_sw srcw); -#ifdef _WIN32 -#include - -static void SLJIT_FUNC sljit_grow_stack(sljit_sw local_size) -{ - /* Workaround for calling the internal _chkstk() function on Windows. - This function touches all 4k pages belongs to the requested stack space, - which size is passed in local_size. This is necessary on Windows where - the stack can only grow in 4k steps. However, this function just burn - CPU cycles if the stack is large enough. However, you don't know it in - advance, so it must always be called. I think this is a bad design in - general even if it has some reasons. */ - *(volatile sljit_s32*)alloca(local_size) = 0; -} - -#endif - #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) #include "sljitNativeX86_32.c" #else From 7a02ecb7fef994332d83dae56ac5584d536f3de0 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 21 Sep 2018 15:55:03 +0200 Subject: [PATCH 07/42] Fixed bug #76909 preg_match difference between 7.3 and < 7.3 Applied upstream patch, see https://bugs.exim.org/show_bug.cgi?id=2321 --- ext/pcre/pcre2lib/pcre2_jit_compile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index 32e985b7938..e2b08ba22a3 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -5856,9 +5856,6 @@ int i, j, k, len, c; if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV)) return FALSE; -if (invert) - nclass = !nclass; - len = 0; for (i = 0; i < 32; i++) @@ -5940,6 +5937,9 @@ if (j != 0) } } +if (invert) + nclass = !nclass; + type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL; add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0)); return TRUE; From 9c58ab37c78d596fcbda1c1c6d53698aa3119024 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 21 Sep 2018 15:57:00 +0200 Subject: [PATCH 08/42] Add test for bug #76909 --- ext/pcre/tests/bug76909.phpt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ext/pcre/tests/bug76909.phpt diff --git a/ext/pcre/tests/bug76909.phpt b/ext/pcre/tests/bug76909.phpt new file mode 100644 index 00000000000..e98da4048c6 --- /dev/null +++ b/ext/pcre/tests/bug76909.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #76909 preg_match difference between 7.3 and < 7.3 +--FILE-- + +--EXPECT-- +int(0) +int(0) +int(0) +int(0) + From 949becb1660a9633dfdca7098c733976466d7efd Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 15 Sep 2018 17:26:02 +0200 Subject: [PATCH 09/42] Add directory structure to the contributing docs This patch adds a php-src directory structure introduction to the contributing guidelines. Thanks to the discussion at [1] and PHP manual. [1] https://github.com/php/php-src/pull/3520 --- CONTRIBUTING.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33e86dd69a0..1ee4df7c180 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,3 +76,128 @@ issues. Although not a formal channel, you can also find a number of core developers on the #php.pecl channel on [EFnet](http://www.efnet.org/). Similarly, many documentation writers can be found on #php.doc. + +## PHP source code directory structure + +PHP source code also includes several files generated during development and +several parts where maintenance is happening upstream in their respective +locations. + +```bash +/ + ├─ .git/ # Git configuration and source directory + └─ TSRM/ # Thread Safe Resource Manager + └─ m4/ # https://github.com/autoconf-archive/autoconf-archive + └─ ax_func_which_gethostbyname_r.m4 + └─ ... + └─ Zend/ # Zend Engine + ├─ zend_language_scanner.c # Generated by re2c + ├─ zend_language_scanner_defs.h # Generated by re2c + ├─ zend_ini_scanner.c # Generated by re2c + ├─ zend_ini_scanner_defs.h # Generated by re2c + ├─ zend_vm_execute.h # Generated by `Zend/zend_vm_gen.php` + ├─ zend_vm_opcodes.c # Generated by `Zend/zend_vm_gen.php` + ├─ zend_vm_opcodes.h # Generated by `Zend/zend_vm_gen.php` + └─ ... + ├─ appveyor/ # Appveyor CI service files + └─ build/ # *nix build system files + ├─ ax_check_compile_flag.m4 # https://github.com/autoconf-archive/autoconf-archive + ├─ ax_gcc_func_attribute.m4 # https://github.com/autoconf-archive/autoconf-archive + ├─ libtool.m4 # https://git.savannah.gnu.org/cgit/libtool.git + ├─ shtool # https://www.gnu.org/software/shtool/ + └─ ... + └─ ext/ # PHP core extensions + └─ bcmath/ + ├─ libbcmath/ # Forked and maintained in php-src + └─ ... + └─ curl/ + ├─ sync-constants.php # The curl symbols checker + └─ ... + └─ date/ + └─ lib/ # Bundled datetime library https://github.com/derickr/timelib + ├─ parse_date.c # Generated by re2c 0.15.3 + ├─ parse_iso_intervals.c # Generated by re2c 0.15.3 + └─ ... + └─ ... + └─ fileinfo/ + ├─ libmagic/ # Modified libmagic https://github.com/file/file + ├─ data_file.c # Generated by `ext/fileinfo/create_data_file.php` + ├─ libmagic.patch # Modifications patch from upstream libmagic + ├─ magicdata.patch # Modifications patch from upstream libmagic + └─ ... + └─ gd/ + ├─ libgd/ # Bundled and modified GD library https://github.com/libgd/libgd + └─ ... + └─ json/ + ├─ json_parser.tab.c # Generated by bison + ├─ json_parser.tab.h # Generated by bison + ├─ json_scanner.c # Generated by re2c + ├─ php_json_scanner_defs.h # Generated by re2c + └─ ... + └─ mbstring/ + ├─ libmbfl/ # Forked and maintained in php-src + ├─ oniguruma/ # Bundled https://github.com/kkos/oniguruma + ├─ oniguruma.patch # Modifications patch from upstream oniguruma + ├─ unicode_data.h # Generated by `ext/mbstring/ucgendat/ucgendat.php` + └─ ... + └─ pcre/ + ├─ pcre2lib/ # https://www.pcre.org/ + └─ ... + └─ pdo/ + ├─ pdo_sql_parser.c # Generated by re2c + └─ ... + └─ phar/ + ├─ phar_path_check.c # Generated by re2c + └─ ... + └─ skeleton/ # Skeleton for developing new extensions with `ext/ext_skel.php` + └─ ... + └─ sqlite3/ + ├─ libsqlite/ # https://www.sqlite.org mirror: https://github.com/mackyle/sqlite + └─ ... + └─ standard/ + └─ html_tables/ + ├─ mappings/ # https://www.unicode.org/Public/MAPPINGS/ + └─ ... + ├─ credits_ext.h # Generated by `scripts/dev/credits` + ├─ credits_sapi.h # Generated by `scripts/dev/credits` + ├─ html_tables.h # Generated by `ext/standard/html_tables/html_table_gen.php` + ├─ url_scanner_ex.c # Generated by re2c + ├─ var_unserializer.c # Generated by re2c + └─ ... + └─ tokenizer/ + ├─ tokenizer_data.c # Generated by `ext/tokenizer/tokenizer_data_gen.sh` + └─ ... + └─ xmlrpc/ + ├─ libxmlrpc/ # Forked and maintained in php-src + └─ ... + └─ zend_test # For testing internal APIs. Not needed for regular builds. + └─ ... + └─ zip/ # Bundled https://github.com/pierrejoye/php_zip + └─ ... + └─ ... + └─ main/ # Binding that ties extensions, SAPIs, and engine together + ├─ streams/ # Streams layer subsystem + ├─ php_version.h # Generated by release managers using `configure` + └─ ... + ├─ pear/ # PEAR installation + └─ sapi/ # PHP SAPI modules + └─ cli/ + ├─ mime_type_map.h # Generated by `sapi/cli/generate_mime_type_map.php` + └─ ... + └─ phpdbg/ + ├─ phpdbg_lexer.c # Generated by re2c + ├─ phpdbg_parser.c # Generated by bison + ├─ phpdbg_parser.h # Generated by bison + └─ ... + └─ ... + ├─ scripts/ # php-config, phpize and internal development scripts + ├─ tests/ # Core features tests + ├─ travis/ # Travis CI service files + └─ win32/ # Windows build system files + ├─ cp_enc_map.c # Generated by `win32/cp_enc_map_gen.exe` + └─ ... + ├─ config.guess # https://git.savannah.gnu.org/cgit/config.git + ├─ config.sub # https://git.savannah.gnu.org/cgit/config.git + ├─ ltmain.sh # https://git.savannah.gnu.org/cgit/libtool.git + └─ ... +``` From 5da3ed69a69fb2bec41c75cf89099d4b66d08cd3 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 21 Sep 2018 19:07:49 +0200 Subject: [PATCH 10/42] Rename *.p5c files to *.inc When including files in PHP tests a good practice so far has been to use the *.inc extension. This patch renames few *.p5c files that are included in phpt files. --- ext/standard/tests/serialize/005.phpt | 2 +- .../{autoload_implements.p5c => autoload_implements.inc} | 0 .../{autoload_interface.p5c => autoload_interface.inc} | 0 ext/standard/tests/serialize/bug30234.phpt | 2 +- tests/classes/autoload_001.phpt | 2 +- tests/classes/autoload_002.phpt | 2 +- tests/classes/autoload_003.phpt | 2 +- tests/classes/autoload_004.phpt | 2 +- tests/classes/autoload_005.phpt | 2 +- tests/classes/autoload_006.phpt | 2 +- tests/classes/{autoload_derived.p5c => autoload_derived.inc} | 0 .../{autoload_implements.p5c => autoload_implements.inc} | 0 .../classes/{autoload_interface.p5c => autoload_interface.inc} | 0 tests/classes/{autoload_root.p5c => autoload_root.inc} | 0 14 files changed, 8 insertions(+), 8 deletions(-) rename ext/standard/tests/serialize/{autoload_implements.p5c => autoload_implements.inc} (100%) rename ext/standard/tests/serialize/{autoload_interface.p5c => autoload_interface.inc} (100%) rename tests/classes/{autoload_derived.p5c => autoload_derived.inc} (100%) rename tests/classes/{autoload_implements.p5c => autoload_implements.inc} (100%) rename tests/classes/{autoload_interface.p5c => autoload_interface.inc} (100%) rename tests/classes/{autoload_root.p5c => autoload_root.inc} (100%) diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index 5c0e8a0d136..9123e4020e7 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -9,7 +9,7 @@ function do_autoload($class_name) { if ($class_name != 'autoload_not_available') { - require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.p5c'); + require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.inc'); } echo __FUNCTION__ . "($class_name)\n"; } diff --git a/ext/standard/tests/serialize/autoload_implements.p5c b/ext/standard/tests/serialize/autoload_implements.inc similarity index 100% rename from ext/standard/tests/serialize/autoload_implements.p5c rename to ext/standard/tests/serialize/autoload_implements.inc diff --git a/ext/standard/tests/serialize/autoload_interface.p5c b/ext/standard/tests/serialize/autoload_interface.inc similarity index 100% rename from ext/standard/tests/serialize/autoload_interface.p5c rename to ext/standard/tests/serialize/autoload_interface.inc diff --git a/ext/standard/tests/serialize/bug30234.phpt b/ext/standard/tests/serialize/bug30234.phpt index ae3a0b2f556..aee42b28a15 100644 --- a/ext/standard/tests/serialize/bug30234.phpt +++ b/ext/standard/tests/serialize/bug30234.phpt @@ -8,7 +8,7 @@ Bug #30234 (__autoload() not invoked for interfaces) Date: Fri, 21 Sep 2018 16:27:51 +0200 Subject: [PATCH 11/42] [ci skip] Update UPGRADING.INTERNALS --- UPGRADING.INTERNALS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 29513f53887..0cbe2e21cdc 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -42,6 +42,10 @@ PHP 7.4 INTERNALS UPGRADE NOTES d. zend_check_private() is removed. Use (func->common.scope == scope) instead. + e. Pointers returned by php_win32_error_to_msg() have to be freed using + php_win32_error_msg_free(). Same regarding php_win_err() vs. + php_win_err_free(). + ======================== 2. Build system changes ======================== From 9f3aac9e390343d0058e5aedcc7e621cd44ed2b5 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 22 Sep 2018 02:10:43 +0200 Subject: [PATCH 12/42] Fix test and add skip section --- ext/pcre/tests/bug76909.phpt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/pcre/tests/bug76909.phpt b/ext/pcre/tests/bug76909.phpt index e98da4048c6..3e8435588dc 100644 --- a/ext/pcre/tests/bug76909.phpt +++ b/ext/pcre/tests/bug76909.phpt @@ -1,14 +1,20 @@ --TEST-- Bug #76909 preg_match difference between 7.3 and < 7.3 +--SKIPIF-- + --FILE-- Date: Sat, 22 Sep 2018 15:20:20 +0200 Subject: [PATCH 13/42] Fix #66828: iconv_mime_encode Q-encoding longer than it should be Before the fix for bug 48289 has been applied, the algorithm to construct a Q-encoded-word has been optimistic, i.e. try to encode as many bytes that *may* fit in the remaining space, calculate the actual length of the Q-encoded word, and if it's too long, try again with a reduced size. However, the fix for the mentioned bug replaced this by a pessimistic algorithm, which always terminates[1] the for loop[2] during the first iteration (which renders the following 3 lines as dead code), and as such easily produces unnecessarily short encoded-words. Instead the proper fix for the bug would have been to make sure that `out_size` is always decremented, if the space isn't sufficient for the encoded-word. [1] [2] --- NEWS | 4 ++++ ext/iconv/iconv.c | 4 ++-- ext/iconv/tests/bug66828.phpt | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 ext/iconv/tests/bug66828.phpt diff --git a/NEWS b/NEWS index 1add82df498..00ee93ea437 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ PHP NEWS . Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected). (Pierrick) +- iconv: + . Fixed bug #66828 (iconv_mime_encode Q-encoding longer than it should be). + (cmb) + - Opcache: . Fixed bug #76832 (ZendOPcache.MemoryBase periodically deleted by the OS). (Anatol) diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index de5bccbb977..ef27b20645b 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1367,7 +1367,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn prev_in_left = ini_in_left = in_left; ini_in_p = in_p; - for (out_size = (char_cnt - 2) / 3; out_size > 0;) { + for (out_size = (char_cnt - 2); out_size > 0;) { #if !ICONV_SUPPORTS_ERRNO size_t prev_out_left; #endif @@ -1431,7 +1431,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn break; } - out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / 3; + out_size -= ((nbytes_required - (char_cnt - 2)) + 2) / 3; in_left = ini_in_left; in_p = ini_in_p; } diff --git a/ext/iconv/tests/bug66828.phpt b/ext/iconv/tests/bug66828.phpt new file mode 100644 index 00000000000..9914b41b14d --- /dev/null +++ b/ext/iconv/tests/bug66828.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #66828 (iconv_mime_encode Q-encoding longer than it should be) +--SKIPIF-- + +--FILE-- + "ISO-8859-1", + "output-charset" => "UTF-8", + "line-length" => 76, + "line-break-chars" => "\n", + "scheme" => "Q" +); +var_dump(iconv_mime_encode("Subject", "Test Test Test Test Test Test Test Test", $preferences)); +?> +===DONE=== +--EXPECT-- +string(74) "Subject: =?UTF-8?Q?Test=20Test=20Test=20Test=20Test=20Test=20Test=20Test?=" +===DONE=== From 9faff4f78306bf0580b95460e3dccee841197a40 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 Sep 2018 09:00:51 +0200 Subject: [PATCH 14/42] Drop ext/spl/spl.php Leftover from ext/spl/internal, which was removed previously. --- ext/spl/spl.php | 1160 ----------------------------------------------- 1 file changed, 1160 deletions(-) delete mode 100644 ext/spl/spl.php diff --git a/ext/spl/spl.php b/ext/spl/spl.php deleted file mode 100644 index adbcef6e8a1..00000000000 --- a/ext/spl/spl.php +++ /dev/null @@ -1,1160 +0,0 @@ -Introduction to Standard PHP Library (SPL) - * - Introducing PHP 5's Standard Library - * - Iterators in PHP5 - * - Advanced OOP with SPL in PHP 5 - * - The Standard PHP Library, Part 1 - * - The Standard PHP Library, Part 2 - * - Die Standard PHP Library (SPL) [german] - * - * 11) Talks on SPL: - * - SPL Update [pps], [pdf] - * - Happy SPLing [pps], [pdf] - * - From engine overloading to SPL [pps], [pdf] - * - SPL for the masses [pps], [pdf] - * - * 12) Debug sessions: - * - Debug session 1 [pps], [pdf] - * - Debug session 2 [pps], [pdf], [swf] - * - Debug session 3 [pps], [pdf] - * - * (c) Marcus Boerger, 2003 - 2007 - */ - -/** @defgroup ZendEngine Zend engine classes - * - * The classes and interfaces in this group are contained in the c-code of - * PHP's Zend engine. - */ - -/** @defgroup SPL Internal classes - * - * The classes and interfaces in this group are contained in the c-code of - * ext/SPL. - */ - -/** @defgroup Examples Example classes - * - * The classes and interfaces in this group are contained as PHP code in the - * examples subdirectory of ext/SPL. Sooner or later they will be moved to - * c-code. - */ - -/** @ingroup SPL - * @brief Default implementation for __autoload() - * @since PHP 5.1 - * - * @param class_name name of class to load - * @param file_extensions file extensions (use defaults if NULL) - */ -function spl_autoload(string $class_name, string $file_extensions = NULL) {/**/}; - -/** @ingroup SPL - * @brief Manual invocation of all registered autoload functions - * @since PHP 5.1 - * - * @param class_name name of class to load - */ -function spl_autoload_call(string $class_name) {/**/}; - -/** @ingroup SPL - * @brief Register and return default file extensions for spl_autoload - * @since PHP 5.1 - * - * @param file_extensions optional comma separated list of extensions to use in - * default autoload function. If not given just return the current list. - * @return comma separated list of file extensions to use in default autoload - * function. - */ -function spl_autoload_extensions($file_extensions) {/**/}; - -/** @ingroup SPL - * @brief Return all registered autoload functionns - * @since PHP 5.1 - * - * @return array of all registered autoload functions or false - */ -function spl_autoload_functions() {/**/}; - -/** @ingroup SPL - * @brief Register given function as autoload implementation - * @since PHP 5.1 - * - * @param autoload_function name of function or array of object/class and - * function name to register as autoload function. - * @param throw whether to throw or issue an error on failure. - */ -function spl_autoload_register(string $autoload_function = "spl_autoload", $throw = true) {/**/}; - -/** @ingroup SPL - * @brief Unregister given function as autoload implementation - * @since PHP 5.1 - * - * @param autoload_function name of function or array of object/class and - * function name to unregister as autoload function. - */ -function spl_autoload_unregister(string $autoload_function = "spl_autoload") {/**/}; - -/** @ingroup SPL - * @brief Return an array of classes and interfaces in SPL - * - * @return array containing the names of all clsses and interfaces defined in - * extension SPL - */ -function spl_classes() {/**/}; - -/** @ingroup SPL - * @brief Count the elements in an iterator - * @since PHP 5.1 - * - * @return number of elements in an iterator - */ -function iterator_count(Traversable $it) {/**/}; - -/** @ingroup SPL - * @brief Copy iterator elements into an array - * @since PHP 5.1 - * - * @param it iterator to copy - * @param use_keys whether touse the keys - * @return array with elements copied from the iterator - */ -function iterator_to_array(Traversable $it, $use_keys = true) {/**/}; - -/** @ingroup ZendEngine - * @brief Basic Exception class. - * @since PHP 5.0 - */ -class Exception -{ - /** The exception message */ - protected $message; - - /** The string representations as generated during construction */ - private $string; - - /** The code passed to the constructor */ - protected $code; - - /** The file name where the exception was instantiated */ - protected $file; - - /** The line number where the exception was instantiated */ - protected $line; - - /** The stack trace */ - private $trace; - - /** Prevent clone - */ - final private function __clone() {} - - /** Construct an exception - * - * @param $message Some text describing the exception - * @param $code Some code describing the exception - */ - function __construct($message = NULL, $code = 0) { - if (func_num_args()) { - $this->message = $message; - } - $this->code = $code; - $this->file = __FILE__; // of throw clause - $this->line = __LINE__; // of throw clause - $this->trace = debug_backtrace(); - $this->string = StringFormat($this); - } - - /** @return the message passed to the constructor - */ - final public function getMessage() - { - return $this->message; - } - - /** @return the code passed to the constructor - */ - final public function getCode() - { - return $this->code; - } - - /** @return the name of the file where the exception was thrown - */ - final public function getFile() - { - return $this->file; - } - - /** @return the line number where the exception was thrown - */ - final public function getLine() - { - return $this->line; - } - - /** @return the stack trace as array - */ - final public function getTrace() - { - return $this->trace; - } - - /** @return the stack trace as string - */ - final public function getTraceAsString() - { - } - - /** @return string representation of exception - */ - public function __toString() - { - return $this->string; - } -} - -/** @ingroup SPL - * @brief Exception that represents error in the program logic. - * @since PHP 5.1 - * - * This kind of exceptions should directly leed to a fix in your code. - */ -class LogicException extends Exception -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a function call was illegal. - * @since PHP 5.1 - */ -class BadFunctionCallException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a method call was illegal. - * @since PHP 5.1 - */ -class BadMethodCallException extends BadFunctionCallException -{ -} - -/** @ingroup SPL - * @brief Exception that denotes a value not in the valid domain was used. - * @since PHP 5.1 - * - * This kind of exception should be used to inform about domain errors in - * mathematical sense. - * - * @see RangeException - */ -class DomainException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception that denotes invalid arguments were passed. - * @since PHP 5.1 - * - * @see UnexpectedValueException - */ -class InvalidArgumentException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a parameter exceeds the allowed length. - * @since PHP 5.1 - * - * This can be used for strings length, array size, file size, number of - * elements read from an Iterator and so on. - */ -class LengthException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when an illegal index was requested. - * @since PHP 5.1 - * - * This represents errors that should be detected at compile time. - * - * @see OutOfBoundsException - */ -class OutOfRangeException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown for errors that are only detectable at runtime. - * @since PHP 5.1 - */ -class RuntimeException extends Exception -{ -} - -/** @ingroup SPL - * @brief Exception thrown when an illegal index was requested. - * @since PHP 5.1 - * - * This represents errors that cannot be detected at compile time. - * - * @see OutOfRangeException - */ -class OutOfBoundsException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate arithmetic/buffer overflow. - * @since PHP 5.1 - */ -class OverflowException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate range errors during program execution. - * @since PHP 5.1 - * - * Normally this means there was an arithmetic error other than under/overflow. - * This is the runtime version of DomainException. - * - * @see DomainException - */ -class RangeException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate arithmetic/buffer underflow. - * @since PHP 5.1 - */ -class UnderflowException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate an unexpected value. - * @since PHP 5.1 - * - * Typically this happens when a function calls another function and espects - * the return value to be of a certain type or value not including arithmetic - * or buffer related errors. - * - * @see InvalidArgumentException - */ -class UnexpectedValueException extends RuntimeException -{ -} - -/** @ingroup ZendEngine - * @brief Interface to override array access of objects. - * @since PHP 5.0 - */ -interface ArrayAccess -{ - /** @param $offset to modify - * @param $value new value - */ - function offsetSet($offset, $value); - - /** @param $offset to retrieve - * @return value at given offset - */ - function offsetGet($offset); - - /** @param $offset to delete - */ - function offsetUnset($offset); - - /** @param $offset to check - * @return whether the offset exists. - */ - function offsetExists($offset); -} - -/** @ingroup ZendEngine - * @brief Interface to detect a class is traversable using foreach. - * @since PHP 5.0 - * - * Abstract base interface that cannot be implemented alone. Instead it - * must be implemented by either IteratorAggregate or Iterator. - * - * @note Internal classes that implement this interface can be used in a - * foreach construct and do not need to implement IteratorAggregate or - * Iterator. - * - * @note This is an engine internal interface which cannot be implemented - * in PHP scripts. Either IteratorAggregate or Iterator must be used - * instead. - */ -interface Traversable -{ -} - -/** @ingroup ZendEngine - * @brief Interface to create an external Iterator. - * @since PHP 5.0 - * - * @note This is an engine internal interface. - */ -interface IteratorAggregate extends Traversable -{ - /** @return an Iterator for the implementing object. - */ - function getIterator(); -} - -/** @ingroup ZendEngine - * @brief Basic iterator - * @since PHP 5.0 - * - * Interface for external iterators or objects that can be iterated - * themselves internally. - * - * @note This is an engine internal interface. - */ -interface Iterator extends Traversable -{ - /** Rewind the Iterator to the first element. - */ - function rewind(); - - /** Return the current element. - */ - function current(); - - /** Return the key of the current element. - */ - function key(); - - /** Move forward to next element. - */ - function next(); - - /** Check if there is a current element after calls to rewind() or next(). - */ - function valid(); -} - -/** @ingroup ZendEngine - * @brief This Interface allows to hook into the global count() function. - * @since PHP 5.1 - */ -interface Countable -{ - /** @return the number the global function count() should show - */ - function count(); -} - -/** @ingroup ZendEngine - * @brief Interface for customized serializing - * @since 5.1 - * - * Classes that implement this interface no longer support __sleep() and - * __wakeup(). The method serialized is called whenever an instance needs to - * be serialized. This does not invoke __destruct() or has any other side - * effect unless programmed inside the method. When the data is unserialized - * the class is known and the appropriate unserialize() method is called as a - * constructor instead of calling __construct(). If you need to execute the - * standard constructor you may do so in the method. - */ -interface Serializable -{ - /** - * @return string representation of the instance - */ - function serialize(); - - /** - * @note This is a constructor - * - * @param $serialized data read from stream to construct the instance - */ - function unserialize($serialized); -} - -/** @ingroup SPL - * @brief An Array wrapper - * @since PHP 5.0 - * @version 1.2 - * - * This array wrapper allows to recursively iterate over Arrays and public - * Object properties. - * - * @see ArrayIterator - */ -class ArrayObject implements IteratorAggregate, ArrayAccess, Countable -{ - /** Properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) */ - const STD_PROP_LIST = 0x00000001; - /** Array indices can be accessed as properties in read/write */ - const ARRAY_AS_PROPS = 0x00000002; - - /** Construct a new array iterator from anything that has a hash table. - * That is any Array or Object. - * - * @param $array the array to use. - * @param $flags see setFlags(). - * @param $iterator_class class used in getIterator() - */ - function __construct($array, $flags = 0, $iterator_class = "ArrayIterator") {/**/} - - /** Set behavior flags. - * - * @param $flags bitmask as follows: - * 0 set: properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) - * 1 set: array indices can be accessed as properties in read/write - */ - function setFlags($flags) {/**/} - - /** @return current flags - */ - function getFlags() {/**/} - - /** Sort the entries by values. - */ - function asort() {/**/} - - /** Sort the entries by key. - */ - function ksort() {/**/} - - /** Sort the entries by values using user defined function. - */ - function uasort(mixed cmp_function) {/**/} - - /** Sort the entries by key using user defined function. - */ - function uksort(mixed cmp_function) {/**/} - - /** Sort the entries by values using "natural order" algorithm. - */ - function natsort() {/**/} - - /** Sort the entries by values using case insensitive "natural order" algorithm. - */ - function natcasesort() {/**/} - - /** @param $array new array or object - */ - function exchangeArray($array) {/**/} - - /** @return the iterator which is an ArrayIterator object connected to - * this object. - */ - function getIterator() {/**/} - - /** @param $index offset to inspect - * @return whetehr offset $index esists - */ - function offsetExists($index) {/**/} - - /** @param $index offset to return value for - * @return value at offset $index - */ - function offsetGet($index) {/**/} - - /** @param $index index to set - * @param $newval new value to store at offset $index - */ - function offsetSet($index, $newval) {/**/} - - /** @param $index offset to unset - */ - function offsetUnset($index) {/**/} - - /** @param $value is appended as last element - * @warning this method cannot be called when the ArrayObject refers to - * an object. - */ - function append($value) {/**/} - - /** @return a \b copy of the array - * @note when the ArrayObject refers to an object then this method - * returns an array of the public properties. - */ - function getArrayCopy() {/**/} - - /** @return the number of elements in the array or the number of public - * properties in the object. - */ - function count() {/**/} - - /* @param $iterator_class new class used in getIterator() - */ - function setIteratorClass($itertor_class) {/**/} - - /* @return class used in getIterator() - */ - function getIteratorClass() {/**/} -} - -/** @ingroup SPL - * @brief An Array iterator - * @since PHP 5.0 - * @version 1.2 - * - * This iterator allows to unset and modify values and keys while iterating - * over Arrays and Objects. - * - * When you want to iterate over the same array multiple times you need to - * instantiate ArrayObject and let it create ArrayIterator instances that - * refer to it either by using foreach or by calling its getIterator() - * method manually. - */ -class ArrayIterator implements SeekableIterator, ArrayAccess, Countable -{ - /** Properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) */ - const STD_PROP_LIST = 0x00000001; - /** Array indices can be accessed as properties in read/write */ - const ARRAY_AS_PROPS = 0x00000002; - - /** Construct a new array iterator from anything that has a hash table. - * That is any Array or Object. - * - * @param $array the array to use. - * @param $flags see setFlags(). - */ - function __construct($array, $flags = 0) {/**/} - - /** Set behavior flags. - * - * @param $flags bitmask as follows: - * 0 set: properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) - * 1 set: array indices can be accessed as properties in read/write - */ - function setFlags($flags) {/**/} - - /** - * @return current flags - */ - function getFlags() {/**/} - - /** Sort the entries by values. - */ - function asort() {/**/} - - /** Sort the entries by key. - */ - function ksort() {/**/} - - /** Sort the entries by values using user defined function. - */ - function uasort(mixed cmp_function) {/**/} - - /** Sort the entries by key using user defined function. - */ - function uksort(mixed cmp_function) {/**/} - - /** Sort the entries by values using "natural order" algorithm. - */ - function natsort() {/**/} - - /** Sort the entries by values using case insensitive "natural order" algorithm. - */ - function natcasesort() {/**/} - - /** @param $index offset to inspect - * @return whetehr offset $index esists - */ - function offsetExists($index) {/**/} - - /** @param $index offset to return value for - * @return value at offset $index - */ - function offsetGet($index) {/**/} - - /** @param $index index to set - * @param $newval new value to store at offset $index - */ - function offsetSet($index, $newval) {/**/} - - /** @param $index offset to unset - */ - function offsetUnset($index) {/**/} - - /** @param $value is appended as last element - * @warning this method cannot be called when the ArrayIterator refers to - * an object. - */ - function append($value) {/**/} - - /** @return a \b copy of the array - * @note when the ArrayIterator refers to an object then this method - * returns an array of the public properties. - */ - function getArrayCopy() {/**/} - - /** @param $position offset to seek to - * @throw OutOfBoundsException if $position is invalid - */ - function seek($position) {/**/} - - /** @return the number of elements in the array or the number of public - * properties in the object. - */ - function count() {/**/} - - /** @copydoc Iterator::rewind */ - function rewind() {/**/} - - /** @copydoc Iterator::valid */ - function valid() {/**/} - - /** @copydoc Iterator::current */ - function current() {/**/} - - /** @copydoc Iterator::key */ - function key() {/**/} - - /** @copydoc Iterator::next */ - function next() {/**/} -} - -/** @ingroup SPL - * @brief File info class - * @since PHP 5.1.3 - */ -class SplFileInfo -{ - /** Construct a file info object - * - * @param $file_name path or file name - */ - function __construct($file_name) {/**/} - - /** @return the path part only. - */ - function getPath() {/**/} - - /** @return the filename only. - */ - function getFilename() {/**/} - - /** @return SplFileInfo created for the file - * @param class_name name of class to instantiate - * @see SplFileInfo::setInfoClass() - */ - function getFileInfo(string class_name = NULL) {/**/} - - /** @return The current entries path and file name. - */ - function getPathname() {/**/} - - /** @return SplFileInfo created for the path - * @param class_name name of class to instantiate - * @see SplFileInfo::setInfoClass() - */ - function getPathInfo(string class_name = NULL) {/**/} - - /** @return The current entry's permissions. - */ - function getPerms() {/**/} - - /** @return The current entry's inode. - */ - function getInode() {/**/} - - /** @return The current entry's size in bytes . - */ - function getSize() {/**/} - - /** @return The current entry's owner name. - */ - function getOwner() {/**/} - - /** @return The current entry's group name. - */ - function getGroup() {/**/} - - /** @return The current entry's last access time. - */ - function getATime() {/**/} - - /** @return The current entry's last modification time. - */ - function getMTime() {/**/} - - /** @return The current entry's last change time. - */ - function getCTime() {/**/} - - /** @return The current entry's file type. - */ - function getType() {/**/} - - /** @return Whether the current entry is writeable. - */ - function isWritable() {/**/} - - /** @return Whether the current entry is readable. - */ - function isReadable() {/**/} - - /** @return Whether the current entry is executable. - */ - function isExecutable() {/**/} - - /** @return Whether the current entry is . - */ - function isFile() {/**/} - - /** @return Whether the current entry is a directory. - */ - function isDir() {/**/} - - /** @return whether the current entry is a link. - */ - function isLink() {/**/} - - /** @return target of link. - */ - function getLinkTarget() {/**/} - - /** @return The resolved path - */ - function getRealPath() {/**/} - - /** @return getPathname() - */ - function __toString() {/**/} - - /** Open the current file as a SplFileObject instance - * - * @param mode open mode - * @param use_include_path whether to search include paths (don't use) - * @param context resource context to passed to open function - * @throw RuntimeException if file cannot be opened (e.g. insufficient - * access rights). - * @return The opened file as a SplFileObject instance - * - * @see SplFileObject - * @see SplFileInfo::setFileClass() - * @see file() - */ - function openFile($mode = 'r', $use_include_path = false, $context = NULL) {/**/} - - /** @param class_name name of class used with openFile(). Must be derived - * from SPLFileObject. - */ - function setFileClass(string class_name = "SplFileObject") {/**/} - - /** @param class_name name of class used with getFileInfo(), getPathInfo(). - * Must be derived from SplFileInfo. - */ - function setInfoClass(string class_name = "SplFileInfo") {/**/} -} - -/** @ingroup SPL - * @brief Directory iterator - * @version 1.1 - * @since PHP 5.0 - */ -class DirectoryIterator extends SplFileInfo implements Iterator -{ - /** Construct a directory iterator from a path-string. - * - * @param $path directory to iterate. - */ - function __construct($path) {/**/} - - /** @copydoc Iterator::rewind */ - function rewind() {/**/} - - /** @copydoc Iterator::valid */ - function valid() {/**/} - - /** @return index of entry - */ - function key() {/**/} - - /** @return $this - */ - function current() {/**/} - - /** @copydoc Iterator::next */ - function next() {/**/} - - /** @return Whether the current entry is either '.' or '..'. - */ - function isDot() {/**/} - - /** @return whether the current entry is a link. - */ - function isLink() {/**/} - - /** @return getFilename() - */ - function __toString() {/**/} -} - -/** @ingroup SPL - * @brief recursive directory iterator - * @version 1.1 - * @since PHP 5.0 - */ -class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveIterator -{ - const CURRENT_AS_FILEINFO 0x00000000; /* make RecursiveDirectoryTree::current() return SplFileInfo */ - const CURRENT_AS_SELF 0x00000010; /* make RecursiveDirectoryTree::current() return getSelf() */ - const CURRENT_AS_PATHNAME 0x00000020; /* make RecursiveDirectoryTree::current() return getPathname() */ - - const KEY_AS_PATHNAME 0x00000000; /* make RecursiveDirectoryTree::key() return getPathname() */ - const KEY_AS_FILENAME 0x00000100; /* make RecursiveDirectoryTree::key() return getFilename() */ - - const NEW_CURRENT_AND_KEY 0x00000100; /* CURRENT_AS_FILEINFO + KEY_AS_FILENAME */ - - /** Construct a directory iterator from a path-string. - * - * @param $path directory to iterate. - * @param $flags open flags - * - CURRENT_AS_FILEINFO - * - CURRENT_AS_SELF - * - CURRENT_AS_PATHNAME - * - KEY_AS_PATHNAME - * - KEY_AS_FILENAME - * - NEW_CURRENT_AND_KEY - */ - function __construct($path, $flags = 0) {/**/} - - /** @return getPathname() or getFilename() depending on flags - */ - function key() {/**/} - - /** @return getFilename() or getFileInfo() depending on flags - */ - function current() {/**/} - - /** @return whether the current is a directory (not '.' or '..'). - */ - function hasChildren() {/**/} - - /** @return a RecursiveDirectoryIterator for the current entry. - */ - function getChildren() {/**/} - - /** @return sub path only (without main path) - */ - function getSubPath() {/**/} - - /** @return the current sub path - */ - function getSubPathname() {/**/} -} - -/** @ingroup SPL - * @brief recursive SimpleXML_Element iterator - * @since PHP 5.0 - * - * The SimpleXMLIterator implements the RecursiveIterator interface. This - * allows iteration over all elements using foreach or an appropriate while - * construct, just like SimpleXMLElement does. When using the foreach construct, - * you will also iterate over the subelements. For every element which - * has subelements, hasChildren() returns true. This will trigger a call to - * getChildren() which returns the iterator for that sub element. - */ -class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, Countable -{ - /** @return whether the current node has sub nodes. - */ - function hasChildren() {/**/} - - /** @return a SimpleXMLIterator for the current node. - */ - function getChildren() {/**/} - - /** @return number of elements/attributes seen with foreach() - */ - function count() {/**/} - - /** @copydoc Iterator::rewind */ - function rewind() {/**/} - - /** @copydoc Iterator::valid */ - function valid() {/**/} - - /** @copydoc Iterator::current */ - function current() {/**/} - - /** @copydoc Iterator::key */ - function key() {/**/} - - /** @copydoc Iterator::next */ - function next() {/**/} -} - -/** @ingroup SPL - * @brief Observer of the observer pattern - * @since PHP 5.1 - * - * For a detailed explanation see Observer pattern in - * - * Gamma, Helm, Johnson, Vlissides
- * Design Patterns - *
- */ -interface SplObserver -{ - /** Called from the subject (i.e. when it's value has changed). - * @param $subject the callee - */ - function update(SplSubject $subject); -} - -/** @ingroup SPL - * @brief Subject to the observer pattern - * @since PHP 5.1 - * @see Observer - */ -interface SplSubject -{ - /** @param $observer new observer to attach - */ - function attach(SplObserver $observer); - - /** @param $observer existing observer to detach - * @note a non attached observer shouldn't result in a warning or similar - */ - function detach(SplObserver $observer); - - /** Notify all observers - */ - function notify(); -} - -?> From e188d2fe0e384ae9c411b8387fea5d36e8d0f62f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 22 Sep 2018 17:43:23 +0200 Subject: [PATCH 15/42] Remove duplicate test file This is already tested in Zend/tests/bug63463.phpt. --- tests/classes/bug63462.phpt | 69 ------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 tests/classes/bug63462.phpt diff --git a/tests/classes/bug63462.phpt b/tests/classes/bug63462.phpt deleted file mode 100644 index f425c1526bc..00000000000 --- a/tests/classes/bug63462.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Test script to verify that magic methods should be called only once when accessing an unset property. ---CREDITS-- -Marco Pivetta ---FILE-- -publicProperty, - $this->protectedProperty, - $this->privateProperty - ); - } - - function __get($name) { - echo '__get ' . $name; - return $this->$name; - } - - function __set($name, $value) { - echo '__set ' . $name . "\n"; - $this->$name = $value; - } - - function __isset($name) { - echo '__isset ' . $name . "\n"; - return isset($this->$name); - } -} - -$test = new Test(); - -$test->nonExisting; -$test->publicProperty; -$test->protectedProperty; -$test->privateProperty; -isset($test->nonExisting); -isset($test->publicProperty); -isset($test->protectedProperty); -isset($test->privateProperty); -$test->nonExisting = 'value'; -$test->publicProperty = 'value'; -$test->protectedProperty = 'value'; -$test->privateProperty = 'value'; - -?> - ---EXPECTF-- -__get nonExisting -Notice: Undefined property: Test::$nonExisting in %sbug63462.php on line %d -__get publicProperty -Notice: Undefined property: Test::$publicProperty in %sbug63462.php on line %d -__get protectedProperty -Notice: Undefined property: Test::$protectedProperty in %sbug63462.php on line %d -__get privateProperty -Notice: Undefined property: Test::$privateProperty in %sbug63462.php on line %d -__isset nonExisting -__isset publicProperty -__isset protectedProperty -__isset privateProperty -__set nonExisting -__set publicProperty -__set protectedProperty -__set privateProperty From 152dc924c565330619a90f99dc1f223bb22ac420 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 22 Sep 2018 18:45:11 +0200 Subject: [PATCH 16/42] Drop WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF And perform some code cleanups this allows. --- ext/mysqlnd/mysqlnd_ps.c | 100 +++++++-------------------------------- 1 file changed, 16 insertions(+), 84 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index f3fab43f0c0..09ef8fa9a38 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -641,39 +641,6 @@ MYSQLND_METHOD(mysqlnd_stmt, send_execute)(MYSQLND_STMT * const s, const enum_my UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) { - /* - We don need to copy the data from the buffers which we will clean. - Because it has already been copied. See - #ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF - */ -#ifdef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF - if (stmt->result_bind && - stmt->result_zvals_separated_once == TRUE && - stmt->state >= MYSQLND_STMT_USER_FETCHING) - { - /* - We need to copy the data from the buffers which we will clean. - The bound variables point to them only if the user has started - to fetch data (MYSQLND_STMT_USER_FETCHING). - We need to check 'result_zvals_separated_once' or we will leak - in the following scenario - prepare("select 1 from dual"); - execute(); - fetch(); <-- no binding, but that's not a problem - bind_result(); - execute(); <-- here we will leak because we separate without need - */ - unsigned int i; - for (i = 0; i < stmt->field_count; i++) { - if (stmt->result_bind[i].bound == TRUE) { - zval *result = &stmt->result_bind[i].zv; - ZVAL_DEREF(result); - Z_TRY_ADDREF_P(result); - } - } - } -#endif - s->m->flush(s); /* @@ -798,28 +765,11 @@ mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, const unsign ZVAL_DEREF(result); /* Clean what we copied last time */ -#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF zval_ptr_dtor(result); -#endif /* copy the type */ if (stmt->result_bind[i].bound == TRUE) { DBG_INF_FMT("i=%u type=%u", i, Z_TYPE(current_row[i])); - if (Z_TYPE(current_row[i]) != IS_NULL) { - /* - Copy the value. - Pre-condition is that the zvals in the result_bind buffer - have been ZVAL_NULL()-ed or to another simple type - (int, double, bool but not string). Because of the reference - counting the user can't delete the strings the variables point to. - */ - - ZVAL_COPY_VALUE(result, ¤t_row[i]); -#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF - Z_TRY_ADDREF_P(result); -#endif - } else { - ZVAL_NULL(result); - } + ZVAL_COPY(result, ¤t_row[i]); } } } @@ -903,24 +853,15 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi zval *data = &result->unbuf->last_row_data[i]; zval *result = &stmt->result_bind[i].zv; - ZVAL_DEREF(result); - /* - stmt->result_bind[i].zv has been already destructed - in result->unbuf->m.free_last_data() - */ -#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF - zval_ptr_dtor(result); -#endif - if (!Z_ISNULL_P(data)) { - if ((Z_TYPE_P(data) == IS_STRING) && (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))){ - meta->fields[i].max_length = Z_STRLEN_P(data); - } - ZVAL_COPY_VALUE(result, data); - /* copied data, thus also the ownership. Thus null data */ - ZVAL_NULL(data); - } else { - ZVAL_NULL(result); + if (Z_TYPE_P(data) == IS_STRING && (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))){ + meta->fields[i].max_length = Z_STRLEN_P(data); } + + ZVAL_DEREF(result); + zval_ptr_dtor(result); + ZVAL_COPY_VALUE(result, data); + /* copied data, thus also the ownership. Thus null data */ + ZVAL_NULL(data); } } MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); @@ -1089,28 +1030,19 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, const unsigned zval *result = &stmt->result_bind[i].zv; ZVAL_DEREF(result); - /* - stmt->result_bind[i].zv has been already destructed - in result->unbuf->m.free_last_data() - */ -#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF zval_ptr_dtor(result); -#endif DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, &stmt->result_bind[i].zv, Z_TYPE_P(data), Z_REFCOUNTED(stmt->result_bind[i].zv)? Z_REFCOUNT(stmt->result_bind[i].zv) : 0); - if (!Z_ISNULL_P(data)) { - if ((Z_TYPE_P(data) == IS_STRING) && - (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))) { - meta->fields[i].max_length = Z_STRLEN_P(data); - } - ZVAL_COPY_VALUE(result, data); - /* copied data, thus also the ownership. Thus null data */ - ZVAL_NULL(data); - } else { - ZVAL_NULL(result); + if (Z_TYPE_P(data) == IS_STRING && + (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))) { + meta->fields[i].max_length = Z_STRLEN_P(data); } + + ZVAL_COPY_VALUE(result, data); + /* copied data, thus also the ownership. Thus null data */ + ZVAL_NULL(data); } } } else { From da17686d605a6aaee792c71ab63608b4476dcf01 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 23 Sep 2018 11:42:07 +0200 Subject: [PATCH 17/42] [ci skip] Update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 9e6184b989f..b9b2ff4dc66 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS . Fixed bug #76711 (OPcache enabled triggers false-positive "Illegal string offset"). (Dmitry) +- PCRE: + . Upgrade PCRE2 to 10.32. (Anatol) + . Fixed bug #76909 (preg_match difference between 7.3 and < 7.3). (Anatol) + - Standard: . Fixed bug #75533 (array_reduce is slow when $carry is large array). (Manabu Matsui) From 59d99a2c47b0af2d18685dbc5ef568d5427adf4f Mon Sep 17 00:00:00 2001 From: bugreportuser <37939393+bugreportuser@users.noreply.github.com> Date: Sat, 22 Sep 2018 11:02:23 -0400 Subject: [PATCH 18/42] Remove unnecessary base64_encode() return value check php_base64_encode() never returns NULL, so base64_encode() will never return false. --- ext/standard/base64.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/standard/base64.c b/ext/standard/base64.c index fb6d491acfe..c750c7a0b93 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -790,11 +790,7 @@ PHP_FUNCTION(base64_encode) ZEND_PARSE_PARAMETERS_END(); result = php_base64_encode((unsigned char*)str, str_len); - if (result != NULL) { - RETURN_STR(result); - } else { - RETURN_FALSE; - } + RETURN_STR(result); } /* }}} */ From c5f108c66ce54ae5ab54d8818d79492d3be2841d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 23 Sep 2018 15:29:25 +0200 Subject: [PATCH 19/42] Handle binary_op failure in overloaded assigns --- ...hrowing_overloaded_compound_assign_op.phpt | 44 +++++++++++++++++++ Zend/zend_execute.c | 10 +++-- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 Zend/tests/throwing_overloaded_compound_assign_op.phpt diff --git a/Zend/tests/throwing_overloaded_compound_assign_op.phpt b/Zend/tests/throwing_overloaded_compound_assign_op.phpt new file mode 100644 index 00000000000..e6e79baf5dd --- /dev/null +++ b/Zend/tests/throwing_overloaded_compound_assign_op.phpt @@ -0,0 +1,44 @@ +--TEST-- +Exception in compound assign op should prevent call to overloaded object handlers +--FILE-- +$k = 42; + return 0; + } +} + +$test = new ArrayObject; +$test[0] = 42; +try { + $test[0] %= 0; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +var_dump($test); + +$test2 = new Test; +try { + $test2->prop %= 0; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +var_dump($test2); + +?> +--EXPECT-- +Modulo by zero +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + [0]=> + int(42) + } +} +Modulo by zero +object(Test)#3 (1) { + ["prop"]=> + int(42) +} diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 8dd1a8c43cb..e204ae59893 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1144,8 +1144,9 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval * } ZVAL_COPY_VALUE(z, value); } - binary_op(&res, Z_ISREF_P(z) ? Z_REFVAL_P(z) : z, value); - Z_OBJ_HT_P(object)->write_dimension(object, property, &res); + if (binary_op(&res, Z_ISREF_P(z) ? Z_REFVAL_P(z) : z, value) == SUCCESS) { + Z_OBJ_HT_P(object)->write_dimension(object, property, &res); + } if (z == &rv) { zval_ptr_dtor(&rv); } @@ -1538,8 +1539,9 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object, z } ZVAL_COPY_VALUE(z, value); } - binary_op(&res, z, value); - Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); + if (binary_op(&res, z, value) == SUCCESS) { + Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), &res); } From 74235ca5f3fae3325175cf0e68cd7e28c86e1378 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 16 Sep 2018 11:48:48 +0200 Subject: [PATCH 20/42] Bump minimum libxml version to 2.7.6 Released Oct 2009, part of RHEL 6. --- UPGRADING | 3 ++ acinclude.m4 | 4 +-- ext/dom/characterdata.c | 12 ------- ext/dom/document.c | 6 ---- ext/dom/tests/DOMDocument_loadXML_error4.phpt | 1 - ext/dom/tests/DOMDocument_load_error4.phpt | 1 - ext/libxml/libxml.c | 6 +--- ext/soap/php_xml.c | 4 --- ext/xml/compat.c | 31 ------------------- ext/xmlreader/php_xmlreader.c | 14 --------- ext/xmlreader/tests/bug42139.phpt | 4 +-- ext/xmlwriter/php_xmlwriter.c | 10 ------ ext/xmlwriter/tests/007.phpt | 1 - ext/xmlwriter/tests/011.phpt | 1 - ext/xmlwriter/tests/012.phpt | 1 - ext/xmlwriter/tests/OO_007.phpt | 1 - ext/xmlwriter/tests/OO_010.phpt | 1 - ext/xmlwriter/tests/OO_011.phpt | 1 - 18 files changed, 7 insertions(+), 95 deletions(-) diff --git a/UPGRADING b/UPGRADING index 629b51b9126..0bb09c6bc46 100644 --- a/UPGRADING +++ b/UPGRADING @@ -63,6 +63,9 @@ PHP 7.4 UPGRADE NOTES - Intl: . The Intl extension now requires at least ICU 50.1. +- Libxml: + . All libxml based extensions now require libxml 2.7.6 or newer. + - Reflection: . Numeric value of class, property, function and constant modifiers was changed. Don't filter methods and properties through diff --git a/acinclude.m4 b/acinclude.m4 index 14dcb62b680..357cbcfb252 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2471,12 +2471,12 @@ AC_DEFUN([PHP_SETUP_LIBXML], [ set $libxml_full_version IFS=$ac_IFS LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` - if test "$LIBXML_VERSION" -ge "2006011"; then + if test "$LIBXML_VERSION" -ge "2007006"; then found_libxml=yes LIBXML_LIBS=`$XML2_CONFIG --libs` LIBXML_INCS=`$XML2_CONFIG --cflags` else - AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) + AC_MSG_ERROR([libxml2 version 2.7.6 or greater required.]) fi fi diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index 8965202c152..ccaaf20d272 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -210,19 +210,7 @@ PHP_FUNCTION(dom_characterdata_append_data) } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); -#if LIBXML_VERSION < 20627 -/* Implement logic from libxml xmlTextConcat to add support for comments and PI */ - if ((nodep->content == (xmlChar *) &(nodep->properties)) || - ((nodep->doc != NULL) && (nodep->doc->dict != NULL) && - xmlDictOwns(nodep->doc->dict, nodep->content))) { - nodep->content = xmlStrncatNew(nodep->content, arg, arg_len); - } else { - nodep->content = xmlStrncat(nodep->content, arg, arg_len); - } - nodep->properties = NULL; -#else xmlTextConcat(nodep, (xmlChar *) arg, arg_len); -#endif RETURN_TRUE; } /* }}} end dom_characterdata_append_data */ diff --git a/ext/dom/document.c b/ext/dom/document.c index 9f9ce5e2f8f..201ce6d4b82 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1858,11 +1858,9 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type RETURN_FALSE; } -#if LIBXML_VERSION >= 20614 if (flags & XML_SCHEMA_VAL_VC_I_CREATE) { valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE; } -#endif xmlSchemaSetValidOptions(vptr, valid_opts); xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); @@ -2213,11 +2211,7 @@ PHP_FUNCTION(dom_document_save_html) xmlBufferFree(buf); } else { int size = 0; -#if LIBXML_VERSION >= 20623 htmlDocDumpMemoryFormat(docp, &mem, &size, format); -#else - htmlDocDumpMemory(docp, &mem, &size); -#endif if (!size || !mem) { RETVAL_FALSE; } else { diff --git a/ext/dom/tests/DOMDocument_loadXML_error4.phpt b/ext/dom/tests/DOMDocument_loadXML_error4.phpt index 1854a34de4d..e35d3dcea5c 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error4.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error4.phpt @@ -12,7 +12,6 @@ Antonio Diaz Ruiz assert.bail=true --SKIPIF-- - --ENV-- XML_FILE=/not_well_formed4.xml LOAD_OPTIONS=0 diff --git a/ext/dom/tests/DOMDocument_load_error4.phpt b/ext/dom/tests/DOMDocument_load_error4.phpt index 9fa6ce279aa..ca9ed79a3e8 100644 --- a/ext/dom/tests/DOMDocument_load_error4.phpt +++ b/ext/dom/tests/DOMDocument_load_error4.phpt @@ -12,7 +12,6 @@ Antonio Diaz Ruiz assert.bail=true --SKIPIF-- - --ENV-- XML_FILE=/not_well_formed4.xml LOAD_OPTIONS=0 diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index c12b9a1d9c9..589fc434421 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -805,20 +805,16 @@ static PHP_MINIT_FUNCTION(libxml) REGISTER_LONG_CONSTANT("LIBXML_NOCDATA", XML_PARSE_NOCDATA, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LIBXML_NONET", XML_PARSE_NONET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LIBXML_PEDANTIC", XML_PARSE_PEDANTIC, CONST_CS | CONST_PERSISTENT); -#if LIBXML_VERSION >= 20621 REGISTER_LONG_CONSTANT("LIBXML_COMPACT", XML_PARSE_COMPACT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LIBXML_NOXMLDECL", XML_SAVE_NO_DECL, CONST_CS | CONST_PERSISTENT); -#endif -#if LIBXML_VERSION >= 20703 REGISTER_LONG_CONSTANT("LIBXML_PARSEHUGE", XML_PARSE_HUGE, CONST_CS | CONST_PERSISTENT); -#endif #if LIBXML_VERSION >= 20900 REGISTER_LONG_CONSTANT("LIBXML_BIGLINES", XML_PARSE_BIG_LINES, CONST_CS | CONST_PERSISTENT); #endif REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT); /* Schema validation options */ -#if defined(LIBXML_SCHEMAS_ENABLED) && LIBXML_VERSION >= 20614 +#if defined(LIBXML_SCHEMAS_ENABLED) REGISTER_LONG_CONSTANT("LIBXML_SCHEMA_CREATE", XML_SCHEMA_VAL_VC_I_CREATE, CONST_CS | CONST_PERSISTENT); #endif diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index 2bb6f2f50bc..0035a70f94b 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -99,9 +99,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename) ctxt->sax->warning = NULL; ctxt->sax->error = NULL; /*ctxt->sax->fatalError = NULL;*/ -#if LIBXML_VERSION >= 20703 ctxt->options |= XML_PARSE_HUGE; -#endif old = php_libxml_disable_entity_loader(1); xmlParseDocument(ctxt); php_libxml_disable_entity_loader(old); @@ -148,9 +146,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) ctxt->sax->warning = NULL; ctxt->sax->error = NULL; /*ctxt->sax->fatalError = NULL;*/ -#if LIBXML_VERSION >= 20703 ctxt->options |= XML_PARSE_HUGE; -#endif old = php_libxml_disable_entity_loader(1); xmlParseDocument(ctxt); php_libxml_disable_entity_loader(old); diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 2018dfa126a..012e6b134bc 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -467,15 +467,8 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m efree(parser); return NULL; } -#if LIBXML_VERSION <= 20617 - /* for older versions of libxml2, allow correct detection of - * charset in documents with a BOM: */ - parser->parser->charset = XML_CHAR_ENCODING_NONE; -#endif -#if LIBXML_VERSION >= 20703 xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX); -#endif parser->parser->replaceEntities = 1; parser->parser->wellFormed = 0; @@ -569,30 +562,6 @@ XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final) { int error; -/* The following is a hack to keep BC with PHP 4 while avoiding -the inifite loop in libxml <= 2.6.17 which occurs when no encoding -has been defined and none can be detected */ -#if LIBXML_VERSION <= 20617 - if (parser->parser->charset == XML_CHAR_ENCODING_NONE) { - if (data_len >= 4 || (parser->parser->input->buf->buffer->use + data_len >= 4)) { - xmlChar start[4]; - int char_count; - - char_count = parser->parser->input->buf->buffer->use; - if (char_count > 4) { - char_count = 4; - } - - memcpy(start, parser->parser->input->buf->buffer->content, (size_t)char_count); - memcpy(start + char_count, data, (size_t)(4 - char_count)); - - if (xmlDetectCharEncoding(&start[0], 4) == XML_CHAR_ENCODING_NONE) { - parser->parser->charset = XML_CHAR_ENCODING_UTF8; - } - } - } -#endif - if (parser->parser->lastError.level >= XML_ERR_WARNING) { return 0; } diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 4d4e7348c93..8b5cf34d665 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -442,7 +442,6 @@ static void php_xmlreader_free_prop_handler(zval *el) /* {{{ */ { pefree(Z_PTR_P(el), 1); } /* }}} */ -#if LIBXML_VERSION >= 20620 /* {{{ php_xmlreader_no_arg_string */ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) { zval *id; @@ -464,7 +463,6 @@ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_ } } /* }}} */ -#endif /* {{{ php_xmlreader_set_relaxng_schema */ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) { @@ -810,12 +808,6 @@ PHP_METHOD(xmlreader, next) id = getThis(); intern = Z_XMLREADER_P(id); if (intern != NULL && intern->ptr != NULL) { -#if LIBXML_VERSION <= 20617 - /* Bug in libxml prevents a next in certain cases when positioned on end of element */ - if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) { - retval = xmlTextReaderRead(intern->ptr); - } else -#endif retval = xmlTextReaderNext(intern->ptr); while (name != NULL && retval == 1) { if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), (xmlChar *)name)) { @@ -899,7 +891,6 @@ PHP_METHOD(xmlreader, resetState) } */ -#if LIBXML_VERSION >= 20620 /* {{{ proto string XMLReader::readInnerXml() Reads the contents of the current node, including child nodes and markup. */ PHP_METHOD(xmlreader, readInnerXml) @@ -965,7 +956,6 @@ PHP_METHOD(xmlreader, setSchema) #endif } /* }}} */ -#endif /* {{{ proto bool XMLReader::setParserProperty(int property, bool value) Sets parser property (one of the parser option constants). @@ -1071,9 +1061,7 @@ PHP_METHOD(xmlreader, XML) reader = xmlNewTextReader(inputbfr, uri); if (reader != NULL) { -#if LIBXML_VERSION >= 20628 ret = xmlTextReaderSetup(reader, NULL, uri, encoding, options); -#endif if (ret == 0) { if (id == NULL) { object_init_ex(return_value, xmlreader_class_entry); @@ -1271,12 +1259,10 @@ static const zend_function_entry xmlreader_functions[] /* {{{ */ = { PHP_ME(xmlreader, open, arginfo_xmlreader_open, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) PHP_ME(xmlreader, read, arginfo_xmlreader_read, ZEND_ACC_PUBLIC) PHP_ME(xmlreader, next, arginfo_xmlreader_next, ZEND_ACC_PUBLIC) -#if LIBXML_VERSION >= 20620 PHP_ME(xmlreader, readInnerXml, arginfo_xmlreader_readInnerXml, ZEND_ACC_PUBLIC) PHP_ME(xmlreader, readOuterXml, arginfo_xmlreader_readOuterXml, ZEND_ACC_PUBLIC) PHP_ME(xmlreader, readString, arginfo_xmlreader_readString, ZEND_ACC_PUBLIC) PHP_ME(xmlreader, setSchema, arginfo_xmlreader_setSchema, ZEND_ACC_PUBLIC) -#endif /* Not Yet Implemented though defined in libxml as of 2.6.9dev PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC) */ diff --git a/ext/xmlreader/tests/bug42139.phpt b/ext/xmlreader/tests/bug42139.phpt index 19602f01035..0ef2d355dd2 100644 --- a/ext/xmlreader/tests/bug42139.phpt +++ b/ext/xmlreader/tests/bug42139.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #42139 (XMLReader option constants are broken using XML()) --SKIPIF-- - + --FILE-- 20617 static PHP_FUNCTION(xmlwriter_start_attribute_ns); static PHP_FUNCTION(xmlwriter_write_attribute_ns); -#endif static PHP_FUNCTION(xmlwriter_start_element); static PHP_FUNCTION(xmlwriter_end_element); static PHP_FUNCTION(xmlwriter_full_end_element); @@ -463,10 +461,8 @@ static const zend_function_entry xmlwriter_functions[] = { PHP_FE(xmlwriter_start_attribute, arginfo_xmlwriter_start_attribute) PHP_FE(xmlwriter_end_attribute, arginfo_xmlwriter_resource) PHP_FE(xmlwriter_write_attribute, arginfo_xmlwriter_write_attribute) -#if LIBXML_VERSION > 20617 PHP_FE(xmlwriter_start_attribute_ns,arginfo_xmlwriter_start_attribute_ns) PHP_FE(xmlwriter_write_attribute_ns,arginfo_xmlwriter_write_attribute_ns) -#endif PHP_FE(xmlwriter_start_element, arginfo_xmlwriter_start_element) PHP_FE(xmlwriter_end_element, arginfo_xmlwriter_resource) PHP_FE(xmlwriter_full_end_element, arginfo_xmlwriter_resource) @@ -513,10 +509,8 @@ static const zend_function_entry xmlwriter_class_functions[] = { PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, arginfo_xmlwriter_method_start_attribute, 0) PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, arginfo_xmlwriter_void, 0) PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, arginfo_xmlwriter_method_write_attribute, 0) -#if LIBXML_VERSION > 20617 PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,arginfo_xmlwriter_method_start_attribute_ns, 0) PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,arginfo_xmlwriter_method_write_attribute_ns, 0) -#endif PHP_ME_MAPPING(startElement, xmlwriter_start_element, arginfo_xmlwriter_method_start_element, 0) PHP_ME_MAPPING(endElement, xmlwriter_end_element, arginfo_xmlwriter_void, 0) PHP_ME_MAPPING(fullEndElement, xmlwriter_full_end_element, arginfo_xmlwriter_void, 0) @@ -808,7 +802,6 @@ static PHP_FUNCTION(xmlwriter_end_attribute) } /* }}} */ -#if LIBXML_VERSION > 20617 /* {{{ proto bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri) Create start namespaced attribute - returns FALSE on error */ static PHP_FUNCTION(xmlwriter_start_attribute_ns) @@ -851,7 +844,6 @@ static PHP_FUNCTION(xmlwriter_start_attribute_ns) RETURN_FALSE; } /* }}} */ -#endif /* {{{ proto bool xmlwriter_write_attribute(resource xmlwriter, string name, string content) Write full attribute - returns FALSE on error */ @@ -896,7 +888,6 @@ static PHP_FUNCTION(xmlwriter_write_attribute) } /* }}} */ -#if LIBXML_VERSION > 20617 /* {{{ proto bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content) Write full namespaced attribute - returns FALSE on error */ static PHP_FUNCTION(xmlwriter_write_attribute_ns) @@ -940,7 +931,6 @@ static PHP_FUNCTION(xmlwriter_write_attribute_ns) RETURN_FALSE; } /* }}} */ -#endif /* {{{ proto bool xmlwriter_start_element(resource xmlwriter, string name) Create start element tag - returns FALSE on error */ diff --git a/ext/xmlwriter/tests/007.phpt b/ext/xmlwriter/tests/007.phpt index 08a5b722369..f1b980a9cc2 100644 --- a/ext/xmlwriter/tests/007.phpt +++ b/ext/xmlwriter/tests/007.phpt @@ -3,7 +3,6 @@ XMLWriter: libxml2 XML Writer, Elements & Attributes --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- Date: Sun, 23 Sep 2018 16:46:58 +0200 Subject: [PATCH 21/42] Sync ext/spl/README with current set of example files --- ext/spl/README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/spl/README b/ext/spl/README index 28373a3eda5..f946f837f85 100644 --- a/ext/spl/README +++ b/ext/spl/README @@ -1,7 +1,7 @@ -This is an extension that aims to implement some efficient data access +This is an extension that aims to implement some efficient data access interfaces and classes. You'll find the classes documented using php -code in the file spl.php or in the corresponding .inc file in the examples -subdirectory. Based on the internal implementations or the files in the -examples subdirectory there are also some .php files to experiment with. +code in the corresponding .inc files in the examples subdirectory. Based +on the internal implementations or the files in the examples subdirectory +there are also some .php files to experiment with. For more information look at: http://php.net/manual/en/book.spl.php From f6605c788f0a73cf4f5f4ea32515b9ba7959e4ac Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 21 Sep 2018 20:25:04 +0200 Subject: [PATCH 22/42] Rename *.php files in Zend/tests to *.inc *.php files are ignored by Git and a better practice might be to rename PHP included files for tests. --- Zend/tests/bug39542.phpt | 2 +- Zend/tests/bug39542/{bug39542.php => bug39542.inc} | 0 Zend/tests/bug67436/{a.php => a.inc} | 0 Zend/tests/bug67436/{b.php => b.inc} | 0 Zend/tests/bug67436/bug67436.phpt | 2 +- Zend/tests/bug67436/bug67436_nohandler.phpt | 4 ++-- Zend/tests/bug67436/{c.php => c.inc} | 0 Zend/tests/use_const/includes/{foo_bar.php => foo_bar.inc} | 0 .../includes/{foo_php_version.php => foo_php_version.inc} | 0 .../use_const/includes/{global_bar.php => global_bar.inc} | 0 .../use_const/includes/{global_baz.php => global_baz.inc} | 0 Zend/tests/use_const/no_global_fallback.phpt | 2 +- Zend/tests/use_const/shadow_core.phpt | 2 +- Zend/tests/use_const/shadow_global.phpt | 4 ++-- Zend/tests/use_function/includes/{foo_bar.php => foo_bar.inc} | 0 .../use_function/includes/{foo_strlen.php => foo_strlen.inc} | 0 .../use_function/includes/{global_bar.php => global_bar.inc} | 0 .../use_function/includes/{global_baz.php => global_baz.inc} | 0 Zend/tests/use_function/no_global_fallback.phpt | 2 +- Zend/tests/use_function/shadow_core.phpt | 2 +- Zend/tests/use_function/shadow_global.phpt | 4 ++-- 21 files changed, 12 insertions(+), 12 deletions(-) rename Zend/tests/bug39542/{bug39542.php => bug39542.inc} (100%) rename Zend/tests/bug67436/{a.php => a.inc} (100%) rename Zend/tests/bug67436/{b.php => b.inc} (100%) rename Zend/tests/bug67436/{c.php => c.inc} (100%) rename Zend/tests/use_const/includes/{foo_bar.php => foo_bar.inc} (100%) rename Zend/tests/use_const/includes/{foo_php_version.php => foo_php_version.inc} (100%) rename Zend/tests/use_const/includes/{global_bar.php => global_bar.inc} (100%) rename Zend/tests/use_const/includes/{global_baz.php => global_baz.inc} (100%) rename Zend/tests/use_function/includes/{foo_bar.php => foo_bar.inc} (100%) rename Zend/tests/use_function/includes/{foo_strlen.php => foo_strlen.inc} (100%) rename Zend/tests/use_function/includes/{global_bar.php => global_bar.inc} (100%) rename Zend/tests/use_function/includes/{global_baz.php => global_baz.inc} (100%) diff --git a/Zend/tests/bug39542.phpt b/Zend/tests/bug39542.phpt index 2008fe140a3..1409c4181c6 100644 --- a/Zend/tests/bug39542.phpt +++ b/Zend/tests/bug39542.phpt @@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } spl_autoload_register(function ($class) { - if (!require_once($class.'.php')) { + if (!require_once($class.'.inc')) { error_log('Error: Autoload class: '.$class.' not found!'); } }); diff --git a/Zend/tests/bug39542/bug39542.php b/Zend/tests/bug39542/bug39542.inc similarity index 100% rename from Zend/tests/bug39542/bug39542.php rename to Zend/tests/bug39542/bug39542.inc diff --git a/Zend/tests/bug67436/a.php b/Zend/tests/bug67436/a.inc similarity index 100% rename from Zend/tests/bug67436/a.php rename to Zend/tests/bug67436/a.inc diff --git a/Zend/tests/bug67436/b.php b/Zend/tests/bug67436/b.inc similarity index 100% rename from Zend/tests/bug67436/b.php rename to Zend/tests/bug67436/b.inc diff --git a/Zend/tests/bug67436/bug67436.phpt b/Zend/tests/bug67436/bug67436.phpt index 8a6b3f80270..2bd06a07459 100644 --- a/Zend/tests/bug67436/bug67436.phpt +++ b/Zend/tests/bug67436/bug67436.phpt @@ -9,7 +9,7 @@ error_reporting=-1 spl_autoload_register(function($classname) { if (in_array($classname, array('a','b','c'))) { - require_once __DIR__ . "/{$classname}.php"; + require_once __DIR__ . "/{$classname}.inc"; } }); diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt index 232110797a6..088761e00b6 100644 --- a/Zend/tests/bug67436/bug67436_nohandler.phpt +++ b/Zend/tests/bug67436/bug67436_nohandler.phpt @@ -5,7 +5,7 @@ bug67436: E_STRICT instead of custom error handler spl_autoload_register(function($classname) { if (in_array($classname, array('a','b','c'))) { - require_once __DIR__ . "/{$classname}.php"; + require_once __DIR__ . "/{$classname}.inc"; } }); @@ -15,6 +15,6 @@ $b = new b(); $b->test(); --EXPECTF-- -Warning: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d +Warning: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.inc on line %d b::test() a::test(c::TESTCONSTANT) diff --git a/Zend/tests/bug67436/c.php b/Zend/tests/bug67436/c.inc similarity index 100% rename from Zend/tests/bug67436/c.php rename to Zend/tests/bug67436/c.inc diff --git a/Zend/tests/use_const/includes/foo_bar.php b/Zend/tests/use_const/includes/foo_bar.inc similarity index 100% rename from Zend/tests/use_const/includes/foo_bar.php rename to Zend/tests/use_const/includes/foo_bar.inc diff --git a/Zend/tests/use_const/includes/foo_php_version.php b/Zend/tests/use_const/includes/foo_php_version.inc similarity index 100% rename from Zend/tests/use_const/includes/foo_php_version.php rename to Zend/tests/use_const/includes/foo_php_version.inc diff --git a/Zend/tests/use_const/includes/global_bar.php b/Zend/tests/use_const/includes/global_bar.inc similarity index 100% rename from Zend/tests/use_const/includes/global_bar.php rename to Zend/tests/use_const/includes/global_bar.inc diff --git a/Zend/tests/use_const/includes/global_baz.php b/Zend/tests/use_const/includes/global_baz.inc similarity index 100% rename from Zend/tests/use_const/includes/global_baz.php rename to Zend/tests/use_const/includes/global_baz.inc diff --git a/Zend/tests/use_const/no_global_fallback.phpt b/Zend/tests/use_const/no_global_fallback.phpt index 3adebd68f55..f9ee6055153 100644 --- a/Zend/tests/use_const/no_global_fallback.phpt +++ b/Zend/tests/use_const/no_global_fallback.phpt @@ -3,7 +3,7 @@ non-existent imported constants should not be looked up in the global table --FILE-- Date: Fri, 21 Sep 2018 20:06:47 +0200 Subject: [PATCH 23/42] Rename *.php files in ext/dom tests to *.inc *.php files are ignored by Git and a better practice might be to rename PHP included files for tests. --- ext/dom/tests/DOMDocument_loadXML_basic.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_error1.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_error2.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_error3.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_error4.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_error5.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_variation1.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_variation2.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_variation3.phpt | 2 +- ext/dom/tests/DOMDocument_loadXML_variation4.phpt | 2 +- ext/dom/tests/DOMDocument_load_basic.phpt | 2 +- ext/dom/tests/DOMDocument_load_error1.phpt | 2 +- ext/dom/tests/DOMDocument_load_error2.phpt | 2 +- ext/dom/tests/DOMDocument_load_error3.phpt | 2 +- ext/dom/tests/DOMDocument_load_error4.phpt | 2 +- ext/dom/tests/DOMDocument_load_error5.phpt | 2 +- ext/dom/tests/DOMDocument_load_variation1.phpt | 2 +- ext/dom/tests/DOMDocument_load_variation2.phpt | 2 +- ext/dom/tests/DOMDocument_load_variation3.phpt | 2 +- ext/dom/tests/DOMDocument_load_variation4.phpt | 2 +- ...mentload_test_method.php => domdocumentload_test_method.inc} | 2 +- ...thod_savexml.php => domdocumentload_test_method_savexml.inc} | 2 +- ...documentload_utilities.php => domdocumentload_utilities.inc} | 0 ...adxml_test_method.php => domdocumentloadxml_test_method.inc} | 2 +- ...d_savexml.php => domdocumentloadxml_test_method_savexml.inc} | 2 +- 25 files changed, 24 insertions(+), 24 deletions(-) rename ext/dom/tests/{domdocumentload_test_method.php => domdocumentload_test_method.inc} (81%) rename ext/dom/tests/{domdocumentload_test_method_savexml.php => domdocumentload_test_method_savexml.inc} (82%) rename ext/dom/tests/{domdocumentload_utilities.php => domdocumentload_utilities.inc} (100%) rename ext/dom/tests/{domdocumentloadxml_test_method.php => domdocumentloadxml_test_method.inc} (82%) rename ext/dom/tests/{domdocumentloadxml_test_method_savexml.php => domdocumentloadxml_test_method_savexml.inc} (83%) diff --git a/ext/dom/tests/DOMDocument_loadXML_basic.phpt b/ext/dom/tests/DOMDocument_loadXML_basic.phpt index 569593c0075..cf25c26d622 100644 --- a/ext/dom/tests/DOMDocument_loadXML_basic.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_basic.phpt @@ -17,5 +17,5 @@ XML_FILE=/book.xml LOAD_OPTIONS=0 EXPECTED_RESULT=1 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_error1.phpt b/ext/dom/tests/DOMDocument_loadXML_error1.phpt index 52d44ea291d..5a2f46e2200 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error1.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error1.phpt @@ -17,7 +17,7 @@ XML_FILE=/not_well_formed.xml LOAD_OPTIONS=0 EXPECTED_RESULT=0 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error2.phpt b/ext/dom/tests/DOMDocument_loadXML_error2.phpt index 6ac4193dafd..3b8e2b48b16 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error2.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error2.phpt @@ -17,7 +17,7 @@ XML_FILE=/not_well_formed2.xml LOAD_OPTIONS=0 EXPECTED_RESULT=0 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error3.phpt b/ext/dom/tests/DOMDocument_loadXML_error3.phpt index 07f7ca77383..be37b5552b8 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error3.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error3.phpt @@ -17,6 +17,6 @@ XML_FILE=/not_well_formed3.xml LOAD_OPTIONS=0 EXPECTED_RESULT=0 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error4.phpt b/ext/dom/tests/DOMDocument_loadXML_error4.phpt index e35d3dcea5c..d2cc3c5dd22 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error4.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error4.phpt @@ -17,6 +17,6 @@ XML_FILE=/not_well_formed4.xml LOAD_OPTIONS=0 EXPECTED_RESULT=0 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error5.phpt b/ext/dom/tests/DOMDocument_loadXML_error5.phpt index a4aa1858f58..d5eaadb06d9 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error5.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error5.phpt @@ -17,6 +17,6 @@ XML_FILE=/not_well_formed5.xml LOAD_OPTIONS=0 EXPECTED_RESULT=0 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s diff --git a/ext/dom/tests/DOMDocument_loadXML_variation1.phpt b/ext/dom/tests/DOMDocument_loadXML_variation1.phpt index 558137526f2..e3a3d94d3b7 100644 --- a/ext/dom/tests/DOMDocument_loadXML_variation1.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_variation1.phpt @@ -17,5 +17,5 @@ XML_FILE=/book_with_dtd2.xml LOAD_OPTIONS=LIBXML_DTDLOAD EXPECTED_RESULT=1 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_variation2.phpt b/ext/dom/tests/DOMDocument_loadXML_variation2.phpt index 71f638efc14..9f9a5edc07f 100644 --- a/ext/dom/tests/DOMDocument_loadXML_variation2.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_variation2.phpt @@ -17,6 +17,6 @@ XML_FILE=/wrong_book_with_dtd2.xml LOAD_OPTIONS=LIBXML_DTDVALID EXPECTED_RESULT=1 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s diff --git a/ext/dom/tests/DOMDocument_loadXML_variation3.phpt b/ext/dom/tests/DOMDocument_loadXML_variation3.phpt index 8e61ec4dbcc..e0186c802da 100644 --- a/ext/dom/tests/DOMDocument_loadXML_variation3.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_variation3.phpt @@ -18,5 +18,5 @@ XML_FILE=/wrong_book_with_dtd.xml LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR EXPECTED_RESULT=1 --FILE_EXTERNAL-- -domdocumentloadxml_test_method.php +domdocumentloadxml_test_method.inc --EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_variation4.phpt b/ext/dom/tests/DOMDocument_loadXML_variation4.phpt index 4f1ea37c192..ab150636425 100644 --- a/ext/dom/tests/DOMDocument_loadXML_variation4.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_variation4.phpt @@ -18,7 +18,7 @@ XML_FILE=/book_with_dtd2.xml LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS EXPECTED_RESULT=1 --FILE_EXTERNAL-- -domdocumentloadxml_test_method_savexml.php +domdocumentloadxml_test_method_savexml.inc --EXPECT-- diff --git a/ext/dom/tests/domdocumentload_test_method.php b/ext/dom/tests/domdocumentload_test_method.inc similarity index 81% rename from ext/dom/tests/domdocumentload_test_method.php rename to ext/dom/tests/domdocumentload_test_method.inc index a15c9e53be8..a643b428d1b 100644 --- a/ext/dom/tests/domdocumentload_test_method.php +++ b/ext/dom/tests/domdocumentload_test_method.inc @@ -1,5 +1,5 @@ Date: Sun, 23 Sep 2018 22:44:58 +0200 Subject: [PATCH 24/42] Remove outdated zlib readme file for windows build --- ext/zlib/zlib_win32_howto.txt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 ext/zlib/zlib_win32_howto.txt diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt deleted file mode 100644 index 59ff3c4f4c7..00000000000 --- a/ext/zlib/zlib_win32_howto.txt +++ /dev/null @@ -1,16 +0,0 @@ -Rules for building ZLIB ------------------------ - -The zlib project requires the following files: - -php_build\zlib\include\zlib.h -php_build\zlib\include\zconf.h -php_build\zlib\lib\zlibstat.lib - -php_build is a directory at the same level as php7. - -Start Visual Studio, load php_modules.dsw, select the ZLIB projects, and build -it. - - - \ No newline at end of file From eceb34073b28f74f1ea6e659bea296664563189f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 09:37:46 +1000 Subject: [PATCH 25/42] Remove trailing whitespace to help keep branches in sycn --- ext/oci8/LICENSE | 26 +++++++++++++------------- ext/oci8/config.m4 | 14 +++++++------- ext/oci8/oci8_failover.c | 4 ++-- ext/oci8/oci8_interface.c | 2 +- ext/oci8/oci8_lob.c | 2 +- ext/oci8/oci8_statement.c | 2 +- ext/oci8/package.xml | 20 ++++++++++---------- ext/oci8/php_oci8_int.h | 18 +++++++++--------- 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/ext/oci8/LICENSE b/ext/oci8/LICENSE index 49c344f0936..5a3770885f1 100644 --- a/ext/oci8/LICENSE +++ b/ext/oci8/LICENSE @@ -1,7 +1,7 @@ --------------------------------------------------------------------- +-------------------------------------------------------------------- The PHP License, version 3.01 Copyright (c) 1999 - 2018 The PHP Group. All rights reserved. --------------------------------------------------------------------- +-------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, is permitted provided that the following conditions @@ -9,22 +9,22 @@ are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + 3. The name "PHP" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact group@php.net. - + 4. Products derived from this software may not be called "PHP", nor may "PHP" appear in their name, without prior written permission from group@php.net. You may indicate that your software works in conjunction with PHP by saying "Foo for PHP" instead of calling it "PHP Foo" or "phpfoo" - + 5. The PHP Group may publish revised and/or new versions of the license from time to time. Each version will be given a distinguishing version number. @@ -41,27 +41,27 @@ are met: "This product includes PHP software, freely available from ". -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND +THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------- +-------------------------------------------------------------------- This software consists of voluntary contributions made by many individuals on behalf of the PHP Group. The PHP Group can be contacted via Email at group@php.net. -For more information on the PHP Group and the PHP project, +For more information on the PHP Group and the PHP project, please see . PHP includes the Zend Engine, freely available at diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index efcc09b5de8..b554a4ac9d2 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -66,8 +66,8 @@ AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ OCI8_ORACLE_VERSION=8.1 elif test -f $OCI8_LCS_BASE.1.0; then OCI8_ORACLE_VERSION=8.0 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then - if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then + elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then + if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then OCI8_ORACLE_VERSION=8.0 else OCI8_ORACLE_VERSION=8.1 @@ -86,7 +86,7 @@ dnl support DTrace for extensions. Creating OCI8_INIT_DTRACE dnl independently instead of using a refactored PHP_INIT_DTRACE allows dnl OCI8 to be DTraced on versions of PHP where core PHP DTrace support dnl isn't available. -dnl +dnl AC_DEFUN([OCI8_INIT_DTRACE],[ ac_srcdir=[]PHP_EXT_SRCDIR([oci8])/ ac_bdir=[]PHP_EXT_BUILDDIR([oci8])/ @@ -173,7 +173,7 @@ PHP_ARG_WITH(oci8, for Oracle Database OCI8 support, Use --with-oci8=instantclient,/path/to/instant/client/lib to use an Oracle Instant Client installation]) -if test "$PHP_OCI8" != "no"; then +if test "$PHP_OCI8" != "no"; then if test -z "$PHP_OCI8"; then dnl --with-oci8=$ORACLE_HOME where ORACLE_HOME isn't set (or is mistyped) will match this case @@ -211,12 +211,12 @@ if test "$PHP_OCI8" != "no"; then fi dnl Check whether --enable-dtrace was set. - dnl To use DTrace with a PECL install, extract the OCI8 archive, phpize it, and set + dnl To use DTrace with a PECL install, extract the OCI8 archive, phpize it, and set dnl PHP_DTRACE=yes before running configure AC_MSG_CHECKING([OCI8 DTrace support]) oci8_do_dtrace="`echo $PHP_OCI8 | cut -d, -f3`" if test "$PHP_DTRACE" = "yes" -o "$oci8_do_dtrace" = "dtrace" ; then - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([yes]) if test "$ext_shared" = "no"; then AC_MSG_ERROR([For DTrace support OCI8 must be configured as a shared extension]) else @@ -242,7 +242,7 @@ if test "$PHP_OCI8" != "no"; then AC_MSG_CHECKING([checking if we're on a 64-bit platform]) if test "$ac_cv_sizeof_long_int" = "4"; then AC_MSG_RESULT([no]) - PHP_OCI8_OH_LIBDIR=lib32 + PHP_OCI8_OH_LIBDIR=lib32 PHP_OCI8_IC_LIBDIR_SUFFIX="" else AC_MSG_RESULT([yes]) diff --git a/ext/oci8/oci8_failover.c b/ext/oci8/oci8_failover.c index 68a46bc4db1..106945ece77 100644 --- a/ext/oci8/oci8_failover.c +++ b/ext/oci8/oci8_failover.c @@ -40,7 +40,7 @@ #include "php_oci8.h" #include "php_oci8_int.h" -/* {{{ callback_fn() +/* {{{ callback_fn() OCI TAF callback function, calling userspace function */ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_event) { @@ -106,7 +106,7 @@ int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback if (!callback) { /* Unregister callback */ if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) { - return 0; // Nothing to unregister + return 0; // Nothing to unregister } registered = 1; diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index d7ae82d69c2..c4205144214 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -56,7 +56,7 @@ PHP_FUNCTION(oci_register_taf_callback) } if (callback) { -#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2) +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2) if (!zend_is_callable(callback, 0, 0)) { callback_name = zend_get_callable_name(callback); php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 3b873976594..3dce6d1cd3b 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -203,7 +203,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece } /* }}} */ -/* {{{ php_oci_lob_calculate_buffer() +/* {{{ php_oci_lob_calculate_buffer() Work out the size for LOB buffering */ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length) { diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 95cf67c4915..97aa51b077e 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1260,7 +1260,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l zend_string_release(zvtmp); } - /* Make sure the minimum of value_sz is 1 to avoid ORA-3149 + /* Make sure the minimum of value_sz is 1 to avoid ORA-3149 * when both in/out parameters are bound with empty strings */ if (value_sz == 0) diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 45e6eb5b173..07a56800bb1 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -508,7 +508,7 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) - + 2.1.5 2.1.5 @@ -520,9 +520,9 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) PHP This version is for PHP 7 only. -Added TAF callback support (PR #2459, KoenigsKind) +Added TAF callback support (PR #2459, KoenigsKind) - + @@ -555,7 +555,7 @@ This version is for PHP 7 only. Fixed bug #71148 (Bind reference overwritten on PHP 7) - + 2.1.2 @@ -588,7 +588,7 @@ This version is for PHP 7 only. Fixed bug #71600 (oci_fetch_all segfaults when selecting more than 8 columns) - + 2.1.0 @@ -601,7 +601,7 @@ Fixed bug #71600 (oci_fetch_all segfaults when selecting more than 8 columns) PHP This version is for PHP 7 only. -Updated driver name format. +Updated driver name format. @@ -661,7 +661,7 @@ Enhancement - Improve performance of multi-row OCI_RETURN_LOB queries (Bug #6687 PHP -Added oci_bind_by_name() support for PL/SQL BOOLEAN type +Added oci_bind_by_name() support for PL/SQL BOOLEAN type Build change: Fix source variable definition for C89 compatibility @@ -763,7 +763,7 @@ Add the connection handle to several DTrace probes. devel PHP - + Fixed --enable-maintainer-zts mode. Allow Implicit Result Set statement resources to inherit the parent's current prefetch count. Allow OCI8 to be DTrace-enabled independently from core PHP. @@ -781,7 +781,7 @@ Require OCI8 to be configured 'shared' when enabling DTrace support. devel PHP - + - NEW FUNCTIONALITY: - Added Implicit Result Set support for Oracle Database 12c. @@ -844,7 +844,7 @@ Require OCI8 to be configured 'shared' when enabling DTrace support. - Regularized code prototypes and fixed some in-line documentation prototypes. - - Fixed code folding. + - Fixed code folding. diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 54ad1c0981b..90448d36ea4 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -98,7 +98,7 @@ extern zend_class_entry *oci_coll_class_entry_ptr; #define PHP_OCI_ERRBUF_LEN OCI_ERROR_MAXMSG_SIZE2 #else #define PHP_OCI_ERRBUF_LEN OCI_ERROR_MAXMSG_SIZE -#endif +#endif /* The mode parameter for oci_connect() is overloaded and accepts both * privilege and external authentication flags OR'd together. @@ -136,7 +136,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_connection */ -typedef struct { +typedef struct { zend_resource *id; /* resource ID */ OCIEnv *env; /* private env handle */ ub2 charset; /* charset ID */ @@ -170,7 +170,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_descriptor */ -typedef struct { +typedef struct { zend_resource *id; zend_ulong index; /* descriptors hash table index */ php_oci_connection *connection; /* parent connection handle */ @@ -187,7 +187,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_lob_ctx */ -typedef struct { +typedef struct { char **lob_data; /* address of pointer to LOB data */ ub4 *lob_len; /* address of LOB length variable (bytes) */ ub4 alloc_len; @@ -195,7 +195,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_collection */ -typedef struct { +typedef struct { zend_resource *id; php_oci_connection *connection; /* parent connection handle */ OCIType *tdo; /* collection's type handle */ @@ -208,7 +208,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_define */ -typedef struct { +typedef struct { zval val; /* zval used in define */ text *name; /* placeholder's name */ ub4 name_len; /* placeholder's name length */ @@ -217,7 +217,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_statement */ -typedef struct { +typedef struct { zend_resource *id; zend_resource *parent_stmtid; /* parent statement id */ struct php_oci_statement *impres_child_stmt;/* child of current Implicit Result Set statement handle */ @@ -242,7 +242,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_bind */ -typedef struct { +typedef struct { OCIBind *bind; /* bind handle */ zval val; /* value */ dvoid *descriptor; /* used for binding of LOBS etc */ @@ -265,7 +265,7 @@ typedef struct { /* }}} */ /* {{{ php_oci_out_column */ -typedef struct { +typedef struct { php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ php_oci_statement *nested_statement; /* statement handle. used when fetching REFCURSORS */ OCIDefine *oci_define; /* define handle */ From a2c0f8722b90becea8e551822dad206552e82d44 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 13:27:27 +1000 Subject: [PATCH 26/42] Remove trailing whitespace to help keep branches in sync --- ext/oci8/tests/array_bind_001.phpt | 10 +++--- ext/oci8/tests/array_bind_002.phpt | 8 ++--- ext/oci8/tests/array_bind_003.phpt | 10 +++--- ext/oci8/tests/array_bind_004.phpt | 10 +++--- ext/oci8/tests/array_bind_005.phpt | 10 +++--- ext/oci8/tests/array_bind_006.phpt | 10 +++--- ext/oci8/tests/array_bind_007.phpt | 8 ++--- ext/oci8/tests/array_bind_008.phpt | 10 +++--- ext/oci8/tests/array_bind_011.phpt | 8 ++--- ext/oci8/tests/array_bind_014.phpt | 10 +++--- ext/oci8/tests/array_bind_bdouble.phpt | 2 +- ext/oci8/tests/array_bind_bfloat.phpt | 2 +- ext/oci8/tests/array_bind_date.phpt | 10 +++--- ext/oci8/tests/array_bind_date1.phpt | 10 +++--- ext/oci8/tests/array_bind_float.phpt | 10 +++--- ext/oci8/tests/array_bind_float1.phpt | 10 +++--- ext/oci8/tests/array_bind_int.phpt | 10 +++--- ext/oci8/tests/array_bind_int1.phpt | 10 +++--- ext/oci8/tests/array_bind_str.phpt | 10 +++--- ext/oci8/tests/array_bind_str1.phpt | 10 +++--- ext/oci8/tests/array_bind_uin.phpt | 2 +- ext/oci8/tests/b47243_1.phpt | 2 +- ext/oci8/tests/b47243_2.phpt | 2 +- ext/oci8/tests/b47243_3.phpt | 2 +- ext/oci8/tests/bind_boolean_1.phpt | 12 +++---- ext/oci8/tests/bind_char_1.phpt | 4 +-- ext/oci8/tests/bind_char_1_11gR1.phpt | 4 +-- ext/oci8/tests/bind_char_2.phpt | 4 +-- ext/oci8/tests/bind_char_2_11gR1.phpt | 4 +-- ext/oci8/tests/bind_char_3_11gR1.phpt | 2 +- ext/oci8/tests/bind_char_4.phpt | 2 +- ext/oci8/tests/bind_char_4_11gR1.phpt | 2 +- ext/oci8/tests/bind_long.phpt | 2 +- ext/oci8/tests/bind_long_raw.phpt | 2 +- ext/oci8/tests/bind_misccoltypes.phpt | 2 +- ext/oci8/tests/bind_misccoltypes_errs.phpt | 8 ++--- ext/oci8/tests/bind_raw.phpt | 2 +- ext/oci8/tests/bind_raw_2.phpt | 2 +- ext/oci8/tests/bind_sqltchr_2.phpt | 4 +-- ext/oci8/tests/bind_sqltnum.phpt | 2 +- ext/oci8/tests/bind_sqltnum_11g.phpt | 2 +- ext/oci8/tests/bind_unsupported_1.phpt | 2 +- ext/oci8/tests/bind_unsupported_2.phpt | 6 ++-- ext/oci8/tests/bind_unsupported_3.phpt | 6 ++-- ext/oci8/tests/bug26133.phpt | 2 +- ext/oci8/tests/bug32325.phpt | 2 +- ext/oci8/tests/bug35973.phpt | 2 +- ext/oci8/tests/bug36010.phpt | 2 +- ext/oci8/tests/bug36403.phpt | 2 +- ext/oci8/tests/bug37220.phpt | 22 ++++++------- ext/oci8/tests/bug37581.phpt | 2 +- ext/oci8/tests/bug38173.phpt | 2 +- ext/oci8/tests/bug40078.phpt | 2 +- ext/oci8/tests/bug40415.phpt | 16 +++++----- ext/oci8/tests/bug41069.phpt | 4 +-- ext/oci8/tests/bug42134.phpt | 2 +- ext/oci8/tests/bug42173.phpt | 2 +- ext/oci8/tests/bug42496_1.phpt | 2 +- ext/oci8/tests/bug42496_2.phpt | 2 +- ext/oci8/tests/bug42841.phpt | 30 +++++++++--------- ext/oci8/tests/bug43492.phpt | 2 +- ext/oci8/tests/bug43492_2.phpt | 2 +- ext/oci8/tests/bug43497.phpt | 2 +- ext/oci8/tests/bug44008.phpt | 2 +- ext/oci8/tests/bug44113.phpt | 2 +- ext/oci8/tests/bug44206.phpt | 4 +-- ext/oci8/tests/bug46994.phpt | 2 +- ext/oci8/tests/bug47189.phpt | 8 ++--- ext/oci8/tests/bug47281.phpt | 4 +-- ext/oci8/tests/bug51253.phpt | 10 +++--- ext/oci8/tests/bug51291_1.phpt | 14 ++++---- ext/oci8/tests/bug51291_2.phpt | 4 +-- ext/oci8/tests/bug68298.phpt | 2 +- ext/oci8/tests/bug70700.phpt | 2 +- ext/oci8/tests/bug71148.phpt | 2 +- ext/oci8/tests/bug71600.phpt | 6 ++-- ext/oci8/tests/coll_001.phpt | 2 +- ext/oci8/tests/coll_002.phpt | 2 +- ext/oci8/tests/coll_002_func.phpt | 2 +- ext/oci8/tests/coll_003.phpt | 2 +- ext/oci8/tests/coll_003_func.phpt | 2 +- ext/oci8/tests/coll_004.phpt | 2 +- ext/oci8/tests/coll_004_func.phpt | 2 +- ext/oci8/tests/coll_005.phpt | 2 +- ext/oci8/tests/coll_006.phpt | 2 +- ext/oci8/tests/coll_006_func.phpt | 2 +- ext/oci8/tests/coll_007.phpt | 2 +- ext/oci8/tests/coll_008.phpt | 2 +- ext/oci8/tests/coll_009.phpt | 4 +-- ext/oci8/tests/coll_009_func.phpt | 4 +-- ext/oci8/tests/coll_010.phpt | 4 +-- ext/oci8/tests/coll_010_func.phpt | 4 +-- ext/oci8/tests/coll_011.phpt | 4 +-- ext/oci8/tests/coll_011_func.phpt | 4 +-- ext/oci8/tests/coll_012.phpt | 4 +-- ext/oci8/tests/coll_012_func.phpt | 4 +-- ext/oci8/tests/coll_013.phpt | 4 +-- ext/oci8/tests/coll_013_func.phpt | 4 +-- ext/oci8/tests/coll_014.phpt | 4 +-- ext/oci8/tests/coll_014_func.phpt | 4 +-- ext/oci8/tests/coll_015.phpt | 4 +-- ext/oci8/tests/coll_015_func.phpt | 4 +-- ext/oci8/tests/coll_016.phpt | 4 +-- ext/oci8/tests/coll_016_func.phpt | 4 +-- ext/oci8/tests/coll_017.phpt | 4 +-- ext/oci8/tests/coll_017_func.phpt | 4 +-- ext/oci8/tests/coll_018.phpt | 2 +- ext/oci8/tests/coll_019.phpt | 4 +-- ext/oci8/tests/commit_001.phpt | 2 +- ext/oci8/tests/commit_002.phpt | 2 +- ext/oci8/tests/commit_old.phpt | 2 +- ext/oci8/tests/conn_attr.inc | 28 ++++++++-------- ext/oci8/tests/conn_attr_1.phpt | 4 +-- ext/oci8/tests/conn_attr_2.phpt | 4 +-- ext/oci8/tests/conn_attr_3.phpt | 2 +- ext/oci8/tests/conn_attr_4.phpt | 4 +-- ext/oci8/tests/conn_attr_5.phpt | 3 +- ext/oci8/tests/connect_scope1.phpt | 2 +- ext/oci8/tests/connect_scope2.phpt | 2 +- ext/oci8/tests/connect_scope_try1.phpt | 2 +- ext/oci8/tests/connect_scope_try2.phpt | 2 +- ext/oci8/tests/connect_scope_try3.phpt | 2 +- ext/oci8/tests/connect_scope_try4.phpt | 2 +- ext/oci8/tests/connect_scope_try5.phpt | 2 +- ext/oci8/tests/connect_scope_try6.phpt | 2 +- .../tests/connect_without_oracle_home.phpt | 4 +-- .../tests/connect_without_oracle_home_11.phpt | 4 +-- .../connect_without_oracle_home_old.phpt | 4 +-- .../connect_without_oracle_home_old_11.phpt | 4 +-- ext/oci8/tests/create_type.inc | 2 +- ext/oci8/tests/cursor_bind.phpt | 4 +-- ext/oci8/tests/cursor_bind_err.phpt | 2 +- ext/oci8/tests/cursors.phpt | 2 +- ext/oci8/tests/cursors_old.phpt | 2 +- ext/oci8/tests/db_op_1.phpt | 10 +++--- ext/oci8/tests/db_op_2.phpt | 10 +++--- ext/oci8/tests/dbmsoutput.phpt | 2 +- ext/oci8/tests/define2.phpt | 4 +-- ext/oci8/tests/define3.phpt | 6 ++-- ext/oci8/tests/define6.phpt | 4 +-- ext/oci8/tests/descriptors.phpt | 2 +- ext/oci8/tests/drcp_cclass1.phpt | 6 ++-- ext/oci8/tests/drcp_conn_close1.phpt | 6 ++-- ext/oci8/tests/drcp_conn_close2.phpt | 6 ++-- ext/oci8/tests/drcp_connect1.phpt | 16 +++++----- ext/oci8/tests/drcp_connection_class.phpt | 10 +++--- ext/oci8/tests/drcp_pconn_close1.phpt | 6 ++-- ext/oci8/tests/drcp_pconn_close2.phpt | 6 ++-- ext/oci8/tests/driver_name.phpt | 12 +++---- ext/oci8/tests/driver_name_11gR2.phpt | 12 +++---- ext/oci8/tests/drop_table.inc | 2 +- ext/oci8/tests/edition_1.phpt | 22 ++++++------- ext/oci8/tests/edition_2.phpt | 18 +++++------ ext/oci8/tests/error.phpt | 2 +- ext/oci8/tests/error2.phpt | 2 +- ext/oci8/tests/error3.phpt | 10 +++--- ext/oci8/tests/error_bind.phpt | 4 +-- ext/oci8/tests/error_bind_2.phpt | 6 ++-- ext/oci8/tests/error_bind_3.phpt | 6 ++-- ext/oci8/tests/error_old.phpt | 2 +- ext/oci8/tests/fetch_all2.phpt | 4 +-- ext/oci8/tests/fetch_all3.phpt | 2 +- ext/oci8/tests/fetch_array.phpt | 2 +- ext/oci8/tests/fetch_into1.phpt | 2 +- ext/oci8/tests/fetch_into2.phpt | 2 +- ext/oci8/tests/fetch_object.phpt | 2 +- ext/oci8/tests/fetch_object_1.phpt | 2 +- ext/oci8/tests/field_funcs.phpt | 2 +- ext/oci8/tests/field_funcs_old.phpt | 2 +- ext/oci8/tests/imp_res_1.phpt | 6 ++-- ext/oci8/tests/imp_res_2.phpt | 6 ++-- ext/oci8/tests/imp_res_3.phpt | 6 ++-- ext/oci8/tests/imp_res_4.phpt | 6 ++-- ext/oci8/tests/imp_res_5.phpt | 6 ++-- ext/oci8/tests/imp_res_6.phpt | 6 ++-- ext/oci8/tests/imp_res_7.phpt | 6 ++-- ext/oci8/tests/imp_res_call_error.phpt | 6 ++-- ext/oci8/tests/imp_res_cancel.phpt | 6 ++-- ext/oci8/tests/imp_res_close.phpt | 6 ++-- ext/oci8/tests/imp_res_cursor.phpt | 6 ++-- ext/oci8/tests/imp_res_dbmsoutput.phpt | 6 ++-- ext/oci8/tests/imp_res_field.phpt | 6 ++-- ext/oci8/tests/imp_res_func_error.phpt | 6 ++-- ext/oci8/tests/imp_res_get_1.phpt | 6 ++-- ext/oci8/tests/imp_res_get_2.phpt | 6 ++-- ext/oci8/tests/imp_res_get_3.phpt | 6 ++-- ext/oci8/tests/imp_res_get_4.phpt | 6 ++-- ext/oci8/tests/imp_res_get_5.phpt | 8 ++--- ext/oci8/tests/imp_res_get_all.phpt | 6 ++-- ext/oci8/tests/imp_res_get_cancel.phpt | 8 ++--- ext/oci8/tests/imp_res_get_close_1.phpt | 8 ++--- ext/oci8/tests/imp_res_get_close_2.phpt | 6 ++-- ext/oci8/tests/imp_res_get_close_3.phpt | 6 ++-- ext/oci8/tests/imp_res_get_cursor.phpt | 6 ++-- ext/oci8/tests/imp_res_get_dbmsoutput.phpt | 8 ++--- ext/oci8/tests/imp_res_get_exec.phpt | 6 ++-- ext/oci8/tests/imp_res_get_none.phpt | 6 ++-- ext/oci8/tests/imp_res_insert.phpt | 6 ++-- ext/oci8/tests/imp_res_lob.phpt | 12 +++---- ext/oci8/tests/imp_res_prefetch.phpt | 6 ++-- ext/oci8/tests/ini_1.phpt | 6 ++-- ext/oci8/tests/lob_001.phpt | Bin 2152 -> 2151 bytes ext/oci8/tests/lob_002.phpt | 2 +- ext/oci8/tests/lob_003.phpt | Bin 1698 -> 1697 bytes ext/oci8/tests/lob_004.phpt | 2 +- ext/oci8/tests/lob_005.phpt | 2 +- ext/oci8/tests/lob_006.phpt | Bin 1766 -> 1765 bytes ext/oci8/tests/lob_007.phpt | 2 +- ext/oci8/tests/lob_008.phpt | 2 +- ext/oci8/tests/lob_009.phpt | 2 +- ext/oci8/tests/lob_010.phpt | 2 +- ext/oci8/tests/lob_011.phpt | 2 +- ext/oci8/tests/lob_012.phpt | 4 +-- ext/oci8/tests/lob_013.phpt | 2 +- ext/oci8/tests/lob_014.phpt | 4 +-- ext/oci8/tests/lob_015.phpt | 2 +- ext/oci8/tests/lob_016.phpt | 2 +- ext/oci8/tests/lob_017.phpt | 2 +- ext/oci8/tests/lob_018.phpt | 2 +- ext/oci8/tests/lob_019.phpt | Bin 1618 -> 1617 bytes ext/oci8/tests/lob_020.phpt | Bin 3146 -> 3145 bytes ext/oci8/tests/lob_021.phpt | 4 +-- ext/oci8/tests/lob_022.phpt | 2 +- ext/oci8/tests/lob_023.phpt | 2 +- ext/oci8/tests/lob_024.phpt | 2 +- ext/oci8/tests/lob_025.phpt | 2 +- ext/oci8/tests/lob_026.phpt | 2 +- ext/oci8/tests/lob_027.phpt | 2 +- ext/oci8/tests/lob_028.phpt | 2 +- ext/oci8/tests/lob_029.phpt | 2 +- ext/oci8/tests/lob_030.phpt | 2 +- ext/oci8/tests/lob_031.phpt | 2 +- ext/oci8/tests/lob_032.phpt | 2 +- ext/oci8/tests/lob_033.phpt | 2 +- ext/oci8/tests/lob_034.phpt | 2 +- ext/oci8/tests/lob_035.phpt | 4 +-- ext/oci8/tests/lob_036.phpt | 2 +- ext/oci8/tests/lob_037.phpt | 2 +- ext/oci8/tests/lob_038.phpt | 2 +- ext/oci8/tests/lob_039.phpt | 2 +- ext/oci8/tests/lob_040.phpt | 6 ++-- ext/oci8/tests/lob_041.phpt | 2 +- ext/oci8/tests/lob_042.phpt | 6 ++-- ext/oci8/tests/lob_043.phpt | 2 +- ext/oci8/tests/lob_044.phpt | 2 +- ext/oci8/tests/lob_aliases.phpt | 2 +- ext/oci8/tests/lob_null.phpt | 20 ++++++------ ext/oci8/tests/lob_temp.phpt | 2 +- ext/oci8/tests/lob_temp1.phpt | 2 +- ext/oci8/tests/lob_temp2.phpt | 2 +- ext/oci8/tests/null_byte_2.phpt | 4 +-- ext/oci8/tests/oci_execute_segfault.phpt | 2 +- ext/oci8/tests/password.phpt | 8 ++--- ext/oci8/tests/password_2.phpt | 8 ++--- ext/oci8/tests/pecl_bug10194.phpt | 4 +-- ext/oci8/tests/pecl_bug10194_blob.phpt | 8 ++--- ext/oci8/tests/pecl_bug10194_blob_64.phpt | 8 ++--- ext/oci8/tests/pecl_bug16035.phpt | 4 +-- ext/oci8/tests/pecl_bug16842.phpt | 2 +- ext/oci8/tests/pecl_bug8816.phpt | 6 ++-- ext/oci8/tests/refcur_prefetch_1.phpt | 6 ++-- ext/oci8/tests/refcur_prefetch_2.phpt | 6 ++-- ext/oci8/tests/refcur_prefetch_3.phpt | 4 +-- ext/oci8/tests/refcur_prefetch_4.phpt | 6 ++-- ext/oci8/tests/statement_cache.phpt | 2 +- ext/oci8/tests/xmltype_01.phpt | 2 +- ext/oci8/tests/xmltype_02.phpt | 6 ++-- 267 files changed, 623 insertions(+), 624 deletions(-) diff --git a/ext/oci8/tests/array_bind_001.phpt b/ext/oci8/tests/array_bind_001.phpt index 0c1644152c2..f1bee56b846 100644 --- a/ext/oci8/tests/array_bind_001.phpt +++ b/ext/oci8/tests/array_bind_001.phpt @@ -1,5 +1,5 @@ --TEST-- -oci_bind_array_by_name() and invalid values 1 +oci_bind_array_by_name() and invalid values 1 --SKIPIF-- --FILE-- @@ -16,15 +16,15 @@ $statement = oci_parse($c, $create); oci_execute($statement); $create_pkg = " -CREATE OR REPLACE PACKAGE ARRAY_BIND_001_PKG AS - TYPE ARRTYPE IS TABLE OF DATE INDEX BY BINARY_INTEGER; - PROCEDURE iobind(c1 IN OUT ARRTYPE); +CREATE OR REPLACE PACKAGE ARRAY_BIND_001_PKG AS + TYPE ARRTYPE IS TABLE OF DATE INDEX BY BINARY_INTEGER; + PROCEDURE iobind(c1 IN OUT ARRTYPE); END ARRAY_BIND_001_PKG;"; $statement = oci_parse($c, $create_pkg); oci_execute($statement); $create_pkg_body = " -CREATE OR REPLACE PACKAGE BODY ARRAY_BIND_001_PKG AS +CREATE OR REPLACE PACKAGE BODY ARRAY_BIND_001_PKG AS CURSOR CUR IS SELECT name FROM bind_test; PROCEDURE iobind(c1 IN OUT ARRTYPE) IS BEGIN diff --git a/ext/oci8/tests/array_bind_002.phpt b/ext/oci8/tests/array_bind_002.phpt index d2b520c78eb..f70ebb3f617 100644 --- a/ext/oci8/tests/array_bind_002.phpt +++ b/ext/oci8/tests/array_bind_002.phpt @@ -16,15 +16,15 @@ $statement = oci_parse($c, $create); oci_execute($statement); $create_pkg = " -CREATE OR REPLACE PACKAGE ARRAY_BIND_002_PKG AS - TYPE ARRTYPE IS TABLE OF DATE INDEX BY BINARY_INTEGER; - PROCEDURE iobind(c1 IN OUT ARRTYPE); +CREATE OR REPLACE PACKAGE ARRAY_BIND_002_PKG AS + TYPE ARRTYPE IS TABLE OF DATE INDEX BY BINARY_INTEGER; + PROCEDURE iobind(c1 IN OUT ARRTYPE); END ARRAY_BIND_002_PKG;"; $statement = oci_parse($c, $create_pkg); oci_execute($statement); $create_pkg_body = " -CREATE OR REPLACE PACKAGE BODY ARRAY_BIND_002_PKG AS +CREATE OR REPLACE PACKAGE BODY ARRAY_BIND_002_PKG AS CURSOR CUR IS SELECT name FROM bind_test; PROCEDURE iobind(c1 IN OUT ARRTYPE) IS BEGIN diff --git a/ext/oci8/tests/array_bind_003.phpt b/ext/oci8/tests/array_bind_003.phpt index bd391db93f1..0de8e68187f 100644 --- a/ext/oci8/tests/array_bind_003.phpt +++ b/ext/oci8/tests/array_bind_003.phpt @@ -4,7 +4,7 @@ oci_bind_array_by_name() and invalid values 3 true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- = 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -46,7 +46,7 @@ var_dump($b); echo "Test 3\n"; -$sql = +$sql = "begin if (:input < 10) then :output := true; @@ -64,7 +64,7 @@ for ($input = 5; $input < 15; ++$input) { echo "Test 4\n"; -$sql = +$sql = "begin if (mod(:userid,2) = 0) then :b := true; @@ -82,7 +82,7 @@ for ($userid = 1; $userid <= 10; ++$userid) { echo "Test 5\n"; -$sql = +$sql = "declare l boolean; begin diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt index bb368fc7da9..84ef14d9574 100644 --- a/ext/oci8/tests/bind_char_1.phpt +++ b/ext/oci8/tests/bind_char_1.phpt @@ -26,7 +26,7 @@ $stmtarray = array( "insert into bind_char_tab values (2, NULL, 'abc')", "insert into bind_char_tab values (3, NULL, 'abc ')" ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -196,7 +196,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_1_11gR1.phpt b/ext/oci8/tests/bind_char_1_11gR1.phpt index 5b22cdc8c4e..317a1db901d 100644 --- a/ext/oci8/tests/bind_char_1_11gR1.phpt +++ b/ext/oci8/tests/bind_char_1_11gR1.phpt @@ -28,7 +28,7 @@ $stmtarray = array( "insert into bind_char_tab values (2, NULL, 'abc')", "insert into bind_char_tab values (3, NULL, 'abc ')" ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -198,7 +198,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt index 57b0c610f1d..3f925e3bbd8 100644 --- a/ext/oci8/tests/bind_char_2.phpt +++ b/ext/oci8/tests/bind_char_2.phpt @@ -25,7 +25,7 @@ $stmtarray = array( "create table bind_char_tab (id number, c1 date)", "insert into bind_char_tab values (1, '2008-04-20')", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -85,7 +85,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt index 438885e12a6..2395b83b886 100644 --- a/ext/oci8/tests/bind_char_2_11gR1.phpt +++ b/ext/oci8/tests/bind_char_2_11gR1.phpt @@ -25,7 +25,7 @@ $stmtarray = array( "create table bind_char_tab (id number, c1 date)", "insert into bind_char_tab values (1, '2008-04-20')", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -85,7 +85,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index af0ad4e682c..8d4707fadd4 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -22,7 +22,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 char) return char as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt index b8f2284830a..fbc13b4a254 100644 --- a/ext/oci8/tests/bind_char_4.phpt +++ b/ext/oci8/tests/bind_char_4.phpt @@ -24,7 +24,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 varchar2) return varchar2 as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index 646b3317a1b..96fcb1e51c7 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -24,7 +24,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 varchar2) return varchar2 as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bind_long.phpt b/ext/oci8/tests/bind_long.phpt index cbd83128cb7..ca19e7edfd2 100644 --- a/ext/oci8/tests/bind_long.phpt +++ b/ext/oci8/tests/bind_long.phpt @@ -4,7 +4,7 @@ bind LONG field true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- --EXPECTF-- -Test 1 insert numbers +Test 1 insert numbers Warning: oci_execute(): ORA-01438: %s in %sbind_misccoltypes_errs.php on line %d array(1) { @@ -128,7 +128,7 @@ array(1) { } } -Test 2 insert numbers +Test 2 insert numbers Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d array(1) { diff --git a/ext/oci8/tests/bind_raw.phpt b/ext/oci8/tests/bind_raw.phpt index c2e8e08768a..a6e6259eef3 100644 --- a/ext/oci8/tests/bind_raw.phpt +++ b/ext/oci8/tests/bind_raw.phpt @@ -4,7 +4,7 @@ bind RAW field true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- = 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/bind_sqltnum_11g.phpt b/ext/oci8/tests/bind_sqltnum_11g.phpt index 1969893604c..3f4a1411a89 100644 --- a/ext/oci8/tests/bind_sqltnum_11g.phpt +++ b/ext/oci8/tests/bind_sqltnum_11g.phpt @@ -4,7 +4,7 @@ Bind with SQLT_NUM diff --git a/ext/oci8/tests/bind_unsupported_1.phpt b/ext/oci8/tests/bind_unsupported_1.phpt index 544b446788e..ba125d99fcb 100644 --- a/ext/oci8/tests/bind_unsupported_1.phpt +++ b/ext/oci8/tests/bind_unsupported_1.phpt @@ -27,7 +27,7 @@ foreach ($types as $t => $v) { $s = oci_parse($c, "select * from dual where dummy = :c1"); $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); + oci_bind_by_name($s, ":c1", $c1, -1, $v); } ?> diff --git a/ext/oci8/tests/bind_unsupported_2.phpt b/ext/oci8/tests/bind_unsupported_2.phpt index b4e2c9b43de..9d0a33df6a5 100644 --- a/ext/oci8/tests/bind_unsupported_2.phpt +++ b/ext/oci8/tests/bind_unsupported_2.phpt @@ -1,8 +1,8 @@ --TEST-- Bind with various unsupported 10g+ bind types --SKIPIF-- - --FILE-- $v) { $s = oci_parse($c, "select * from dual where dummy = :c1"); $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); + oci_bind_by_name($s, ":c1", $c1, -1, $v); } ?> diff --git a/ext/oci8/tests/bind_unsupported_3.phpt b/ext/oci8/tests/bind_unsupported_3.phpt index 5c9dec37295..48b719aa54f 100644 --- a/ext/oci8/tests/bind_unsupported_3.phpt +++ b/ext/oci8/tests/bind_unsupported_3.phpt @@ -1,10 +1,10 @@ --TEST-- -Bind with various bind types not supported by TimesTen +Bind with various bind types not supported by TimesTen --SKIPIF-- false, 'timesten' => true); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- $v) { $s = oci_parse($c, "select * from dual where dummy = :c1"); $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); + oci_bind_by_name($s, ":c1", $c1, -1, $v); } ?> diff --git a/ext/oci8/tests/bug26133.phpt b/ext/oci8/tests/bug26133.phpt index 59f8a17f38d..2da5d483d0f 100644 --- a/ext/oci8/tests/bug26133.phpt +++ b/ext/oci8/tests/bug26133.phpt @@ -36,7 +36,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt index 854e5c15909..906195c60f3 100644 --- a/ext/oci8/tests/bug32325.phpt +++ b/ext/oci8/tests/bug32325.phpt @@ -4,7 +4,7 @@ Bug #32325 (Cannot retrieve collection using OCI8) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- writetemporary("", OCI_TEMP_CLOB); -$success = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS); +$query = "UPDATE bug37220_tab + SET bug37220_tab.mycolumn = updateXML(bug37220_tab.mycolumn,'/THETAG',xmltype.createXML(:data)) + WHERE existsNode(bug37220_tab.mycolumn,'/THETAG[@myID=\"1234\"]') = 1"; +$stmt = oci_parse ($c, $query); +$clob = oci_new_descriptor($c, OCI_D_LOB); +oci_bind_by_name($stmt, ':data', $clob, -1, OCI_B_CLOB); +$clob->writetemporary("", OCI_TEMP_CLOB); +$success = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS); oci_free_statement($stmt); -$clob->close(); +$clob->close(); // Query back the change $query = "select * from bug37220_tab"; -$stmt = oci_parse ($c, $query); +$stmt = oci_parse ($c, $query); oci_execute($stmt); diff --git a/ext/oci8/tests/bug37581.phpt b/ext/oci8/tests/bug37581.phpt index a1eeafc7610..39d1168059c 100644 --- a/ext/oci8/tests/bug37581.phpt +++ b/ext/oci8/tests/bug37581.phpt @@ -4,7 +4,7 @@ Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (empty($dbase)) die ("skip requires network connection alias for DB link loopback"); @@ -51,7 +51,7 @@ $stmtarray = array( "insert into bug41069_tab (c1, c2, c3, c4, c5, c6, c7, c9, c10, c12, c15) values (113, 'aaaaaaa', 'bbbbbbbbbb', 'cccccc', 'e', 'f', 'dddd', '12/04/2006', '12/04/2006', 2224, 'zzzzzzz')" ); - + oci8_test_sql_execute($c, $stmtarray); diff --git a/ext/oci8/tests/bug42134.phpt b/ext/oci8/tests/bug42134.phpt index 10b7ef160d2..63091100a1f 100644 --- a/ext/oci8/tests/bug42134.phpt +++ b/ext/oci8/tests/bug42134.phpt @@ -4,7 +4,7 @@ Bug #42134 (Collection error for invalid collection name) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --INI-- oci8.statement_cache_size=20 --FILE-- @@ -24,10 +24,10 @@ $stmtarray = array( end bug42841_proc;", "create or replace package bug43449_pkg is - type cursortype is ref Cursor; + type cursortype is ref Cursor; function testcursor return cursortype; end bug43449_pkg;", - + "create or replace package body bug43449_pkg is function testcursor return cursortype is retCursor cursorType; @@ -50,32 +50,32 @@ function do_bug42841($c) $stmt = oci_parse($c, $sql); $cursor = oci_new_cursor($c); oci_bind_by_name($stmt, ":cursor", $cursor, -1, OCI_B_CURSOR); - + oci_execute($stmt, OCI_DEFAULT); oci_execute($cursor); - + while($row = oci_fetch_array($cursor, OCI_ASSOC + OCI_RETURN_LOBS)) { $data1[] = $row; } - + oci_free_statement($stmt); oci_free_statement($cursor); var_dump($data1); - + echo "Second attempt\n"; - + $sql = "BEGIN bug42841_proc(:cursor); END;"; $stmt = oci_parse($c, $sql); $cursor = oci_new_cursor($c); oci_bind_by_name($stmt, ":cursor", $cursor, -1, OCI_B_CURSOR); - + oci_execute($stmt, OCI_DEFAULT); oci_execute($cursor); - + while($row = oci_fetch_array($cursor, OCI_ASSOC + OCI_RETURN_LOBS)) { $data2[] = $row; } - + oci_free_statement($stmt); oci_free_statement($cursor); var_dump($data2); @@ -90,19 +90,19 @@ function do_bug43449($c) } function bug43449_getCur($c) -{ +{ $cur = oci_new_cursor($c); $stmt = oci_parse($c, 'begin :cur := bug43449_pkg.testcursor; end;'); oci_bind_by_name($stmt, ':cur', $cur, -1, OCI_B_CURSOR); oci_execute($stmt, OCI_DEFAULT); oci_execute($cur, OCI_DEFAULT); - + $ret = array(); - + while (ocifetchinto($cur, $row, OCI_ASSOC)) { $ret[] = $row; } - + oci_free_statement($cur); oci_free_statement($stmt); return $ret; diff --git a/ext/oci8/tests/bug43492.phpt b/ext/oci8/tests/bug43492.phpt index e84fa42556c..7c91ea22b64 100644 --- a/ext/oci8/tests/bug43492.phpt +++ b/ext/oci8/tests/bug43492.phpt @@ -4,7 +4,7 @@ Bug #43492 (Nested cursor leaks) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); diff --git a/ext/oci8/tests/bug44008.phpt b/ext/oci8/tests/bug44008.phpt index faacdc62540..c9930f24398 100644 --- a/ext/oci8/tests/bug44008.phpt +++ b/ext/oci8/tests/bug44008.phpt @@ -4,7 +4,7 @@ Bug #44008 (Incorrect usage of OCI-Lob->close crashes PHP) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); diff --git a/ext/oci8/tests/bug44206.phpt b/ext/oci8/tests/bug44206.phpt index 63805bf6e3a..20c92b0f64c 100644 --- a/ext/oci8/tests/bug44206.phpt +++ b/ext/oci8/tests/bug44206.phpt @@ -4,7 +4,7 @@ Bug #44206 (Test if selecting ref cursors leads to ORA-1000 maximum open cursors true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs: different error handling for this undefined behavior require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- ===DONE=== diff --git a/ext/oci8/tests/bug47281.phpt b/ext/oci8/tests/bug47281.phpt index 0990a95f3bb..60590ca092a 100644 --- a/ext/oci8/tests/bug47281.phpt +++ b/ext/oci8/tests/bug47281.phpt @@ -12,7 +12,7 @@ if (!isset($matches[0]) || )) { die("skip test works only with Oracle 11.2.0.2 or earlier Oracle client libraries"); } -?> +?> --ENV-- NLS_LANG=.AL32UTF8 --FILE-- @@ -25,7 +25,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace procedure bug47281_sp as begin - raise_application_error(-20000, + raise_application_error(-20000, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccDeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeFggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhIjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjKlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllM'); end;" ); diff --git a/ext/oci8/tests/bug51253.phpt b/ext/oci8/tests/bug51253.phpt index b38bc7606b7..b25d393ee23 100644 --- a/ext/oci8/tests/bug51253.phpt +++ b/ext/oci8/tests/bug51253.phpt @@ -4,7 +4,7 @@ Bug #51253 (oci_bind_array_by_name() array references) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --ENV-- NLS_LANG=.AL32UTF8 --FILE-- diff --git a/ext/oci8/tests/bug71148.phpt b/ext/oci8/tests/bug71148.phpt index 44bd0e80078..204aab3c808 100644 --- a/ext/oci8/tests/bug71148.phpt +++ b/ext/oci8/tests/bug71148.phpt @@ -127,7 +127,7 @@ var_dump($cache3); oci_free_statement($stmt); -// Test 6: Bind IN OUT parameter within the same scope of execute +// Test 6: Bind IN OUT parameter within the same scope of execute $sql = "call bindproc(:var1, :var2, :var3)"; $cache1 = 'STR1'; diff --git a/ext/oci8/tests/bug71600.phpt b/ext/oci8/tests/bug71600.phpt index 102c59f81a5..c49dd0ee03d 100644 --- a/ext/oci8/tests/bug71600.phpt +++ b/ext/oci8/tests/bug71600.phpt @@ -4,7 +4,7 @@ Bug #71600 (oci_fetch_all result in segfault when select more than 8 columns) true, 'timesten' => true); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- = 11)) { "grant use on edition myedition1 to $testuser", ); } else { - // Server is Pre 11.2 + // Server is Pre 11.2 $stmtarray = array( "drop user $testuser cascade", "create user $testuser identified by $testpassword", @@ -34,7 +34,7 @@ foreach ($stmtarray as $stmt) { $m = oci_error($s); if (!in_array($m['code'], array( // ignore expected errors 942 // table or view does not exist - , 1918 // user does not exist + , 1918 // user does not exist , 2289 // sequence does not exist , 4080 // trigger does not exist , 38802 // edition does not exist @@ -50,8 +50,8 @@ foreach ($stmtarray as $stmt) { function get_attr($conn,$attr) { - $sel_stmt="select " .$attr. " from v\$session where sid = - (select sid from v\$session where audsid = + $sel_stmt="select " .$attr. " from v\$session where sid = + (select sid from v\$session where audsid = sys_context('userenv','sessionid')) order by 1"; $s2 = oci_parse($conn,$sel_stmt); oci_execute($s2,OCI_DEFAULT); @@ -60,8 +60,8 @@ function get_attr($conn,$attr) } } -/* Pass $conn_type=1 for a connection with oci_connect() - Pass $conn_type=2 for ooci_pconnect +/* Pass $conn_type=1 for a connection with oci_connect() + Pass $conn_type=2 for ooci_pconnect Default will give a oci_new_connect */ function get_conn($conn_type) @@ -87,23 +87,23 @@ function get_conn($conn_type) function set_attr($conn,$attr,$sufix) { - if (!strcmp($attr,'MODULE')) + if (!strcmp($attr,'MODULE')) $r = oci_set_module_name($conn,'PHP TEST'.$sufix); - else if (!strcmp($attr,'ACTION')) + else if (!strcmp($attr,'ACTION')) $r = oci_set_action($conn,'TASK'.$sufix); - else if (!strcmp($attr,'CLIENT_INFO')) + else if (!strcmp($attr,'CLIENT_INFO')) $r = oci_set_client_info($conn,'INFO1'.$sufix); - else if (!strcmp($attr,'CLIENT_IDENTIFIER')) + else if (!strcmp($attr,'CLIENT_IDENTIFIER')) $r = oci_set_client_identifier($conn,'ID00'.$sufix); else echo "Pass one of the above four attributes!!!\n"; if ($r) { echo "Value of $attr has been set successfully\n"; } - + //Do a round-trip here oci_server_version($conn); - return $r; + return $r; } function set_edit_attr($value) @@ -126,7 +126,7 @@ function get_edit_attr ($conn) { function get_sys_attr($conn,$attr) { - $sel_stmt="select " .$attr. " from v\$session where sid = + $sel_stmt="select " .$attr. " from v\$session where sid = (select sid from v\$session where audsid = sys_context('userenv','sessionid')) order by 1"; $s2 = oci_parse($conn,$sel_stmt); oci_execute($s2,OCI_DEFAULT); @@ -141,7 +141,7 @@ function clean_up($c) { "drop edition myedition cascade", "drop user " . $GLOBALS['testuser'] . " cascade", ); - + foreach ($stmtarray as $stmt) { $s = oci_parse($c, $stmt); @oci_execute($s); diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt index 745b1cd93f9..d16e10f61cb 100644 --- a/ext/oci8/tests/conn_attr_1.phpt +++ b/ext/oci8/tests/conn_attr_1.phpt @@ -1,7 +1,7 @@ --TEST-- Set and get of connection attributes with all types of connections. --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); @@ -18,7 +18,7 @@ if (!(isset($matches[0]) && $matches[1] >= 10)) { true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); @@ -20,7 +20,7 @@ oci8.privileged_connect = On = 10)) { = 2) || ($matches[1] >= 12) ))) { @@ -22,7 +22,7 @@ if (!(isset($matches[0]) && = 10)) { true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- ===DONE=== ---EXPECT-- +--EXPECT-- array(2) { [0]=> string(1) "1" diff --git a/ext/oci8/tests/cursor_bind_err.phpt b/ext/oci8/tests/cursor_bind_err.phpt index 197aad1d197..3ee539f3d32 100644 --- a/ext/oci8/tests/cursor_bind_err.phpt +++ b/ext/oci8/tests/cursor_bind_err.phpt @@ -4,7 +4,7 @@ binding a cursor (with errors) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { @@ -13,11 +13,11 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } if (!function_exists('oci_set_db_operation')) -{ +{ die("skip function oci_set_db_operation() does not exist"); } ?> @@ -58,4 +58,4 @@ array(1) { string(7) "db_op_1" } ===DONE=== - + diff --git a/ext/oci8/tests/db_op_2.phpt b/ext/oci8/tests/db_op_2.phpt index 05c2269ae0b..10c5700223b 100644 --- a/ext/oci8/tests/db_op_2.phpt +++ b/ext/oci8/tests/db_op_2.phpt @@ -1,8 +1,8 @@ --TEST-- oci_set_db_operation: basic test for end-to-end tracing --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { @@ -13,11 +13,11 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } if (!function_exists('oci_set_db_operation')) -{ +{ die("skip function oci_set_db_operation() does not exist"); } ?> @@ -66,4 +66,4 @@ array(2) { string(7) "db_op_2a" } ===DONE=== - + diff --git a/ext/oci8/tests/dbmsoutput.phpt b/ext/oci8/tests/dbmsoutput.phpt index eaace0fa084..68906aa796c 100644 --- a/ext/oci8/tests/dbmsoutput.phpt +++ b/ext/oci8/tests/dbmsoutput.phpt @@ -4,7 +4,7 @@ PL/SQL: dbms_output true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs (Calling PL/SQL from SQL is not supported in TimesTen) require(dirname(__FILE__).'/skipif.inc'); -?> +?> --INI-- oci8.connection_class=test oci8.old_oci_close_semantics=0 @@ -24,7 +24,7 @@ var_dump($conn1 = oci_connect($user,$password,$dbase)); // Create the package drcp_create_package($conn1); -echo "Test 1b\n"; +echo "Test 1b\n"; // OCI_CONNECT echo " This is with OCI_CONNECT.....\n"; drcp_select_packagevar($conn1); // Returns 0 @@ -35,7 +35,7 @@ echo " Connection conn1 closed....\n"; echo "Test 2\n"; // Second connection should return 0 for the package variable. var_dump($conn2 = oci_connect($user,$password,$dbase)); -echo " Select with connection 2 \n"; +echo " Select with connection 2\n"; drcp_select_packagevar($conn2); // Returns 0 drcp_set_packagevar($conn2,100); @@ -43,7 +43,7 @@ echo "Test 3\n"; // Third connection. There is no oci_close() for conn2 hence this should // return the value set by conn2. var_dump($conn3 = oci_connect($user,$password,$dbase)); -echo " Select with connection 3 \n"; +echo " Select with connection 3\n"; drcp_select_packagevar($conn3); // Returns 100 // Close all the connections @@ -63,7 +63,7 @@ echo " Connection pconn1 closed....\n"; echo "Test 5\n"; var_dump($pconn2 = oci_pconnect($user,$password,$dbase)); -echo " Select with persistent connection 2 \n"; +echo " Select with persistent connection 2\n"; drcp_select_packagevar($pconn2); // Returns 1000 oci_close($pconn2); @@ -80,12 +80,12 @@ Test 1b Connection conn1 closed.... Test 2 resource(%d) of type (oci8 connection) - Select with connection 2 + Select with connection 2 The value of the package variable is 0 Package variable value set to 100 Test 3 resource(%d) of type (oci8 connection) - Select with connection 3 + Select with connection 3 The value of the package variable is 100 Test 4 This is with oci_pconnect()..... @@ -94,7 +94,7 @@ resource(%d) of type (oci8 persistent connection) Connection pconn1 closed.... Test 5 resource(%d) of type (oci8 persistent connection) - Select with persistent connection 2 + Select with persistent connection 2 The value of the package variable is 1000 Done diff --git a/ext/oci8/tests/drcp_connection_class.phpt b/ext/oci8/tests/drcp_connection_class.phpt index c01c144d236..b6ca31ce2a9 100644 --- a/ext/oci8/tests/drcp_connection_class.phpt +++ b/ext/oci8/tests/drcp_connection_class.phpt @@ -2,9 +2,9 @@ DRCP: oci8.connection_class with ini_get() and ini_set() --SKIPIF-- = 11)) { +if (!(isset($matches[0]) && $matches[0] >= 11)) { die("skip works only with Oracle 11g or greater version of Oracle client libraries"); } ?> @@ -16,15 +16,15 @@ oci8.connection_class=test echo "Setting a new connection class now\n"; ini_set('oci8.connection_class',"New cc"); -// Get the New connection class name .Should return New CC +// Get the New connection class name. Should return New CC $new_cc = ini_get('oci8.connection_class'); -echo "The New oci8.connection_class is $new_cc \n"; +echo "The New oci8.connection_class is $new_cc\n"; echo "Done\n"; ?> --EXPECTF-- Setting a new connection class now -The New oci8.connection_class is New cc +The New oci8.connection_class is New cc Done diff --git a/ext/oci8/tests/drcp_pconn_close1.phpt b/ext/oci8/tests/drcp_pconn_close1.phpt index a9b912b26fe..53e7b1e3ef1 100644 --- a/ext/oci8/tests/drcp_pconn_close1.phpt +++ b/ext/oci8/tests/drcp_pconn_close1.phpt @@ -29,9 +29,9 @@ oci_close($conn2); // Compare the resource numbers if ($rn1 === $rn2) - echo "Both connections share a resource : OK \n"; + echo "Both connections share a resource : OK\n"; else - echo "Both connections are different : NOT OK \n"; + echo "Both connections are different : NOT OK\n"; echo "Done\n"; @@ -40,5 +40,5 @@ echo "Done\n"; This is with a OCI_PCONNECT resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) -Both connections share a resource : OK +Both connections share a resource : OK Done diff --git a/ext/oci8/tests/drcp_pconn_close2.phpt b/ext/oci8/tests/drcp_pconn_close2.phpt index 5fd2c2355f6..1c64762018c 100644 --- a/ext/oci8/tests/drcp_pconn_close2.phpt +++ b/ext/oci8/tests/drcp_pconn_close2.phpt @@ -31,9 +31,9 @@ oci_close($conn2); // Compare the resource numbers if ($rn1 === $rn2) - echo "Both connections share a resource : NOT OK \n"; + echo "Both connections share a resource : NOT OK\n"; else - echo "Both connections are different : OK \n"; + echo "Both connections are different : OK\n"; echo "Done\n"; @@ -42,5 +42,5 @@ echo "Done\n"; This is with a OCI_PCONNECT resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) -Both connections are different : OK +Both connections are different : OK Done diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt index a5be162e40e..bc42ad234d2 100644 --- a/ext/oci8/tests/driver_name.phpt +++ b/ext/oci8/tests/driver_name.phpt @@ -1,7 +1,7 @@ --TEST-- Verify that the Driver Name attribute is set --SKIPIF-- -= 2) || ($matches[1] >= 12) ))) { @@ -30,11 +30,11 @@ if (!(isset($matches[0]) && /* In 11.2, there can only be one child edition. So this test will * fail to create the necessary editions if a child edition exists - * already + * already */ $testuser = 'testuser_attr_1'; // Used in conn_attr.inc -$testpassword = 'testuser'; +$testpassword = 'testuser'; require(dirname(__FILE__)."/conn_attr.inc"); @@ -45,18 +45,18 @@ function select_fn($conn) { var_dump($row); } } -/* Create a editon MYEDITION +/* Create a editon MYEDITION create a view view_ed in MYEDITION1. create the same view 'view_ed' with a different definition in MYEDITION. select from both the editions and verify the contents. */ set_edit_attr('MYEDITION'); -$conn = oci_connect($testuser,$testpassword,$dbase); +$conn = oci_connect($testuser,$testpassword,$dbase); if ($conn === false) { $m = oci_error(); die("Error:" . $m['message']); } - + $stmtarray = array( "drop table edit_tab", "create table edit_tab (name varchar2(10),age number,job varchar2(50), salary number)", @@ -73,7 +73,7 @@ select_fn($conn); // Create a different version of view_ed in MYEDITION1. set_edit_attr('MYEDITION1'); -$conn2 = oci_new_connect($testuser,$testpassword,$dbase); +$conn2 = oci_new_connect($testuser,$testpassword,$dbase); $stmt = "create or replace editioning view view_ed as select name,age,job,salary from edit_tab"; $s = oci_parse($conn2, $stmt); oci_execute($s); @@ -83,7 +83,7 @@ get_edit_attr($conn2); select_fn($conn2); // Verify the contents in MYEDITION EDITION. -echo "version of view_ed in MYEDITION \n"; +echo "version of view_ed in MYEDITION\n"; get_edit_attr($conn); select_fn($conn); @@ -135,7 +135,7 @@ array(4) { [3]=> string(%d) "100" } -version of view_ed in MYEDITION +version of view_ed in MYEDITION The value of current EDITION is MYEDITION array(3) { [0]=> diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt index 12e902667e6..6d56f9be5ca 100644 --- a/ext/oci8/tests/edition_2.phpt +++ b/ext/oci8/tests/edition_2.phpt @@ -2,14 +2,14 @@ Set and check Oracle 11gR2 "edition" attribute --SKIPIF-- = 2) || ($matches[1] >= 12) ))) { @@ -33,7 +33,7 @@ if (!(isset($matches[0]) && */ $testuser = 'testuser_ed_2'; // Used in conn_attr.inc -$testpassword = 'testuser'; +$testpassword = 'testuser'; require(dirname(__FILE__)."/conn_attr.inc"); @@ -113,7 +113,7 @@ echo "\n\n**Test 1.7 - Test with ALTER SESSION statement to change the edition * set_edit_attr('MYEDITION'); $c1 = get_conn(3); -echo "get the value set to MYEDITION with oci_set_edition \n"; +echo "get the value set to MYEDITION with oci_set_edition\n"; get_edit_attr($c1); $alter_stmt = "alter session set edition = MYEDITION1"; @@ -123,7 +123,7 @@ oci_commit($c1); echo "Get the value set to MYEDITION1 with alter session\n"; get_edit_attr($c1); -echo " Get the value with a new connection \n"; +echo " Get the value with a new connection\n"; $c2 = get_conn(1); get_edit_attr($c2); @@ -131,7 +131,7 @@ echo " Set the value back using oci-set_edition\n"; set_edit_attr('MYEDITION'); get_edit_attr($c2); -echo " Get the value with a new conenction \n"; +echo " Get the value with a new conenction\n"; $c3 = get_conn(1); get_edit_attr($c3); @@ -225,17 +225,17 @@ The value of current EDITION is MYEDITION1 **Test 1.7 - Test with ALTER SESSION statement to change the edition ******* The value of edition has been successfully set Testing with oci_new_connect() -get the value set to MYEDITION with oci_set_edition +get the value set to MYEDITION with oci_set_edition The value of current EDITION is MYEDITION Get the value set to MYEDITION1 with alter session The value of current EDITION is MYEDITION1 - Get the value with a new connection + Get the value with a new connection Testing with oci_connect() The value of current EDITION is MYEDITION Set the value back using oci-set_edition The value of edition has been successfully set The value of current EDITION is MYEDITION - Get the value with a new conenction + Get the value with a new conenction Testing with oci_connect() The value of current EDITION is MYEDITION diff --git a/ext/oci8/tests/error.phpt b/ext/oci8/tests/error.phpt index 7fedd0ddad6..c3fb2de6640 100644 --- a/ext/oci8/tests/error.phpt +++ b/ext/oci8/tests/error.phpt @@ -4,7 +4,7 @@ oci_error() error message for parsing error true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); diff --git a/ext/oci8/tests/error3.phpt b/ext/oci8/tests/error3.phpt index 8540db250a5..29650439e2b 100644 --- a/ext/oci8/tests/error3.phpt +++ b/ext/oci8/tests/error3.phpt @@ -1,7 +1,7 @@ --TEST-- Maximum Oracle error length --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); // Assume runtime client version is >= compile time client version @@ -21,11 +21,11 @@ echo "Test 1\n"; error_reporting(E_ALL); -$s = oci_parse($c, "declare -s varchar2(4000); -begin +$s = oci_parse($c, "declare +s varchar2(4000); +begin s := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBabcdefghBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'; -raise_application_error(-20333, s); +raise_application_error(-20333, s); end;"); oci_execute($s); diff --git a/ext/oci8/tests/error_bind.phpt b/ext/oci8/tests/error_bind.phpt index 6ee26ee8250..0b039a16d96 100644 --- a/ext/oci8/tests/error_bind.phpt +++ b/ext/oci8/tests/error_bind.phpt @@ -23,7 +23,7 @@ $stmt = oci_parse($c, "insert into bind_test values (:name)"); oci_bind_by_name($stmt, ":name", $name, 10, SQLT_CHR); var_dump(oci_execute($stmt)); -echo "Test 1 - Assign a resource to the bind variable and execute \n"; +echo "Test 1 - Assign a resource to the bind variable and execute\n"; $name=$c; var_dump(oci_execute($stmt)); @@ -50,7 +50,7 @@ echo "Done\n"; --EXPECTF-- Insert value bool(true) -Test 1 - Assign a resource to the bind variable and execute +Test 1 - Assign a resource to the bind variable and execute Warning: oci_execute(): Invalid variable used for bind in %s on line %d bool(false) diff --git a/ext/oci8/tests/error_bind_2.phpt b/ext/oci8/tests/error_bind_2.phpt index 642716887ea..592702b9319 100644 --- a/ext/oci8/tests/error_bind_2.phpt +++ b/ext/oci8/tests/error_bind_2.phpt @@ -1,8 +1,8 @@ --TEST-- Test some more oci_bind_by_name error conditions --SKIPIF-- - true, 'timesten' => true); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/error_bind_3.phpt b/ext/oci8/tests/error_bind_3.phpt index 7522dfe60a5..47ca71dcd13 100644 --- a/ext/oci8/tests/error_bind_3.phpt +++ b/ext/oci8/tests/error_bind_3.phpt @@ -1,8 +1,8 @@ --TEST-- Test some more oci_bind_by_name error conditions --SKIPIF-- - true, 'timesten' => true); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/error_old.phpt b/ext/oci8/tests/error_old.phpt index c6f9cd300d3..8df1ee5df2f 100644 --- a/ext/oci8/tests/error_old.phpt +++ b/ext/oci8/tests/error_old.phpt @@ -4,7 +4,7 @@ ocierror() true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- --EXPECTF-- diff --git a/ext/oci8/tests/fetch_array.phpt b/ext/oci8/tests/fetch_array.phpt index db5c6c554b9..03640e5901c 100644 --- a/ext/oci8/tests/fetch_array.phpt +++ b/ext/oci8/tests/fetch_array.phpt @@ -4,7 +4,7 @@ oci_fetch_array() true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_2.phpt b/ext/oci8/tests/imp_res_2.phpt index 860a5fbb34e..ca92eba3d36 100644 --- a/ext/oci8/tests/imp_res_2.phpt +++ b/ext/oci8/tests/imp_res_2.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: Zero Rows --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_3.phpt b/ext/oci8/tests/imp_res_3.phpt index 0fc4815893d..53c04651282 100644 --- a/ext/oci8/tests/imp_res_3.phpt +++ b/ext/oci8/tests/imp_res_3.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: bigger data size --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_4.phpt b/ext/oci8/tests/imp_res_4.phpt index 762ae772249..d938f9f4cea 100644 --- a/ext/oci8/tests/imp_res_4.phpt +++ b/ext/oci8/tests/imp_res_4.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_fetch --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_5.phpt b/ext/oci8/tests/imp_res_5.phpt index 564a7a37404..7c06dee78f4 100644 --- a/ext/oci8/tests/imp_res_5.phpt +++ b/ext/oci8/tests/imp_res_5.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_fetch_all --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_6.phpt b/ext/oci8/tests/imp_res_6.phpt index f94efe70db9..278c47b3118 100644 --- a/ext/oci8/tests/imp_res_6.phpt +++ b/ext/oci8/tests/imp_res_6.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: alternating oci_fetch_* calls --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_7.phpt b/ext/oci8/tests/imp_res_7.phpt index 05ae5e68579..abcf8aeb1b5 100644 --- a/ext/oci8/tests/imp_res_7.phpt +++ b/ext/oci8/tests/imp_res_7.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: bigger data size --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_call_error.phpt b/ext/oci8/tests/imp_res_call_error.phpt index bae2c47e9ef..774131ee00c 100644 --- a/ext/oci8/tests/imp_res_call_error.phpt +++ b/ext/oci8/tests/imp_res_call_error.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: using SQL 'CALL' --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_cancel.phpt b/ext/oci8/tests/imp_res_cancel.phpt index 663d630dfbe..692a1fabb1a 100644 --- a/ext/oci8/tests/imp_res_cancel.phpt +++ b/ext/oci8/tests/imp_res_cancel.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_cancel --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_close.phpt b/ext/oci8/tests/imp_res_close.phpt index f01205dc48e..de85a3d1ca9 100644 --- a/ext/oci8/tests/imp_res_close.phpt +++ b/ext/oci8/tests/imp_res_close.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_free_statement #1 --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_cursor.phpt b/ext/oci8/tests/imp_res_cursor.phpt index cac0a5d1c0b..6ba1261f257 100644 --- a/ext/oci8/tests/imp_res_cursor.phpt +++ b/ext/oci8/tests/imp_res_cursor.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: nested cursor --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_dbmsoutput.phpt b/ext/oci8/tests/imp_res_dbmsoutput.phpt index 8c9808d96c3..6f1d7cb2157 100644 --- a/ext/oci8/tests/imp_res_dbmsoutput.phpt +++ b/ext/oci8/tests/imp_res_dbmsoutput.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: interleaved with DBMS_OUTPUT --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_field.phpt b/ext/oci8/tests/imp_res_field.phpt index 54b8295cf92..5cb88569ca7 100644 --- a/ext/oci8/tests/imp_res_field.phpt +++ b/ext/oci8/tests/imp_res_field.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: field tests --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_func_error.phpt b/ext/oci8/tests/imp_res_func_error.phpt index 73c0557930c..a5c7e84241d 100644 --- a/ext/oci8/tests/imp_res_func_error.phpt +++ b/ext/oci8/tests/imp_res_func_error.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: test with a PL/SQL function --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_1.phpt b/ext/oci8/tests/imp_res_get_1.phpt index 665f773b573..226f1e557be 100644 --- a/ext/oci8/tests/imp_res_get_1.phpt +++ b/ext/oci8/tests/imp_res_get_1.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_2.phpt b/ext/oci8/tests/imp_res_get_2.phpt index b20b8dd3970..1747e4b4e30 100644 --- a/ext/oci8/tests/imp_res_get_2.phpt +++ b/ext/oci8/tests/imp_res_get_2.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: similar to imp_res_get_1 but with unrolled loop --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_3.phpt b/ext/oci8/tests/imp_res_get_3.phpt index 15b2efaef0d..dd3e141fa57 100644 --- a/ext/oci8/tests/imp_res_get_3.phpt +++ b/ext/oci8/tests/imp_res_get_3.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test 3 --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_4.phpt b/ext/oci8/tests/imp_res_get_4.phpt index ea7fb8775a7..658ec9c050e 100644 --- a/ext/oci8/tests/imp_res_get_4.phpt +++ b/ext/oci8/tests/imp_res_get_4.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved fetches --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_5.phpt b/ext/oci8/tests/imp_res_get_5.phpt index 3cfa0967a21..cee25cc5095 100644 --- a/ext/oci8/tests/imp_res_get_5.phpt +++ b/ext/oci8/tests/imp_res_get_5.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: get from wrong statement --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -27,7 +27,7 @@ function print_row($row) echo "\n"; } -$plsql = +$plsql = "declare c1 sys_refcursor; begin diff --git a/ext/oci8/tests/imp_res_get_all.phpt b/ext/oci8/tests/imp_res_get_all.phpt index d2dcbea6c78..02ea0cbe1f5 100644 --- a/ext/oci8/tests/imp_res_get_all.phpt +++ b/ext/oci8/tests/imp_res_get_all.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_fetch_all --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_cancel.phpt b/ext/oci8/tests/imp_res_get_cancel.phpt index 7dbcecbfe9d..a9a6d723230 100644 --- a/ext/oci8/tests/imp_res_get_cancel.phpt +++ b/ext/oci8/tests/imp_res_get_cancel.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_cancel --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -53,4 +53,4 @@ Test 1 1 3 ===DONE=== - + diff --git a/ext/oci8/tests/imp_res_get_close_1.phpt b/ext/oci8/tests/imp_res_get_close_1.phpt index 0e3b3b0c13d..20f46b4f1cf 100644 --- a/ext/oci8/tests/imp_res_get_close_1.phpt +++ b/ext/oci8/tests/imp_res_get_close_1.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #1 --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -21,7 +21,7 @@ require(dirname(__FILE__).'/connect.inc'); // Initialization -$plsql = +$plsql = "declare c1 sys_refcursor; begin diff --git a/ext/oci8/tests/imp_res_get_close_2.phpt b/ext/oci8/tests/imp_res_get_close_2.phpt index 419a4f4f053..efc0e6da607 100644 --- a/ext/oci8/tests/imp_res_get_close_2.phpt +++ b/ext/oci8/tests/imp_res_get_close_2.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #2 --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_close_3.phpt b/ext/oci8/tests/imp_res_get_close_3.phpt index 4793a6c8820..3cf0b503de5 100644 --- a/ext/oci8/tests/imp_res_get_close_3.phpt +++ b/ext/oci8/tests/imp_res_get_close_3.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #3 --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_cursor.phpt b/ext/oci8/tests/imp_res_get_cursor.phpt index ccdb6f54903..e00472d18ee 100644 --- a/ext/oci8/tests/imp_res_get_cursor.phpt +++ b/ext/oci8/tests/imp_res_get_cursor.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: nested cursor --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt index cbc2389e468..a20d1eaf69f 100644 --- a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt +++ b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved with DBMS_OUTPUT --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -153,4 +153,4 @@ array(3) { string(6) "Line 3" } ===DONE=== - + diff --git a/ext/oci8/tests/imp_res_get_exec.phpt b/ext/oci8/tests/imp_res_get_exec.phpt index dbd8f3ef3a2..d36fb661363 100644 --- a/ext/oci8/tests/imp_res_get_exec.phpt +++ b/ext/oci8/tests/imp_res_get_exec.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: Execute twice --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_get_none.phpt b/ext/oci8/tests/imp_res_get_none.phpt index 981f4945e24..f97b7987507 100644 --- a/ext/oci8/tests/imp_res_get_none.phpt +++ b/ext/oci8/tests/imp_res_get_none.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: no implicit results --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_insert.phpt b/ext/oci8/tests/imp_res_insert.phpt index d9c0705b554..2fea690607f 100644 --- a/ext/oci8/tests/imp_res_insert.phpt +++ b/ext/oci8/tests/imp_res_insert.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: Commit modes --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/imp_res_lob.phpt b/ext/oci8/tests/imp_res_lob.phpt index 247803581d2..3e52fb117e9 100644 --- a/ext/oci8/tests/imp_res_lob.phpt +++ b/ext/oci8/tests/imp_res_lob.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: LOBs --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> @@ -35,7 +35,7 @@ $stmtarray = array( open c1 for select * from imp_res_lob_tab order by 1; dbms_sql.return_result(c1); open c1 for select * from dual; - dbms_sql.return_result(c1); + dbms_sql.return_result(c1); open c1 for select c2 from imp_res_lob_tab order by c1; dbms_sql.return_result(c1); end;" @@ -50,7 +50,7 @@ $s = oci_parse($c, "begin imp_res_lob_proc(); end;"); oci_execute($s); while (($row = oci_fetch_row($s)) != false) { foreach ($row as $item) { - if (is_object($item)) { + if (is_object($item)) { echo " " . $item->load(); } else { echo " " . $item; @@ -64,7 +64,7 @@ $s = oci_parse($c, "begin imp_res_lob_proc(); end;"); oci_execute($s); $row = oci_fetch_row($s); foreach ($row as $item) { - if (is_object($item)) { + if (is_object($item)) { echo " " . $item->load(); } else { echo " " . $item; diff --git a/ext/oci8/tests/imp_res_prefetch.phpt b/ext/oci8/tests/imp_res_prefetch.phpt index 5acdd518e58..8daa2ff4148 100644 --- a/ext/oci8/tests/imp_res_prefetch.phpt +++ b/ext/oci8/tests/imp_res_prefetch.phpt @@ -1,8 +1,8 @@ --TEST-- Oracle Database 12c Implicit Result Sets: basic test --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); @@ -10,7 +10,7 @@ if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); } preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { +if (!(isset($matches[0]) && $matches[0] >= 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/ini_1.phpt b/ext/oci8/tests/ini_1.phpt index 2fba79813e8..0c3597b6194 100644 --- a/ext/oci8/tests/ini_1.phpt +++ b/ext/oci8/tests/ini_1.phpt @@ -1,10 +1,10 @@ --TEST-- Test OCI8 php.ini settings --SKIPIF-- -= 11)) { +if (!(isset($matches[0]) && $matches[0] >= 11)) { die("skip works only with Oracle 11g or greater version of Oracle client libraries"); } ?> diff --git a/ext/oci8/tests/lob_001.phpt b/ext/oci8/tests/lob_001.phpt index cb94bfae1327af8427a45b16f06f629b719389f3..a6967fa787f87bd0fac046f5c62286bdc56b12cc 100644 GIT binary patch delta 10 ScmaDM@LXWR?u~oaumb=dumxKH delta 12 UcmaDZ@Iqk1ZbpTTyVtM-042u-djJ3c diff --git a/ext/oci8/tests/lob_002.phpt b/ext/oci8/tests/lob_002.phpt index 912c27b9892..f2c585b817a 100644 --- a/ext/oci8/tests/lob_002.phpt +++ b/ext/oci8/tests/lob_002.phpt @@ -4,7 +4,7 @@ oci_lob_write() and friends (with errors) true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- RWp^b-?*#I4Z1l0fl delta 12 TcmaFL`;2$OAx4Fbhm_d>B$5R6 diff --git a/ext/oci8/tests/lob_007.phpt b/ext/oci8/tests/lob_007.phpt index 1ca236ea28a..3553502abb2 100644 --- a/ext/oci8/tests/lob_007.phpt +++ b/ext/oci8/tests/lob_007.phpt @@ -4,7 +4,7 @@ oci_lob_write()/size()/load() true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- {x diff --git a/ext/oci8/tests/lob_020.phpt b/ext/oci8/tests/lob_020.phpt index 3faa89ff716a8f10fe46b4f93dbe20091a3342a3..5f430675acf60c91ff8be5de1d4c657fc01af54a 100644 GIT binary patch delta 10 RcmX>laZ+N!$&IHPxB(q71tS0e delta 12 TcmX>paY|ysNk)Z@CmXl{Bnt&Y diff --git a/ext/oci8/tests/lob_021.phpt b/ext/oci8/tests/lob_021.phpt index 16b389dd05f..0cf73c36ebd 100644 --- a/ext/oci8/tests/lob_021.phpt +++ b/ext/oci8/tests/lob_021.phpt @@ -1,10 +1,10 @@ --TEST-- -oci_lob_free()/close() +oci_lob_free()/close() --SKIPIF-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- ---EXPECTF-- +--EXPECTF-- Test 1. Check how many rows in the table array(1) { ["NUMROWS"]=> diff --git a/ext/oci8/tests/lob_030.phpt b/ext/oci8/tests/lob_030.phpt index d7fd21b961c..013a3f0c450 100644 --- a/ext/oci8/tests/lob_030.phpt +++ b/ext/oci8/tests/lob_030.phpt @@ -4,7 +4,7 @@ Test piecewise fetch of CLOBs equal to, and larger than PHP_OCI_LOB_BUFFER_SIZE true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- read(), LOB->seek() and LOB->tell() with nul bytes in data true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- write() for multiple inserts true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- tell() . "\n"; echo "Data: " . $row[$i][0]->read(12) . "\n"; } - + echo "Done\n"; ?> diff --git a/ext/oci8/tests/lob_041.phpt b/ext/oci8/tests/lob_041.phpt index c5c0a209f3c..944952982fb 100644 --- a/ext/oci8/tests/lob_041.phpt +++ b/ext/oci8/tests/lob_041.phpt @@ -4,7 +4,7 @@ Check LOBS are valid after statement free true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- import("does_not_exist")); var_dump($blob->saveFile("does_not_exist")); require(dirname(__FILE__).'/drop_table.inc'); - + echo "Done\n"; - + ?> --EXPECTF-- object(OCI-Lob)#%d (1) { diff --git a/ext/oci8/tests/lob_043.phpt b/ext/oci8/tests/lob_043.phpt index 4cd159510b2..5d723be4478 100644 --- a/ext/oci8/tests/lob_043.phpt +++ b/ext/oci8/tests/lob_043.phpt @@ -16,7 +16,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "drop table lob_043_tab", "create table lob_043_tab(id number, c1 clob)", - "begin + "begin for i in 1..50000 loop insert into lob_043_tab (id, c1) values (i, i || ' abcdefghijklmnopq'); end loop; diff --git a/ext/oci8/tests/lob_044.phpt b/ext/oci8/tests/lob_044.phpt index 28599cc33b5..a4ea684ae00 100644 --- a/ext/oci8/tests/lob_044.phpt +++ b/ext/oci8/tests/lob_044.phpt @@ -4,7 +4,7 @@ oci_lob_truncate() with default parameter value true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- close(); } @@ -57,7 +57,7 @@ $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo $m['message'], "\n"; -} +} else { $lob->close(); } @@ -71,7 +71,7 @@ $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo $m['message'], "\n"; -} +} else { $lob->close(); } @@ -87,7 +87,7 @@ $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo $m['message'], "\n"; -} +} else { $lob->close(); } @@ -101,7 +101,7 @@ $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo $m['message'], "\n"; -} +} else { $lob->close(); } @@ -115,7 +115,7 @@ $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo $m['message'], "\n"; -} +} else { $lob->close(); } @@ -188,7 +188,7 @@ $s = oci_parse($c, 'drop table lob_null_tab'); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Temporary CLOB: NULL Temporary CLOB: '' Temporary CLOB: text diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt index 9a07fb5ac0b..513496942ba 100644 --- a/ext/oci8/tests/lob_temp.phpt +++ b/ext/oci8/tests/lob_temp.phpt @@ -4,7 +4,7 @@ temporary lobs true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --INI-- display_errors = On error_reporting = E_WARNING @@ -28,7 +28,7 @@ $s = oci_parse($c, "select * from dual where :bv = 1"); $bv = 1; oci_bind_by_name($s, ":bv\0:bv", $bv); oci_execute($s); - + ?> ===DONE=== diff --git a/ext/oci8/tests/oci_execute_segfault.phpt b/ext/oci8/tests/oci_execute_segfault.phpt index 59eb8013e9a..08a41a82eca 100644 --- a/ext/oci8/tests/oci_execute_segfault.phpt +++ b/ext/oci8/tests/oci_execute_segfault.phpt @@ -4,7 +4,7 @@ oci_execute() segfault after repeated bind of LOB descriptor true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- --FILE-- @@ -35,7 +35,7 @@ var_dump($c2); $rn2 = (int)$c2; // Despite using the old password this connect should succeed and return the original resource -$c3 = oci_connect("testuser_pw", "testuserpwd", $dbase); +$c3 = oci_connect("testuser_pw", "testuserpwd", $dbase); var_dump($c3); $rn3 = (int)$c3; diff --git a/ext/oci8/tests/password_2.phpt b/ext/oci8/tests/password_2.phpt index 13da9ff7b26..62fddb4c362 100644 --- a/ext/oci8/tests/password_2.phpt +++ b/ext/oci8/tests/password_2.phpt @@ -1,11 +1,11 @@ --TEST-- oci_password_change() for persistent connections --SKIPIF-- - --FILE-- @@ -34,7 +34,7 @@ var_dump($c2); $rn2 = (int)$c2; // Despite using the old password this connect should succeed and return the original resource -$c3 = oci_pconnect("testuser_pw2", "testuserpwd", $dbase); +$c3 = oci_pconnect("testuser_pw2", "testuserpwd", $dbase); var_dump($c3); $rn3 = (int)$c3; diff --git a/ext/oci8/tests/pecl_bug10194.phpt b/ext/oci8/tests/pecl_bug10194.phpt index 3c1c7887c2f..42df6905db7 100644 --- a/ext/oci8/tests/pecl_bug10194.phpt +++ b/ext/oci8/tests/pecl_bug10194.phpt @@ -1,5 +1,5 @@ --TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) +PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) --SKIPIF-- true, 'timesten' => false); // test runs on these DBs @@ -8,7 +8,7 @@ if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (getenv("USE_ZEND_ALLOC") === "0") { die("skip Zend MM disabled"); } -?> +?> --INI-- memory_limit=10M --FILE-- diff --git a/ext/oci8/tests/pecl_bug10194_blob.phpt b/ext/oci8/tests/pecl_bug10194_blob.phpt index 96f94bcf4c1..aab1cf88821 100644 --- a/ext/oci8/tests/pecl_bug10194_blob.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob.phpt @@ -1,5 +1,5 @@ --TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) +PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) --SKIPIF-- true, 'timesten' => false); // test runs on these DBs @@ -9,14 +9,14 @@ if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (getenv("USE_ZEND_ALLOC") === "0") { die("skip Zend MM disabled"); } -?> +?> --INI-- memory_limit=3M --FILE-- ---EXPECTF-- +--EXPECTF-- Before load() Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/pecl_bug10194_blob_64.phpt b/ext/oci8/tests/pecl_bug10194_blob_64.phpt index e1a4cc034e2..ca5e568be37 100644 --- a/ext/oci8/tests/pecl_bug10194_blob_64.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob_64.phpt @@ -1,7 +1,7 @@ --TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) +PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) --SKIPIF-- - true, 'timesten' => false); // test runs on thes require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); @@ -16,7 +16,7 @@ memory_limit=6M ---EXPECTF-- +--EXPECTF-- Before load() Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/pecl_bug16035.phpt b/ext/oci8/tests/pecl_bug16035.phpt index 29ff6439d1c..d557e0a5c03 100644 --- a/ext/oci8/tests/pecl_bug16035.phpt +++ b/ext/oci8/tests/pecl_bug16035.phpt @@ -1,8 +1,8 @@ --TEST-- PECL Bug #16035 (Crash with Oracle 10.2 connecting with a character set but ORACLE_HOME is not set) --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --INI-- error_reporting = E_WARNING --FILE-- diff --git a/ext/oci8/tests/pecl_bug8816.phpt b/ext/oci8/tests/pecl_bug8816.phpt index 71771b21004..9e151f6a8c6 100644 --- a/ext/oci8/tests/pecl_bug8816.phpt +++ b/ext/oci8/tests/pecl_bug8816.phpt @@ -4,7 +4,7 @@ PECL Bug #8816 (issue in php_oci_statement_fetch with more than one piecewise co true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -?> +?> --FILE-- = 10))) { die("skip expected output only valid when using Oracle 10g or greater database server"); } @@ -21,7 +21,7 @@ if (!(isset($matches[0]) && = 10))) { die("skip expected output only valid when using Oracle 10g or greater database server"); } @@ -21,7 +21,7 @@ if (!(isset($matches[0]) && = 2) || ($matches[1] >= 12) ))) { @@ -57,7 +57,7 @@ oci_execute($s); $data = oci_fetch_array($s); oci_execute($data['CURS1']); -// Calculate round-trips +// Calculate round-trips $initial_rt = print_roundtrips($c); for ($i = 0;$i<10;$i++) { echo "Fetch Row using Nested cursor Query\n"; diff --git a/ext/oci8/tests/refcur_prefetch_4.phpt b/ext/oci8/tests/refcur_prefetch_4.phpt index 131ae6ad6b0..8ec4c983a30 100644 --- a/ext/oci8/tests/refcur_prefetch_4.phpt +++ b/ext/oci8/tests/refcur_prefetch_4.phpt @@ -5,7 +5,7 @@ Prefetch with REF cursor. Test No 4 if (!extension_loaded('oci8')) die("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && +if (!(isset($matches[0]) && ($matches[1] >= 10))) { die("skip expected output only valid when using Oracle 10g or greater database server"); } @@ -21,7 +21,7 @@ if (!(isset($matches[0]) && true, 'timesten' => true); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); ?> diff --git a/ext/oci8/tests/xmltype_01.phpt b/ext/oci8/tests/xmltype_01.phpt index 1855ed08873..8fb6206f26d 100644 --- a/ext/oci8/tests/xmltype_01.phpt +++ b/ext/oci8/tests/xmltype_01.phpt @@ -1,7 +1,7 @@ --TEST-- Basic XMLType test --SKIPIF-- - true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); diff --git a/ext/oci8/tests/xmltype_02.phpt b/ext/oci8/tests/xmltype_02.phpt index 9a17f5db180..a21e5e47ef0 100644 --- a/ext/oci8/tests/xmltype_02.phpt +++ b/ext/oci8/tests/xmltype_02.phpt @@ -5,7 +5,7 @@ Basic XMLType test #2 $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (!extension_loaded("simplexml")) die ("skip no simplexml extension"); -?> +?> --FILE-- Date: Mon, 24 Sep 2018 15:59:52 +1000 Subject: [PATCH 27/42] Sync EXPECT usage with PHP-7.3 --- ext/oci8/tests/array_bind_005.phpt | 2 +- ext/oci8/tests/array_bind_014.phpt | 2 +- ext/oci8/tests/b47243_1.phpt | 2 +- ext/oci8/tests/b47243_2.phpt | 2 +- ext/oci8/tests/b47243_3.phpt | 2 +- ext/oci8/tests/bind_boolean_1.phpt | 2 +- ext/oci8/tests/bind_char_3.phpt | 2 +- ext/oci8/tests/bind_char_3_11gR1.phpt | 2 +- ext/oci8/tests/bind_char_4.phpt | 2 +- ext/oci8/tests/bind_char_4_11gR1.phpt | 2 +- ext/oci8/tests/bind_empty.phpt | 2 +- ext/oci8/tests/bind_misccoltypes.phpt | 2 +- ext/oci8/tests/bind_query.phpt | 2 +- ext/oci8/tests/bind_sqltafc.phpt | 2 +- ext/oci8/tests/bind_sqltchr_1.phpt | 2 +- ext/oci8/tests/bind_sqltchr_2.phpt | 2 +- ext/oci8/tests/bind_sqltint.phpt | 2 +- ext/oci8/tests/bug27303_3.phpt | 2 +- ext/oci8/tests/bug37581.phpt | 2 +- ext/oci8/tests/bug38161.phpt | 2 +- ext/oci8/tests/bug40078.phpt | 2 +- ext/oci8/tests/bug42496_1.phpt | 2 +- ext/oci8/tests/bug42496_2.phpt | 2 +- ext/oci8/tests/bug46994.phpt | 2 +- ext/oci8/tests/bug47281.phpt | 2 +- ext/oci8/tests/bug47281_tt.phpt | 2 +- ext/oci8/tests/bug68298.phpt | 2 +- ext/oci8/tests/bug70700.phpt | 2 +- ext/oci8/tests/bug71422.phpt | 2 +- ext/oci8/tests/bug74625.phpt | 2 +- ext/oci8/tests/close.phpt | 2 +- ext/oci8/tests/coll_019.phpt | 3 --- ext/oci8/tests/commit_001.phpt | 2 +- ext/oci8/tests/conn_attr_5.phpt | 2 +- ext/oci8/tests/connect_scope1.phpt | 2 +- ext/oci8/tests/connect_scope2.phpt | 2 +- ext/oci8/tests/db_op_1.phpt | 2 +- ext/oci8/tests/db_op_2.phpt | 2 +- ext/oci8/tests/dbmsoutput.phpt | 2 +- ext/oci8/tests/define5.phpt | 2 +- ext/oci8/tests/define_old.phpt | 2 +- ext/oci8/tests/details.inc | 4 ++-- ext/oci8/tests/drcp_connection_class.phpt | 2 +- ext/oci8/tests/drcp_functions.inc | 8 ++++---- ext/oci8/tests/dupcolnames.phpt | 2 +- ext/oci8/tests/error_set.phpt | 2 +- ext/oci8/tests/fetch.phpt | 2 +- ext/oci8/tests/fetch_all1.phpt | 2 +- ext/oci8/tests/fetch_all3.phpt | 2 +- ext/oci8/tests/fetch_all4.phpt | 2 +- ext/oci8/tests/fetch_all5.phpt | 2 +- ext/oci8/tests/fetch_into.phpt | 2 +- ext/oci8/tests/fetch_row.phpt | 2 +- ext/oci8/tests/imp_res_2.phpt | 2 +- ext/oci8/tests/imp_res_3.phpt | 2 +- ext/oci8/tests/imp_res_7.phpt | 2 +- ext/oci8/tests/imp_res_cancel.phpt | 2 +- ext/oci8/tests/imp_res_cursor.phpt | 2 +- ext/oci8/tests/imp_res_dbmsoutput.phpt | 2 +- ext/oci8/tests/imp_res_field.phpt | 2 +- ext/oci8/tests/imp_res_get_1.phpt | 2 +- ext/oci8/tests/imp_res_get_2.phpt | 2 +- ext/oci8/tests/imp_res_get_3.phpt | 2 +- ext/oci8/tests/imp_res_get_5.phpt | 2 +- ext/oci8/tests/imp_res_get_all.phpt | 2 +- ext/oci8/tests/imp_res_get_cancel.phpt | 2 +- ext/oci8/tests/imp_res_get_close_3.phpt | 2 +- ext/oci8/tests/imp_res_get_cursor.phpt | 2 +- ext/oci8/tests/imp_res_get_dbmsoutput.phpt | 2 +- ext/oci8/tests/imp_res_get_exec.phpt | 2 +- ext/oci8/tests/imp_res_get_none.phpt | 2 +- ext/oci8/tests/imp_res_insert.phpt | 2 +- ext/oci8/tests/imp_res_lob.phpt | 2 +- ext/oci8/tests/imp_res_prefetch.phpt | 2 +- ext/oci8/tests/ini_1.phpt | 2 +- ext/oci8/tests/lob_018.phpt | 2 +- ext/oci8/tests/lob_029.phpt | 2 +- ext/oci8/tests/lob_030.phpt | 2 +- ext/oci8/tests/lob_031.phpt | 2 +- ext/oci8/tests/lob_043.phpt | 2 +- ext/oci8/tests/lob_044.phpt | 2 +- ext/oci8/tests/lob_null.phpt | 4 ++-- ext/oci8/tests/lob_temp.phpt | 2 +- ext/oci8/tests/lob_temp1.phpt | 2 +- ext/oci8/tests/lob_temp2.phpt | 2 +- ext/oci8/tests/minfo.phpt | 2 +- ext/oci8/tests/privileged_connect.phpt | 2 +- ext/oci8/tests/privileged_connect1.phpt | 2 +- ext/oci8/tests/statement_type.phpt | 2 +- ext/oci8/tests/testping.phpt | 2 +- ext/oci8/tests/uncommitted.phpt | 2 +- 91 files changed, 95 insertions(+), 98 deletions(-) diff --git a/ext/oci8/tests/array_bind_005.phpt b/ext/oci8/tests/array_bind_005.phpt index 7aa87ec8e5e..31d368d661c 100644 --- a/ext/oci8/tests/array_bind_005.phpt +++ b/ext/oci8/tests/array_bind_005.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- array(5) { [0]=> string(0) "" diff --git a/ext/oci8/tests/array_bind_014.phpt b/ext/oci8/tests/array_bind_014.phpt index 51346263a3c..8a88aff33be 100644 --- a/ext/oci8/tests/array_bind_014.phpt +++ b/ext/oci8/tests/array_bind_014.phpt @@ -60,7 +60,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- array(5) { [0]=> int(5) diff --git a/ext/oci8/tests/b47243_1.phpt b/ext/oci8/tests/b47243_1.phpt index f6f348e4450..711c3f79c95 100644 --- a/ext/oci8/tests/b47243_1.phpt +++ b/ext/oci8/tests/b47243_1.phpt @@ -21,5 +21,5 @@ oci_fetch_all($s, $r); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- ===DONE=== diff --git a/ext/oci8/tests/b47243_2.phpt b/ext/oci8/tests/b47243_2.phpt index 7481d858c04..0a71760b604 100644 --- a/ext/oci8/tests/b47243_2.phpt +++ b/ext/oci8/tests/b47243_2.phpt @@ -22,5 +22,5 @@ oci_free_statement($s); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- ===DONE=== diff --git a/ext/oci8/tests/b47243_3.phpt b/ext/oci8/tests/b47243_3.phpt index 3d597cc388f..20e94b7676f 100644 --- a/ext/oci8/tests/b47243_3.phpt +++ b/ext/oci8/tests/b47243_3.phpt @@ -23,5 +23,5 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- ===DONE=== diff --git a/ext/oci8/tests/bind_boolean_1.phpt b/ext/oci8/tests/bind_boolean_1.phpt index a080e7d7f72..35da536c056 100644 --- a/ext/oci8/tests/bind_boolean_1.phpt +++ b/ext/oci8/tests/bind_boolean_1.phpt @@ -102,7 +102,7 @@ var_dump($b1, $b2); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 bool(true) bool(false) diff --git a/ext/oci8/tests/bind_char_3.phpt b/ext/oci8/tests/bind_char_3.phpt index 9ff09551afe..8c86d4dfae4 100644 --- a/ext/oci8/tests/bind_char_3.phpt +++ b/ext/oci8/tests/bind_char_3.phpt @@ -243,7 +243,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default Executing: Oci_execute error ORA-6502 diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index 8d4707fadd4..4ab77c6a5c0 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -243,7 +243,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default Executing: Oci_execute error ORA-6502 diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt index fbc13b4a254..0e380ec5f08 100644 --- a/ext/oci8/tests/bind_char_4.phpt +++ b/ext/oci8/tests/bind_char_4.phpt @@ -245,7 +245,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default Executing: Oci_execute error ORA-6502 diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index 96fcb1e51c7..cc1276181da 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -245,7 +245,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default Executing: Oci_execute error ORA-6502 diff --git a/ext/oci8/tests/bind_empty.phpt b/ext/oci8/tests/bind_empty.phpt index 4c6c07e3c04..90e7679371d 100644 --- a/ext/oci8/tests/bind_empty.phpt +++ b/ext/oci8/tests/bind_empty.phpt @@ -91,7 +91,7 @@ $statement = oci_parse($c, $drop); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 bool(true) Test 2 diff --git a/ext/oci8/tests/bind_misccoltypes.phpt b/ext/oci8/tests/bind_misccoltypes.phpt index 703bd28c245..cc2a269aee4 100644 --- a/ext/oci8/tests/bind_misccoltypes.phpt +++ b/ext/oci8/tests/bind_misccoltypes.phpt @@ -270,7 +270,7 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- TEST86 insert all ORATYPE values TEST87 SELECT all values using DEFINEs diff --git a/ext/oci8/tests/bind_query.phpt b/ext/oci8/tests/bind_query.phpt index e4edc93299c..df1d0204cbf 100644 --- a/ext/oci8/tests/bind_query.phpt +++ b/ext/oci8/tests/bind_query.phpt @@ -64,7 +64,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(1) { [0]=> diff --git a/ext/oci8/tests/bind_sqltafc.phpt b/ext/oci8/tests/bind_sqltafc.phpt index 8d2ce2ae61b..8243851eb3e 100644 --- a/ext/oci8/tests/bind_sqltafc.phpt +++ b/ext/oci8/tests/bind_sqltafc.phpt @@ -89,7 +89,7 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 0 - base table creation without binds array(5) { ["ID"]=> diff --git a/ext/oci8/tests/bind_sqltchr_1.phpt b/ext/oci8/tests/bind_sqltchr_1.phpt index aabf9bda5c5..a5c6d77b67f 100644 --- a/ext/oci8/tests/bind_sqltchr_1.phpt +++ b/ext/oci8/tests/bind_sqltchr_1.phpt @@ -135,7 +135,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- TEST241 bind SQLT_CHR array(1) { ["VARCHAR2_T10"]=> diff --git a/ext/oci8/tests/bind_sqltchr_2.phpt b/ext/oci8/tests/bind_sqltchr_2.phpt index 51d588f92c0..e459d2270cc 100644 --- a/ext/oci8/tests/bind_sqltchr_2.phpt +++ b/ext/oci8/tests/bind_sqltchr_2.phpt @@ -43,7 +43,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - PL/SQL IN and OUT variables string(22) "Cat got your keyboard?" string(22) "CAT GOT YOUR KEYBOARD?" diff --git a/ext/oci8/tests/bind_sqltint.phpt b/ext/oci8/tests/bind_sqltint.phpt index ac8518e791b..dfefe3d7ed0 100644 --- a/ext/oci8/tests/bind_sqltint.phpt +++ b/ext/oci8/tests/bind_sqltint.phpt @@ -216,7 +216,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- TEST141 wrong bind type SQLT_INT array(1) { ["VARCHAR2_T10"]=> diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt index 63953884718..e2910670886 100644 --- a/ext/oci8/tests/bug27303_3.phpt +++ b/ext/oci8/tests/bug27303_3.phpt @@ -49,7 +49,7 @@ foreach ($create_st as $statement) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- int(1) int(2) int(3) diff --git a/ext/oci8/tests/bug37581.phpt b/ext/oci8/tests/bug37581.phpt index 39d1168059c..b9b491cac06 100644 --- a/ext/oci8/tests/bug37581.phpt +++ b/ext/oci8/tests/bug37581.phpt @@ -44,7 +44,7 @@ var_dump($strings); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- array(5) { [0]=> string(1) "A" diff --git a/ext/oci8/tests/bug38161.phpt b/ext/oci8/tests/bug38161.phpt index e0fbba816ab..0664510146e 100644 --- a/ext/oci8/tests/bug38161.phpt +++ b/ext/oci8/tests/bug38161.phpt @@ -24,7 +24,7 @@ var_dump($bv); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- NULL int(0) Done diff --git a/ext/oci8/tests/bug40078.phpt b/ext/oci8/tests/bug40078.phpt index 26c175748b6..b7abcf5214b 100644 --- a/ext/oci8/tests/bug40078.phpt +++ b/ext/oci8/tests/bug40078.phpt @@ -42,7 +42,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- array(5) { [0]=> string(3) "one" diff --git a/ext/oci8/tests/bug42496_1.phpt b/ext/oci8/tests/bug42496_1.phpt index a332b7d4ea4..ed64b389f07 100644 --- a/ext/oci8/tests/bug42496_1.phpt +++ b/ext/oci8/tests/bug42496_1.phpt @@ -52,6 +52,6 @@ $stmtarray = array( oci8_test_sql_execute($c, $stmtarray); ?> ---EXPECTF-- +--EXPECT-- Test 1 Done diff --git a/ext/oci8/tests/bug42496_2.phpt b/ext/oci8/tests/bug42496_2.phpt index 2f002296cb2..4dff86cc6c1 100644 --- a/ext/oci8/tests/bug42496_2.phpt +++ b/ext/oci8/tests/bug42496_2.phpt @@ -50,6 +50,6 @@ $stmtarray = array( oci8_test_sql_execute($c, $stmtarray); ?> ---EXPECTF-- +--EXPECT-- Test 2 Done diff --git a/ext/oci8/tests/bug46994.phpt b/ext/oci8/tests/bug46994.phpt index 8a557c508ba..63ddbd01508 100644 --- a/ext/oci8/tests/bug46994.phpt +++ b/ext/oci8/tests/bug46994.phpt @@ -71,7 +71,7 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 string(26) "This should be the output." Test 2 diff --git a/ext/oci8/tests/bug47281.phpt b/ext/oci8/tests/bug47281.phpt index 60590ca092a..e7b6dc43ccc 100644 --- a/ext/oci8/tests/bug47281.phpt +++ b/ext/oci8/tests/bug47281.phpt @@ -59,7 +59,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccDeeeeeeeeeeee Test 2 diff --git a/ext/oci8/tests/bug47281_tt.phpt b/ext/oci8/tests/bug47281_tt.phpt index 4b4e92ede65..687655fe8c5 100644 --- a/ext/oci8/tests/bug47281_tt.phpt +++ b/ext/oci8/tests/bug47281_tt.phpt @@ -51,7 +51,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 ORA-57000: TT8507: ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Test 2 diff --git a/ext/oci8/tests/bug68298.phpt b/ext/oci8/tests/bug68298.phpt index 4ea8f14c535..e05a6ad9498 100644 --- a/ext/oci8/tests/bug68298.phpt +++ b/ext/oci8/tests/bug68298.phpt @@ -38,7 +38,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- array(1) { ["COL1"]=> array(2) { diff --git a/ext/oci8/tests/bug70700.phpt b/ext/oci8/tests/bug70700.phpt index 8c948dc2050..5431a90f6a9 100644 --- a/ext/oci8/tests/bug70700.phpt +++ b/ext/oci8/tests/bug70700.phpt @@ -155,7 +155,7 @@ echo 'size of stream4a is ', strlen($stream4a), ' bytes, ', mb_strlen($stream4a) echo 'beg of stream4a is ', $start4a, PHP_EOL; echo 'end of stream4a is ', $ending4a, PHP_EOL; ---EXPECTF-- +--EXPECT-- Test 1: j size of string1 is 1000006 bytes, 1000006 chars. diff --git a/ext/oci8/tests/bug71422.phpt b/ext/oci8/tests/bug71422.phpt index 5978e04ecef..b294b46dadb 100644 --- a/ext/oci8/tests/bug71422.phpt +++ b/ext/oci8/tests/bug71422.phpt @@ -49,7 +49,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- array(1) { ["RAW_QUERY"]=> string(3) "Foo" diff --git a/ext/oci8/tests/bug74625.phpt b/ext/oci8/tests/bug74625.phpt index df9440e42af..f3bc7ac60a8 100644 --- a/ext/oci8/tests/bug74625.phpt +++ b/ext/oci8/tests/bug74625.phpt @@ -49,7 +49,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- array(5) { [0]=> int(-2) diff --git a/ext/oci8/tests/close.phpt b/ext/oci8/tests/close.phpt index 55bb4ea3642..aed90fcaa71 100644 --- a/ext/oci8/tests/close.phpt +++ b/ext/oci8/tests/close.phpt @@ -13,5 +13,5 @@ oci_connect($user, $password, $dbase); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done diff --git a/ext/oci8/tests/coll_019.phpt b/ext/oci8/tests/coll_019.phpt index e9896c4658a..cfadfe56355 100644 --- a/ext/oci8/tests/coll_019.phpt +++ b/ext/oci8/tests/coll_019.phpt @@ -5,9 +5,6 @@ Test collection Oracle error handling collections and numbers (2) $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); ?> -$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -?> --FILE-- ---EXPECTF-- +--EXPECT-- bool(true) int(0) array(5) { diff --git a/ext/oci8/tests/conn_attr_5.phpt b/ext/oci8/tests/conn_attr_5.phpt index 624eb63e126..129181dc278 100644 --- a/ext/oci8/tests/conn_attr_5.phpt +++ b/ext/oci8/tests/conn_attr_5.phpt @@ -51,7 +51,7 @@ function get_scope() { clean_up($c); echo "Done"; ?> ---EXPECTF-- +--EXPECT-- **Test - Set and get values for the attributes with scope end ************ Testing with oci_connect() Value of CLIENT_INFO has been set successfully diff --git a/ext/oci8/tests/connect_scope1.phpt b/ext/oci8/tests/connect_scope1.phpt index 27b15f1e6e5..b1f6653f120 100644 --- a/ext/oci8/tests/connect_scope1.phpt +++ b/ext/oci8/tests/connect_scope1.phpt @@ -68,7 +68,7 @@ oci8_test_sql_execute($c1, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1 - oci_connect array(1) { ["C1"]=> diff --git a/ext/oci8/tests/connect_scope2.phpt b/ext/oci8/tests/connect_scope2.phpt index 6fcfa238c9d..660630bb6b6 100644 --- a/ext/oci8/tests/connect_scope2.phpt +++ b/ext/oci8/tests/connect_scope2.phpt @@ -68,7 +68,7 @@ oci8_test_sql_execute($c1, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1 - oci_pconnect array(1) { ["C1"]=> diff --git a/ext/oci8/tests/db_op_1.phpt b/ext/oci8/tests/db_op_1.phpt index b4f7db168bc..27de28db031 100644 --- a/ext/oci8/tests/db_op_1.phpt +++ b/ext/oci8/tests/db_op_1.phpt @@ -47,7 +47,7 @@ dq($c, 'select dbop_name from v$sql_monitor where dbop_name is not null order by ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(1) { ["DUMMY"]=> diff --git a/ext/oci8/tests/db_op_2.phpt b/ext/oci8/tests/db_op_2.phpt index 10c5700223b..1878347123b 100644 --- a/ext/oci8/tests/db_op_2.phpt +++ b/ext/oci8/tests/db_op_2.phpt @@ -49,7 +49,7 @@ dq($c, 'select dbop_name from v$sql_monitor where dbop_name like \'db_op2%\' ord --XFAIL-- Fails due to Oracle Bug 16695981 ---EXPECTF-- +--EXPECT-- Test 1 array(1) { ["DUMMY"]=> diff --git a/ext/oci8/tests/dbmsoutput.phpt b/ext/oci8/tests/dbmsoutput.phpt index 68906aa796c..6a8a718c8aa 100644 --- a/ext/oci8/tests/dbmsoutput.phpt +++ b/ext/oci8/tests/dbmsoutput.phpt @@ -132,7 +132,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(1) { [0]=> diff --git a/ext/oci8/tests/define5.phpt b/ext/oci8/tests/define5.phpt index 978d66b2607..774bac2344a 100644 --- a/ext/oci8/tests/define5.phpt +++ b/ext/oci8/tests/define5.phpt @@ -57,7 +57,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1 - must do define before execute bool(true) NULL diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt index cc07e2ea94f..d174ef9155a 100644 --- a/ext/oci8/tests/define_old.phpt +++ b/ext/oci8/tests/define_old.phpt @@ -43,6 +43,6 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(4) "some" Done diff --git a/ext/oci8/tests/details.inc b/ext/oci8/tests/details.inc index e54ea84abdb..731b562d0ab 100644 --- a/ext/oci8/tests/details.inc +++ b/ext/oci8/tests/details.inc @@ -30,11 +30,11 @@ if (file_exists(dirname(__FILE__)."/details_local.inc")) { $dbase = "localhost/XE"; $test_drcp = FALSE; } - + /* * Common object names for scripts to use */ - + $table_name = "tb".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5); $type_name = strtoupper("tp".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5)); $schema = ''; diff --git a/ext/oci8/tests/drcp_connection_class.phpt b/ext/oci8/tests/drcp_connection_class.phpt index b6ca31ce2a9..8544b99fc8f 100644 --- a/ext/oci8/tests/drcp_connection_class.phpt +++ b/ext/oci8/tests/drcp_connection_class.phpt @@ -24,7 +24,7 @@ echo "The New oci8.connection_class is $new_cc\n"; echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Setting a new connection class now The New oci8.connection_class is New cc Done diff --git a/ext/oci8/tests/drcp_functions.inc b/ext/oci8/tests/drcp_functions.inc index f6b24446c99..320026486e1 100644 --- a/ext/oci8/tests/drcp_functions.inc +++ b/ext/oci8/tests/drcp_functions.inc @@ -7,7 +7,7 @@ function drcp_create_table($conn) $create_sql = "CREATE TABLE DRCPTEST (id NUMBER, name VARCHAR2(10), dept VARCHAR2(10))"; $statement = oci_parse($conn, $create_sql); oci_execute($statement); - + $id_values = array(100,101,102,103,104,105,106,107,108); $name_values = array("WIILIAMS","JOHN","SMITH","JONES","ADAMS","ROBERT", "BILL","LAWSON","MARY"); @@ -17,7 +17,7 @@ function drcp_create_table($conn) $insert = "INSERT INTO DRCPTEST VALUES(".$id_values[$i].",'". $name_values[$i]."','".$dept_values[$i]."')"; $s = oci_parse($conn, $insert); oci_execute($s); - } + } } function drcp_drop_table($conn) @@ -74,12 +74,12 @@ function drcp_create_package($c) end;"; $s1 = oci_parse($c, $create_package_stmt); oci_execute($s1); - + $package_body = "create or replace package body drcp_test_package as procedure p1(var1 int) is begin var :=var1; - end; + end; function f1 return number is begin return drcp_test_package.var; diff --git a/ext/oci8/tests/dupcolnames.phpt b/ext/oci8/tests/dupcolnames.phpt index bf074971781..cc1fdd18545 100644 --- a/ext/oci8/tests/dupcolnames.phpt +++ b/ext/oci8/tests/dupcolnames.phpt @@ -59,7 +59,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - OCI_ASSOC array(3) { ["C1"]=> diff --git a/ext/oci8/tests/error_set.phpt b/ext/oci8/tests/error_set.phpt index ad56e8aefad..b0c53408c33 100644 --- a/ext/oci8/tests/error_set.phpt +++ b/ext/oci8/tests/error_set.phpt @@ -53,7 +53,7 @@ var_dump($r); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 bool(false) 24960 diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt index b968ae4bf6e..6fdec313f18 100644 --- a/ext/oci8/tests/fetch.phpt +++ b/ext/oci8/tests/fetch.phpt @@ -46,7 +46,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(1) "1" string(1) "1" string(1) "1" diff --git a/ext/oci8/tests/fetch_all1.phpt b/ext/oci8/tests/fetch_all1.phpt index b8155b170b0..00e747cc357 100644 --- a/ext/oci8/tests/fetch_all1.phpt +++ b/ext/oci8/tests/fetch_all1.phpt @@ -48,7 +48,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- int(3) array(2) { ["ID"]=> diff --git a/ext/oci8/tests/fetch_all3.phpt b/ext/oci8/tests/fetch_all3.phpt index f2a401d7c0a..728dc7e3ebc 100644 --- a/ext/oci8/tests/fetch_all3.phpt +++ b/ext/oci8/tests/fetch_all3.phpt @@ -125,7 +125,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- None int(4) array(2) { diff --git a/ext/oci8/tests/fetch_all4.phpt b/ext/oci8/tests/fetch_all4.phpt index 1d4a8df7b7c..7c3b5ea83c1 100644 --- a/ext/oci8/tests/fetch_all4.phpt +++ b/ext/oci8/tests/fetch_all4.phpt @@ -47,7 +47,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 int(0) array(2) { diff --git a/ext/oci8/tests/fetch_all5.phpt b/ext/oci8/tests/fetch_all5.phpt index d82fd30e41c..28e1a2e72d8 100644 --- a/ext/oci8/tests/fetch_all5.phpt +++ b/ext/oci8/tests/fetch_all5.phpt @@ -58,7 +58,7 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 int(3) array(2) { diff --git a/ext/oci8/tests/fetch_into.phpt b/ext/oci8/tests/fetch_into.phpt index d90c4d95dcb..5235dac8a00 100644 --- a/ext/oci8/tests/fetch_into.phpt +++ b/ext/oci8/tests/fetch_into.phpt @@ -49,7 +49,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- int(2) array(2) { [0]=> diff --git a/ext/oci8/tests/fetch_row.phpt b/ext/oci8/tests/fetch_row.phpt index 40bc4f893ca..1b5176974a9 100644 --- a/ext/oci8/tests/fetch_row.phpt +++ b/ext/oci8/tests/fetch_row.phpt @@ -43,7 +43,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- array(2) { [0]=> string(1) "1" diff --git a/ext/oci8/tests/imp_res_2.phpt b/ext/oci8/tests/imp_res_2.phpt index ca92eba3d36..567cefb2bae 100644 --- a/ext/oci8/tests/imp_res_2.phpt +++ b/ext/oci8/tests/imp_res_2.phpt @@ -84,7 +84,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 Test 2 array(1) { diff --git a/ext/oci8/tests/imp_res_3.phpt b/ext/oci8/tests/imp_res_3.phpt index 53c04651282..965edb12240 100644 --- a/ext/oci8/tests/imp_res_3.phpt +++ b/ext/oci8/tests/imp_res_3.phpt @@ -82,7 +82,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 a 1 a 1 a 1 a 1 a 1 a 1 a 1 a 1 a 2 f diff --git a/ext/oci8/tests/imp_res_7.phpt b/ext/oci8/tests/imp_res_7.phpt index abcf8aeb1b5..8502ab2488b 100644 --- a/ext/oci8/tests/imp_res_7.phpt +++ b/ext/oci8/tests/imp_res_7.phpt @@ -593,7 +593,7 @@ while (($row = oci_fetch_row($s)) != false) { ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 2 diff --git a/ext/oci8/tests/imp_res_cancel.phpt b/ext/oci8/tests/imp_res_cancel.phpt index 692a1fabb1a..7c503c3cb98 100644 --- a/ext/oci8/tests/imp_res_cancel.phpt +++ b/ext/oci8/tests/imp_res_cancel.phpt @@ -57,7 +57,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 bool(true) diff --git a/ext/oci8/tests/imp_res_cursor.phpt b/ext/oci8/tests/imp_res_cursor.phpt index 6ba1261f257..57bdddeab20 100644 --- a/ext/oci8/tests/imp_res_cursor.phpt +++ b/ext/oci8/tests/imp_res_cursor.phpt @@ -87,7 +87,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 X 1 abcde diff --git a/ext/oci8/tests/imp_res_dbmsoutput.phpt b/ext/oci8/tests/imp_res_dbmsoutput.phpt index 6f1d7cb2157..cb6fae095f3 100644 --- a/ext/oci8/tests/imp_res_dbmsoutput.phpt +++ b/ext/oci8/tests/imp_res_dbmsoutput.phpt @@ -105,7 +105,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(2) { [0]=> diff --git a/ext/oci8/tests/imp_res_field.phpt b/ext/oci8/tests/imp_res_field.phpt index 5cb88569ca7..3d10e15dacf 100644 --- a/ext/oci8/tests/imp_res_field.phpt +++ b/ext/oci8/tests/imp_res_field.phpt @@ -126,7 +126,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - can't get IRS fields from parent num fields : 0 diff --git a/ext/oci8/tests/imp_res_get_1.phpt b/ext/oci8/tests/imp_res_get_1.phpt index 226f1e557be..79ad8711ffc 100644 --- a/ext/oci8/tests/imp_res_get_1.phpt +++ b/ext/oci8/tests/imp_res_get_1.phpt @@ -90,7 +90,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 abcde 2 fghij diff --git a/ext/oci8/tests/imp_res_get_2.phpt b/ext/oci8/tests/imp_res_get_2.phpt index 1747e4b4e30..3ed3036f6ba 100644 --- a/ext/oci8/tests/imp_res_get_2.phpt +++ b/ext/oci8/tests/imp_res_get_2.phpt @@ -96,7 +96,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 abcde 2 fghij diff --git a/ext/oci8/tests/imp_res_get_3.phpt b/ext/oci8/tests/imp_res_get_3.phpt index dd3e141fa57..f0f0b164da4 100644 --- a/ext/oci8/tests/imp_res_get_3.phpt +++ b/ext/oci8/tests/imp_res_get_3.phpt @@ -82,7 +82,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 abcde 2 fghij diff --git a/ext/oci8/tests/imp_res_get_5.phpt b/ext/oci8/tests/imp_res_get_5.phpt index cee25cc5095..eabc7867e98 100644 --- a/ext/oci8/tests/imp_res_get_5.phpt +++ b/ext/oci8/tests/imp_res_get_5.phpt @@ -95,7 +95,7 @@ oci_free_statement($s); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 3 4 diff --git a/ext/oci8/tests/imp_res_get_all.phpt b/ext/oci8/tests/imp_res_get_all.phpt index 02ea0cbe1f5..98bb8c08d2b 100644 --- a/ext/oci8/tests/imp_res_get_all.phpt +++ b/ext/oci8/tests/imp_res_get_all.phpt @@ -59,7 +59,7 @@ while (($s1 = oci_get_implicit_resultset($s))) { ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(1) { [1]=> diff --git a/ext/oci8/tests/imp_res_get_cancel.phpt b/ext/oci8/tests/imp_res_get_cancel.phpt index a9a6d723230..1ea6beaf606 100644 --- a/ext/oci8/tests/imp_res_get_cancel.phpt +++ b/ext/oci8/tests/imp_res_get_cancel.phpt @@ -48,7 +48,7 @@ while (($s1 = oci_get_implicit_resultset($s))) { ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 3 diff --git a/ext/oci8/tests/imp_res_get_close_3.phpt b/ext/oci8/tests/imp_res_get_close_3.phpt index 3cf0b503de5..d57644c924b 100644 --- a/ext/oci8/tests/imp_res_get_close_3.phpt +++ b/ext/oci8/tests/imp_res_get_close_3.phpt @@ -54,7 +54,7 @@ oci_free_statement($s); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 2 diff --git a/ext/oci8/tests/imp_res_get_cursor.phpt b/ext/oci8/tests/imp_res_get_cursor.phpt index e00472d18ee..417c1124196 100644 --- a/ext/oci8/tests/imp_res_get_cursor.phpt +++ b/ext/oci8/tests/imp_res_get_cursor.phpt @@ -89,7 +89,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 abcde 2 fghij diff --git a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt index a20d1eaf69f..32732163d85 100644 --- a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt +++ b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt @@ -119,7 +119,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 array(3) { [0]=> diff --git a/ext/oci8/tests/imp_res_get_exec.phpt b/ext/oci8/tests/imp_res_get_exec.phpt index d36fb661363..6f5a503ec3b 100644 --- a/ext/oci8/tests/imp_res_get_exec.phpt +++ b/ext/oci8/tests/imp_res_get_exec.phpt @@ -48,7 +48,7 @@ oci_free_statement($s); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 2 diff --git a/ext/oci8/tests/imp_res_get_none.phpt b/ext/oci8/tests/imp_res_get_none.phpt index f97b7987507..73d2913884f 100644 --- a/ext/oci8/tests/imp_res_get_none.phpt +++ b/ext/oci8/tests/imp_res_get_none.phpt @@ -40,7 +40,7 @@ var_dump($s1); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 bool(false) ===DONE=== diff --git a/ext/oci8/tests/imp_res_insert.phpt b/ext/oci8/tests/imp_res_insert.phpt index 2fea690607f..317d4def66f 100644 --- a/ext/oci8/tests/imp_res_insert.phpt +++ b/ext/oci8/tests/imp_res_insert.phpt @@ -105,7 +105,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - No commit in procedure, OCI_COMMIT_ON_SUCCESS mode 111 array(1) { diff --git a/ext/oci8/tests/imp_res_lob.phpt b/ext/oci8/tests/imp_res_lob.phpt index 3e52fb117e9..16f0701e72c 100644 --- a/ext/oci8/tests/imp_res_lob.phpt +++ b/ext/oci8/tests/imp_res_lob.phpt @@ -84,7 +84,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 1 aaaaa a 2 bbbbb b diff --git a/ext/oci8/tests/imp_res_prefetch.phpt b/ext/oci8/tests/imp_res_prefetch.phpt index 8daa2ff4148..c00e4be2979 100644 --- a/ext/oci8/tests/imp_res_prefetch.phpt +++ b/ext/oci8/tests/imp_res_prefetch.phpt @@ -83,7 +83,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - prefetch 0 bool(true) array(2) { diff --git a/ext/oci8/tests/ini_1.phpt b/ext/oci8/tests/ini_1.phpt index 0c3597b6194..9c9b378e7bb 100644 --- a/ext/oci8/tests/ini_1.phpt +++ b/ext/oci8/tests/ini_1.phpt @@ -55,7 +55,7 @@ echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - check initialization oci8.privileged_connect = 1 oci8.max_persistent = 111 diff --git a/ext/oci8/tests/lob_018.phpt b/ext/oci8/tests/lob_018.phpt index f73bbf54b88..94c888cb645 100644 --- a/ext/oci8/tests/lob_018.phpt +++ b/ext/oci8/tests/lob_018.phpt @@ -91,7 +91,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 string(4) "data" string(9) "long data" diff --git a/ext/oci8/tests/lob_029.phpt b/ext/oci8/tests/lob_029.phpt index f018a74575d..615c2722f2d 100644 --- a/ext/oci8/tests/lob_029.phpt +++ b/ext/oci8/tests/lob_029.phpt @@ -89,7 +89,7 @@ oci_execute($s); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1. Check how many rows in the table array(1) { ["NUMROWS"]=> diff --git a/ext/oci8/tests/lob_030.phpt b/ext/oci8/tests/lob_030.phpt index 013a3f0c450..014d40a2a58 100644 --- a/ext/oci8/tests/lob_030.phpt +++ b/ext/oci8/tests/lob_030.phpt @@ -62,7 +62,7 @@ require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Test 1: A CLOB with an even number of bytes int(1050000) Test 2: A CLOB with an odd number of bytes diff --git a/ext/oci8/tests/lob_031.phpt b/ext/oci8/tests/lob_031.phpt index 52674c67829..ee99e4ceeca 100644 --- a/ext/oci8/tests/lob_031.phpt +++ b/ext/oci8/tests/lob_031.phpt @@ -91,7 +91,7 @@ require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- 1. 3 2. 6 3. 9 diff --git a/ext/oci8/tests/lob_043.phpt b/ext/oci8/tests/lob_043.phpt index 5d723be4478..b4ac8d240b1 100644 --- a/ext/oci8/tests/lob_043.phpt +++ b/ext/oci8/tests/lob_043.phpt @@ -80,7 +80,7 @@ oci_close($c); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 f1 ended Test 2 diff --git a/ext/oci8/tests/lob_044.phpt b/ext/oci8/tests/lob_044.phpt index a4ea684ae00..a49c0b75710 100644 --- a/ext/oci8/tests/lob_044.phpt +++ b/ext/oci8/tests/lob_044.phpt @@ -59,7 +59,7 @@ oci8_test_sql_execute($c, $stmtarray); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- Test 1 - truncate on insert int(72) bool(true) diff --git a/ext/oci8/tests/lob_null.phpt b/ext/oci8/tests/lob_null.phpt index 45d688ae682..f4dac4de7a2 100644 --- a/ext/oci8/tests/lob_null.phpt +++ b/ext/oci8/tests/lob_null.phpt @@ -188,7 +188,7 @@ $s = oci_parse($c, 'drop table lob_null_tab'); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Temporary CLOB: NULL Temporary CLOB: '' Temporary CLOB: text @@ -265,4 +265,4 @@ Fetch via the procedure parameter 7 is an object: string(0) "" 8 is an object: string(0) "" 9 is an object: string(28) "Inserted with RETURNING INTO" -Done \ No newline at end of file +Done diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt index 513496942ba..186e106beae 100644 --- a/ext/oci8/tests/lob_temp.phpt +++ b/ext/oci8/tests/lob_temp.phpt @@ -27,7 +27,7 @@ var_dump($blob->read(2)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- bool(true) string(4) "test" bool(true) diff --git a/ext/oci8/tests/lob_temp1.phpt b/ext/oci8/tests/lob_temp1.phpt index 86c29c1b51b..a1cf843dfee 100644 --- a/ext/oci8/tests/lob_temp1.phpt +++ b/ext/oci8/tests/lob_temp1.phpt @@ -25,7 +25,7 @@ var_dump($blob->close()); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- bool(true) string(4) "test" bool(true) diff --git a/ext/oci8/tests/lob_temp2.phpt b/ext/oci8/tests/lob_temp2.phpt index fd5b56333f5..8592fa17509 100644 --- a/ext/oci8/tests/lob_temp2.phpt +++ b/ext/oci8/tests/lob_temp2.phpt @@ -28,7 +28,7 @@ var_dump($res); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- bool(true) array(1) { ["CLOB"]=> diff --git a/ext/oci8/tests/minfo.phpt b/ext/oci8/tests/minfo.phpt index 34a19ca693e..05862e89430 100644 --- a/ext/oci8/tests/minfo.phpt +++ b/ext/oci8/tests/minfo.phpt @@ -15,5 +15,5 @@ if ($r !== 1) echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt index 98fe3ed2250..3b72f2021a3 100644 --- a/ext/oci8/tests/privileged_connect.phpt +++ b/ext/oci8/tests/privileged_connect.phpt @@ -14,7 +14,7 @@ oci_connect("", "", "", false, "qwe"); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d diff --git a/ext/oci8/tests/privileged_connect1.phpt b/ext/oci8/tests/privileged_connect1.phpt index 9581675ad2e..768b0c20d3a 100644 --- a/ext/oci8/tests/privileged_connect1.phpt +++ b/ext/oci8/tests/privileged_connect1.phpt @@ -16,7 +16,7 @@ oci_connect("", "", "", false, "qwe"); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_connect(): ORA-%d: %s in %s on line %d Warning: oci_connect(): ORA-%d: %s in %s on line %d diff --git a/ext/oci8/tests/statement_type.phpt b/ext/oci8/tests/statement_type.phpt index 29cdd944020..ed71240a95d 100644 --- a/ext/oci8/tests/statement_type.phpt +++ b/ext/oci8/tests/statement_type.phpt @@ -31,7 +31,7 @@ foreach ($sqls as $sql) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(6) "SELECT" string(6) "DELETE" string(6) "INSERT" diff --git a/ext/oci8/tests/testping.phpt b/ext/oci8/tests/testping.phpt index a0d65a30c35..720ba8d0713 100644 --- a/ext/oci8/tests/testping.phpt +++ b/ext/oci8/tests/testping.phpt @@ -21,5 +21,5 @@ for ($i = 0; $i < 2; $i++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done diff --git a/ext/oci8/tests/uncommitted.phpt b/ext/oci8/tests/uncommitted.phpt index 3c341c8cb45..a779bba3408 100644 --- a/ext/oci8/tests/uncommitted.phpt +++ b/ext/oci8/tests/uncommitted.phpt @@ -12,5 +12,5 @@ oci_execute($stmt, OCI_DEFAULT); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done From 37652336c7a8a740b5d922edff66c8cea885c108 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 16:38:39 +1000 Subject: [PATCH 28/42] And strip trailing tabs too... --- ext/oci8/oci8.c | 2 +- ext/oci8/oci8_collection.c | 58 ++-- ext/oci8/oci8_interface.c | 284 +++++++++--------- ext/oci8/oci8_lob.c | 94 +++--- ext/oci8/oci8_statement.c | 148 ++++----- ext/oci8/tests/array_bind_001.phpt | 2 +- ext/oci8/tests/array_bind_002.phpt | 2 +- ext/oci8/tests/array_bind_003.phpt | 2 +- ext/oci8/tests/array_bind_004.phpt | 2 +- ext/oci8/tests/array_bind_005.phpt | 2 +- ext/oci8/tests/array_bind_006.phpt | 2 +- ext/oci8/tests/array_bind_007.phpt | 2 +- ext/oci8/tests/array_bind_008.phpt | 2 +- ext/oci8/tests/array_bind_009.phpt | 2 +- ext/oci8/tests/array_bind_010.phpt | 2 +- ext/oci8/tests/array_bind_011.phpt | 2 +- ext/oci8/tests/array_bind_012.phpt | 2 +- ext/oci8/tests/array_bind_013.phpt | 2 +- ext/oci8/tests/array_bind_014.phpt | 2 +- ext/oci8/tests/array_bind_date.phpt | 2 +- ext/oci8/tests/array_bind_date1.phpt | 2 +- ext/oci8/tests/array_bind_float.phpt | 2 +- ext/oci8/tests/array_bind_float1.phpt | 2 +- ext/oci8/tests/array_bind_int.phpt | 2 +- ext/oci8/tests/array_bind_int1.phpt | 2 +- ext/oci8/tests/array_bind_str.phpt | 2 +- ext/oci8/tests/array_bind_str1.phpt | 2 +- ext/oci8/tests/bind_char_1.phpt | 4 +- ext/oci8/tests/bind_char_1_11gR1.phpt | 4 +- ext/oci8/tests/bind_char_2.phpt | 4 +- ext/oci8/tests/bind_char_2_11gR1.phpt | 4 +- ext/oci8/tests/bind_char_3_11gR1.phpt | 2 +- ext/oci8/tests/bind_char_4.phpt | 2 +- ext/oci8/tests/bind_char_4_11gR1.phpt | 2 +- ext/oci8/tests/bug27303_1.phpt | 4 +- ext/oci8/tests/bug27303_1_11gR1.phpt | 2 +- ext/oci8/tests/bug27303_2.phpt | 4 +- ext/oci8/tests/bug27303_2_11gR1.phpt | 4 +- ext/oci8/tests/bug27303_3.phpt | 4 +- ext/oci8/tests/bug27303_4.phpt | 4 +- ext/oci8/tests/bug27303_4_11gR1.phpt | 4 +- ext/oci8/tests/bug32325.phpt | 6 +- ext/oci8/tests/bug35973.phpt | 2 +- ext/oci8/tests/bug36010.phpt | 2 +- ext/oci8/tests/bug37220.phpt | 2 +- ext/oci8/tests/bug37581.phpt | 2 +- ext/oci8/tests/bug38161.phpt | 2 +- ext/oci8/tests/bug40078.phpt | 2 +- ext/oci8/tests/bug41069.phpt | 2 +- ext/oci8/tests/bug43497.phpt | 16 +- ext/oci8/tests/bug51253.phpt | 2 +- ext/oci8/tests/bug71600.phpt | 6 +- ext/oci8/tests/close.phpt | 4 +- ext/oci8/tests/coll_009.phpt | 2 +- ext/oci8/tests/coll_009_func.phpt | 2 +- ext/oci8/tests/coll_010.phpt | 2 +- ext/oci8/tests/coll_010_func.phpt | 2 +- ext/oci8/tests/coll_011.phpt | 2 +- ext/oci8/tests/coll_011_func.phpt | 2 +- ext/oci8/tests/coll_012.phpt | 2 +- ext/oci8/tests/coll_012_func.phpt | 2 +- ext/oci8/tests/coll_013.phpt | 2 +- ext/oci8/tests/coll_013_func.phpt | 2 +- ext/oci8/tests/coll_014.phpt | 2 +- ext/oci8/tests/coll_014_func.phpt | 2 +- ext/oci8/tests/coll_015.phpt | 2 +- ext/oci8/tests/coll_015_func.phpt | 2 +- ext/oci8/tests/coll_016.phpt | 2 +- ext/oci8/tests/coll_016_func.phpt | 2 +- ext/oci8/tests/coll_017.phpt | 2 +- ext/oci8/tests/coll_017_func.phpt | 2 +- ext/oci8/tests/commit_001.phpt | 2 +- ext/oci8/tests/commit_old.phpt | 2 +- ext/oci8/tests/conn_attr_4.phpt | 2 +- ext/oci8/tests/connect.phpt | 2 +- ext/oci8/tests/connect_old.phpt | 2 +- ext/oci8/tests/connect_scope1.phpt | 2 +- ext/oci8/tests/connect_scope2.phpt | 2 +- ext/oci8/tests/connect_scope_try1.phpt | 2 +- ext/oci8/tests/connect_scope_try2.phpt | 2 +- ext/oci8/tests/connect_scope_try3.phpt | 2 +- ext/oci8/tests/connect_scope_try4.phpt | 2 +- ext/oci8/tests/connect_scope_try5.phpt | 2 +- ext/oci8/tests/connect_scope_try6.phpt | 2 +- ext/oci8/tests/connect_with_charset_001.phpt | 2 +- .../tests/connect_without_oracle_home.phpt | 2 +- .../tests/connect_without_oracle_home_11.phpt | 2 +- .../connect_without_oracle_home_old.phpt | 2 +- .../connect_without_oracle_home_old_11.phpt | 2 +- ext/oci8/tests/debug.phpt | 2 +- ext/oci8/tests/default_prefetch.phpt | 2 +- ext/oci8/tests/default_prefetch0.phpt | 2 +- ext/oci8/tests/default_prefetch1.phpt | 2 +- ext/oci8/tests/default_prefetch2.phpt | 2 +- ext/oci8/tests/define2.phpt | 2 +- ext/oci8/tests/define3.phpt | 4 +- ext/oci8/tests/descriptors.phpt | 2 +- ext/oci8/tests/edition_2.phpt | 2 +- ext/oci8/tests/exec_fetch.phpt | 2 +- ext/oci8/tests/execute_mode.phpt | 2 +- ext/oci8/tests/fetch.phpt | 2 +- ext/oci8/tests/fetch_all.phpt | 2 +- ext/oci8/tests/fetch_all1.phpt | 2 +- ext/oci8/tests/fetch_all2.phpt | 2 +- ext/oci8/tests/fetch_array.phpt | 2 +- ext/oci8/tests/fetch_into1.phpt | 2 +- ext/oci8/tests/fetch_into2.phpt | 2 +- ext/oci8/tests/lob_001.phpt | Bin 2151 -> 2150 bytes ext/oci8/tests/lob_003.phpt | Bin 1697 -> 1696 bytes ext/oci8/tests/lob_004.phpt | 2 +- ext/oci8/tests/lob_005.phpt | 2 +- ext/oci8/tests/lob_006.phpt | Bin 1765 -> 1764 bytes ext/oci8/tests/lob_007.phpt | 2 +- ext/oci8/tests/lob_008.phpt | 2 +- ext/oci8/tests/lob_009.phpt | 2 +- ext/oci8/tests/lob_010.phpt | 2 +- ext/oci8/tests/lob_011.phpt | 2 +- ext/oci8/tests/lob_012.phpt | 2 +- ext/oci8/tests/lob_013.phpt | 2 +- ext/oci8/tests/lob_014.phpt | 2 +- ext/oci8/tests/lob_015.phpt | 2 +- ext/oci8/tests/lob_016.phpt | 2 +- ext/oci8/tests/lob_017.phpt | 2 +- ext/oci8/tests/lob_018.phpt | 2 +- ext/oci8/tests/lob_019.phpt | Bin 1617 -> 1616 bytes ext/oci8/tests/lob_020.phpt | Bin 3145 -> 3144 bytes ext/oci8/tests/lob_021.phpt | 2 +- ext/oci8/tests/lob_022.phpt | 2 +- ext/oci8/tests/lob_023.phpt | 2 +- ext/oci8/tests/lob_024.phpt | 2 +- ext/oci8/tests/lob_025.phpt | 2 +- ext/oci8/tests/lob_026.phpt | 2 +- ext/oci8/tests/lob_027.phpt | 4 +- ext/oci8/tests/lob_031.phpt | 2 +- ext/oci8/tests/lob_032.phpt | 2 +- ext/oci8/tests/lob_033.phpt | 2 +- ext/oci8/tests/lob_034.phpt | 2 +- ext/oci8/tests/lob_035.phpt | 2 +- ext/oci8/tests/lob_042.phpt | 4 +- ext/oci8/tests/lob_044.phpt | 2 +- ext/oci8/tests/lob_temp.phpt | 2 +- ext/oci8/tests/lob_temp1.phpt | 2 +- ext/oci8/tests/pecl_bug10194.phpt | 4 +- ext/oci8/tests/persistent.phpt | 4 +- ext/oci8/tests/prefetch_old.phpt | 2 +- ext/oci8/tests/privileged_connect.phpt | 2 +- ext/oci8/tests/privileged_connect1.phpt | 2 +- ext/oci8/tests/select_null.phpt | 2 +- ext/oci8/tests/serverversion.phpt | 2 +- ext/oci8/tests/statement_cache.phpt | 2 +- ext/oci8/tests/uncommitted.phpt | 4 +- 151 files changed, 462 insertions(+), 462 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 4543974aab2..e0d55aeaad1 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1872,7 +1872,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char if ((tmp_val != NULL) && (Z_TYPE_P(tmp_val) == IS_RESOURCE)) { tmp = Z_RES_VAL_P(tmp_val); } - + if ((tmp_val != NULL) && (tmp != NULL) && (ZSTR_LEN(tmp->hash_key) == ZSTR_LEN(hashed_details.s)) && (memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s), diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 6cf471272dd..3744a84b9b7 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -41,13 +41,13 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len) -{ +{ dvoid *dschp1 = NULL; dvoid *parmp1; dvoid *parmp2; php_oci_collection *collection; sword errstatus; - + collection = emalloc(sizeof(php_oci_collection)); collection->connection = connection; @@ -195,7 +195,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch default: php_error_docref(NULL, E_WARNING, "unknown collection type %d", collection->coll_typecode); break; - } + } /* Create object to hold return table */ PHP_OCI_CALL_RETURN(errstatus, OCIObjectNew, @@ -221,7 +221,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch PHP_OCI_REGISTER_RESOURCE(collection, le_collection); connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return collection; - + CLEANUP: if (dschp1) { @@ -230,7 +230,7 @@ CLEANUP: } connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - php_oci_collection_close(collection); + php_oci_collection_close(collection); return NULL; } /* }}} */ @@ -241,7 +241,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size) { php_oci_connection *connection = collection->connection; sword errstatus; - + PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); if (errstatus != OCI_SUCCESS) { @@ -259,7 +259,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size) int php_oci_collection_max(php_oci_collection *collection, zend_long *max) { php_oci_connection *connection = collection->connection; - + PHP_OCI_CALL_RETURN(*max, OCICollMax, (connection->env, collection->collection)); /* error handling is not necessary here? */ @@ -296,7 +296,7 @@ int php_oci_collection_append_null(php_oci_collection *collection) /* append NULL element */ PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); - + if (errstatus != OCI_SUCCESS) { errstatus = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); @@ -341,7 +341,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } @@ -358,7 +358,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe sword errstatus; element_double = zend_strtod(number, NULL); - + PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); if (errstatus != OCI_SUCCESS) { @@ -396,7 +396,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; sword errstatus; - + PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); if (errstatus != OCI_SUCCESS) { @@ -433,12 +433,12 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int if (element_len == 0) { return php_oci_collection_append_null(collection); } - + switch(collection->element_typecode) { case OCI_TYPECODE_DATE: return php_oci_collection_append_date(collection, element, element_len); break; - + case OCI_TYPECODE_VARCHAR2 : return php_oci_collection_append_string(collection, element, element_len); break; @@ -478,7 +478,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind oratext buff[1024]; ub4 buff_len = 1024; sword errstatus; - + ZVAL_NULL(result_element); connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ @@ -500,7 +500,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + if (exists == 0) { /* element doesn't exist */ return 1; @@ -514,7 +514,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind switch (collection->element_typecode) { case OCI_TYPECODE_DATE: PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); - + if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); @@ -523,7 +523,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind ZVAL_STRINGL(result_element, (char *)buff, buff_len); Z_STRVAL_P(result_element)[buff_len] = '\0'; - + return 0; break; @@ -531,9 +531,9 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind { OCIString *oci_string = *(OCIString **)element; text *str; - + PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string)); - + if (str) { ZVAL_STRING(result_element, (char *)str); } @@ -554,7 +554,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind case OCI_TYPECODE_SMALLINT: /* SMALLINT */ { double double_number; - + PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); if (errstatus != OCI_SUCCESS) { @@ -562,7 +562,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + ZVAL_DOUBLE(result_element, double_number); return 0; @@ -588,7 +588,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon /* set NULL element */ PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); - + if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); @@ -634,7 +634,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } @@ -651,7 +651,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l sword errstatus; element_double = zend_strtod(number, NULL); - + PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); if (errstatus != OCI_SUCCESS) { @@ -690,7 +690,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; sword errstatus; - + PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); if (errstatus != OCI_SUCCESS) { @@ -728,12 +728,12 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind if (value_len == 0) { return php_oci_collection_element_set_null(collection, index); } - + switch(collection->element_typecode) { case OCI_TYPECODE_DATE: return php_oci_collection_element_set_date(collection, index, value, value_len); break; - + case OCI_TYPECODE_VARCHAR2 : return php_oci_collection_element_set_string(collection, index, value, value_len); break; @@ -768,7 +768,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle { php_oci_connection *connection = collection_dest->connection; sword errstatus; - + PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); if (errstatus != OCI_SUCCESS) { @@ -798,7 +798,7 @@ void php_oci_collection_close(php_oci_collection *collection) connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } } - + zend_list_delete(collection->connection->id); efree(collection); return; diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index c4205144214..cd17386b5fe 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -172,7 +172,7 @@ PHP_FUNCTION(oci_bind_by_name) zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) { return; } @@ -180,7 +180,7 @@ PHP_FUNCTION(oci_bind_by_name) if (type) { bind_type = (ub2) type; } - + PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type)) { @@ -202,7 +202,7 @@ PHP_FUNCTION(oci_bind_array_by_name) zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - + 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; } @@ -212,12 +212,12 @@ PHP_FUNCTION(oci_bind_array_by_name) if (ZEND_NUM_ARGS() == 5 && max_item_len <= 0) { max_item_len = -1; } - + if (max_array_len <= 0) { php_error_docref(NULL, E_WARNING, "Maximum array length must be greater than zero"); RETURN_FALSE; } - + if (php_oci_bind_array_by_name(statement, name, (sb4) name_len, bind_var, max_array_len, max_item_len, type)) { RETURN_FALSE; } @@ -237,7 +237,7 @@ PHP_FUNCTION(oci_free_descriptor) return; } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; @@ -271,7 +271,7 @@ PHP_FUNCTION(oci_lob_save) return; } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; @@ -283,7 +283,7 @@ PHP_FUNCTION(oci_lob_save) php_error_docref(NULL, E_WARNING, "Offset parameter must be greater than or equal to 0"); RETURN_FALSE; } - + if (php_oci_lob_write(descriptor, (ub4) offset, data, (ub4) data_len, &bytes_written)) { RETURN_FALSE; } @@ -308,7 +308,7 @@ PHP_FUNCTION(oci_lob_import) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) { return; - } + } } if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { @@ -337,14 +337,14 @@ PHP_FUNCTION(oci_lob_load) if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len)) { @@ -380,24 +380,24 @@ PHP_FUNCTION(oci_lob_read) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) { return; - } + } } if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (length <= 0) { php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0"); RETURN_FALSE; } - + if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len)) { RETURN_FALSE; - } + } if (buffer_len > 0) { zend_string *ret = zend_string_init(buffer, buffer_len, 0); efree(buffer); @@ -416,20 +416,20 @@ PHP_FUNCTION(oci_lob_eof) zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; ub4 lob_length; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (!php_oci_lob_get_length(descriptor, &lob_length)) { if (lob_length == descriptor->lob_current_position) { RETURN_TRUE; @@ -445,21 +445,21 @@ PHP_FUNCTION(oci_lob_tell) { zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - RETURN_LONG(descriptor->lob_current_position); + + RETURN_LONG(descriptor->lob_current_position); } /* }}} */ @@ -469,20 +469,20 @@ PHP_FUNCTION(oci_lob_rewind) { zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + descriptor->lob_current_position = 0; RETURN_TRUE; @@ -497,7 +497,7 @@ PHP_FUNCTION(oci_lob_seek) php_oci_descriptor *descriptor; zend_long offset, whence = PHP_OCI_SEEK_SET; ub4 lob_length; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &offset, &whence) == FAILURE) { return; @@ -506,14 +506,14 @@ PHP_FUNCTION(oci_lob_seek) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) { return; - } + } } if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_get_length(descriptor, &lob_length)) { @@ -536,7 +536,7 @@ PHP_FUNCTION(oci_lob_seek) default: descriptor->lob_current_position = (offset > 0) ? (ub4) offset : 0; break; - } + } if (descriptor->lob_current_position > UB4MAXVAL) { php_error_docref(NULL, E_WARNING, "Invalid offset or LOB position"); RETURN_FALSE; @@ -552,20 +552,20 @@ PHP_FUNCTION(oci_lob_size) zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; ub4 lob_length; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (php_oci_lob_get_length(descriptor, &lob_length)) { RETURN_FALSE; } @@ -583,12 +583,12 @@ PHP_FUNCTION(oci_lob_write) zend_long write_len = 0; ub4 bytes_written; char *data; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &write_len) == FAILURE) { return; } - + if (ZEND_NUM_ARGS() == 2) { data_len = MIN((zend_long) data_len, write_len); } @@ -602,18 +602,18 @@ PHP_FUNCTION(oci_lob_write) data_len = MIN((zend_long) data_len, write_len); } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (data_len <= 0) { RETURN_LONG(0); } - + if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, (ub4) data_len, &bytes_written)) { RETURN_FALSE; } @@ -627,7 +627,7 @@ PHP_FUNCTION(oci_lob_append) { zval *tmp_dest, *tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from; php_oci_descriptor *descriptor_dest, *descriptor_from; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) { return; @@ -636,22 +636,22 @@ PHP_FUNCTION(oci_lob_append) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - + if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); - + if (php_oci_lob_append(descriptor_dest, descriptor_from)) { RETURN_FALSE; } @@ -668,7 +668,7 @@ PHP_FUNCTION(oci_lob_truncate) php_oci_descriptor *descriptor; zend_long trim_length = 0; ub4 ub_trim_length; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &trim_length) == FAILURE) { return; @@ -677,9 +677,9 @@ PHP_FUNCTION(oci_lob_truncate) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; @@ -692,7 +692,7 @@ PHP_FUNCTION(oci_lob_truncate) ub_trim_length = (ub4) trim_length; PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (php_oci_lob_truncate(descriptor, ub_trim_length)) { RETURN_FALSE; } @@ -708,7 +708,7 @@ PHP_FUNCTION(oci_lob_erase) php_oci_descriptor *descriptor; ub4 bytes_erased; zend_long offset = -1, length = -1; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &offset, &length) == FAILURE) { return; @@ -733,7 +733,7 @@ PHP_FUNCTION(oci_lob_erase) php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0"); RETURN_FALSE; } - + if (ZEND_NUM_ARGS() > 2 && length < 0) { php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0"); RETURN_FALSE; @@ -761,7 +761,7 @@ PHP_FUNCTION(oci_lob_flush) zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; zend_long flush_flag = 0; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flush_flag) == FAILURE) { return; @@ -772,14 +772,14 @@ PHP_FUNCTION(oci_lob_flush) return; } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { /* buffering wasn't enabled, there is nothing to flush */ RETURN_FALSE; @@ -799,7 +799,7 @@ PHP_FUNCTION(ocisetbufferinglob) zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; zend_bool flag; - + if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &flag) == FAILURE) { return; @@ -808,16 +808,16 @@ PHP_FUNCTION(ocisetbufferinglob) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (php_oci_lob_set_buffering(descriptor, flag)) { RETURN_FALSE; } @@ -831,20 +831,20 @@ PHP_FUNCTION(ocigetbufferinglob) { zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { RETURN_TRUE; } @@ -859,29 +859,29 @@ PHP_FUNCTION(oci_lob_copy) zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from; php_oci_descriptor *descriptor_dest, *descriptor_from; zend_long length = 0; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) { return; } - + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - + if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); - + if (ZEND_NUM_ARGS() == 3 && length < 0) { php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0"); RETURN_FALSE; } - + if (ZEND_NUM_ARGS() == 2) { /* indicate that we want to copy from the current position to the end of the LOB */ length = -1; @@ -901,28 +901,28 @@ PHP_FUNCTION(oci_lob_is_equal) zval *tmp_first, *tmp_second, *z_descriptor_first, *z_descriptor_second; php_oci_descriptor *descriptor_first, *descriptor_second; boolean is_equal; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) { return; } - + if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - + if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first); PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second); if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal)) { RETURN_FALSE; } - + if (is_equal == TRUE) { RETURN_TRUE; } @@ -933,7 +933,7 @@ PHP_FUNCTION(oci_lob_is_equal) /* {{{ proto bool oci_lob_export([string filename [, int start [, int length]]]) Writes a large object into a file */ PHP_FUNCTION(oci_lob_export) -{ +{ zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *filename; @@ -947,7 +947,7 @@ PHP_FUNCTION(oci_lob_export) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) { return; } - + if (ZEND_NUM_ARGS() > 1 && start < 0) { php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0"); RETURN_FALSE; @@ -961,7 +961,7 @@ PHP_FUNCTION(oci_lob_export) if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) { return; } - + if (ZEND_NUM_ARGS() > 2 && start < 0) { php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0"); RETURN_FALSE; @@ -976,13 +976,13 @@ PHP_FUNCTION(oci_lob_export) php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - + if (php_oci_lob_get_length(descriptor, &lob_length)) { RETURN_FALSE; - } - + } + if (start == -1) { start = 0; } @@ -1026,7 +1026,7 @@ PHP_FUNCTION(oci_lob_export) if (buffer) { efree(buffer); } - + length -= tmp_bytes_read; descriptor->lob_current_position += tmp_bytes_read; start += tmp_bytes_read; @@ -1059,14 +1059,14 @@ PHP_FUNCTION(oci_lob_write_temporary) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_write_tmp(descriptor, type, data, (int) data_len)) { @@ -1082,18 +1082,18 @@ PHP_FUNCTION(oci_lob_close) { zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_close(descriptor)) { @@ -1119,8 +1119,8 @@ PHP_FUNCTION(oci_new_descriptor) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); /* php_oci_lob_create() checks type */ - descriptor = php_oci_lob_create(connection, type); - + descriptor = php_oci_lob_create(connection, type); + if (!descriptor) { RETURN_NULL(); } @@ -1170,7 +1170,7 @@ PHP_FUNCTION(oci_commit) if (connection->descriptors) { php_oci_connection_descriptors_free(connection); } - + if (php_oci_connection_commit(connection)) { RETURN_FALSE; } @@ -1245,7 +1245,7 @@ PHP_FUNCTION(oci_field_type) if (!column) { RETURN_FALSE; } - + switch (column->data_type) { #ifdef SQLT_TIMESTAMP case SQLT_TIMESTAMP: @@ -1460,7 +1460,7 @@ PHP_FUNCTION(oci_fetch_all) while (!php_oci_statement_fetch(statement, nrows)) { zval row; - + array_init_size(&row, statement->ncolumns); for (i = 0; i < statement->ncolumns; i++) { @@ -1491,11 +1491,11 @@ PHP_FUNCTION(oci_fetch_all) array_init_size(array, statement->ncolumns); columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); outarrs = safe_emalloc(statement->ncolumns, sizeof(zval*), 0); - + if (flags & PHP_OCI_NUM) { for (i = 0; i < statement->ncolumns; i++) { columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0); - + array_init(&tmp); outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp); } @@ -1503,7 +1503,7 @@ PHP_FUNCTION(oci_fetch_all) for (i = 0; i < statement->ncolumns; i++) { zend_string *zvtmp; columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0); - + array_init(&tmp); zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0); outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zvtmp, &tmp); @@ -1524,7 +1524,7 @@ PHP_FUNCTION(oci_fetch_all) break; } } - + efree(columns); efree(outarrs); } @@ -1605,7 +1605,7 @@ PHP_FUNCTION(oci_close) /* do nothing to keep BC */ return; } - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) { return; } @@ -1622,7 +1622,7 @@ PHP_FUNCTION(oci_close) } /* ZVAL_NULL(z_connection); */ - + RETURN_TRUE; } /* }}} */ @@ -2071,7 +2071,7 @@ PHP_FUNCTION(oci_new_cursor) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); statement = php_oci_statement_create(connection, NULL, 0); - + if (statement) { RETURN_RES(statement->id); } @@ -2084,7 +2084,7 @@ PHP_FUNCTION(oci_new_cursor) PHP_FUNCTION(oci_result) { php_oci_out_column *column; - + column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); if(column) { php_oci_column_to_zval(column, return_value, 0); @@ -2124,7 +2124,7 @@ PHP_FUNCTION(oci_server_version) if (php_oci_server_get_version(connection, version, sizeof(version))) { RETURN_FALSE; } - + ret = zend_string_init(version, strlen(version), 0); RETURN_STR(ret); } @@ -2216,14 +2216,14 @@ PHP_FUNCTION(oci_free_collection) if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); zend_list_close(collection->id); @@ -2248,14 +2248,14 @@ PHP_FUNCTION(oci_collection_append) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_append(collection, value, (int) value_len)) { @@ -2282,20 +2282,20 @@ PHP_FUNCTION(oci_collection_element_get) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_element_get(collection, element_index, &value)) { RETURN_FALSE; } - + RETURN_ZVAL(&value, 1, 1); } /* }}} */ @@ -2315,9 +2315,9 @@ PHP_FUNCTION(oci_collection_assign) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property. The first argument should be valid collection object"); RETURN_FALSE; @@ -2356,14 +2356,14 @@ PHP_FUNCTION(oci_collection_element_assign) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_element_set(collection, element_index, value, (int) value_len)) { @@ -2380,18 +2380,18 @@ PHP_FUNCTION(oci_collection_size) zval *tmp, *z_collection = getThis(); php_oci_collection *collection; sb4 size = 0; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_size(collection, &size)) { @@ -2408,18 +2408,18 @@ PHP_FUNCTION(oci_collection_max) zval *tmp, *z_collection = getThis(); php_oci_collection *collection; zend_long max; - + if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_max(collection, &max)) { @@ -2445,20 +2445,20 @@ PHP_FUNCTION(oci_collection_trim) else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) { return; - } + } } - + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_trim(collection, trim_size)) { RETURN_FALSE; } - RETURN_TRUE; + RETURN_TRUE; } /* }}} */ @@ -2471,13 +2471,13 @@ PHP_FUNCTION(oci_new_collection) php_oci_collection *collection; char *tdo, *schema = NULL; size_t tdo_len, schema_len = 0; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { return; } - + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - + if ( (collection = php_oci_collection_create(connection, tdo, (int) tdo_len, schema, (int) schema_len)) ) { object_init_ex(return_value, oci_coll_class_entry_ptr); add_property_resource(return_value, "collection", collection->id); diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 3dce6d1cd3b..f80aeae7879 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -81,7 +81,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon } PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor); - + descriptor->lob_current_position = 0; descriptor->lob_size = -1; /* we should set it to -1 to know, that it's just not initialized */ descriptor->buffering = PHP_OCI_LOB_BUFFER_DISABLED; /* buffering is off by default */ @@ -97,7 +97,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon zend_hash_init(connection->descriptors, 0, NULL, php_oci_descriptor_flush_hash_dtor, 0); connection->descriptor_count = 0; } - + descriptor->index = (connection->descriptor_count)++; if (connection->descriptor_count == LONG_MAX) { php_error_docref(NULL, E_WARNING, "Internal descriptor counter has reached limit"); @@ -120,7 +120,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length) sword errstatus; *length = 0; - + if (descriptor->lob_size >= 0) { *length = descriptor->lob_size; return 0; @@ -133,7 +133,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length) return 1; } } - + PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); if (errstatus != OCI_SUCCESS) { @@ -156,7 +156,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length) connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } - return 0; + return 0; } /* }}} */ @@ -226,7 +226,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, z descriptor->chunk_size = chunk_size; connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } - + if ((read_length % descriptor->chunk_size) != 0) { return (int) descriptor->chunk_size * (((int) read_length / descriptor->chunk_size) + 1); } @@ -264,24 +264,24 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen if (length <= 0) { return 0; } - + if (initial_offset > length) { php_error_docref(NULL, E_WARNING, "Offset must be less than size of the LOB"); return 1; } - + if (read_length == -1) { requested_len = length; } - + if ((ub4) requested_len > (length - (ub4) initial_offset)) { requested_len = length - initial_offset; } - + if (requested_len <= 0) { return 0; } - + offset = initial_offset; if (descriptor->type == OCI_DTYPE_FILE) { @@ -352,15 +352,15 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen (ub1) descriptor->charset_form /* The character set form of the buffer data. */ ) ); - + efree(bufp); - + if (is_clob) { offset = descriptor->lob_current_position + chars_read; } else { offset = descriptor->lob_current_position + bytes_read; } - + if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); @@ -371,7 +371,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen *data_len = 0; return 1; } - + descriptor->lob_current_position = (int)offset; if (descriptor->type == OCI_DTYPE_FILE) { @@ -402,20 +402,20 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i php_oci_connection *connection = (php_oci_connection *) descriptor->connection; ub4 lob_length; sword errstatus; - + *bytes_written = 0; if (php_oci_lob_get_length(descriptor, &lob_length)) { return 1; } - + if (!data || data_len <= 0) { return 0; } - + if (offset > descriptor->lob_current_position) { offset = descriptor->lob_current_position; } - + PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, ( connection->svc, @@ -441,16 +441,16 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i } *bytes_written = data_len; descriptor->lob_current_position += data_len; - + if ((int) descriptor->lob_current_position > (int) descriptor->lob_size) { descriptor->lob_size = descriptor->lob_current_position; } - + /* marking buffer as used */ if (descriptor->buffering == PHP_OCI_LOB_BUFFER_ENABLED) { descriptor->buffering = PHP_OCI_LOB_BUFFER_USED; } - + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } @@ -467,12 +467,12 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off) /* disabling when it's already off */ return 0; } - + if (on_off && descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { /* enabling when it's already on */ return 0; } - + if (on_off) { PHP_OCI_CALL_RETURN(errstatus, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); } else { @@ -509,11 +509,11 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d php_oci_connection *connection = descriptor_dest->connection; ub4 length_dest, length_from, copy_len; sword errstatus; - + if (php_oci_lob_get_length(descriptor_dest, &length_dest)) { return 1; } - + if (php_oci_lob_get_length(descriptor_from, &length_from)) { return 1; } @@ -546,7 +546,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } @@ -573,7 +573,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor) if (php_oci_temp_lob_close(descriptor)) { return 1; } - + return 0; } /* }}} */ @@ -587,16 +587,16 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor) sword errstatus; PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); - + if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + if (is_temporary) { PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); - + if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); @@ -630,7 +630,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag) return 1; break; } - + /* do not really flush buffer, but report success * to suppress OCI error when flushing not used buffer * */ @@ -683,7 +683,7 @@ void php_oci_lob_free (php_oci_descriptor *descriptor) } } } - + /* flushing Lobs & Files with buffering enabled */ if ((descriptor->type == OCI_DTYPE_FILE || descriptor->type == OCI_DTYPE_LOB) && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED) { php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE); @@ -711,17 +711,17 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename) char buf[8192]; ub4 offset = 1; sword errstatus; - + if (php_check_open_basedir(filename)) { return 1; } - + if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) { php_error_docref(NULL, E_WARNING, "Can't open file %s", filename); return 1; } - while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { + while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, ( @@ -751,7 +751,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename) offset += loblen; } close(fp); - + return 0; } /* }}} */ @@ -769,7 +769,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor if (php_oci_lob_get_length(descriptor_dest, &dest_len)) { return 1; } - + if (php_oci_lob_get_length(descriptor_from, &from_len)) { return 1; } @@ -798,11 +798,11 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng OCILobLocator *lob = descriptor->descriptor; ub4 lob_length; sword errstatus; - + if (php_oci_lob_get_length(descriptor, &lob_length)) { return 1; } - + if (lob_length <= 0) { return 0; } @@ -816,7 +816,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng php_error_docref(NULL, E_WARNING, "Size must be less than or equal to the current LOB size"); return 1; } - + PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, (ub4) new_lob_length)); if (errstatus != OCI_SUCCESS) { @@ -824,7 +824,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + descriptor->lob_size = (ub4) new_lob_length; connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ @@ -842,11 +842,11 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len sword errstatus; *bytes_erased = 0; - + if (php_oci_lob_get_length(descriptor, &lob_length)) { return 1; } - + if (offset == -1) { offset = descriptor->lob_current_position; } @@ -854,7 +854,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len if (length == -1) { length = lob_length; } - + PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, (ub4) offset+1)); if (errstatus != OCI_SUCCESS) { @@ -862,7 +862,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - + *bytes_erased = length; connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; @@ -898,7 +898,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char OCILobLocator *lob = descriptor->descriptor; ub4 bytes_written = 0; sword errstatus; - + switch (type) { case OCI_TEMP_BLOB: case OCI_TEMP_CLOB: diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 97aa51b077e..a0635fb7e67 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -60,9 +60,9 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char /* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */ PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); } - + PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL)); - + if (query_len > 0) { PHP_OCI_CALL_RETURN(errstatus, OCIStmtPrepare2, ( @@ -93,7 +93,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char return NULL; } } - + if (query && query_len) { statement->last_query = ecalloc(1, query_len + 1); memcpy(statement->last_query, query, query_len); @@ -118,11 +118,11 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char } else { php_oci_statement_set_prefetch(statement, (ub4)100); /* semi-arbitrary, "sensible default" */ } - + PHP_OCI_REGISTER_RESOURCE(statement, le_statement); OCI_G(num_statements)++; - + return statement; } /* }}} */ @@ -153,7 +153,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) statement2 = ecalloc(1,sizeof(php_oci_statement)); PHP_OCI_CALL(OCIHandleAlloc, (statement->connection->env, (dvoid **)&(statement2->err), OCI_HTYPE_ERROR, 0, NULL)); - statement2->stmt = (OCIStmt *)result; + statement2->stmt = (OCIStmt *)result; statement2->parent_stmtid = statement->id; statement2->impres_child_stmt = NULL; statement2->impres_count = 0; @@ -175,11 +175,11 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) GC_REFCOUNT(statement2->connection->id)++; php_oci_statement_set_prefetch(statement2, statement->prefetch_count); - + PHP_OCI_REGISTER_RESOURCE(statement2, le_statement); - + OCI_G(num_statements)++; - + return statement2; } #endif /* OCI_MAJOR_VERSION < 12 */ @@ -197,7 +197,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch ) } PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); - + if (errstatus != OCI_SUCCESS) { statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); @@ -293,7 +293,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows) piecewisecols = 1; } } - + while (errstatus == OCI_NEED_DATA) { if (piecewisecols) { PHP_OCI_CALL_RETURN(errstatus, @@ -359,11 +359,11 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows) if (column == NULL) { continue; } - + if (!column->define) { continue; } - + ZEND_ASSERT(Z_ISREF(column->define->val)); zval_ptr_dtor(Z_REFVAL(column->define->val)); ZVAL_NULL(Z_REFVAL(column->define->val)); @@ -419,11 +419,11 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf php_oci_out_column *outcol = (php_oci_out_column *)ctx; if (!outcol) { - + php_error_docref(NULL, E_WARNING, "Invalid context pointer value"); return OCI_ERROR; } - + switch(outcol->data_type) { case SQLT_RSET: { php_oci_statement *nested_stmt; @@ -466,7 +466,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf } outcol->descid = descr->id; descr->charset_form = outcol->charset_form; - + *bufpp = descr->descriptor; *alenpp = &(outcol->retlen4); *piecep = OCI_ONE_PIECE; @@ -512,7 +512,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) return 1; break; } - + if (!statement->stmttype) { /* get statement type */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); @@ -531,7 +531,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) } else { iters = 1; } - + if (statement->last_query) { /* Don't execute REFCURSORS or Implicit Result Set handles */ if (statement->binds) { @@ -550,7 +550,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + if (statement->binds) { zend_hash_apply(statement->binds, php_oci_bind_post_exec); } @@ -575,15 +575,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) if (statement->stmttype == OCI_STMT_SELECT && statement->executed == 0) { /* we only need to do the define step is this very statement is executed the first time! */ statement->executed = 1; - + ALLOC_HASHTABLE(statement->columns); zend_hash_init(statement->columns, 13, NULL, php_oci_column_hash_dtor, 0); - + counter = 1; /* get number of columns */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); - + if (errstatus != OCI_SUCCESS) { statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); @@ -591,19 +591,19 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) } statement->ncolumns = colcount; - + for (counter = 1; counter <= colcount; counter++) { outcol = (php_oci_out_column *) ecalloc(1, sizeof(php_oci_out_column)); - + if ((outcol = zend_hash_index_update_ptr(statement->columns, counter, outcol)) == NULL) { FREE_HASHTABLE(statement->columns); /* out of memory */ return 1; } - + /* get column */ PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); - + if (errstatus != OCI_SUCCESS) { statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); @@ -629,7 +629,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + /* get character set id */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); @@ -639,10 +639,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + /* get size of the column */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); - + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); statement->errcode = php_oci_error(statement->err, errstatus); @@ -655,7 +655,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) /* get scale of the column */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); - + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); statement->errcode = php_oci_error(statement->err, errstatus); @@ -665,17 +665,17 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) /* get precision of the column */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); - + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + /* get name of the column */ PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); - + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); statement->errcode = php_oci_error(statement->err, errstatus); @@ -766,9 +766,9 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) } else { outcol->storage_size4++; /* add one for string terminator */ } - + outcol->storage_size4 *= 3; - + dynamic = OCI_DEFAULT; buf = outcol->data = (text *) safe_emalloc(1, outcol->storage_size4, 0); memset(buf, 0, outcol->storage_size4); @@ -812,7 +812,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) ); } - + if (errstatus != OCI_SUCCESS) { statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); @@ -902,7 +902,7 @@ void php_oci_statement_free(php_oci_statement *statement) zend_list_delete(statement->connection->id); efree(statement); - + OCI_G(num_statements)--; } /* }}} */ @@ -923,7 +923,7 @@ int php_oci_bind_pre_exec(zval *data, void *result) * bind->indicator are not used for oci_bind_array_by_name. */ return 0; - } + } switch (bind->type) { case SQLT_NTY: case SQLT_BFILEE: @@ -936,7 +936,7 @@ int php_oci_bind_pre_exec(zval *data, void *result) *(int *)result = 1; } break; - + case SQLT_CHR: case SQLT_AFC: case SQLT_INT: @@ -1036,7 +1036,7 @@ int php_oci_bind_post_exec(zval *data) ub4 buff_len = 1024; memset((void*)buff,0,sizeof(buff)); - + 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_ptr_dtor(entry); @@ -1063,7 +1063,7 @@ int php_oci_bind_post_exec(zval *data) } } break; - + case SQLT_AFC: case SQLT_CHR: case SQLT_VCS: @@ -1119,7 +1119,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l case SQLT_NTY: { zval *tmp; - + if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "collection", sizeof("collection")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find collection property"); return 1; @@ -1128,7 +1128,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l PHP_OCI_ZVAL_TO_COLLECTION_EX(tmp, bind_collection); value_sz = sizeof(void*); mode = OCI_DEFAULT; - + if (!bind_collection->collection) { return 1; } @@ -1141,7 +1141,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l case SQLT_RDD: { zval *tmp; - + if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "descriptor", sizeof("descriptor")-1)) == NULL) { php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); return 1; @@ -1150,15 +1150,15 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, bind_descriptor); value_sz = sizeof(void*); - + oci_desc = bind_descriptor->descriptor; - + if (!oci_desc) { return 1; } } break; - + case SQLT_INT: case SQLT_NUM: if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) { @@ -1170,7 +1170,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l value_sz = sizeof(oci_phpsized_int); mode = OCI_DEFAULT; break; - + case SQLT_LBI: case SQLT_BIN: case SQLT_LNG: @@ -1265,7 +1265,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l */ if (value_sz == 0) value_sz = 1; - + bindp->descriptor = oci_desc; bindp->statement = oci_stmt; bindp->parent_statement = statement; @@ -1283,7 +1283,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l statement->stmt, /* statement handle */ (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ statement->err, /* error handle */ - (text*) name, /* placeholder name */ + (text*) name, /* placeholder name */ (sb4) name_len, /* placeholder length */ (dvoid *)bind_data, /* in/out data */ value_sz, /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ @@ -1335,14 +1335,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l (ub4 *) 0 ) ); - + if (errstatus) { statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } } - + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } @@ -1484,7 +1484,7 @@ sb4 php_oci_bind_out_callback( Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(val) + 1); /* XXX is this right? */ ZVAL_STRINGL(val, NULL, Z_STRLEN(val) + 1); -#endif +#endif /* XXX we assume that zend-zval len has 4 bytes */ *alenpp = (ub4*) &Z_STRLEN_P(val); @@ -1520,7 +1520,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME if (need_data && !statement->has_data) { return NULL; } - + if (Z_TYPE_P(column_index) == IS_STRING) { column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), (int) Z_STRLEN_P(column_index)); if (!column) { @@ -1551,9 +1551,9 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type) { ub2 statement_type; sword errstatus; - + *type = 0; - + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); if (errstatus != OCI_SUCCESS) { @@ -1574,9 +1574,9 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows) { ub4 statement_numrows; sword errstatus; - + *numrows = 0; - + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); if (errstatus != OCI_SUCCESS) { @@ -1609,7 +1609,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength); return 1; } - + switch(type) { case SQLT_NUM: case SQLT_INT: @@ -1620,7 +1620,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t case SQLT_FLT: bind = php_oci_bind_array_helper_double(val, max_table_length); break; - + case SQLT_AFC: case SQLT_CHR: case SQLT_VCS: @@ -1646,7 +1646,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t /* failed to generate bind struct */ return 1; } - + bind->descriptor = NULL; bind->statement = NULL; bind->parent_statement = statement; @@ -1675,8 +1675,8 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t (ub4) OCI_DEFAULT ) ); - - + + if (errstatus != OCI_SUCCESS) { if (bind->array.elements) { efree(bind->array.elements); @@ -1737,7 +1737,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le zend_hash_move_forward(hash); } } - + bind = emalloc(sizeof(php_oci_bind)); ZVAL_UNDEF(&bind->val); bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0); @@ -1749,9 +1749,9 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le memset(bind->array.element_lengths, 0, max_table_length*sizeof(ub2)); bind->array.indicators = safe_emalloc(max_table_length, sizeof(sb2), 0); memset(bind->array.indicators, 0, max_table_length*sizeof(sb2)); - + zend_hash_internal_pointer_reset(hash); - + for (i = 0; i < bind->array.current_length; i++) { if ((entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_string_ex(entry); @@ -1769,13 +1769,13 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le for (i = 0; i < max_table_length; i++) { if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { int element_length; - + convert_to_string_ex(entry); element_length = ((size_t) maxlength > Z_STRLEN_P(entry)) ? (int) Z_STRLEN_P(entry) : (int) maxlength; - + memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_P(entry), element_length); ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; - + zend_hash_move_forward(hash); } else { ((text *)bind->array.elements)[i*maxlength] = '\0'; @@ -1808,7 +1808,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); bind->array.indicators = NULL; - + zend_hash_internal_pointer_reset(hash); for (i = 0; i < max_table_length; i++) { if (i < bind->array.current_length) { @@ -1849,7 +1849,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); bind->array.indicators = NULL; - + zend_hash_internal_pointer_reset(hash); for (i = 0; i < max_table_length; i++) { if (i < bind->array.current_length) { @@ -1899,7 +1899,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng bind->array.element_lengths[i] = sizeof(OCIDate); } if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - + convert_to_string_ex(entry); PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_P(entry), (ub4) Z_STRLEN_P(entry), NULL, 0, NULL, 0, &oci_date)); @@ -1912,7 +1912,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } - + ((OCIDate *)bind->array.elements)[i] = oci_date; zend_hash_move_forward(hash); } else { @@ -1927,7 +1927,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } - + ((OCIDate *)bind->array.elements)[i] = oci_date; } connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ diff --git a/ext/oci8/tests/array_bind_001.phpt b/ext/oci8/tests/array_bind_001.phpt index f1bee56b846..15a86477794 100644 --- a/ext/oci8/tests/array_bind_001.phpt +++ b/ext/oci8/tests/array_bind_001.phpt @@ -58,7 +58,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): OCI-21560: argument 3 is null, invalid, or out of range in %s on line %d Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d diff --git a/ext/oci8/tests/array_bind_002.phpt b/ext/oci8/tests/array_bind_002.phpt index f70ebb3f617..2bf39b58658 100644 --- a/ext/oci8/tests/array_bind_002.phpt +++ b/ext/oci8/tests/array_bind_002.phpt @@ -58,7 +58,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): Maximum array length must be greater than zero in %s on line %d Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d diff --git a/ext/oci8/tests/array_bind_003.phpt b/ext/oci8/tests/array_bind_003.phpt index 0de8e68187f..0979f4340f0 100644 --- a/ext/oci8/tests/array_bind_003.phpt +++ b/ext/oci8/tests/array_bind_003.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_execute(): ORA-01403: %s ORA-06512: at "%s.ARRAY_BIND_003_PKG", line %d ORA-06512: at line %d in %sarray_bind_003.php on line %d diff --git a/ext/oci8/tests/array_bind_004.phpt b/ext/oci8/tests/array_bind_004.phpt index 297229cab8a..d9dfb01548e 100644 --- a/ext/oci8/tests/array_bind_004.phpt +++ b/ext/oci8/tests/array_bind_004.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_execute(): ORA-01403: %s ORA-06512: at "%s.ARRAY_BIND_004_PKG", line %d ORA-06512: at line %d in %sarray_bind_004.php on line %d diff --git a/ext/oci8/tests/array_bind_005.phpt b/ext/oci8/tests/array_bind_005.phpt index 31d368d661c..b9a8b8c8203 100644 --- a/ext/oci8/tests/array_bind_005.phpt +++ b/ext/oci8/tests/array_bind_005.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(0) "" diff --git a/ext/oci8/tests/array_bind_006.phpt b/ext/oci8/tests/array_bind_006.phpt index f2239f9d19f..56db1aea619 100644 --- a/ext/oci8/tests/array_bind_006.phpt +++ b/ext/oci8/tests/array_bind_006.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(4) "five" diff --git a/ext/oci8/tests/array_bind_007.phpt b/ext/oci8/tests/array_bind_007.phpt index a3c63bca86e..7cde333aadd 100644 --- a/ext/oci8/tests/array_bind_007.phpt +++ b/ext/oci8/tests/array_bind_007.phpt @@ -58,7 +58,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: -1 in %s on line %d Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d diff --git a/ext/oci8/tests/array_bind_008.phpt b/ext/oci8/tests/array_bind_008.phpt index 512ce053743..5b1975cd184 100644 --- a/ext/oci8/tests/array_bind_008.phpt +++ b/ext/oci8/tests/array_bind_008.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_execute(): ORA-06550: line %d, column %d: PLS-00418: %s ORA-06550: %s diff --git a/ext/oci8/tests/array_bind_009.phpt b/ext/oci8/tests/array_bind_009.phpt index 8e83b0982c4..64b2e8cded2 100644 --- a/ext/oci8/tests/array_bind_009.phpt +++ b/ext/oci8/tests/array_bind_009.phpt @@ -11,7 +11,7 @@ var_dump(oci_bind_array_by_name($c, ":c1", $array, 5, 5, SQLT_CHR)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): supplied resource is not a valid oci8 statement resource in %s on line %d bool(false) Done diff --git a/ext/oci8/tests/array_bind_010.phpt b/ext/oci8/tests/array_bind_010.phpt index ede82c97fce..b5ba85938c5 100644 --- a/ext/oci8/tests/array_bind_010.phpt +++ b/ext/oci8/tests/array_bind_010.phpt @@ -19,7 +19,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): ORA-01036: illegal variable name/number in %s on line %d array(5) { [0]=> diff --git a/ext/oci8/tests/array_bind_011.phpt b/ext/oci8/tests/array_bind_011.phpt index 90631619bcd..164821c221a 100644 --- a/ext/oci8/tests/array_bind_011.phpt +++ b/ext/oci8/tests/array_bind_011.phpt @@ -58,7 +58,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d diff --git a/ext/oci8/tests/array_bind_012.phpt b/ext/oci8/tests/array_bind_012.phpt index 38e1701a4b8..e2b74a9ce98 100644 --- a/ext/oci8/tests/array_bind_012.phpt +++ b/ext/oci8/tests/array_bind_012.phpt @@ -19,7 +19,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name(): Invalid max length value (-10) in %s on line %d array(0) { } diff --git a/ext/oci8/tests/array_bind_013.phpt b/ext/oci8/tests/array_bind_013.phpt index 4da9d8bbed8..44d4bd1e6de 100644 --- a/ext/oci8/tests/array_bind_013.phpt +++ b/ext/oci8/tests/array_bind_013.phpt @@ -22,7 +22,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_bind_array_by_name() expects at most 6 parameters, 7 given in %s on line %d NULL diff --git a/ext/oci8/tests/array_bind_014.phpt b/ext/oci8/tests/array_bind_014.phpt index 8a88aff33be..51224bc3e07 100644 --- a/ext/oci8/tests/array_bind_014.phpt +++ b/ext/oci8/tests/array_bind_014.phpt @@ -60,7 +60,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> int(5) diff --git a/ext/oci8/tests/array_bind_date.phpt b/ext/oci8/tests/array_bind_date.phpt index cc48779fd19..75d2dbb3ba0 100644 --- a/ext/oci8/tests/array_bind_date.phpt +++ b/ext/oci8/tests/array_bind_date.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(9) "05-NOV-05" diff --git a/ext/oci8/tests/array_bind_date1.phpt b/ext/oci8/tests/array_bind_date1.phpt index 8e1aceaa06b..c0228539a19 100644 --- a/ext/oci8/tests/array_bind_date1.phpt +++ b/ext/oci8/tests/array_bind_date1.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(9) "05-NOV-05" diff --git a/ext/oci8/tests/array_bind_float.phpt b/ext/oci8/tests/array_bind_float.phpt index a7cc87bc683..dbd1437696b 100644 --- a/ext/oci8/tests/array_bind_float.phpt +++ b/ext/oci8/tests/array_bind_float.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> float(5.9999) diff --git a/ext/oci8/tests/array_bind_float1.phpt b/ext/oci8/tests/array_bind_float1.phpt index 082262594bb..c342c0eb58f 100644 --- a/ext/oci8/tests/array_bind_float1.phpt +++ b/ext/oci8/tests/array_bind_float1.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> float(5.9999) diff --git a/ext/oci8/tests/array_bind_int.phpt b/ext/oci8/tests/array_bind_int.phpt index 08574779710..19fa3bf2ac1 100644 --- a/ext/oci8/tests/array_bind_int.phpt +++ b/ext/oci8/tests/array_bind_int.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> int(5) diff --git a/ext/oci8/tests/array_bind_int1.phpt b/ext/oci8/tests/array_bind_int1.phpt index 7a784bac61f..b730cb2f204 100644 --- a/ext/oci8/tests/array_bind_int1.phpt +++ b/ext/oci8/tests/array_bind_int1.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> int(5) diff --git a/ext/oci8/tests/array_bind_str.phpt b/ext/oci8/tests/array_bind_str.phpt index bda452fd028..70c148afcf3 100644 --- a/ext/oci8/tests/array_bind_str.phpt +++ b/ext/oci8/tests/array_bind_str.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(4) "five" diff --git a/ext/oci8/tests/array_bind_str1.phpt b/ext/oci8/tests/array_bind_str1.phpt index 9444786cbe1..aabed16d4fb 100644 --- a/ext/oci8/tests/array_bind_str1.phpt +++ b/ext/oci8/tests/array_bind_str1.phpt @@ -61,7 +61,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(4) "five" diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt index 84ef14d9574..477bb1422f3 100644 --- a/ext/oci8/tests/bind_char_1.phpt +++ b/ext/oci8/tests/bind_char_1.phpt @@ -26,7 +26,7 @@ $stmtarray = array( "insert into bind_char_tab values (2, NULL, 'abc')", "insert into bind_char_tab values (3, NULL, 'abc ')" ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -196,7 +196,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_1_11gR1.phpt b/ext/oci8/tests/bind_char_1_11gR1.phpt index 317a1db901d..7a97213cad4 100644 --- a/ext/oci8/tests/bind_char_1_11gR1.phpt +++ b/ext/oci8/tests/bind_char_1_11gR1.phpt @@ -28,7 +28,7 @@ $stmtarray = array( "insert into bind_char_tab values (2, NULL, 'abc')", "insert into bind_char_tab values (3, NULL, 'abc ')" ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -198,7 +198,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt index 3f925e3bbd8..5ab03553b79 100644 --- a/ext/oci8/tests/bind_char_2.phpt +++ b/ext/oci8/tests/bind_char_2.phpt @@ -25,7 +25,7 @@ $stmtarray = array( "create table bind_char_tab (id number, c1 date)", "insert into bind_char_tab values (1, '2008-04-20')", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -85,7 +85,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt index 2395b83b886..00831111b6e 100644 --- a/ext/oci8/tests/bind_char_2_11gR1.phpt +++ b/ext/oci8/tests/bind_char_2_11gR1.phpt @@ -25,7 +25,7 @@ $stmtarray = array( "create table bind_char_tab (id number, c1 date)", "insert into bind_char_tab values (1, '2008-04-20')", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test @@ -85,7 +85,7 @@ function do_e_q($s) $stmtarray = array( "drop table bind_char_tab" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index 4ab77c6a5c0..3c3d3b36dc5 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -22,7 +22,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 char) return char as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt index 0e380ec5f08..60d7ac6c9f6 100644 --- a/ext/oci8/tests/bind_char_4.phpt +++ b/ext/oci8/tests/bind_char_4.phpt @@ -24,7 +24,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 varchar2) return varchar2 as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index cc1276181da..9bc0ddf428d 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -24,7 +24,7 @@ require(dirname(__FILE__).'/connect.inc'); $stmtarray = array( "create or replace function bind_char_3_fn(p1 varchar2) return varchar2 as begin return p1; end;", ); - + oci8_test_sql_execute($c, $stmtarray); // Run Test diff --git a/ext/oci8/tests/bug27303_1.phpt b/ext/oci8/tests/bug27303_1.phpt index 0b9d2b99e0e..3058c1bcaec 100644 --- a/ext/oci8/tests/bug27303_1.phpt +++ b/ext/oci8/tests/bug27303_1.phpt @@ -16,7 +16,7 @@ NLS_LANG= ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug27303_1_11gR1.phpt b/ext/oci8/tests/bug27303_1_11gR1.phpt index d2018783bc9..f7e224f45c1 100644 --- a/ext/oci8/tests/bug27303_1_11gR1.phpt +++ b/ext/oci8/tests/bug27303_1_11gR1.phpt @@ -51,7 +51,7 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt index ee2f7b52aa5..76188153e58 100644 --- a/ext/oci8/tests/bug27303_2.phpt +++ b/ext/oci8/tests/bug27303_2.phpt @@ -16,7 +16,7 @@ NLS_LANG= ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug27303_2_11gR1.phpt b/ext/oci8/tests/bug27303_2_11gR1.phpt index a50b3e26132..0a0cc44845c 100644 --- a/ext/oci8/tests/bug27303_2_11gR1.phpt +++ b/ext/oci8/tests/bug27303_2_11gR1.phpt @@ -16,7 +16,7 @@ NLS_LANG= ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt index e2910670886..aafdf61e731 100644 --- a/ext/oci8/tests/bug27303_3.phpt +++ b/ext/oci8/tests/bug27303_3.phpt @@ -6,7 +6,7 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) ---EXPECT-- +--EXPECT-- int(1) int(2) int(3) diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt index ed9d5a1fe6d..a88f29807d2 100644 --- a/ext/oci8/tests/bug27303_4.phpt +++ b/ext/oci8/tests/bug27303_4.phpt @@ -16,7 +16,7 @@ NLS_LANG= ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug27303_4_11gR1.phpt b/ext/oci8/tests/bug27303_4_11gR1.phpt index 550d89fdcc5..ff21d23a2a9 100644 --- a/ext/oci8/tests/bug27303_4_11gR1.phpt +++ b/ext/oci8/tests/bug27303_4_11gR1.phpt @@ -14,7 +14,7 @@ if (!(isset($matches[0]) && $matches[1] < 12)) { ---EXPECT-- +--EXPECT-- string(1) "1" string(1) "2" string(1) "3" diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt index 906195c60f3..925433659b4 100644 --- a/ext/oci8/tests/bug32325.phpt +++ b/ext/oci8/tests/bug32325.phpt @@ -9,7 +9,7 @@ require(dirname(__FILE__).'/skipif.inc'); ---EXPECT-- +--EXPECT-- int(4) float(2) float(3) diff --git a/ext/oci8/tests/bug35973.phpt b/ext/oci8/tests/bug35973.phpt index 399391b8e98..4c000d022b6 100644 --- a/ext/oci8/tests/bug35973.phpt +++ b/ext/oci8/tests/bug35973.phpt @@ -33,7 +33,7 @@ $s1 = oci_parse($c, "drop table test_nclob"); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- array(1) { ["NC"]=> object(OCI-Lob)#%d (1) { diff --git a/ext/oci8/tests/bug36010.phpt b/ext/oci8/tests/bug36010.phpt index ec382d27ba0..cd68b66f34d 100644 --- a/ext/oci8/tests/bug36010.phpt +++ b/ext/oci8/tests/bug36010.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- writetemporary("", OCI_TEMP_CLOB); $success = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS); -oci_free_statement($stmt); +oci_free_statement($stmt); $clob->close(); // Query back the change diff --git a/ext/oci8/tests/bug37581.phpt b/ext/oci8/tests/bug37581.phpt index b9b491cac06..642414f9a35 100644 --- a/ext/oci8/tests/bug37581.phpt +++ b/ext/oci8/tests/bug37581.phpt @@ -44,7 +44,7 @@ var_dump($strings); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(1) "A" diff --git a/ext/oci8/tests/bug38161.phpt b/ext/oci8/tests/bug38161.phpt index 0664510146e..4187de8fed1 100644 --- a/ext/oci8/tests/bug38161.phpt +++ b/ext/oci8/tests/bug38161.phpt @@ -24,7 +24,7 @@ var_dump($bv); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- NULL int(0) Done diff --git a/ext/oci8/tests/bug40078.phpt b/ext/oci8/tests/bug40078.phpt index b7abcf5214b..9fdcb14b7d0 100644 --- a/ext/oci8/tests/bug40078.phpt +++ b/ext/oci8/tests/bug40078.phpt @@ -42,7 +42,7 @@ var_dump($array); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(5) { [0]=> string(3) "one" diff --git a/ext/oci8/tests/bug41069.phpt b/ext/oci8/tests/bug41069.phpt index 29f579448e2..a7606819f3b 100644 --- a/ext/oci8/tests/bug41069.phpt +++ b/ext/oci8/tests/bug41069.phpt @@ -51,7 +51,7 @@ $stmtarray = array( "insert into bug41069_tab (c1, c2, c3, c4, c5, c6, c7, c9, c10, c12, c15) values (113, 'aaaaaaa', 'bbbbbbbbbb', 'cccccc', 'e', 'f', 'dddd', '12/04/2006', '12/04/2006', 2224, 'zzzzzzz')" ); - + oci8_test_sql_execute($c, $stmtarray); diff --git a/ext/oci8/tests/bug43497.phpt b/ext/oci8/tests/bug43497.phpt index 6171127591e..618836da58f 100644 --- a/ext/oci8/tests/bug43497.phpt +++ b/ext/oci8/tests/bug43497.phpt @@ -102,27 +102,27 @@ function dropxmltab($c) // delete table function fillxmltab($c) { for ($id = 1; $id <= 100; $id++) { - - // create an XML element string with random data + + // create an XML element string with random data $s = ""; for ($j = 0; $j < 128; $j++) { - $s .= rand(); + $s .= rand(); } - $s .= "\n"; + $s .= "\n"; for ($j = 0; $j < 4; $j++) { $s .= $s; - } + } $data = "" . $s . ""; - + // insert XML data into database - + $stmt = oci_parse($c, "insert into bug43497_tab(id, xml) values (:id, sys.xmltype.createxml(:xml))"); oci_bind_by_name($stmt, ":id", $id); $clob = oci_new_descriptor($c, OCI_D_LOB); oci_bind_by_name($stmt, ":xml", $clob, -1, OCI_B_CLOB); $clob->writetemporary($data); oci_execute($stmt); - + $clob->close(); $clob->free(); } diff --git a/ext/oci8/tests/bug51253.phpt b/ext/oci8/tests/bug51253.phpt index b25d393ee23..21a0cf8a3f9 100644 --- a/ext/oci8/tests/bug51253.phpt +++ b/ext/oci8/tests/bug51253.phpt @@ -89,7 +89,7 @@ $statement = oci_parse($c, "DROP TABLE BIND_TEST"); echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- Test 1 array(5) { [0]=> diff --git a/ext/oci8/tests/bug71600.phpt b/ext/oci8/tests/bug71600.phpt index c49dd0ee03d..fc548d26c1d 100644 --- a/ext/oci8/tests/bug71600.phpt +++ b/ext/oci8/tests/bug71600.phpt @@ -9,7 +9,7 @@ require(dirname(__FILE__).'/skipif.inc'); ===DONE=== ---EXPECT-- +--EXPECT-- Test 1 Executing SELECT statament... Fetching data by columns... diff --git a/ext/oci8/tests/close.phpt b/ext/oci8/tests/close.phpt index aed90fcaa71..6f9d2b84736 100644 --- a/ext/oci8/tests/close.phpt +++ b/ext/oci8/tests/close.phpt @@ -10,8 +10,8 @@ require dirname(__FILE__).'/connect.inc'; oci_close($c); oci_connect($user, $password, $dbase); - + echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- Done diff --git a/ext/oci8/tests/coll_009.phpt b/ext/oci8/tests/coll_009.phpt index 5f502036f38..bb3f6aed751 100644 --- a/ext/oci8/tests/coll_009.phpt +++ b/ext/oci8/tests/coll_009.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_009_func.phpt b/ext/oci8/tests/coll_009_func.phpt index 40d7e60228c..38573bd3a88 100644 --- a/ext/oci8/tests/coll_009_func.phpt +++ b/ext/oci8/tests/coll_009_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_010.phpt b/ext/oci8/tests/coll_010.phpt index 11dbe61f70c..620872c206d 100644 --- a/ext/oci8/tests/coll_010.phpt +++ b/ext/oci8/tests/coll_010.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_010_func.phpt b/ext/oci8/tests/coll_010_func.phpt index f3284584d30..75a6c1209cb 100644 --- a/ext/oci8/tests/coll_010_func.phpt +++ b/ext/oci8/tests/coll_010_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_011.phpt b/ext/oci8/tests/coll_011.phpt index da0650cfdd1..220ed179a56 100644 --- a/ext/oci8/tests/coll_011.phpt +++ b/ext/oci8/tests/coll_011.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_011_func.phpt b/ext/oci8/tests/coll_011_func.phpt index 684da3d85d3..ff121d78203 100644 --- a/ext/oci8/tests/coll_011_func.phpt +++ b/ext/oci8/tests/coll_011_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_012.phpt b/ext/oci8/tests/coll_012.phpt index 3d47ee8830e..c99a5abb3af 100644 --- a/ext/oci8/tests/coll_012.phpt +++ b/ext/oci8/tests/coll_012.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_012_func.phpt b/ext/oci8/tests/coll_012_func.phpt index 08841447764..1a20b37bc10 100644 --- a/ext/oci8/tests/coll_012_func.phpt +++ b/ext/oci8/tests/coll_012_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_013.phpt b/ext/oci8/tests/coll_013.phpt index f85c98a9071..2bb836ae1a4 100644 --- a/ext/oci8/tests/coll_013.phpt +++ b/ext/oci8/tests/coll_013.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_013_func.phpt b/ext/oci8/tests/coll_013_func.phpt index 2132a06a0ae..27c2e66868c 100644 --- a/ext/oci8/tests/coll_013_func.phpt +++ b/ext/oci8/tests/coll_013_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_014.phpt b/ext/oci8/tests/coll_014.phpt index eca1c18ee41..de3d46bd293 100644 --- a/ext/oci8/tests/coll_014.phpt +++ b/ext/oci8/tests/coll_014.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_014_func.phpt b/ext/oci8/tests/coll_014_func.phpt index ad04ad0be7d..4acde26e9ee 100644 --- a/ext/oci8/tests/coll_014_func.phpt +++ b/ext/oci8/tests/coll_014_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_015.phpt b/ext/oci8/tests/coll_015.phpt index 3618af4f738..2d8a0f382b0 100644 --- a/ext/oci8/tests/coll_015.phpt +++ b/ext/oci8/tests/coll_015.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_015_func.phpt b/ext/oci8/tests/coll_015_func.phpt index af82ff12856..d88b14547e5 100644 --- a/ext/oci8/tests/coll_015_func.phpt +++ b/ext/oci8/tests/coll_015_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_016.phpt b/ext/oci8/tests/coll_016.phpt index 3f6dac744cb..1ba78007ccf 100644 --- a/ext/oci8/tests/coll_016.phpt +++ b/ext/oci8/tests/coll_016.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_016_func.phpt b/ext/oci8/tests/coll_016_func.phpt index 470ac1da73e..ba3bee863ae 100644 --- a/ext/oci8/tests/coll_016_func.phpt +++ b/ext/oci8/tests/coll_016_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_017.phpt b/ext/oci8/tests/coll_017.phpt index 7c07e3c61df..c988e4ffe62 100644 --- a/ext/oci8/tests/coll_017.phpt +++ b/ext/oci8/tests/coll_017.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/coll_017_func.phpt b/ext/oci8/tests/coll_017_func.phpt index a08a95f052b..1aff12d7646 100644 --- a/ext/oci8/tests/coll_017_func.phpt +++ b/ext/oci8/tests/coll_017_func.phpt @@ -18,7 +18,7 @@ $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); diff --git a/ext/oci8/tests/commit_001.phpt b/ext/oci8/tests/commit_001.phpt index 2df6b03382f..2696217a0f8 100644 --- a/ext/oci8/tests/commit_001.phpt +++ b/ext/oci8/tests/commit_001.phpt @@ -74,7 +74,7 @@ var_dump($all); require(dirname(__FILE__).'/drop_table.inc'); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/commit_old.phpt b/ext/oci8/tests/commit_old.phpt index dadffb6850e..0e3e08112ac 100644 --- a/ext/oci8/tests/commit_old.phpt +++ b/ext/oci8/tests/commit_old.phpt @@ -64,7 +64,7 @@ var_dump($all); require dirname(__FILE__).'/drop_table.inc'; - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/conn_attr_4.phpt b/ext/oci8/tests/conn_attr_4.phpt index c44b70aeca1..7897ddd4c9e 100644 --- a/ext/oci8/tests/conn_attr_4.phpt +++ b/ext/oci8/tests/conn_attr_4.phpt @@ -62,7 +62,7 @@ foreach($values_array as $val ) { oci_set_module_name($c1,$val); oci_set_client_identifier($c1,$val); oci_set_client_info($c1,$val); - $r = oci_set_action($c1,$val); + $r = oci_set_action($c1,$val); if ($r) { echo "Values set successfully to $val\n"; foreach($attr_array as $attr) { diff --git a/ext/oci8/tests/connect.phpt b/ext/oci8/tests/connect.phpt index 6ce4c533ba0..390ce1923eb 100644 --- a/ext/oci8/tests/connect.phpt +++ b/ext/oci8/tests/connect.phpt @@ -13,7 +13,7 @@ if (!empty($dbase)) { else { var_dump(oci_connect($user, $password)); } - + echo "Done\n"; ?> diff --git a/ext/oci8/tests/connect_old.phpt b/ext/oci8/tests/connect_old.phpt index 55f1734a5a2..390c418a11f 100644 --- a/ext/oci8/tests/connect_old.phpt +++ b/ext/oci8/tests/connect_old.phpt @@ -13,7 +13,7 @@ if (!empty($dbase)) { else { var_dump(ocilogon($user, $password)); } - + echo "Done\n"; ?> diff --git a/ext/oci8/tests/connect_scope1.phpt b/ext/oci8/tests/connect_scope1.phpt index b1f6653f120..55cc1710470 100644 --- a/ext/oci8/tests/connect_scope1.phpt +++ b/ext/oci8/tests/connect_scope1.phpt @@ -18,7 +18,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope2.phpt b/ext/oci8/tests/connect_scope2.phpt index 660630bb6b6..76ed42ca178 100644 --- a/ext/oci8/tests/connect_scope2.phpt +++ b/ext/oci8/tests/connect_scope2.phpt @@ -18,7 +18,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try1.phpt b/ext/oci8/tests/connect_scope_try1.phpt index d30fc6686da..6dc94792db7 100644 --- a/ext/oci8/tests/connect_scope_try1.phpt +++ b/ext/oci8/tests/connect_scope_try1.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try2.phpt b/ext/oci8/tests/connect_scope_try2.phpt index bb1ad4a7c65..47e2b384b44 100644 --- a/ext/oci8/tests/connect_scope_try2.phpt +++ b/ext/oci8/tests/connect_scope_try2.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try3.phpt b/ext/oci8/tests/connect_scope_try3.phpt index 4a82362127a..6e1c652ad5e 100644 --- a/ext/oci8/tests/connect_scope_try3.phpt +++ b/ext/oci8/tests/connect_scope_try3.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try4.phpt b/ext/oci8/tests/connect_scope_try4.phpt index 25a951a7923..f35f4e68b52 100644 --- a/ext/oci8/tests/connect_scope_try4.phpt +++ b/ext/oci8/tests/connect_scope_try4.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try5.phpt b/ext/oci8/tests/connect_scope_try5.phpt index 0a2518d4e03..325ce2fb99c 100644 --- a/ext/oci8/tests/connect_scope_try5.phpt +++ b/ext/oci8/tests/connect_scope_try5.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_scope_try6.phpt b/ext/oci8/tests/connect_scope_try6.phpt index 653bacc8794..6cc54a21bbe 100644 --- a/ext/oci8/tests/connect_scope_try6.phpt +++ b/ext/oci8/tests/connect_scope_try6.phpt @@ -20,7 +20,7 @@ if (!empty($dbase)) $c1 = oci_new_connect($user,$password,$dbase); else $c1 = oci_new_connect($user,$password); - + oci8_test_sql_execute($c1, $stmtarray); // Run Test diff --git a/ext/oci8/tests/connect_with_charset_001.phpt b/ext/oci8/tests/connect_with_charset_001.phpt index 9149747cdbb..36963ab5a0f 100644 --- a/ext/oci8/tests/connect_with_charset_001.phpt +++ b/ext/oci8/tests/connect_with_charset_001.phpt @@ -21,7 +21,7 @@ var_dump($c5 == $c6); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt index 4ccc2989c87..0e4a37ca3a2 100644 --- a/ext/oci8/tests/connect_without_oracle_home.phpt +++ b/ext/oci8/tests/connect_without_oracle_home.phpt @@ -28,7 +28,7 @@ if (!empty($dbase)) { else { var_dump(oci_connect($user, $password)); } - + ?> ===DONE=== diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt index 9962ecfcf84..09f778362c1 100644 --- a/ext/oci8/tests/connect_without_oracle_home_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_11.phpt @@ -31,7 +31,7 @@ if (!empty($dbase)) { else { var_dump(oci_connect($user, $password)); } - + ?> ===DONE=== diff --git a/ext/oci8/tests/connect_without_oracle_home_old.phpt b/ext/oci8/tests/connect_without_oracle_home_old.phpt index 7e15bc5dd4d..1bc7b37c236 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old.phpt @@ -24,7 +24,7 @@ if (!empty($dbase)) { else { var_dump(ocilogon($user, $password)); } - + ?> ===DONE=== diff --git a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt index 6371b3f909f..07803b99965 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt @@ -31,7 +31,7 @@ if (!empty($dbase)) { else { var_dump(ocilogon($user, $password)); } - + ?> ===DONE=== diff --git a/ext/oci8/tests/debug.phpt b/ext/oci8/tests/debug.phpt index 66ab0f0d005..729726fdd6f 100644 --- a/ext/oci8/tests/debug.phpt +++ b/ext/oci8/tests/debug.phpt @@ -15,7 +15,7 @@ if (!empty($dbase)) { else { oci_connect($user, $password); } - + oci_internal_debug(false); ?> diff --git a/ext/oci8/tests/default_prefetch.phpt b/ext/oci8/tests/default_prefetch.phpt index cc70c6ecb3c..5d2934e4cb4 100644 --- a/ext/oci8/tests/default_prefetch.phpt +++ b/ext/oci8/tests/default_prefetch.phpt @@ -44,7 +44,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/default_prefetch0.phpt b/ext/oci8/tests/default_prefetch0.phpt index cc70c6ecb3c..5d2934e4cb4 100644 --- a/ext/oci8/tests/default_prefetch0.phpt +++ b/ext/oci8/tests/default_prefetch0.phpt @@ -44,7 +44,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/default_prefetch1.phpt b/ext/oci8/tests/default_prefetch1.phpt index bc788293657..04fbd1a5a51 100644 --- a/ext/oci8/tests/default_prefetch1.phpt +++ b/ext/oci8/tests/default_prefetch1.phpt @@ -44,7 +44,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/default_prefetch2.phpt b/ext/oci8/tests/default_prefetch2.phpt index d8a76dbb079..33e91150b6a 100644 --- a/ext/oci8/tests/default_prefetch2.phpt +++ b/ext/oci8/tests/default_prefetch2.phpt @@ -45,7 +45,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/define2.phpt b/ext/oci8/tests/define2.phpt index 086cc7275c4..67cff225c19 100644 --- a/ext/oci8/tests/define2.phpt +++ b/ext/oci8/tests/define2.phpt @@ -14,7 +14,7 @@ $stmtarray = array( "drop table phptestrawtable", "create table phptestrawtable( id number(10), fileimage raw(1000))" ); - + oci8_test_sql_execute($c, $stmtarray); $stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)"); diff --git a/ext/oci8/tests/define3.phpt b/ext/oci8/tests/define3.phpt index 70426f61b49..701c89db549 100644 --- a/ext/oci8/tests/define3.phpt +++ b/ext/oci8/tests/define3.phpt @@ -14,7 +14,7 @@ $stmtarray = array( "drop table phpdefblobtable", "create table phpdefblobtable (id number(10), fileimage blob)" ); - + oci8_test_sql_execute($c, $stmtarray); // Load data @@ -78,7 +78,7 @@ while (oci_fetch($stmt)) { $stmtarray = array( "drop table phpdefblobtable" ); - + oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; diff --git a/ext/oci8/tests/descriptors.phpt b/ext/oci8/tests/descriptors.phpt index 9a4c650c479..0b4aeb09f70 100644 --- a/ext/oci8/tests/descriptors.phpt +++ b/ext/oci8/tests/descriptors.phpt @@ -41,7 +41,7 @@ require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- array(1) { ["BLOB"]=> object(OCI-Lob)#%d (1) { diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt index 6d56f9be5ca..9ec5f4b96de 100644 --- a/ext/oci8/tests/edition_2.phpt +++ b/ext/oci8/tests/edition_2.phpt @@ -92,7 +92,7 @@ foreach ($values_array as $val ) { if ($c1) { get_edit_attr($c1); oci_close($c1); - } + } } echo "\n\n**Test 1.5 - Negative case with an invalid string value. *********\n"; diff --git a/ext/oci8/tests/exec_fetch.phpt b/ext/oci8/tests/exec_fetch.phpt index 52d515ffc4c..b318ee48fcc 100644 --- a/ext/oci8/tests/exec_fetch.phpt +++ b/ext/oci8/tests/exec_fetch.phpt @@ -15,7 +15,7 @@ var_dump(oci_fetch_array($stmt)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_execute(): ORA-00942: %s in %s on line %d bool(false) diff --git a/ext/oci8/tests/execute_mode.phpt b/ext/oci8/tests/execute_mode.phpt index 90570cae80a..ffa97f0f2fe 100644 --- a/ext/oci8/tests/execute_mode.phpt +++ b/ext/oci8/tests/execute_mode.phpt @@ -14,6 +14,6 @@ oci_execute($stmt, -1); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- Warning: oci_execute(): Invalid execute mode given: -1 in %s on line %d Done diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt index 6fdec313f18..a2906034874 100644 --- a/ext/oci8/tests/fetch.phpt +++ b/ext/oci8/tests/fetch.phpt @@ -43,7 +43,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/fetch_all.phpt b/ext/oci8/tests/fetch_all.phpt index b8155b170b0..fe34bd8ecec 100644 --- a/ext/oci8/tests/fetch_all.phpt +++ b/ext/oci8/tests/fetch_all.phpt @@ -45,7 +45,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECTF-- diff --git a/ext/oci8/tests/fetch_all1.phpt b/ext/oci8/tests/fetch_all1.phpt index 00e747cc357..20afe5967cd 100644 --- a/ext/oci8/tests/fetch_all1.phpt +++ b/ext/oci8/tests/fetch_all1.phpt @@ -45,7 +45,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/fetch_all2.phpt b/ext/oci8/tests/fetch_all2.phpt index 261c46f38b8..ca43348c2b4 100644 --- a/ext/oci8/tests/fetch_all2.phpt +++ b/ext/oci8/tests/fetch_all2.phpt @@ -50,7 +50,7 @@ var_dump(oci_fetch_all($s, $all, 0, 1, OCI_BOTH)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/fetch_array.phpt b/ext/oci8/tests/fetch_array.phpt index 03640e5901c..9b67f27e8f5 100644 --- a/ext/oci8/tests/fetch_array.phpt +++ b/ext/oci8/tests/fetch_array.phpt @@ -97,7 +97,7 @@ while ($row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS)) { } require dirname(__FILE__).'/drop_table.inc'; - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/fetch_into1.phpt b/ext/oci8/tests/fetch_into1.phpt index 05fc78aa019..68e5f9cfaec 100644 --- a/ext/oci8/tests/fetch_into1.phpt +++ b/ext/oci8/tests/fetch_into1.phpt @@ -58,7 +58,7 @@ var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/fetch_into2.phpt b/ext/oci8/tests/fetch_into2.phpt index 39b1dc72b9c..2d725415807 100644 --- a/ext/oci8/tests/fetch_into2.phpt +++ b/ext/oci8/tests/fetch_into2.phpt @@ -46,7 +46,7 @@ var_dump(ocifetchinto($s, $all, 1000000)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; - + echo "Done\n"; ?> --EXPECTF-- diff --git a/ext/oci8/tests/lob_001.phpt b/ext/oci8/tests/lob_001.phpt index a6967fa787f87bd0fac046f5c62286bdc56b12cc..432239d12992264c7b5f5047e0352f8b3b794697 100644 GIT binary patch delta 13 VcmaDZ@JwLB>4|-^8(-G30{}442BZK0 delta 15 XcmaDR@LXWRX-3Y8eX<*0)Ug8qH?9V) diff --git a/ext/oci8/tests/lob_003.phpt b/ext/oci8/tests/lob_003.phpt index 95193bccf65f0cbd824d9ae5de8cf08c946bfd12..b0b1d31af4a9c6299938f859c95a9d277a988cd1 100644 GIT binary patch delta 10 ScmZ3;yMTAXsg0+vu>t@ZOa%=9 delta 12 UcmZ3$yO4LnDMrqXr>?OA03YTB761SM diff --git a/ext/oci8/tests/lob_004.phpt b/ext/oci8/tests/lob_004.phpt index 03d42015212..a363199776c 100644 --- a/ext/oci8/tests/lob_004.phpt +++ b/ext/oci8/tests/lob_004.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- --FILE-- RWB}UGPf8{oQ_`(VRI}Znz diff --git a/ext/oci8/tests/lob_007.phpt b/ext/oci8/tests/lob_007.phpt index 3553502abb2..934f012862a 100644 --- a/ext/oci8/tests/lob_007.phpt +++ b/ext/oci8/tests/lob_007.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- t@x#|B>j delta 16 Ycmcb>bCGAlO-9bi4J@)7zeTYE06AO+X8-^I diff --git a/ext/oci8/tests/lob_020.phpt b/ext/oci8/tests/lob_020.phpt index 5f430675acf60c91ff8be5de1d4c657fc01af54a..c4ad5276b1b3df6bfca23fee6ba8983295021a89 100644 GIT binary patch delta 10 RcmX>paYACk&5gJ6xd9z~1uy^r delta 12 TcmX>haZ+N!O-9a*H}kmxBmf0D diff --git a/ext/oci8/tests/lob_021.phpt b/ext/oci8/tests/lob_021.phpt index 0cf73c36ebd..9eee7abd6c7 100644 --- a/ext/oci8/tests/lob_021.phpt +++ b/ext/oci8/tests/lob_021.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- = 0; $i--) { $row = oci_fetch_array($s); var_dump($row['BLOB']->load()); var_dump($row['BLOB']->truncate(($i-1)*10)); - + oci_commit($c); } diff --git a/ext/oci8/tests/lob_031.phpt b/ext/oci8/tests/lob_031.phpt index ee99e4ceeca..99168442922 100644 --- a/ext/oci8/tests/lob_031.phpt +++ b/ext/oci8/tests/lob_031.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- import("does_not_exist")); var_dump($blob->saveFile("does_not_exist")); require(dirname(__FILE__).'/drop_table.inc'); - + echo "Done\n"; - + ?> --EXPECTF-- object(OCI-Lob)#%d (1) { diff --git a/ext/oci8/tests/lob_044.phpt b/ext/oci8/tests/lob_044.phpt index a49c0b75710..4ed661c0e61 100644 --- a/ext/oci8/tests/lob_044.phpt +++ b/ext/oci8/tests/lob_044.phpt @@ -7,7 +7,7 @@ require(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- --FILE-- --FILE-- ---EXPECTF-- +--EXPECTF-- Fatal error: Allowed memory size of 10485760 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/persistent.phpt b/ext/oci8/tests/persistent.phpt index 884cd35a4cc..1bdfc3c90f6 100644 --- a/ext/oci8/tests/persistent.phpt +++ b/ext/oci8/tests/persistent.phpt @@ -4,7 +4,7 @@ reusing persistent connections --FILE-- ---EXPECTF-- +--EXPECTF-- resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) diff --git a/ext/oci8/tests/prefetch_old.phpt b/ext/oci8/tests/prefetch_old.phpt index ac43771c6be..7f50993a648 100644 --- a/ext/oci8/tests/prefetch_old.phpt +++ b/ext/oci8/tests/prefetch_old.phpt @@ -46,7 +46,7 @@ $stmtarray = array( ); oci8_test_sql_execute($c, $stmtarray); - + echo "Done\n"; ?> --EXPECT-- diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt index 3b72f2021a3..3e06283421d 100644 --- a/ext/oci8/tests/privileged_connect.phpt +++ b/ext/oci8/tests/privileged_connect.phpt @@ -4,7 +4,7 @@ privileged connect tests --FILE-- ---EXPECTF-- +--EXPECTF-- array(2) { [0]=> NULL diff --git a/ext/oci8/tests/serverversion.phpt b/ext/oci8/tests/serverversion.phpt index 6cbb5aaad00..1c4b7d7d268 100644 --- a/ext/oci8/tests/serverversion.phpt +++ b/ext/oci8/tests/serverversion.phpt @@ -13,7 +13,7 @@ if (!empty($dbase)) { else { var_dump($c = oci_connect($user, $password)); } - + $v = oci_server_version($c); var_dump(str_replace("\n", "", $v)); diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt index d903b8de22b..8ab9ddc8c10 100644 --- a/ext/oci8/tests/statement_cache.phpt +++ b/ext/oci8/tests/statement_cache.phpt @@ -24,7 +24,7 @@ var_dump(oci_fetch_array($stmt)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- array(2) { [0]=> string(1) "4" diff --git a/ext/oci8/tests/uncommitted.phpt b/ext/oci8/tests/uncommitted.phpt index a779bba3408..cb90e4a5143 100644 --- a/ext/oci8/tests/uncommitted.phpt +++ b/ext/oci8/tests/uncommitted.phpt @@ -4,7 +4,7 @@ uncommitted connection --FILE-- ---EXPECT-- +--EXPECT-- Done From 338802b543023247a3c9b7af563d555c80c2c5d1 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 16:52:17 +1000 Subject: [PATCH 29/42] Remove $id from phpinfo as already done in PHP-7.3 --- ext/oci8/oci8.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index e0d55aeaad1..1a02187e53f 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1207,7 +1207,6 @@ PHP_MINFO_FUNCTION(oci) php_info_print_table_row(2, "OCI8 DTrace Support", "disabled"); #endif php_info_print_table_row(2, "OCI8 Version", PHP_OCI8_VERSION); - php_info_print_table_row(2, "Revision", "$Id$"); #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) php_oci_client_get_version(ver, sizeof(ver)); From 3d497f884f90a329b576988bbb8887872520c0fe Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 17:01:13 +1000 Subject: [PATCH 30/42] Make tests portable across PHP 7.x versions --- ext/oci8/tests/bug51291_1.phpt | 4 ++-- ext/oci8/tests/lob_002.phpt | 4 ++-- ext/oci8/tests/lob_026.phpt | 2 +- ext/oci8/tests/privileged_connect.phpt | 2 +- ext/oci8/tests/privileged_connect1.phpt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/oci8/tests/bug51291_1.phpt b/ext/oci8/tests/bug51291_1.phpt index e9e409433d8..4fa2e239959 100644 --- a/ext/oci8/tests/bug51291_1.phpt +++ b/ext/oci8/tests/bug51291_1.phpt @@ -167,7 +167,7 @@ array(4) { Test 2 - Parse -Warning: oci_error() expects parameter 1 to be resource, boolean given in %sbug51291_1.php on line %d +Warning: oci_error() expects parameter 1 to be resource, bool%sgiven in %sbug51291_1.php on line %d bool(false) array(4) { ["code"]=> @@ -182,7 +182,7 @@ array(4) { NULL 2nd call -Warning: oci_error() expects parameter 1 to be resource, boolean given in %sbug51291_1.php on line %d +Warning: oci_error() expects parameter 1 to be resource, bool%sgiven in %sbug51291_1.php on line %d bool(false) array(4) { ["code"]=> diff --git a/ext/oci8/tests/lob_002.phpt b/ext/oci8/tests/lob_002.phpt index f2c585b817a..188f83ddd38 100644 --- a/ext/oci8/tests/lob_002.phpt +++ b/ext/oci8/tests/lob_002.phpt @@ -62,13 +62,13 @@ object(OCI-Lob)#%d (1) { } int(0) -Warning: OCI-Lob::write() expects parameter 2 to be integer, string given in %slob_002.php on line %d +Warning: OCI-Lob::write() expects parameter 2 to be int%s string given in %slob_002.php on line %d NULL int(4) int(40000) int(40004) -Warning: OCI-Lob::seek() expects parameter 1 to be integer, string given in %slob_002.php on line %d +Warning: OCI-Lob::seek() expects parameter 1 to be int%s string given in %slob_002.php on line %d NULL bool(false) int(40004) diff --git a/ext/oci8/tests/lob_026.phpt b/ext/oci8/tests/lob_026.phpt index 5799bc5277a..42f0d8f7750 100644 --- a/ext/oci8/tests/lob_026.phpt +++ b/ext/oci8/tests/lob_026.phpt @@ -73,7 +73,7 @@ NULL bool(true) int(3) -Warning: oci_lob_seek() expects parameter 1 to be OCI-Lob, integer given in %s on line %d +Warning: oci_lob_seek() expects parameter 1 to be OCI-Lob, int%sgiven in %s on line %d NULL bool(true) array(2) { diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt index 3e06283421d..cb19d739076 100644 --- a/ext/oci8/tests/privileged_connect.phpt +++ b/ext/oci8/tests/privileged_connect.phpt @@ -21,5 +21,5 @@ Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_c Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d -Warning: oci_connect() expects parameter 5 to be integer, string given in %s on line %d +Warning: oci_connect() expects parameter 5 to be int%s string given in %s on line %d Done diff --git a/ext/oci8/tests/privileged_connect1.phpt b/ext/oci8/tests/privileged_connect1.phpt index d33711a91a0..a4b8b76ba7d 100644 --- a/ext/oci8/tests/privileged_connect1.phpt +++ b/ext/oci8/tests/privileged_connect1.phpt @@ -23,5 +23,5 @@ Warning: oci_connect(): ORA-%d: %s in %s on line %d Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d -Warning: oci_connect() expects parameter 5 to be integer, string given in %s on line %d +Warning: oci_connect() expects parameter 5 to be int%s string given in %s on line %d Done From 57eb25b393366c8650b2cf85ef12ea76d01bdd95 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 17:06:29 +1000 Subject: [PATCH 31/42] Backport master branch comment typo fix --- ext/oci8/oci8_failover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/oci8/oci8_failover.c b/ext/oci8/oci8_failover.c index 106945ece77..ab279974581 100644 --- a/ext/oci8/oci8_failover.c +++ b/ext/oci8/oci8_failover.c @@ -71,7 +71,7 @@ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_even returnValue = (sb4) Z_LVAL(retval); } - /* Setting params[0] to null so ressource isn't destroyed on zval_dtor */ + /* Setting params[0] to null so resource isn't destroyed on zval_dtor */ ZVAL_NULL(¶ms[0]); /* Cleanup */ From 91954c24da379946786e21e10f2a5d1a3306f64f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 20:05:54 +1000 Subject: [PATCH 32/42] Make usable for PECL OCI8 release for PHP 7.x --- ext/oci8/oci8.c | 45 +++++++++++++++++++++++++++++++++++-- ext/oci8/oci8_collection.c | 4 ++++ ext/oci8/oci8_interface.c | 28 +++++++++++++++++++++++ ext/oci8/oci8_lob.c | 4 ++++ ext/oci8/oci8_statement.c | 46 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 125 insertions(+), 2 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 1a02187e53f..63fb334c991 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1454,8 +1454,13 @@ void php_oci_column_hash_dtor(zval *data) if (column->descid) { if (GC_REFCOUNT(column->descid) == 1) zend_list_close(column->descid); - else + else { +#if PHP_VERSION_ID < 70300 GC_REFCOUNT(column->descid)--; +#else + GC_DELREF(column->descid); +#endif + } } if (column->data) { @@ -1536,7 +1541,7 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus) case OCI_ERROR: errcode = php_oci_fetch_errmsg(err_p, errbuf, sizeof(errbuf)); if (errcode) { - php_error_docref(NULL, E_WARNING, "%s", errbuf, sizeof(errbuf)); + php_error_docref(NULL, E_WARNING, "%s", errbuf); } else { php_error_docref(NULL, E_WARNING, "failed to fetch error message"); } @@ -1877,7 +1882,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char (memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s), ZSTR_LEN(tmp->hash_key)) == 0)) { connection = tmp; +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(connection->id); +#else + GC_ADDREF(connection->id); +#endif } } else { PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); @@ -1887,7 +1896,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(connection->id); +#else + GC_ADDREF(connection->id); +#endif } } smart_str_free(&hashed_details); @@ -1898,7 +1911,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char } else { /* we do not ping non-persistent connections */ smart_str_free(&hashed_details); +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(connection->id); +#else + GC_ADDREF(connection->id); +#endif return connection; } } /* is_open is true? */ @@ -2040,8 +2057,10 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* add to the appropriate hash */ if (connection->is_persistent) { +#if PHP_VERSION_ID < 70300 new_le.ptr = connection; new_le.type = le_pconnection; +#endif connection->used_this_request = 1; PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); @@ -2050,9 +2069,17 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * refcount is decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(connection->id); +#else + GC_ADDREF(connection->id); +#endif } +#if PHP_VERSION_ID < 70300 zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource)); +#else + zend_register_persistent_resource_ex(connection->hash_key, connection, le_pconnection); +#endif OCI_G(num_persistent)++; OCI_G(num_links)++; } else if (!exclusive) { @@ -2447,7 +2474,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode) if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */ ZVAL_RES(value, column->stmtid); +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(column->stmtid); +#else + GC_ADDREF(column->stmtid); +#endif } else if (column->is_descr) { if (column->data_type != SQLT_RDD) { @@ -2491,7 +2522,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode) /* return the locator */ object_init_ex(value, oci_lob_class_entry_ptr); add_property_resource(value, "descriptor", column->descid); +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(column->descid); +#else + GC_ADDREF(column->descid); +#endif } } else { switch (column->retcode) { @@ -2873,7 +2908,9 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * { smart_str spool_hashed_details = {0}; php_oci_spool *session_pool = NULL; +#if PHP_VERSION_ID < 70300 zend_resource spool_le = {{0}}; +#endif zend_resource *spool_out_le = NULL; zend_bool iserror = 0; zval *spool_out_zv = NULL; @@ -2920,10 +2957,14 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * iserror = 1; goto exit_get_spool; } +#if PHP_VERSION_ID < 70300 spool_le.ptr = session_pool; spool_le.type = le_psessionpool; PHP_OCI_REGISTER_RESOURCE(session_pool, le_psessionpool); zend_hash_update_mem(&EG(persistent_list), session_pool->spool_hash_key, (void *)&spool_le, sizeof(zend_resource)); +#else + zend_register_persistent_resource_ex(session_pool->spool_hash_key, session_pool, le_psessionpool); +#endif } else if (spool_out_le->type == le_psessionpool && ZSTR_LEN(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == ZSTR_LEN(spool_hashed_details.s) && memcmp(ZSTR_VAL(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key), ZSTR_VAL(spool_hashed_details.s), ZSTR_LEN(spool_hashed_details.s)) == 0) { diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 3744a84b9b7..7ddda06bb28 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -52,7 +52,11 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch collection->connection = connection; collection->collection = NULL; +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(collection->connection->id); +#else + GC_ADDREF(collection->connection->id); +#endif /* get type handle by name */ PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index cd17386b5fe..82cb30bfbfe 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -60,16 +60,28 @@ PHP_FUNCTION(oci_register_taf_callback) if (!zend_is_callable(callback, 0, 0)) { callback_name = zend_get_callable_name(callback); php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); +#if PHP_VERSION_ID < 70300 zend_string_release(callback_name); +#else + zend_string_release_ex(callback_name, 0); +#endif RETURN_FALSE; } #else if (!zend_is_callable(callback, 0, &callback_name)) { php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); +#if PHP_VERSION_ID < 70300 zend_string_release(callback_name); +#else + zend_string_release_ex(callback_name, 0); +#endif RETURN_FALSE; } +#if PHP_VERSION_ID < 70300 zend_string_release(callback_name); +#else + zend_string_release_ex(callback_name, 0); +#endif #endif } @@ -141,10 +153,18 @@ PHP_FUNCTION(oci_define_by_name) /* if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { */ zvtmp = zend_string_init(name, name_len, 0); if ((define = zend_hash_add_new_ptr(statement->defines, zvtmp, define)) != NULL) { +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif } else { efree(define); +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif RETURN_FALSE; } @@ -1472,7 +1492,11 @@ PHP_FUNCTION(oci_fetch_all) zend_string *zvtmp; zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0); zend_symtable_update(Z_ARRVAL(row), zvtmp, &element); +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif } } @@ -1507,7 +1531,11 @@ PHP_FUNCTION(oci_fetch_all) array_init(&tmp); zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0); outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zvtmp, &tmp); +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif } } diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index f80aeae7879..1a443899513 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -67,7 +67,11 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon descriptor = ecalloc(1, sizeof(php_oci_descriptor)); descriptor->type = (ub4) type; descriptor->connection = connection; +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(descriptor->connection->id); +#else + GC_ADDREF(descriptor->connection->id); +#endif PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index a0635fb7e67..31b5a48cb8e 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -111,7 +111,11 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char statement->impres_child_stmt = NULL; statement->impres_count = 0; statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */ +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(statement->connection->id); +#else + GC_ADDREF(statement->connection->id); +#endif if (OCI_G(default_prefetch) >= 0) { php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch)); @@ -171,8 +175,13 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) statement2->has_descr = 0; statement2->stmttype = 0; +#if PHP_VERSION_ID < 70300 GC_REFCOUNT(statement->id)++; GC_REFCOUNT(statement2->connection->id)++; +#else + GC_ADDREF(statement->id); + GC_ADDREF(statement2->connection->id); +#endif php_oci_statement_set_prefetch(statement2, statement->prefetch_count); @@ -433,7 +442,11 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf return OCI_ERROR; } nested_stmt->parent_stmtid = outcol->statement->id; +#if PHP_VERSION_ID < 70300 ++GC_REFCOUNT(outcol->statement->id); +#else + GC_ADDREF(outcol->statement->id); +#endif outcol->nested_statement = nested_stmt; outcol->stmtid = nested_stmt->id; @@ -595,11 +608,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) for (counter = 1; counter <= colcount; counter++) { outcol = (php_oci_out_column *) ecalloc(1, sizeof(php_oci_out_column)); +#if PHP_VERSION_ID < 70300 if ((outcol = zend_hash_index_update_ptr(statement->columns, counter, outcol)) == NULL) { FREE_HASHTABLE(statement->columns); /* out of memory */ return 1; } +#else + outcol = zend_hash_index_update_ptr(statement->columns, counter, outcol); +#endif /* get column */ PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); @@ -993,8 +1010,12 @@ int php_oci_bind_post_exec(zval *data) * binds, php_oci_bind_out_callback() should have allocated a * new string that we can modify here. */ +#if PHP_VERSION_ID < 70300 SEPARATE_STRING(zv); Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0); +#else + ZVAL_NEW_STR(zv, zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0)); +#endif Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0'; } else if (Z_TYPE_P(zv) == IS_ARRAY) { int i; @@ -1257,7 +1278,11 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l zvtmp = zend_string_init(name, name_len, 0); bindp = (php_oci_bind *) ecalloc(1, sizeof(php_oci_bind)); bindp = zend_hash_update_ptr(statement->binds, zvtmp, bindp); +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif } /* Make sure the minimum of value_sz is 1 to avoid ORA-3149 @@ -1528,6 +1553,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME return NULL; } } else { +#if PHP_VERSION_ID < 70300 zval tmp; /* NB: for PHP4 compat only, it should be using 'Z' instead */ tmp = *column_index; @@ -1540,6 +1566,17 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME return NULL; } zval_ptr_dtor(&tmp); +#else + zend_long tmp; + /* NB: for PHP4 compat only, it should be using 'Z' instead */ + + tmp = zval_get_long(column_index); + column = php_oci_statement_get_column(statement, tmp, NULL, 0); + if (!column) { + php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", tmp); + return NULL; + } +#endif } return column; } @@ -1602,8 +1639,13 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t ZEND_ASSERT(Z_ISREF_P(var)); val = Z_REFVAL_P(var); +#if PHP_VERSION_ID < 70300 SEPARATE_ZVAL_NOREF(val); convert_to_array(val); +#else + convert_to_array(val); + SEPARATE_ARRAY(val); +#endif if (maxlength < -1) { php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength); @@ -1706,7 +1748,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t zvtmp = zend_string_init(name, name_len, 0); zend_hash_update_ptr(statement->binds, zvtmp, bind); +#if PHP_VERSION_ID < 70300 zend_string_release(zvtmp); +#else + zend_string_release_ex(zvtmp, 0); +#endif statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; From 9e56a3373e88c6e147a5e11acddf134d2d3209ba Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 24 Sep 2018 20:52:58 +1000 Subject: [PATCH 33/42] Terminate smart string correctly This is related to Zend VM regression bug #75881. The regression was fixed in the VM, so there is no user visible change from the termination correction. --- ext/oci8/oci8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 63fb334c991..aac2484d3e9 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1788,12 +1788,12 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char timestamp = time(NULL); smart_str_append_unsigned_ex(&hashed_details, session_mode, 0); - smart_str_0(&hashed_details); - if (persistent) { smart_str_appendl_ex(&hashed_details, "pc", sizeof("pc") - 1, 0); } + smart_str_0(&hashed_details); + /* make it lowercase */ php_strtolower(ZSTR_VAL(hashed_details.s), ZSTR_LEN(hashed_details.s)); From 36092b23548403a7b9f1af1425ead3471689e604 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 25 Sep 2018 11:29:01 +0200 Subject: [PATCH 34/42] Update NEWS wrt. php-7.3.0RC2 tagging --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b9b2ff4dc66..8d50dea72f3 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 7.3.0RC2 +?? ??? ????, PHP 7.3.0RC3 + + +27 Sep 2018, PHP 7.3.0RC2 - CURL: . Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected). From 5edaa6f9470f40cee1b48c8e5b0a3e2654594f90 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 25 Sep 2018 15:44:56 +0300 Subject: [PATCH 35/42] Removed unused function --- ext/soap/php_encoding.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 41b704897c3..144851f2e6e 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2158,16 +2158,6 @@ static void add_xml_array_elements(xmlNodePtr xmlParam, } } -static inline int array_num_elements(HashTable* ht) -{ - if (ht->nNumUsed && - Z_TYPE(ht->arData[ht->nNumUsed-1].val) != IS_UNDEF && - ht->arData[ht->nNumUsed-1].key == NULL) { - return ht->arData[ht->nNumUsed-1].h - 1; - } - return 0; -} - static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) { sdlTypePtr sdl_type = type->sdl_type; From b5d0eb44c0c1a452a82054e860e8c6a9420ac5df Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Tue, 25 Sep 2018 11:18:24 -0400 Subject: [PATCH 36/42] Fixed bug #76918 Repeated parameter name in arg info --- ext/hash/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index bbc12aa414b..e8c554e88de 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -1292,7 +1292,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_file, 0, 0, 2) ZEND_ARG_INFO(0, context) ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, stream_context) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_final, 0, 0, 1) From 45bb95c03667ed61e3cdaa682b20294d27c21c6e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 24 Sep 2018 21:01:44 +0200 Subject: [PATCH 37/42] Reformat macros in php_reflection.c --- ext/reflection/php_reflection.c | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 0a073420e39..d98aa55b3a4 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -75,29 +75,28 @@ PHPAPI zend_class_entry *reflection_extension_ptr; PHPAPI zend_class_entry *reflection_zend_extension_ptr; /* Exception throwing macro */ -#define _DO_THROW(msg) \ - zend_throw_exception(reflection_exception_ptr, msg, 0); \ - return; \ +#define _DO_THROW(msg) \ + zend_throw_exception(reflection_exception_ptr, msg, 0); \ + return; -#define RETURN_ON_EXCEPTION \ - if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \ - return; \ - } +#define GET_REFLECTION_OBJECT() do { \ + intern = Z_REFLECTION_P(getThis()); \ + if (intern->ptr == NULL) { \ + if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \ + return; \ + } \ + zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \ + return; \ + } \ +} while (0) -#define GET_REFLECTION_OBJECT() \ - intern = Z_REFLECTION_P(getThis()); \ - if (intern->ptr == NULL) { \ - RETURN_ON_EXCEPTION \ - zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \ - return; \ - } \ - -#define GET_REFLECTION_OBJECT_PTR(target) \ - GET_REFLECTION_OBJECT() \ - target = intern->ptr; \ +#define GET_REFLECTION_OBJECT_PTR(target) do { \ + GET_REFLECTION_OBJECT(); \ + target = intern->ptr; \ +} while (0) /* Class constants */ -#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \ +#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \ zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value); /* {{{ Object structure */ From 74ade095dbd3093e5091a9b6f8fb9f9f476bffe6 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 24 Sep 2018 21:23:53 +0200 Subject: [PATCH 38/42] Remove unused "dummy" member in reflection_object --- ext/reflection/php_reflection.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index d98aa55b3a4..c82e29702a2 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -135,7 +135,6 @@ typedef enum { /* Struct for reflection objects */ typedef struct { - zval dummy; /* holder for the second property */ zval obj; void *ptr; zend_class_entry *ce; From 981e5e17fa8111bf11fce7316bf8986aec67da8c Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 25 Sep 2018 22:30:22 +0200 Subject: [PATCH 39/42] Remove unused ext/enchant/tests files - ext/enchant/tests/hindi_correct.txt - ext/enchant/tests/hindi_incorrect.txt Added via 5956f9a3984249a763ce629532a01073de8109fe but never used. --- ext/enchant/tests/hindi_correct.txt | 1 - ext/enchant/tests/hindi_incorrect.txt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 ext/enchant/tests/hindi_correct.txt delete mode 100644 ext/enchant/tests/hindi_incorrect.txt diff --git a/ext/enchant/tests/hindi_correct.txt b/ext/enchant/tests/hindi_correct.txt deleted file mode 100644 index cced6b86fad..00000000000 --- a/ext/enchant/tests/hindi_correct.txt +++ /dev/null @@ -1 +0,0 @@ -इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खीचें व छोड़ें diff --git a/ext/enchant/tests/hindi_incorrect.txt b/ext/enchant/tests/hindi_incorrect.txt deleted file mode 100644 index 1f7353c958f..00000000000 --- a/ext/enchant/tests/hindi_incorrect.txt +++ /dev/null @@ -1 +0,0 @@ -इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खच व छड From 5f29e3fb6e3049c2c020ee05e71460ee238ab040 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Tue, 25 Sep 2018 16:37:41 -0400 Subject: [PATCH 40/42] Bump version --- NEWS | 5 ++++- configure.ac | 2 +- main/php_version.h | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 7690f0e454a..da8ddaa7d31 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2018, PHP 7.2.11 +?? ??? 2018, PHP 7.2.12 + + +11 Oct 2018, PHP 7.2.11 - Core: . Fixed bug #76800 (foreach inconsistent if array modified during loop). diff --git a/configure.ac b/configure.ac index 11f85e07484..d3f3cacd076 100644 --- a/configure.ac +++ b/configure.ac @@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=7 PHP_MINOR_VERSION=2 -PHP_RELEASE_VERSION=11 +PHP_RELEASE_VERSION=12 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/main/php_version.h b/main/php_version.h index 544150bc7b8..19c1f2ecd95 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 7 #define PHP_MINOR_VERSION 2 -#define PHP_RELEASE_VERSION 11 +#define PHP_RELEASE_VERSION 12 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "7.2.11-dev" -#define PHP_VERSION_ID 70211 +#define PHP_VERSION "7.2.12-dev" +#define PHP_VERSION_ID 70212 From e3293ad35d2e6a17ff0110de6571f8f9ecd15192 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 25 Sep 2018 22:50:17 +0200 Subject: [PATCH 41/42] Remove unused ext/exif/tests/test6.jpg Added via 569c69ba36757f42351d37580a2e5721070df973 and then removed via fb5da94c1bdb1cf69d0ba77fb372b84724339d98 --- ext/exif/tests/test6.jpg | Bin 1240 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ext/exif/tests/test6.jpg diff --git a/ext/exif/tests/test6.jpg b/ext/exif/tests/test6.jpg deleted file mode 100644 index 073cefdfe0221f6f2d283139df9f590ad46c47a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1240 zcmex=W>z~q&UQ}a?7 z{y$`z=~|JQ#=zj~%b>-;z`()4)HH*E3CPj_Vzo(aV73^L?GMBm0U7xv`3g$DdJ0bY zsYU6jMM`=Mt|^%%sVNHT2tjo{2FGA$Pfwr@kHnmudn!!If!EG#N4EFs7P22cvZ zK_?k`xw(1ycm??Q1Vs4w_(VVip9n;YATb8~KfoZ!0dzDYGoum%lOQ9rAmjhLK*uxw zKf-7a^bIQ`7=Szh1kAulVPR!s=iubx2I@hTWMp7shDi!AFtRW*GqEtSva@lpGV>S% zB?XyT6om{~9Rm}El?oe;*hD5S+~}mNA{uls$=IZ*>7p~c>ZITg4?iXsn~E*k)U4(* zIV8pP(Bcv^@k^nPQa^2OIefYF@n<*nDN9HZQ8PJ$F4p5 zX6_!IUfw=^`S#=2pMMtwMF|rN3)oHUY^Uu>f6As3gp4)HqQD+%8Z@IN|>-1|DXxoq`PZ W3|~X0pIWK1{Qu4WqtQMRqa6S<2|%_0 From ab1ce6058a4a3ee9aa9785b97046393dabad66ca Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 26 Sep 2018 06:11:13 +0200 Subject: [PATCH 42/42] Make ext/session/mod_files.sh executable Making shell script executable makes it possible to run like `ext/session/mod_files.sh` and avoids error permission denied. --- ext/session/mod_files.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ext/session/mod_files.sh diff --git a/ext/session/mod_files.sh b/ext/session/mod_files.sh old mode 100644 new mode 100755