diff options
-rw-r--r-- | ext/gettext/gettext_arginfo.h | 2 | ||||
-rw-r--r-- | ext/json/json_arginfo.h | 2 | ||||
-rwxr-xr-x | scripts/dev/gen_stub.php | 36 |
3 files changed, 27 insertions, 13 deletions
diff --git a/ext/gettext/gettext_arginfo.h b/ext/gettext/gettext_arginfo.h index 6ac4cac5e5..ee248aafae 100644 --- a/ext/gettext/gettext_arginfo.h +++ b/ext/gettext/gettext_arginfo.h @@ -1,6 +1,6 @@ /* This is a generated file, edit the .stub.php file instead. */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_textdomain, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_textdomain, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) ZEND_END_ARG_INFO() diff --git a/ext/json/json_arginfo.h b/ext/json/json_arginfo.h index fa0dcea5ae..9c6f30686a 100644 --- a/ext/json/json_arginfo.h +++ b/ext/json/json_arginfo.h @@ -8,7 +8,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_json_decode, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, assoc, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, assoc, _IS_BOOL, 1) ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/scripts/dev/gen_stub.php b/scripts/dev/gen_stub.php index 48b89da113..6caffda14d 100755 --- a/scripts/dev/gen_stub.php +++ b/scripts/dev/gen_stub.php @@ -13,20 +13,34 @@ try { exit(1); } -if ($argc < 2) { - die("Usage: php gen_stub.php foobar.stub.php\n"); +if ($argc >= 2) { + // Generate single file. + processStubFile($argv[1]); +} else { + // Regenerate all stub files we can find. + $it = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator('.'), + RecursiveIteratorIterator::LEAVES_ONLY + ); + foreach ($it as $file) { + $pathName = $file->getPathName(); + if (preg_match('/\.stub\.php$/', $pathName)) { + processStubFile($pathName); + } + } } -$stubFile = $argv[1]; -$arginfoFile = str_replace('.stub.php', '', $stubFile) . '_arginfo.h'; +function processStubFile(string $stubFile) { + $arginfoFile = str_replace('.stub.php', '', $stubFile) . '_arginfo.h'; -try { - $funcInfos = parseStubFile($stubFile); - $arginfoCode = generateArgInfoCode($funcInfos); - file_put_contents($arginfoFile, $arginfoCode); -} catch (Exception $e) { - echo "Caught {$e->getMessage()} while processing $stubFile\n"; - exit(1); + try { + $funcInfos = parseStubFile($stubFile); + $arginfoCode = generateArgInfoCode($funcInfos); + file_put_contents($arginfoFile, $arginfoCode); + } catch (Exception $e) { + echo "Caught {$e->getMessage()} while processing $stubFile\n"; + exit(1); + } } class Type { |