From 4815be44db6b7a73cabfa872dc17d7e1574e1930 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 19 Apr 2020 20:05:16 +0200 Subject: [PATCH] Generate function entries from stubs Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3. Closes GH-5421 --- ext/pcntl/pcntl.c | 45 +-------- ext/pcntl/pcntl.stub.php | 4 +- ext/pcntl/pcntl_arginfo.h | 90 +++++++++++++++++- ext/simplexml/simplexml.c | 35 +------ ext/simplexml/simplexml.stub.php | 7 +- ext/simplexml/simplexml_arginfo.h | 45 +++++++++ ext/simplexml/sxe.c | 28 ++---- ext/simplexml/sxe.stub.php | 2 + ext/simplexml/sxe_arginfo.h | 21 +++++ ext/snmp/php_snmp.h | 36 ------- ext/snmp/snmp.c | 72 +++----------- ext/snmp/snmp.stub.php | 2 + ext/snmp/snmp_arginfo.h | 76 +++++++++++++++ ext/soap/soap.c | 121 ++---------------------- ext/soap/soap.stub.php | 63 +++++++------ ext/soap/soap_arginfo.h | 96 +++++++++++++++++++ ext/sqlite3/sqlite3.c | 150 +++++++++--------------------- ext/sqlite3/sqlite3.stub.php | 14 ++- ext/sqlite3/sqlite3_arginfo.h | 108 +++++++++++++++++++++ 19 files changed, 563 insertions(+), 452 deletions(-) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index a4554a61cd..a52429e549 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -57,53 +57,10 @@ ZEND_DECLARE_MODULE_GLOBALS(pcntl) static PHP_GINIT_FUNCTION(pcntl); -static const zend_function_entry pcntl_functions[] = { - PHP_FE(pcntl_fork, arginfo_pcntl_fork) - PHP_FE(pcntl_waitpid, arginfo_pcntl_waitpid) - PHP_FE(pcntl_wait, arginfo_pcntl_wait) - PHP_FE(pcntl_signal, arginfo_pcntl_signal) - PHP_FE(pcntl_signal_get_handler, arginfo_pcntl_signal_get_handler) - PHP_FE(pcntl_signal_dispatch, arginfo_pcntl_signal_dispatch) - PHP_FE(pcntl_wifexited, arginfo_pcntl_wifexited) - PHP_FE(pcntl_wifstopped, arginfo_pcntl_wifstopped) - PHP_FE(pcntl_wifsignaled, arginfo_pcntl_wifsignaled) - PHP_FE(pcntl_wexitstatus, arginfo_pcntl_wifexitstatus) - PHP_FE(pcntl_wtermsig, arginfo_pcntl_wtermsig) - PHP_FE(pcntl_wstopsig, arginfo_pcntl_wstopsig) - PHP_FE(pcntl_exec, arginfo_pcntl_exec) - PHP_FE(pcntl_alarm, arginfo_pcntl_alarm) - PHP_FE(pcntl_get_last_error, arginfo_pcntl_get_last_error) - PHP_FALIAS(pcntl_errno, pcntl_get_last_error, arginfo_pcntl_errno) - PHP_FE(pcntl_strerror, arginfo_pcntl_strerror) -#ifdef HAVE_GETPRIORITY - PHP_FE(pcntl_getpriority, arginfo_pcntl_getpriority) -#endif -#ifdef HAVE_SETPRIORITY - PHP_FE(pcntl_setpriority, arginfo_pcntl_setpriority) -#endif -#ifdef HAVE_SIGPROCMASK - PHP_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask) -#endif -#ifdef HAVE_STRUCT_SIGINFO_T -# if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT - PHP_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo) - PHP_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait) -# endif -#endif -#ifdef HAVE_WCONTINUED - PHP_FE(pcntl_wifcontinued, arginfo_pcntl_wifcontinued) -#endif - PHP_FE(pcntl_async_signals, arginfo_pcntl_async_signals) -#ifdef HAVE_UNSHARE - PHP_FE(pcntl_unshare, arginfo_pcntl_unshare) -#endif - PHP_FE_END -}; - zend_module_entry pcntl_module_entry = { STANDARD_MODULE_HEADER, "pcntl", - pcntl_functions, + ext_functions, PHP_MINIT(pcntl), PHP_MSHUTDOWN(pcntl), PHP_RINIT(pcntl), diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 82bac57316..60e9c98a7f 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -1,5 +1,7 @@ get_iterator = php_sxe_get_iterator; diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php index f78694c139..68eaf2be6e 100644 --- a/ext/simplexml/simplexml.stub.php +++ b/ext/simplexml/simplexml.stub.php @@ -1,5 +1,7 @@ create_object = ce_SimpleXMLElement->create_object; diff --git a/ext/simplexml/sxe.stub.php b/ext/simplexml/sxe.stub.php index d609e93846..a6e24dbc5c 100644 --- a/ext/simplexml/sxe.stub.php +++ b/ext/simplexml/sxe.stub.php @@ -1,5 +1,7 @@ value pairs for multi OID request */ -PHP_METHOD(snmp, get) +PHP_METHOD(SNMP, get) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, (-1)); } @@ -1591,7 +1557,7 @@ PHP_METHOD(snmp, get) /* {{{ proto mixed SNMP::getnext(mixed object_id) Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */ -PHP_METHOD(snmp, getnext) +PHP_METHOD(SNMP, getnext) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, (-1)); } @@ -1599,7 +1565,7 @@ PHP_METHOD(snmp, getnext) /* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]]) Return all objects including their respective object id within the specified one as array of oid->value pairs */ -PHP_METHOD(snmp, walk) +PHP_METHOD(SNMP, walk) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1)); } @@ -1607,7 +1573,7 @@ PHP_METHOD(snmp, walk) /* {{{ proto bool SNMP::set(mixed object_id, mixed type, mixed value) Set the value of a SNMP object */ -PHP_METHOD(snmp, set) +PHP_METHOD(SNMP, set) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, (-1)); } @@ -1615,7 +1581,7 @@ PHP_METHOD(snmp, set) /* {{{ proto bool SNMP::setSecurity(string sec_level, [ string auth_protocol, string auth_passphrase [, string priv_protocol, string priv_passphrase [, string contextName [, string contextEngineID]]]]) Set SNMPv3 security-related session parameters */ -PHP_METHOD(snmp, setSecurity) +PHP_METHOD(SNMP, setSecurity) { php_snmp_object *snmp_object; zval *object = ZEND_THIS; @@ -1640,7 +1606,7 @@ PHP_METHOD(snmp, setSecurity) /* {{{ proto int SNMP::getErrno() Get last error code number */ -PHP_METHOD(snmp, getErrno) +PHP_METHOD(SNMP, getErrno) { php_snmp_object *snmp_object; zval *object = ZEND_THIS; @@ -1658,7 +1624,7 @@ PHP_METHOD(snmp, getErrno) /* {{{ proto int SNMP::getError() Get last error message */ -PHP_METHOD(snmp, getError) +PHP_METHOD(SNMP, getError) { php_snmp_object *snmp_object; zval *object = ZEND_THIS; @@ -1979,22 +1945,6 @@ static void free_php_snmp_properties(zval *el) /* {{{ */ } /* }}} */ -/* {{{ php_snmp_class_methods[] */ -static const zend_function_entry php_snmp_class_methods[] = { - PHP_ME(snmp, __construct, arginfo_class_SNMP___construct, ZEND_ACC_PUBLIC) - PHP_ME(snmp, close, arginfo_class_SNMP_close, ZEND_ACC_PUBLIC) - PHP_ME(snmp, setSecurity, arginfo_class_SNMP_setSecurity, ZEND_ACC_PUBLIC) - - PHP_ME(snmp, get, arginfo_class_SNMP_get, ZEND_ACC_PUBLIC) - PHP_ME(snmp, getnext, arginfo_class_SNMP_getnext, ZEND_ACC_PUBLIC) - PHP_ME(snmp, walk, arginfo_class_SNMP_walk, ZEND_ACC_PUBLIC) - PHP_ME(snmp, set, arginfo_class_SNMP_set, ZEND_ACC_PUBLIC) - PHP_ME(snmp, getErrno, arginfo_class_SNMP_getErrno, ZEND_ACC_PUBLIC) - PHP_ME(snmp, getError, arginfo_class_SNMP_getError, ZEND_ACC_PUBLIC) - - PHP_FE_END -}; - #define PHP_SNMP_PROPERTY_ENTRY_RECORD(name) \ { "" #name "", sizeof("" #name "") - 1, php_snmp_read_##name, php_snmp_write_##name } @@ -2042,7 +1992,7 @@ PHP_MINIT_FUNCTION(snmp) php_snmp_object_handlers.get_gc = php_snmp_get_gc; /* Register SNMP Class */ - INIT_CLASS_ENTRY(ce, "SNMP", php_snmp_class_methods); + INIT_CLASS_ENTRY(ce, "SNMP", class_SNMP_methods); ce.create_object = php_snmp_object_new; php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo); php_snmp_object_handlers.clone_obj = NULL; @@ -2137,7 +2087,7 @@ zend_module_entry snmp_module_entry = { NULL, snmp_module_deps, "snmp", - snmp_functions, + ext_functions, PHP_MINIT(snmp), PHP_MSHUTDOWN(snmp), NULL, diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php index bee2b39318..06632b602d 100644 --- a/ext/snmp/snmp.stub.php +++ b/ext/snmp/snmp.stub.php @@ -1,5 +1,7 @@ = 3006011 /* {{{ proto bool SQLite3::backup(SQLite3 destination_db[, string source_dbname = "main"[, string destination_dbname = "main"]]) Backups the current database to another one. */ -PHP_METHOD(sqlite3, backup) +PHP_METHOD(SQLite3, backup) { php_sqlite3_db_object *source_obj; php_sqlite3_db_object *destination_obj; @@ -1453,7 +1453,7 @@ PHP_METHOD(sqlite3, backup) /* {{{ proto int SQLite3Stmt::paramCount() Returns the number of parameters within the prepared statement. */ -PHP_METHOD(sqlite3stmt, paramCount) +PHP_METHOD(SQLite3Stmt, paramCount) { php_sqlite3_stmt *stmt_obj; zval *object = ZEND_THIS; @@ -1472,7 +1472,7 @@ PHP_METHOD(sqlite3stmt, paramCount) /* {{{ proto bool SQLite3Stmt::close() Closes the prepared statement. */ -PHP_METHOD(sqlite3stmt, close) +PHP_METHOD(SQLite3Stmt, close) { php_sqlite3_stmt *stmt_obj; zval *object = ZEND_THIS; @@ -1494,7 +1494,7 @@ PHP_METHOD(sqlite3stmt, close) /* {{{ proto bool SQLite3Stmt::reset() Reset the prepared statement to the state before it was executed, bindings still remain. */ -PHP_METHOD(sqlite3stmt, reset) +PHP_METHOD(SQLite3Stmt, reset) { php_sqlite3_stmt *stmt_obj; zval *object = ZEND_THIS; @@ -1517,7 +1517,7 @@ PHP_METHOD(sqlite3stmt, reset) /* {{{ proto bool SQLite3Stmt::clear() Clear all current bound parameters. */ -PHP_METHOD(sqlite3stmt, clear) +PHP_METHOD(SQLite3Stmt, clear) { php_sqlite3_stmt *stmt_obj; zval *object = ZEND_THIS; @@ -1547,7 +1547,7 @@ PHP_METHOD(sqlite3stmt, clear) /* {{{ proto bool SQLite3Stmt::readOnly() Returns true if a statement is definitely read only */ -PHP_METHOD(sqlite3stmt, readOnly) +PHP_METHOD(SQLite3Stmt, readOnly) { php_sqlite3_stmt *stmt_obj; zval *object = ZEND_THIS; @@ -1677,7 +1677,7 @@ static int php_sqlite3_bind_params(php_sqlite3_stmt *stmt_obj) /* {{{ */ /* {{{ proto string SQLite3Stmt::getSQL([expanded = false]) Returns the SQL statement used to prepare the query. If expanded is true, binded parameters and values will be expanded. */ -PHP_METHOD(sqlite3stmt, getSQL) +PHP_METHOD(SQLite3Stmt, getSQL) { php_sqlite3_stmt *stmt_obj; zend_bool expanded = 0; @@ -1822,7 +1822,7 @@ static void sqlite3stmt_bind(INTERNAL_FUNCTION_PARAMETERS) /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type]) Bind Parameter to a stmt variable. */ -PHP_METHOD(sqlite3stmt, bindParam) +PHP_METHOD(SQLite3Stmt, bindParam) { sqlite3stmt_bind(INTERNAL_FUNCTION_PARAM_PASSTHRU); } @@ -1830,7 +1830,7 @@ PHP_METHOD(sqlite3stmt, bindParam) /* {{{ proto bool SQLite3Stmt::bindValue(int parameter_number, mixed parameter [, int type]) Bind Value of a parameter to a stmt variable. */ -PHP_METHOD(sqlite3stmt, bindValue) +PHP_METHOD(SQLite3Stmt, bindValue) { sqlite3stmt_bind(INTERNAL_FUNCTION_PARAM_PASSTHRU); } @@ -1840,7 +1840,7 @@ PHP_METHOD(sqlite3stmt, bindValue) /* {{{ proto SQLite3Result SQLite3Stmt::execute() Executes a prepared statement and returns a result set object. */ -PHP_METHOD(sqlite3stmt, execute) +PHP_METHOD(SQLite3Stmt, execute) { php_sqlite3_stmt *stmt_obj; php_sqlite3_result *result; @@ -1901,7 +1901,7 @@ PHP_METHOD(sqlite3stmt, execute) /* {{{ proto SQLite3Stmt::__construct(SQLite3 dbobject, String Statement) __constructor for SQLite3Stmt. */ -PHP_METHOD(sqlite3stmt, __construct) +PHP_METHOD(SQLite3Stmt, __construct) { php_sqlite3_stmt *stmt_obj; php_sqlite3_db_object *db_obj; @@ -1951,7 +1951,7 @@ PHP_METHOD(sqlite3stmt, __construct) /* {{{ proto int SQLite3Result::numColumns() Number of columns in the result set. */ -PHP_METHOD(sqlite3result, numColumns) +PHP_METHOD(SQLite3Result, numColumns) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -1969,7 +1969,7 @@ PHP_METHOD(sqlite3result, numColumns) /* {{{ proto string SQLite3Result::columnName(int column) Returns the name of the nth column. */ -PHP_METHOD(sqlite3result, columnName) +PHP_METHOD(SQLite3Result, columnName) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -1994,7 +1994,7 @@ PHP_METHOD(sqlite3result, columnName) /* {{{ proto int SQLite3Result::columnType(int column) Returns the type of the nth column. */ -PHP_METHOD(sqlite3result, columnType) +PHP_METHOD(SQLite3Result, columnType) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -2017,7 +2017,7 @@ PHP_METHOD(sqlite3result, columnType) /* {{{ proto array SQLite3Result::fetchArray([int mode]) Fetch a result row as both an associative or numerically indexed array or both. */ -PHP_METHOD(sqlite3result, fetchArray) +PHP_METHOD(SQLite3Result, fetchArray) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -2073,7 +2073,7 @@ PHP_METHOD(sqlite3result, fetchArray) /* {{{ proto bool SQLite3Result::reset() Resets the result set back to the first row. */ -PHP_METHOD(sqlite3result, reset) +PHP_METHOD(SQLite3Result, reset) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -2095,7 +2095,7 @@ PHP_METHOD(sqlite3result, reset) /* {{{ proto bool SQLite3Result::finalize() Closes the result set. */ -PHP_METHOD(sqlite3result, finalize) +PHP_METHOD(SQLite3Result, finalize) { php_sqlite3_result *result_obj; zval *object = ZEND_THIS; @@ -2121,76 +2121,12 @@ PHP_METHOD(sqlite3result, finalize) /* {{{ proto SQLite3Result::__construct() __constructor for SQLite3Result. */ -PHP_METHOD(sqlite3result, __construct) +PHP_METHOD(SQLite3Result, __construct) { zend_throw_exception(zend_ce_exception, "SQLite3Result cannot be directly instantiated", 0); } /* }}} */ -/* {{{ php_sqlite3_class_methods */ -static const zend_function_entry php_sqlite3_class_methods[] = { - PHP_ME(sqlite3, open, arginfo_class_SQLite3_open, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, close, arginfo_class_SQLite3_close, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, exec, arginfo_class_SQLite3_query, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, version, arginfo_class_SQLite3_version, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(sqlite3, lastInsertRowID, arginfo_class_SQLite3_lastInsertRowID, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, lastErrorCode, arginfo_class_SQLite3_lastErrorCode, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, lastExtendedErrorCode, arginfo_class_SQLite3_lastExtendedErrorCode, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, enableExtendedResultCodes, arginfo_class_SQLite3_enableExtendedResultCodes, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, lastErrorMsg, arginfo_class_SQLite3_lastErrorMsg, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, busyTimeout, arginfo_class_SQLite3_busyTimeout, ZEND_ACC_PUBLIC) -#ifndef SQLITE_OMIT_LOAD_EXTENSION - PHP_ME(sqlite3, loadExtension, arginfo_class_SQLite3_loadExtension, ZEND_ACC_PUBLIC) -#endif - PHP_ME(sqlite3, changes, arginfo_class_SQLite3_changes, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, escapeString, arginfo_class_SQLite3_escapeString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(sqlite3, prepare, arginfo_class_SQLite3_prepare, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, query, arginfo_class_SQLite3_query, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, querySingle, arginfo_class_SQLite3_querySingle, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, createFunction, arginfo_class_SQLite3_createFunction, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, createAggregate, arginfo_class_SQLite3_createAggregate, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, createCollation, arginfo_class_SQLite3_createCollation, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, openBlob, arginfo_class_SQLite3_openBlob, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, enableExceptions, arginfo_class_SQLite3_enableExceptions, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3, setAuthorizer, arginfo_class_SQLite3_setAuthorizer, ZEND_ACC_PUBLIC) -#if SQLITE_VERSION_NUMBER >= 3006011 - PHP_ME(sqlite3, backup, arginfo_class_SQLite3_backup, ZEND_ACC_PUBLIC) -#endif - /* Aliases */ - PHP_MALIAS(sqlite3, __construct, open, arginfo_class_SQLite3___construct, ZEND_ACC_PUBLIC) - PHP_FE_END -}; -/* }}} */ - -/* {{{ php_sqlite3_stmt_class_methods */ -static const zend_function_entry php_sqlite3_stmt_class_methods[] = { - PHP_ME(sqlite3stmt, paramCount, arginfo_class_SQLite3Stmt_paramCount, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, close, arginfo_class_SQLite3Stmt_close, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, reset, arginfo_class_SQLite3Stmt_reset, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, clear, arginfo_class_SQLite3Stmt_clear, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, execute, arginfo_class_SQLite3Stmt_execute, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, bindParam, arginfo_class_SQLite3Stmt_bindParam, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, bindValue, arginfo_class_SQLite3Stmt_bindValue, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, readOnly, arginfo_class_SQLite3Stmt_readOnly, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, getSQL, arginfo_class_SQLite3Stmt_getSQL, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3stmt, __construct, arginfo_class_SQLite3Stmt___construct, ZEND_ACC_PRIVATE) - PHP_FE_END -}; -/* }}} */ - -/* {{{ php_sqlite3_result_class_methods */ -static const zend_function_entry php_sqlite3_result_class_methods[] = { - PHP_ME(sqlite3result, numColumns, arginfo_class_SQLite3Result_numColumns, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, columnName, arginfo_class_SQLite3Result_columnName, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, columnType, arginfo_class_SQLite3Result_columnType, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, fetchArray, arginfo_class_SQLite3Result_fetchArray, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, reset, arginfo_class_SQLite3Result_reset, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, finalize, arginfo_class_SQLite3Result_finalize, ZEND_ACC_PUBLIC) - PHP_ME(sqlite3result, __construct, arginfo_class_SQLite3Result___construct, ZEND_ACC_PRIVATE) - PHP_FE_END -}; -/* }}} */ - /* {{{ Authorization Callback */ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, const char *arg2, const char *arg3, const char *arg4) @@ -2499,7 +2435,7 @@ PHP_MINIT_FUNCTION(sqlite3) memcpy(&sqlite3_result_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); /* Register SQLite 3 Class */ - INIT_CLASS_ENTRY(ce, "SQLite3", php_sqlite3_class_methods); + INIT_CLASS_ENTRY(ce, "SQLite3", class_SQLite3_methods); ce.create_object = php_sqlite3_object_new; sqlite3_object_handlers.offset = XtOffsetOf(php_sqlite3_db_object, zo); sqlite3_object_handlers.clone_obj = NULL; @@ -2509,7 +2445,7 @@ PHP_MINIT_FUNCTION(sqlite3) php_sqlite3_sc_entry->unserialize = zend_class_unserialize_deny; /* Register SQLite 3 Prepared Statement Class */ - INIT_CLASS_ENTRY(ce, "SQLite3Stmt", php_sqlite3_stmt_class_methods); + INIT_CLASS_ENTRY(ce, "SQLite3Stmt", class_SQLite3Stmt_methods); ce.create_object = php_sqlite3_stmt_object_new; sqlite3_stmt_object_handlers.offset = XtOffsetOf(php_sqlite3_stmt, zo); sqlite3_stmt_object_handlers.clone_obj = NULL; @@ -2519,7 +2455,7 @@ PHP_MINIT_FUNCTION(sqlite3) php_sqlite3_stmt_entry->unserialize = zend_class_unserialize_deny; /* Register SQLite 3 Result Class */ - INIT_CLASS_ENTRY(ce, "SQLite3Result", php_sqlite3_result_class_methods); + INIT_CLASS_ENTRY(ce, "SQLite3Result", class_SQLite3Result_methods); ce.create_object = php_sqlite3_result_object_new; sqlite3_result_object_handlers.offset = XtOffsetOf(php_sqlite3_result, zo); sqlite3_result_object_handlers.clone_obj = NULL; diff --git a/ext/sqlite3/sqlite3.stub.php b/ext/sqlite3/sqlite3.stub.php index 18478d85b3..42ba303b00 100644 --- a/ext/sqlite3/sqlite3.stub.php +++ b/ext/sqlite3/sqlite3.stub.php @@ -1,7 +1,10 @@ = 3006011 +ZEND_METHOD(SQLite3, backup); +#endif +ZEND_METHOD(SQLite3, escapeString); +ZEND_METHOD(SQLite3, prepare); +ZEND_METHOD(SQLite3, exec); +ZEND_METHOD(SQLite3, query); +ZEND_METHOD(SQLite3, querySingle); +ZEND_METHOD(SQLite3, createFunction); +ZEND_METHOD(SQLite3, createAggregate); +ZEND_METHOD(SQLite3, createCollation); +ZEND_METHOD(SQLite3, openBlob); +ZEND_METHOD(SQLite3, enableExceptions); +ZEND_METHOD(SQLite3, enableExtendedResultCodes); +ZEND_METHOD(SQLite3, setAuthorizer); +ZEND_METHOD(SQLite3Stmt, __construct); +ZEND_METHOD(SQLite3Stmt, bindParam); +ZEND_METHOD(SQLite3Stmt, bindValue); +ZEND_METHOD(SQLite3Stmt, clear); +ZEND_METHOD(SQLite3Stmt, close); +ZEND_METHOD(SQLite3Stmt, execute); +ZEND_METHOD(SQLite3Stmt, getSQL); +ZEND_METHOD(SQLite3Stmt, paramCount); +ZEND_METHOD(SQLite3Stmt, readOnly); +ZEND_METHOD(SQLite3Stmt, reset); +ZEND_METHOD(SQLite3Result, __construct); +ZEND_METHOD(SQLite3Result, numColumns); +ZEND_METHOD(SQLite3Result, columnName); +ZEND_METHOD(SQLite3Result, columnType); +ZEND_METHOD(SQLite3Result, fetchArray); +ZEND_METHOD(SQLite3Result, reset); +ZEND_METHOD(SQLite3Result, finalize); + + +static const zend_function_entry class_SQLite3_methods[] = { + ZEND_MALIAS(SQLite3, __construct, open, arginfo_class_SQLite3___construct, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, open, arginfo_class_SQLite3_open, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, close, arginfo_class_SQLite3_close, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, version, arginfo_class_SQLite3_version, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(SQLite3, lastInsertRowID, arginfo_class_SQLite3_lastInsertRowID, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, lastErrorCode, arginfo_class_SQLite3_lastErrorCode, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, lastExtendedErrorCode, arginfo_class_SQLite3_lastExtendedErrorCode, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, lastErrorMsg, arginfo_class_SQLite3_lastErrorMsg, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, changes, arginfo_class_SQLite3_changes, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, busyTimeout, arginfo_class_SQLite3_busyTimeout, ZEND_ACC_PUBLIC) +#if !defined(SQLITE_OMIT_LOAD_EXTENSION) + ZEND_ME(SQLite3, loadExtension, arginfo_class_SQLite3_loadExtension, ZEND_ACC_PUBLIC) +#endif +#if SQLITE_VERSION_NUMBER >= 3006011 + ZEND_ME(SQLite3, backup, arginfo_class_SQLite3_backup, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(SQLite3, escapeString, arginfo_class_SQLite3_escapeString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(SQLite3, prepare, arginfo_class_SQLite3_prepare, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, exec, arginfo_class_SQLite3_exec, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, query, arginfo_class_SQLite3_query, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, querySingle, arginfo_class_SQLite3_querySingle, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, createFunction, arginfo_class_SQLite3_createFunction, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, createAggregate, arginfo_class_SQLite3_createAggregate, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, createCollation, arginfo_class_SQLite3_createCollation, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, openBlob, arginfo_class_SQLite3_openBlob, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, enableExceptions, arginfo_class_SQLite3_enableExceptions, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, enableExtendedResultCodes, arginfo_class_SQLite3_enableExtendedResultCodes, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3, setAuthorizer, arginfo_class_SQLite3_setAuthorizer, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_SQLite3Stmt_methods[] = { + ZEND_ME(SQLite3Stmt, __construct, arginfo_class_SQLite3Stmt___construct, ZEND_ACC_PRIVATE) + ZEND_ME(SQLite3Stmt, bindParam, arginfo_class_SQLite3Stmt_bindParam, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, bindValue, arginfo_class_SQLite3Stmt_bindValue, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, clear, arginfo_class_SQLite3Stmt_clear, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, close, arginfo_class_SQLite3Stmt_close, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, execute, arginfo_class_SQLite3Stmt_execute, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, getSQL, arginfo_class_SQLite3Stmt_getSQL, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, paramCount, arginfo_class_SQLite3Stmt_paramCount, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, readOnly, arginfo_class_SQLite3Stmt_readOnly, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Stmt, reset, arginfo_class_SQLite3Stmt_reset, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_SQLite3Result_methods[] = { + ZEND_ME(SQLite3Result, __construct, arginfo_class_SQLite3Result___construct, ZEND_ACC_PRIVATE) + ZEND_ME(SQLite3Result, numColumns, arginfo_class_SQLite3Result_numColumns, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Result, columnName, arginfo_class_SQLite3Result_columnName, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Result, columnType, arginfo_class_SQLite3Result_columnType, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Result, fetchArray, arginfo_class_SQLite3Result_fetchArray, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Result, reset, arginfo_class_SQLite3Result_reset, ZEND_ACC_PUBLIC) + ZEND_ME(SQLite3Result, finalize, arginfo_class_SQLite3Result_finalize, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; -- 2.40.0