summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-09 12:57:58 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-09 12:57:58 +0100
commitccc70ec5d429f9b7e47888593d48f39843d7e441 (patch)
treedfcf2fb92c271fae7b2e8fa1f50ea85bf7f058fe /ext/phar
parente32d5e8fe79360daa6d75f496776d91cf9d32852 (diff)
parent44192ce80b72c9aaf4aa1af80d14a42ae203d608 (diff)
downloadphp-git-ccc70ec5d429f9b7e47888593d48f39843d7e441.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Make Phar $fileNotFoundScript nullable
Diffstat (limited to 'ext/phar')
-rw-r--r--ext/phar/phar_object.c2
-rw-r--r--ext/phar/phar_object.stub.php4
-rw-r--r--ext/phar/phar_object_arginfo.h4
-rw-r--r--ext/phar/tests/cache_list/frontcontroller12.phpt2
-rw-r--r--ext/phar/tests/cache_list/frontcontroller13.phpt2
-rw-r--r--ext/phar/tests/cache_list/frontcontroller31.phpt2
-rw-r--r--ext/phar/tests/frontcontroller12.phpt2
-rw-r--r--ext/phar/tests/frontcontroller13.phpt2
-rw-r--r--ext/phar/tests/frontcontroller31.phpt2
-rw-r--r--ext/phar/tests/tar/frontcontroller12.phar.phpt2
-rw-r--r--ext/phar/tests/tar/frontcontroller13.phar.phpt2
-rw-r--r--ext/phar/tests/zip/frontcontroller12.phar.phpt2
-rw-r--r--ext/phar/tests/zip/frontcontroller13.phar.phpt2
13 files changed, 15 insertions, 15 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index bd5e87b0c6..5ecf7a2ba9 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -552,7 +552,7 @@ PHP_METHOD(Phar, webPhar)
phar_entry_info *info = NULL;
size_t sapi_mod_name_len = strlen(sapi_module.name);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!saf!", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!af!", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) {
RETURN_THROWS();
}
diff --git a/ext/phar/phar_object.stub.php b/ext/phar/phar_object.stub.php
index 13a00804ec..b8e428028e 100644
--- a/ext/phar/phar_object.stub.php
+++ b/ext/phar/phar_object.stub.php
@@ -174,7 +174,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
final public static function unlinkArchive(string $filename): bool {}
final public static function webPhar(
- ?string $alias = null, ?string $index = null, string $fileNotFoundScript = "",
+ ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
array $mimeTypes = [], ?callable $rewrite = null): void {}
}
@@ -473,7 +473,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
/** @implementation-alias Phar::webPhar */
final public static function webPhar(
- ?string $alias = null, ?string $index = null, string $fileNotFoundScript = "",
+ ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
array $mimeTypes = [], ?callable $rewrite = null): void {}
}
diff --git a/ext/phar/phar_object_arginfo.h b/ext/phar/phar_object_arginfo.h
index 1e91c2f1a0..3858271c8e 100644
--- a/ext/phar/phar_object_arginfo.h
+++ b/ext/phar/phar_object_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 96900fb403c625ad76b86bac37aed65722472f84 */
+ * Stub hash: bad833e724b1ebface8e8331310ecf7c32a52898 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -204,7 +204,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_webPhar, 0, 0, IS_VOID, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, alias, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, index, IS_STRING, 1, "null")
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fileNotFoundScript, IS_STRING, 0, "\"\"")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fileNotFoundScript, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimeTypes, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rewrite, IS_CALLABLE, 1, "null")
ZEND_END_ARG_INFO()
diff --git a/ext/phar/tests/cache_list/frontcontroller12.phpt b/ext/phar/tests/cache_list/frontcontroller12.phpt
index 8b78e62c9c..857b7dc875 100644
--- a/ext/phar/tests/cache_list/frontcontroller12.phpt
+++ b/ext/phar/tests/cache_list/frontcontroller12.phpt
@@ -16,6 +16,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller12.php:2
Stack trace:
-#0 %sfrontcontroller12.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller12.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller12.php on line 2
diff --git a/ext/phar/tests/cache_list/frontcontroller13.phpt b/ext/phar/tests/cache_list/frontcontroller13.phpt
index 9d2f9105da..ddbab34c07 100644
--- a/ext/phar/tests/cache_list/frontcontroller13.phpt
+++ b/ext/phar/tests/cache_list/frontcontroller13.phpt
@@ -16,6 +16,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller13.php:2
Stack trace:
-#0 %sfrontcontroller13.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller13.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller13.php on line 2
diff --git a/ext/phar/tests/cache_list/frontcontroller31.phpt b/ext/phar/tests/cache_list/frontcontroller31.phpt
index 41e36bf669..3419bb381d 100644
--- a/ext/phar/tests/cache_list/frontcontroller31.phpt
+++ b/ext/phar/tests/cache_list/frontcontroller31.phpt
@@ -15,6 +15,6 @@ files/frontcontroller16.phar
--EXPECTF--
Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrite) must be a valid callback or null, class "fail" not found in %s:%d
Stack trace:
-#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
+#0 %s(%d): Phar::webPhar('test.phar', '/index.php', NULL, Array, Array)
#1 {main}
thrown in %s on line %d
diff --git a/ext/phar/tests/frontcontroller12.phpt b/ext/phar/tests/frontcontroller12.phpt
index a7b1a892d6..40bd8e333f 100644
--- a/ext/phar/tests/frontcontroller12.phpt
+++ b/ext/phar/tests/frontcontroller12.phpt
@@ -15,6 +15,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller12.php:2
Stack trace:
-#0 %sfrontcontroller12.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller12.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller12.php on line 2
diff --git a/ext/phar/tests/frontcontroller13.phpt b/ext/phar/tests/frontcontroller13.phpt
index 99b769d406..60d5709c6f 100644
--- a/ext/phar/tests/frontcontroller13.phpt
+++ b/ext/phar/tests/frontcontroller13.phpt
@@ -15,6 +15,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller13.php:2
Stack trace:
-#0 %sfrontcontroller13.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller13.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller13.php on line 2
diff --git a/ext/phar/tests/frontcontroller31.phpt b/ext/phar/tests/frontcontroller31.phpt
index 721df4849c..121a9389ee 100644
--- a/ext/phar/tests/frontcontroller31.phpt
+++ b/ext/phar/tests/frontcontroller31.phpt
@@ -14,6 +14,6 @@ files/frontcontroller16.phar
--EXPECTF--
Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrite) must be a valid callback or null, class "fail" not found in %s:%d
Stack trace:
-#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
+#0 %s(%d): Phar::webPhar('test.phar', '/index.php', NULL, Array, Array)
#1 {main}
thrown in %s on line %d
diff --git a/ext/phar/tests/tar/frontcontroller12.phar.phpt b/ext/phar/tests/tar/frontcontroller12.phar.phpt
index cbb928ff77..cec426b05a 100644
--- a/ext/phar/tests/tar/frontcontroller12.phar.phpt
+++ b/ext/phar/tests/tar/frontcontroller12.phar.phpt
@@ -15,6 +15,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller12.phar.php:2
Stack trace:
-#0 %sfrontcontroller12.phar.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller12.phar.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller12.phar.php on line 2
diff --git a/ext/phar/tests/tar/frontcontroller13.phar.phpt b/ext/phar/tests/tar/frontcontroller13.phar.phpt
index 107961a70f..7d9992cb9d 100644
--- a/ext/phar/tests/tar/frontcontroller13.phar.phpt
+++ b/ext/phar/tests/tar/frontcontroller13.phar.phpt
@@ -15,6 +15,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller13.phar.php:2
Stack trace:
-#0 %sfrontcontroller13.phar.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller13.phar.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller13.phar.php on line 2
diff --git a/ext/phar/tests/zip/frontcontroller12.phar.phpt b/ext/phar/tests/zip/frontcontroller12.phar.phpt
index 9f5b0a13aa..2169264b64 100644
--- a/ext/phar/tests/zip/frontcontroller12.phar.phpt
+++ b/ext/phar/tests/zip/frontcontroller12.phar.phpt
@@ -17,6 +17,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller12.phar.php:2
Stack trace:
-#0 %sfrontcontroller12.phar.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller12.phar.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller12.phar.php on line 2
diff --git a/ext/phar/tests/zip/frontcontroller13.phar.phpt b/ext/phar/tests/zip/frontcontroller13.phar.phpt
index 5d2a77e4ac..c9c72a7a60 100644
--- a/ext/phar/tests/zip/frontcontroller13.phar.phpt
+++ b/ext/phar/tests/zip/frontcontroller13.phar.phpt
@@ -17,6 +17,6 @@ Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught PharException: Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed in %sfrontcontroller13.phar.php:2
Stack trace:
-#0 %sfrontcontroller13.phar.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#0 %sfrontcontroller13.phar.php(2): Phar::webPhar('whatever', 'index.php', NULL, Array)
#1 {main}
thrown in %sfrontcontroller13.phar.php on line 2