@@ -1735,9 +1735,8 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa
1735
1735
}
1736
1736
/* }}} */
1737
1737
1738
- /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type])
1739
- Bind Parameter to a stmt variable. */
1740
- PHP_METHOD (sqlite3stmt , bindParam )
1738
+ /* {{{ Common implementation of ::bindParam() and ::bindValue */
1739
+ static void sqlite3stmt_bind (INTERNAL_FUNCTION_PARAMETERS )
1741
1740
{
1742
1741
php_sqlite3_stmt * stmt_obj ;
1743
1742
zval * object = ZEND_THIS ;
@@ -1774,42 +1773,19 @@ PHP_METHOD(sqlite3stmt, bindParam)
1774
1773
}
1775
1774
/* }}} */
1776
1775
1776
+ /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type])
1777
+ Bind Parameter to a stmt variable. */
1778
+ PHP_METHOD (sqlite3stmt , bindParam )
1779
+ {
1780
+ sqlite3stmt_bind (INTERNAL_FUNCTION_PARAM_PASSTHRU );
1781
+ }
1782
+ /* }}} */
1783
+
1777
1784
/* {{{ proto bool SQLite3Stmt::bindValue(int parameter_number, mixed parameter [, int type])
1778
1785
Bind Value of a parameter to a stmt variable. */
1779
1786
PHP_METHOD (sqlite3stmt , bindValue )
1780
1787
{
1781
- php_sqlite3_stmt * stmt_obj ;
1782
- zval * object = ZEND_THIS ;
1783
- struct php_sqlite3_bound_param param = {0 };
1784
- zval * parameter ;
1785
- stmt_obj = Z_SQLITE3_STMT_P (object );
1786
-
1787
- param .param_number = -1 ;
1788
- param .type = SQLITE3_TEXT ;
1789
-
1790
- if (zend_parse_parameters_ex (ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS (), "lz|l" , & param .param_number , & parameter , & param .type ) == FAILURE ) {
1791
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Sz|l" , & param .name , & parameter , & param .type ) == FAILURE ) {
1792
- return ;
1793
- }
1794
- }
1795
-
1796
- SQLITE3_CHECK_INITIALIZED (stmt_obj -> db_obj , stmt_obj -> initialised , SQLite3 );
1797
- SQLITE3_CHECK_INITIALIZED_STMT (stmt_obj -> stmt , SQLite3Stmt );
1798
-
1799
- ZVAL_COPY (& param .parameter , parameter );
1800
-
1801
- if (ZEND_NUM_ARGS () < 3 ) {
1802
- PHP_SQLITE3_SET_TYPE (parameter , param );
1803
- }
1804
-
1805
- if (!register_bound_parameter_to_sqlite (& param , stmt_obj )) {
1806
- if (!Z_ISUNDEF (param .parameter )) {
1807
- zval_ptr_dtor (& (param .parameter ));
1808
- ZVAL_UNDEF (& param .parameter );
1809
- }
1810
- RETURN_FALSE ;
1811
- }
1812
- RETURN_TRUE ;
1788
+ sqlite3stmt_bind (INTERNAL_FUNCTION_PARAM_PASSTHRU );
1813
1789
}
1814
1790
/* }}} */
1815
1791
0 commit comments