summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-10-09 09:50:18 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-11-18 12:38:10 +0100
commit100552d4b5f648e0d6548c5e7393f8d7c10f0acb (patch)
tree0c941617f170b80dd382c819f61345b9bbf9d0b7
parenta9e8cd2b6b9e24820643b47f427ee10836d944d6 (diff)
downloadphp-git-100552d4b5f648e0d6548c5e7393f8d7c10f0acb.tar.gz
Add stubs for PDO
-rw-r--r--Zend/tests/bug71428.2.phpt4
-rw-r--r--ext/pdo/pdo.c6
-rw-r--r--ext/pdo/pdo.stub.php133
-rw-r--r--ext/pdo/pdo_arginfo.h129
-rw-r--r--ext/pdo/pdo_dbh.c82
-rw-r--r--ext/pdo/pdo_stmt.c115
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_subclass.phpt2
7 files changed, 311 insertions, 160 deletions
diff --git a/Zend/tests/bug71428.2.phpt b/Zend/tests/bug71428.2.phpt
index 9fc15fc8c5..0056bd8144 100644
--- a/Zend/tests/bug71428.2.phpt
+++ b/Zend/tests/bug71428.2.phpt
@@ -5,13 +5,13 @@ bug #71428.2: inheritance of ye olde dynamic interfaces
--FILE--
<?php
interface StatementInterface {
- public function fetch($first = null, $second, $third);
+ public function fetch(int $first = PDO::FETCH_BOTH, int $second = PDO::FETCH_ORI_NEXT, int $third = 0);
}
class Statement extends PDOStatement implements StatementInterface {}
interface StatementInterface1 {
- public function fetch($first = null, $second = null, $third = null);
+ public function fetch(int $first = PDO::FETCH_ASSOC, int $second = PDO::FETCH_ORI_PRIOR, int $third = 1);
}
class Statement1 extends PDOStatement implements StatementInterface1 {}
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 1d81e4c547..cba264ef63 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -29,6 +29,7 @@
#include "php_pdo_int.h"
#include "zend_exceptions.h"
#include "ext/spl/spl_exceptions.h"
+#include "pdo_arginfo.h"
zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
@@ -96,11 +97,6 @@ PHP_FUNCTION(pdo_drivers)
}
/* }}} */
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO(arginfo_pdo_drivers, 0)
-ZEND_END_ARG_INFO()
-/* }}} */
-
/* {{{ pdo_functions[] */
const zend_function_entry pdo_functions[] = {
PHP_FE(pdo_drivers, arginfo_pdo_drivers)
diff --git a/ext/pdo/pdo.stub.php b/ext/pdo/pdo.stub.php
new file mode 100644
index 0000000000..7be5ad3772
--- /dev/null
+++ b/ext/pdo/pdo.stub.php
@@ -0,0 +1,133 @@
+<?php
+
+/* pdo.c */
+
+function pdo_drivers(): array {}
+
+/* pdo_dbh.c */
+
+class PDO {
+ public function __construct(string $dsn, ?string $username = null, ?string $passwd = null, ?array $options = null) {}
+
+ /** @return bool */
+ public function beginTransaction() {}
+
+ /** @return bool */
+ public function commit() {}
+
+ /** @return string|null */
+ public function errorCode() {}
+
+ /** @return array */
+ public function errorInfo() {}
+
+ /** @return int|false */
+ public function exec(string $statement) {}
+
+ /** @return mixed */
+ public function getAttribute(int $attribute) {}
+
+ /** @return array */
+ public static function getAvailableDrivers() {}
+
+ /** @return bool */
+ public function inTransaction() {}
+
+ /** @return string|false */
+ public function lastInsertId(?string $name = null) {}
+
+ /** @return PDOStatement|false */
+ public function prepare(string $statement, array $driver_options = []) {}
+
+ /** @return PDOStatement|false */
+ public function query(string $statement) {}
+
+ /** @return string|false */
+ public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {}
+
+ /** @return bool */
+ public function rollBack() {}
+
+ /**
+ * @param mixed $value
+ * @return bool
+ */
+ public function setAttribute(int $attribute, $value) {}
+}
+
+/* pdo_stmt.c */
+
+class PDOStatement implements Traversable {
+ /**
+ * @param mixed $driverdata
+ * @return bool
+ */
+ public function bindColumn(int|string $column, &$param, int $type = 0, int $maxlen = 0, $driverdata = null) {}
+
+ /**
+ * @param mixed $driver_options
+ * @return bool
+ */
+ public function bindParam(int|string $parameter, &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, $driverdata = null) {}
+
+ /**
+ * @param int|string $parameter
+ * @param mixed $value
+ * @return bool
+ */
+ public function bindValue($parameter, $value, int $type = PDO::PARAM_STR) {}
+
+ /** @return bool */
+ public function closeCursor() {}
+
+ /** @return int|false */
+ public function columnCount() {}
+
+ /** @return false|null */
+ public function debugDumpParams() {}
+
+ /** @return string|false|null */
+ public function errorCode() {}
+
+ /** @return array|false */
+ public function errorInfo() {}
+
+ /** @return bool */
+ public function execute(?array $input_parameters = null) {}
+
+ /** @return mixed */
+ public function fetch(int $fetch_style = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {}
+
+ /**
+ * @param mixed $fetch_argument
+ * @return array|false
+ */
+ public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, $fetch_argument = UNKNOWN, array $ctor_args = []) {}
+
+ /** @return mixed */
+ public function fetchColumn(int $column_number = 0) {}
+
+ /** @return mixed */
+ public function fetchObject(?string $class_name = "stdClass", ?array $ctor_args = null) {}
+
+ /** @return mixed */
+ public function getAttribute(int $attribute) {}
+
+ /** @return array|false */
+ public function getColumnMeta(int $column) {}
+
+ /** @return bool */
+ public function nextRowset() {}
+
+ /** @return int|false */
+ public function rowCount() {}
+
+ /**
+ * @param mixed $value
+ * @return bool
+ */
+ public function setAttribute(int $attribute, $value) {}
+
+ /** @return bool */
+ public function setFetchMode(int $mode, ...$params) {}
+}
diff --git a/ext/pdo/pdo_arginfo.h b/ext/pdo/pdo_arginfo.h
new file mode 100644
index 0000000000..7759d1b310
--- /dev/null
+++ b/ext/pdo/pdo_arginfo.h
@@ -0,0 +1,129 @@
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pdo_drivers, 0, 0, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 1)
+ ZEND_ARG_TYPE_INFO(0, passwd, IS_STRING, 1)
+ ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 1)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_beginTransaction, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDO_commit arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDO_errorCode arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDO_errorInfo arginfo_class_PDO_beginTransaction
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_exec, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_getAttribute, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDO_getAvailableDrivers arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDO_inTransaction arginfo_class_PDO_beginTransaction
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_lastInsertId, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_prepare, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, driver_options, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDO_query arginfo_class_PDO_exec
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, parameter_type, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDO_rollBack arginfo_class_PDO_beginTransaction
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_setAttribute, 0, 0, 2)
+ ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
+ ZEND_ARG_TYPE_MASK(0, column, MAY_BE_LONG|MAY_BE_STRING)
+ ZEND_ARG_INFO(1, param)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, maxlen, IS_LONG, 0)
+ ZEND_ARG_INFO(0, driverdata)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
+ ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_LONG|MAY_BE_STRING)
+ ZEND_ARG_INFO(1, param)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, maxlen, IS_LONG, 0)
+ ZEND_ARG_INFO(0, driverdata)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2)
+ ZEND_ARG_INFO(0, parameter)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDOStatement_closeCursor arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_columnCount arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_debugDumpParams arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_errorCode arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_errorInfo arginfo_class_PDO_beginTransaction
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_execute, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, input_parameters, IS_ARRAY, 1)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetch, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, fetch_style, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, cursor_orientation, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, cursor_offset, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, fetch_style, IS_LONG, 0)
+ ZEND_ARG_INFO(0, fetch_argument)
+ ZEND_ARG_TYPE_INFO(0, ctor_args, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, column_number, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchObject, 0, 0, 0)
+ ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 1)
+ ZEND_ARG_TYPE_INFO(0, ctor_args, IS_ARRAY, 1)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDOStatement_getAttribute arginfo_class_PDO_getAttribute
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getColumnMeta, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_PDOStatement_nextRowset arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_rowCount arginfo_class_PDO_beginTransaction
+
+#define arginfo_class_PDOStatement_setAttribute arginfo_class_PDO_setAttribute
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
+ ZEND_ARG_VARIADIC_INFO(0, params)
+ZEND_END_ARG_INFO()
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 28cca1e11b..2a8eb6c6d4 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -32,6 +32,7 @@
#include "zend_object_handlers.h"
#include "zend_hash.h"
#include "zend_interfaces.h"
+#include "pdo_arginfo.h"
static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value);
@@ -899,8 +900,8 @@ static PHP_METHOD(PDO, getAttribute)
}
/* }}} */
-/* {{{ proto int PDO::exec(string query)
- Execute a query that does not return a row set, returning the number of affected rows */
+/* {{{ proto int PDO::exec(string statement)
+ Execute a statement that does not return a row set, returning the number of affected rows */
static PHP_METHOD(PDO, exec)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
@@ -928,8 +929,8 @@ static PHP_METHOD(PDO, exec)
}
/* }}} */
-/* {{{ proto string PDO::lastInsertId([string seqname])
- Returns the id of the last row that we affected on this connection. Some databases require a sequence or table name to be passed in. Not always meaningful. */
+/* {{{ proto string PDO::lastInsertId([string name])
+ Returns the id of the last row that we affected on this connection. Some databases require a sequence or table name to be passed in. Not always meaningful. */
static PHP_METHOD(PDO, lastInsertId)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
@@ -989,7 +990,7 @@ static PHP_METHOD(PDO, errorCode)
}
/* }}} */
-/* {{{ proto int PDO::errorInfo()
+/* {{{ proto array PDO::errorInfo()
Fetch extended error information associated with the last operation on the database handle */
static PHP_METHOD(PDO, errorInfo)
{
@@ -1120,7 +1121,7 @@ static PHP_METHOD(PDO, query)
/* }}} */
/* {{{ proto string PDO::quote(string string [, int paramtype])
- quotes string for use in a query. The optional paramtype acts as a hint for drivers that have alternate quoting styles. The default value is PDO_PARAM_STR */
+ quotes string for use in a query. The optional paramtype acts as a hint for drivers that have alternate quoting styles. The default value is PDO_PARAM_STR */
static PHP_METHOD(PDO, quote)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
@@ -1171,61 +1172,22 @@ static PHP_METHOD(PDO, getAvailableDrivers)
}
/* }}} */
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 1)
- ZEND_ARG_INFO(0, dsn)
- ZEND_ARG_INFO(0, username)
- ZEND_ARG_INFO(0, passwd)
- ZEND_ARG_INFO(0, options) /* array */
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo_prepare, 0, 0, 1)
- ZEND_ARG_INFO(0, statement)
- ZEND_ARG_INFO(0, options) /* array */
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdo_setattribute, 0)
- ZEND_ARG_INFO(0, attribute)
- ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdo_getattribute, 0)
- ZEND_ARG_INFO(0, attribute)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdo_exec, 0)
- ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo_lastinsertid, 0, 0, 0)
- ZEND_ARG_INFO(0, seqname)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo_quote, 0, 0, 1)
- ZEND_ARG_INFO(0, string)
- ZEND_ARG_INFO(0, paramtype)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdo__void, 0)
-ZEND_END_ARG_INFO()
-/* }}} */
-
const zend_function_entry pdo_dbh_functions[] = /* {{{ */ {
- ZEND_MALIAS(PDO, __construct, dbh_constructor, arginfo_pdo___construct, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, prepare, arginfo_pdo_prepare, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, beginTransaction, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, commit, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, rollBack, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, inTransaction, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, setAttribute, arginfo_pdo_setattribute, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, exec, arginfo_pdo_exec, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, query, NULL, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, lastInsertId, arginfo_pdo_lastinsertid, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, errorCode, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, errorInfo, arginfo_pdo__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, getAttribute, arginfo_pdo_getattribute, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, quote, arginfo_pdo_quote, ZEND_ACC_PUBLIC)
- PHP_ME(PDO, getAvailableDrivers, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_MALIAS(PDO, __construct, dbh_constructor, arginfo_class_PDO___construct, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, prepare, arginfo_class_PDO_prepare, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, beginTransaction, arginfo_class_PDO_beginTransaction, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, commit, arginfo_class_PDO_commit, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, rollBack, arginfo_class_PDO_rollBack, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, inTransaction, arginfo_class_PDO_inTransaction, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, setAttribute, arginfo_class_PDO_setAttribute, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, exec, arginfo_class_PDO_exec, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, query, arginfo_class_PDO_query, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, lastInsertId, arginfo_class_PDO_lastInsertId, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, errorCode, arginfo_class_PDO_errorCode, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, errorInfo, arginfo_class_PDO_errorInfo, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, getAttribute, arginfo_class_PDO_getAttribute, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, quote, arginfo_class_PDO_quote, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, getAvailableDrivers, arginfo_class_PDO_getAvailableDrivers, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
/* }}} */
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 94caae7078..2a702836c5 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -32,77 +32,7 @@
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "php_memory_streams.h"
-
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO(arginfo_pdostatement__void, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_execute, 0, 0, 0)
- ZEND_ARG_INFO(0, bound_input_params) /* array */
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetch, 0, 0, 0)
- ZEND_ARG_INFO(0, how)
- ZEND_ARG_INFO(0, orientation)
- ZEND_ARG_INFO(0, offset)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchobject, 0, 0, 0)
- ZEND_ARG_INFO(0, class_name)
- ZEND_ARG_INFO(0, ctor_args) /* array */
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchcolumn, 0, 0, 0)
- ZEND_ARG_INFO(0, column_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchall, 0, 0, 0)
- ZEND_ARG_INFO(0, how)
- ZEND_ARG_INFO(0, class_name)
- ZEND_ARG_INFO(0, ctor_args) /* array */
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindvalue, 0, 0, 2)
- ZEND_ARG_INFO(0, paramno)
- ZEND_ARG_INFO(0, param)
- ZEND_ARG_INFO(0, type)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindparam, 0, 0, 2)
- ZEND_ARG_INFO(0, paramno)
- ZEND_ARG_INFO(1, param)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, maxlen)
- ZEND_ARG_INFO(0, driverdata)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindcolumn, 0, 0, 2)
- ZEND_ARG_INFO(0, column)
- ZEND_ARG_INFO(1, param)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, maxlen)
- ZEND_ARG_INFO(0, driverdata)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_setattribute, 0)
- ZEND_ARG_INFO(0, attribute)
- ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_getattribute, 0)
- ZEND_ARG_INFO(0, attribute)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_getcolumnmeta, 0)
- ZEND_ARG_INFO(0, column)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_setfetchmode, 0, 0, 1)
- ZEND_ARG_INFO(0, mode)
- ZEND_ARG_INFO(0, param)
- ZEND_ARG_INFO(0, params)
-ZEND_END_ARG_INFO()
-/* }}} */
+#include "pdo_arginfo.h"
#define PHP_STMT_GET_OBJ \
pdo_stmt_t *stmt = Z_PDO_STMT_P(ZEND_THIS); \
@@ -1821,7 +1751,7 @@ static PHP_METHOD(PDOStatement, getColumnMeta)
}
/* }}} */
-/* {{{ proto bool PDOStatement::setFetchMode(int mode [mixed* params])
+/* {{{ proto bool PDOStatement::setFetchMode(int mode [, mixed* params])
Changes the default fetch mode for subsequent fetches (params have different meaning for different fetch modes) */
int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip)
@@ -2103,6 +2033,8 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
struct pdo_bound_param_data *param;
PHP_STMT_GET_OBJ;
+ ZEND_PARSE_PARAMETERS_NONE();
+
if (out == NULL) {
RETURN_FALSE;
}
@@ -2151,27 +2083,26 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
php_stream_close(out);
}
/* }}} */
-
const zend_function_entry pdo_dbstmt_functions[] = {
- PHP_ME(PDOStatement, execute, arginfo_pdostatement_execute, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, fetch, arginfo_pdostatement_fetch, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, bindParam, arginfo_pdostatement_bindparam, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, bindColumn, arginfo_pdostatement_bindcolumn, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, bindValue, arginfo_pdostatement_bindvalue, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, rowCount, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, fetchColumn, arginfo_pdostatement_fetchcolumn, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, fetchAll, arginfo_pdostatement_fetchall, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, fetchObject, arginfo_pdostatement_fetchobject, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, errorCode, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, errorInfo, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, setAttribute, arginfo_pdostatement_setattribute, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, getAttribute, arginfo_pdostatement_getattribute, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, columnCount, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, getColumnMeta, arginfo_pdostatement_getcolumnmeta, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, setFetchMode, arginfo_pdostatement_setfetchmode, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, nextRowset, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, closeCursor, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
- PHP_ME(PDOStatement, debugDumpParams, arginfo_pdostatement__void, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, execute, arginfo_class_PDOStatement_execute, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetch, arginfo_class_PDOStatement_fetch, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindParam, arginfo_class_PDOStatement_bindParam, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindColumn, arginfo_class_PDOStatement_bindColumn, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindValue, arginfo_class_PDOStatement_bindValue, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, rowCount, arginfo_class_PDOStatement_rowCount, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchColumn, arginfo_class_PDOStatement_fetchColumn, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchAll, arginfo_class_PDOStatement_fetchAll, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchObject, arginfo_class_PDOStatement_fetchObject, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, errorCode, arginfo_class_PDOStatement_errorCode, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, errorInfo, arginfo_class_PDOStatement_errorInfo, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, setAttribute, arginfo_class_PDOStatement_setAttribute, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, getAttribute, arginfo_class_PDOStatement_getAttribute, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, columnCount, arginfo_class_PDOStatement_columnCount, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, getColumnMeta, arginfo_class_PDOStatement_getColumnMeta, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, setFetchMode, arginfo_class_PDOStatement_setFetchMode, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, nextRowset, arginfo_class_PDOStatement_nextRowset, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, closeCursor, arginfo_class_PDOStatement_closeCursor, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, debugDumpParams, arginfo_class_PDOStatement_debugDumpParams, ZEND_ACC_PUBLIC)
PHP_FE_END
};
diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
index 604a13bdb3..83158b3484 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
@@ -24,7 +24,7 @@ MySQLPDOTest::skip();
return parent::exec($statement);
}
- public function query() {
+ public function query($statement) {
$this->protocol();
return call_user_func_array(array($this, 'parent::query'), func_get_args());
}