From: Nikita Popov Date: Fri, 3 Apr 2020 14:18:47 +0000 (+0200) Subject: Stubs: Store information per-class X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2c92d7fd326b011b509b6daedee5f4e035fcae1;p=php Stubs: Store information per-class We'll need this if we want to generate method entries. --- diff --git a/build/gen_stub.php b/build/gen_stub.php index d25ef2dc22..e94399fbe3 100644 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -350,16 +350,39 @@ class FuncInfo { } } +class ClassInfo { + /** @var string */ + public $name; + /** @var FuncInfo[] */ + public $funcInfos; + + public function __construct(string $name, array $funcInfos) { + $this->name = $name; + $this->funcInfos = $funcInfos; + } +} + class FileInfo { /** @var FuncInfo[] */ public $funcInfos; + /** @var ClassInfo[] */ + public $classInfos; /** @var bool */ public $generateFunctionEntries; - public function __construct(array $funcInfos, bool $generateFunctionEntries) { + public function __construct( + array $funcInfos, array $classInfos, bool $generateFunctionEntries) { $this->funcInfos = $funcInfos; + $this->classInfos = $classInfos; $this->generateFunctionEntries = $generateFunctionEntries; } + + public function getAllFuncInfos(): iterable { + yield from $this->funcInfos; + foreach ($this->classInfos as $classInfo) { + yield from $classInfo->funcInfos; + } + } } function parseFunctionLike( @@ -507,6 +530,7 @@ function parseStubFile(string $fileName): FileInfo { } $funcInfos = []; + $classInfos = []; $conds = []; foreach ($stmts as $stmt) { $cond = handlePreprocessorConditions($conds, $stmt); @@ -521,6 +545,7 @@ function parseStubFile(string $fileName): FileInfo { if ($stmt instanceof Stmt\ClassLike) { $className = $stmt->name->toString(); + $methodInfos = []; foreach ($stmt->stmts as $classStmt) { $cond = handlePreprocessorConditions($conds, $classStmt); if ($classStmt instanceof Stmt\Nop) { @@ -531,16 +556,18 @@ function parseStubFile(string $fileName): FileInfo { throw new Exception("Not implemented {$classStmt->getType()}"); } - $funcInfos[] = parseFunctionLike( + $methodInfos[] = parseFunctionLike( $classStmt->name->toString(), $className, $classStmt, $cond); } + + $classInfos[] = new ClassInfo($className, $methodInfos); continue; } throw new Exception("Unexpected node {$stmt->getType()}"); } - return new FileInfo($funcInfos, $generateFunctionEntries); + return new FileInfo($funcInfos, $classInfos, $generateFunctionEntries); } function funcInfoToCode(FuncInfo $funcInfo): string { @@ -638,10 +665,11 @@ function findEquivalentFuncInfo(array $generatedFuncInfos, $funcInfo): ?FuncInfo return null; } +/** @param FuncInfo[] $funcInfos */ function generateCodeWithConditions( - FileInfo $fileInfo, string $separator, Closure $codeGenerator): string { + iterable $funcInfos, string $separator, Closure $codeGenerator): string { $code = ""; - foreach ($fileInfo->funcInfos as $funcInfo) { + foreach ($funcInfos as $funcInfo) { $funcCode = $codeGenerator($funcInfo); if ($funcCode === null) { continue; @@ -665,7 +693,7 @@ function generateArgInfoCode(FileInfo $fileInfo): string { $code = "/* This is a generated file, edit the .stub.php file instead. */\n"; $generatedFuncInfos = []; $code .= generateCodeWithConditions( - $fileInfo, "\n", + $fileInfo->getAllFuncInfos(), "\n", function(FuncInfo $funcInfo) use(&$generatedFuncInfos) { /* If there already is an equivalent arginfo structure, only emit a #define */ if ($generatedFuncInfo = findEquivalentFuncInfo($generatedFuncInfos, $funcInfo)) { @@ -684,8 +712,8 @@ function generateArgInfoCode(FileInfo $fileInfo): string { if ($fileInfo->generateFunctionEntries) { $code .= "\n\n"; - $code .= generateCodeWithConditions($fileInfo, "", function(FuncInfo $funcInfo) { - if ($funcInfo->className || $funcInfo->alias) { + $code .= generateCodeWithConditions($fileInfo->funcInfos, "", function(FuncInfo $funcInfo) { + if ($funcInfo->alias) { return null; } @@ -693,11 +721,7 @@ function generateArgInfoCode(FileInfo $fileInfo): string { }); $code .= "\n\nstatic const zend_function_entry ext_functions[] = {\n"; - $code .= generateCodeWithConditions($fileInfo, "", function(FuncInfo $funcInfo) { - if ($funcInfo->className) { - return null; - } - + $code .= generateCodeWithConditions($fileInfo->funcInfos, "", function(FuncInfo $funcInfo) { if ($funcInfo->alias) { return sprintf( "\tZEND_FALIAS(%s, %s, %s)\n", diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h index 8f0f356bb0..266fc31a33 100644 --- a/ext/fileinfo/fileinfo_arginfo.h +++ b/ext/fileinfo/fileinfo_arginfo.h @@ -1,28 +1,10 @@ /* This is a generated file, edit the .stub.php file instead. */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo___construct, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_open, 0, 0, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, arg, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_buffer, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_set_flags, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_finfo_open arginfo_class_finfo___construct - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, finfo) ZEND_END_ARG_INFO() @@ -49,3 +31,21 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mime_content_type, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() + +#define arginfo_class_finfo___construct arginfo_finfo_open + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_buffer, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_set_flags, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index b5307d917f..74c80bd13a 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,248 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, socket, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_change_user, 0, 0, 3) - ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_character_set_name, 0, 0, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_close arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction - -#define arginfo_class_mysqli_connect arginfo_class_mysqli___construct - -#define arginfo_class_mysqli_dump_debug_info arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_debug, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, debug_options, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_get_charset arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_get_client_info arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_get_connection_stats arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_get_server_info arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_get_warnings arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_init arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, connection_id, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_more_results arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_next_result arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_ping arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4) - ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, sec, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, usec, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_prepare arginfo_class_mysqli_multi_query - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, resultmode, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, socket, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, string_to_escape, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_reap_async_query arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_escape_string arginfo_class_mysqli_real_escape_string - -#define arginfo_class_mysqli_real_query arginfo_class_mysqli_multi_query - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_rollback arginfo_class_mysqli_begin_transaction - -#define arginfo_class_mysqli_savepoint arginfo_class_mysqli_release_savepoint - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_select_db, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_set_charset, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_options, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_set_opt arginfo_class_mysqli_options - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cert, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority_path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_stat arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_init arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_store_result, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_thread_safe arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_use_result arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_refresh, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mysqli_link, IS_OBJECT, 0) - ZEND_ARG_TYPE_INFO(0, resmode, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_result_close arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_result_free arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_data_seek, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_result_fetch_field arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_result_fetch_fields arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_field_direct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, field_nr, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_all, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, result_type, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_result_fetch_array arginfo_class_mysqli_result_fetch_all - -#define arginfo_class_mysqli_result_fetch_assoc arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_result_fetch_row arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_result_field_seek arginfo_class_mysqli_result_fetch_field_direct - -#define arginfo_class_mysqli_result_free_result arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, mode_in, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, types, IS_STRING, 0) - ZEND_ARG_VARIADIC_INFO(1, vars) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, 0) - ZEND_ARG_VARIADIC_INFO(1, vars) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_data_seek arginfo_class_mysqli_result_data_seek - -#define arginfo_class_mysqli_stmt_execute arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_fetch arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_get_warnings arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_result_metadata arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_more_results arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_next_result arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_num_rows arginfo_class_mysqli_character_set_name - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, param_nr, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_mysqli_stmt_free_result arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_reset arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_prepare arginfo_class_mysqli_multi_query - -#define arginfo_class_mysqli_stmt_store_result arginfo_class_mysqli_character_set_name - -#define arginfo_class_mysqli_stmt_get_result arginfo_class_mysqli_character_set_name - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) ZEND_END_ARG_INFO() @@ -653,3 +410,246 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_escape_string arginfo_mysqli_real_escape_string #define arginfo_mysqli_set_opt arginfo_mysqli_options + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, socket, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_change_user, 0, 0, 3) + ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_character_set_name, 0, 0, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_close arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction + +#define arginfo_class_mysqli_connect arginfo_class_mysqli___construct + +#define arginfo_class_mysqli_dump_debug_info arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_debug, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, debug_options, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_get_charset arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_get_client_info arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_get_connection_stats arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_get_server_info arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_get_warnings arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_init arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, connection_id, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_more_results arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_next_result arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_ping arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4) + ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, sec, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, usec, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_prepare arginfo_class_mysqli_multi_query + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, resultmode, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, socket, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, string_to_escape, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_reap_async_query arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_escape_string arginfo_class_mysqli_real_escape_string + +#define arginfo_class_mysqli_real_query arginfo_class_mysqli_multi_query + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_rollback arginfo_class_mysqli_begin_transaction + +#define arginfo_class_mysqli_savepoint arginfo_class_mysqli_release_savepoint + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_select_db, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_set_charset, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_options, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_set_opt arginfo_class_mysqli_options + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cert, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, certificate_authority, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, certificate_authority_path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_stat arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_init arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_store_result, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_thread_safe arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_use_result arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_refresh, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, mysqli_link, IS_OBJECT, 0) + ZEND_ARG_TYPE_INFO(0, resmode, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_result_close arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_result_free arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_data_seek, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_result_fetch_field arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_result_fetch_fields arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_field_direct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, field_nr, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_all, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, result_type, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_result_fetch_array arginfo_class_mysqli_result_fetch_all + +#define arginfo_class_mysqli_result_fetch_assoc arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_result_fetch_row arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_result_field_seek arginfo_class_mysqli_result_fetch_field_direct + +#define arginfo_class_mysqli_result_free_result arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt___construct, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, mode_in, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, types, IS_STRING, 0) + ZEND_ARG_VARIADIC_INFO(1, vars) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, 0) + ZEND_ARG_VARIADIC_INFO(1, vars) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_data_seek arginfo_class_mysqli_result_data_seek + +#define arginfo_class_mysqli_stmt_execute arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_fetch arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_get_warnings arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_result_metadata arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_more_results arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_next_result arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_num_rows arginfo_class_mysqli_character_set_name + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, param_nr, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_mysqli_stmt_free_result arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_reset arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_prepare arginfo_class_mysqli_multi_query + +#define arginfo_class_mysqli_stmt_store_result arginfo_class_mysqli_character_set_name + +#define arginfo_class_mysqli_stmt_get_result arginfo_class_mysqli_character_set_name diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 3a4c52977f..89a72f63ae 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,14 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass_is_object, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass___toString, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestTrait_testMethod, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -35,3 +26,12 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_leak_bytes, 0, 0, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, bytes, IS_LONG, 0) ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass_is_object, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass___toString, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestTrait_testMethod, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO()