diff options
Diffstat (limited to 'ext/pdo')
83 files changed, 230 insertions, 1188 deletions
diff --git a/ext/pdo/CREDITS b/ext/pdo/CREDITS index a9899d230f..a9899d230f 100755..100644 --- a/ext/pdo/CREDITS +++ b/ext/pdo/CREDITS diff --git a/ext/pdo/README b/ext/pdo/README deleted file mode 100755 index cb7b4297d4..0000000000 --- a/ext/pdo/README +++ /dev/null @@ -1,52 +0,0 @@ -PHP Data Objects -================ - -Concept: Data Access Abstraction - -Goals: - -1/ Be light-weight -2/ Provide common API for common database operations -3/ Be performant -4/ Keep majority of PHP specific stuff in the PDO core (such as persistent - resource management); drivers should only have to worry about getting the - data and not about PHP internals. - - -Transactions and autocommit -=========================== - -When you create a database handle, you *should* specify the autocommit -behaviour that you require. PDO will default to autocommit on. - -$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true)); - -When auto-commit is on, the driver will implicitly commit each query as it is -executed. This works fine for most simple tasks but can be significantly -slower when you are making a large number of udpates. - -$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false)); - -When auto-commit is off, you must then use $dbh->beginTransaction() to -initiate a transaction. When your work is done, you then call $dbh->commit() -or $dbh->rollBack() to persist or abort your changes respectively. Not all -databases support transactions. - -You can change the auto-commit mode at run-time: - -$dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false); - -Regardless of the error handling mode set on the database handle, if the -autocommit mode cannot be changed, an exception will be thrown. - -Some drivers will allow you to temporarily disable autocommit if you call -$dbh->beginTransaction(). When you commit() or rollBack() such a transaction, -the handle will switch back to autocommit mode again. If the mode could not -be changed, an exception will be raised, as noted above. - -When the database handle is closed or destroyed (or at request end for -persistent handles), the driver will implicitly rollBack(). It is your -responsibility to call commit() when you are done making changes and -autocommit is turned off. - -vim:tw=78:et diff --git a/ext/pdo/config.m4 b/ext/pdo/config.m4 index 91c977a7a9..ad02f36e3a 100755..100644 --- a/ext/pdo/config.m4 +++ b/ext/pdo/config.m4 @@ -1,41 +1,16 @@ dnl config.m4 for extension pdo -dnl vim:se ts=2 sw=2 et: -AC_DEFUN([PHP_PDO_PEAR_CHECK],[ - pdo_running_under_pear=0 - case `pwd` in - /var/tmp/pear-build-*) - pdo_running_under_pear=1 - ;; - esac - - if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then - # we're running in an environment that smells like pear, - # and the PHP_PEAR_VERSION env var is not set. That implies - # that we're running under a slightly broken pear installer - AC_MSG_ERROR([ -PDO requires that you upgrade your PEAR installer tools. Please -do so now by running: - - % sudo pear upgrade pear - -or by manually downloading and installing PEAR version 1.3.5 or higher. - -Once you've upgraded, please re-try your PDO install. - ]) - fi -]) - -PHP_ARG_ENABLE(pdo, whether to enable PDO support, -[ --disable-pdo Disable PHP Data Objects support], yes) +PHP_ARG_ENABLE([pdo], + [whether to enable PDO support], + [AS_HELP_STRING([--disable-pdo], + [Disable PHP Data Objects support])], + [yes]) if test "$PHP_PDO" != "no"; then dnl Make sure $PHP_PDO is 'yes' when it's not 'no' :) PHP_PDO=yes - PHP_PDO_PEAR_CHECK - PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared) ifdef([PHP_ADD_EXTENSION_DEP], [ diff --git a/ext/pdo/config.w32 b/ext/pdo/config.w32 index 1613fb0a3a..1613fb0a3a 100755..100644 --- a/ext/pdo/config.w32 +++ b/ext/pdo/config.w32 diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index b3af842a4b..88839bf61f 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -37,9 +37,6 @@ zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce; /* for exceptional circumstances */ zend_class_entry *pdo_exception_ce; -ZEND_DECLARE_MODULE_GLOBALS(pdo) -static PHP_GINIT_FUNCTION(pdo); - /* True global resources - no need for thread safety here */ /* the registry of PDO drivers */ @@ -132,11 +129,7 @@ zend_module_entry pdo_module_entry = { NULL, PHP_MINFO(pdo), PHP_PDO_VERSION, - PHP_MODULE_GLOBALS(pdo), - PHP_GINIT(pdo), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX + STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -147,13 +140,6 @@ zend_module_entry pdo_module_entry = { ZEND_GET_MODULE(pdo) #endif -/* {{{ PHP_GINIT_FUNCTION */ -static PHP_GINIT_FUNCTION(pdo) -{ - pdo_globals->global_value = 0; -} -/* }}} */ - PDO_API int php_pdo_register_driver(const pdo_driver_t *driver) /* {{{ */ { if (driver->api_version != PDO_DRIVER_API) { @@ -392,12 +378,3 @@ PHP_MINFO_FUNCTION(pdo) } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo.php b/ext/pdo/pdo.php index 1008f7bd04..a11cb62b4d 100755 --- a/ext/pdo/pdo.php +++ b/ext/pdo/pdo.php @@ -1,3 +1,4 @@ +#!/usr/bin/env php <?php dl('pdo.so'); dl('pdo_sqlite.so'); diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 36bb2a17ac..160be18387 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -33,6 +33,7 @@ #include "zend_exceptions.h" #include "zend_object_handlers.h" #include "zend_hash.h" +#include "zend_interfaces.h" static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value); @@ -194,7 +195,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen) /* {{{ */ */ static PHP_METHOD(PDO, dbh_constructor) { - zval *object = getThis(); + zval *object = ZEND_THIS; pdo_dbh_t *dbh = NULL; zend_bool is_persistent = 0; char *data_source; @@ -463,7 +464,7 @@ static PHP_METHOD(PDO, prepare) size_t statement_len; zval *options = NULL, *opt, *item, ctor_args; zend_class_entry *dbstmt_ce, *pce; - pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis()); + pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS); pdo_dbh_t *dbh = dbh_obj->inner; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -558,7 +559,7 @@ static PHP_METHOD(PDO, prepare) Initiates a transaction */ static PHP_METHOD(PDO, beginTransaction) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -591,7 +592,7 @@ static PHP_METHOD(PDO, beginTransaction) Commit a transaction */ static PHP_METHOD(PDO, commit) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -617,7 +618,7 @@ static PHP_METHOD(PDO, commit) roll back a transaction */ static PHP_METHOD(PDO, rollBack) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -643,7 +644,7 @@ static PHP_METHOD(PDO, rollBack) determine if inside a transaction */ static PHP_METHOD(PDO, inTransaction) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -816,7 +817,7 @@ fail: Set an attribute */ static PHP_METHOD(PDO, setAttribute) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); zend_long attr; zval *value; @@ -839,7 +840,7 @@ static PHP_METHOD(PDO, setAttribute) Get an attribute */ static PHP_METHOD(PDO, getAttribute) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); zend_long attr; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -904,7 +905,7 @@ static PHP_METHOD(PDO, getAttribute) Execute a query 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(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); char *statement; size_t statement_len; zend_long ret; @@ -933,7 +934,7 @@ static PHP_METHOD(PDO, exec) 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(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); char *name = NULL; size_t namelen; @@ -967,7 +968,7 @@ static PHP_METHOD(PDO, lastInsertId) Fetch the error code associated with the last operation on the database handle */ static PHP_METHOD(PDO, errorCode) { - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -998,7 +999,7 @@ static PHP_METHOD(PDO, errorInfo) int error_count_diff = 0; int error_expected_count = 3; - pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -1046,7 +1047,7 @@ static PHP_METHOD(PDO, query) pdo_stmt_t *stmt; char *statement; size_t statement_len; - pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis()); + pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS); pdo_dbh_t *dbh = dbh_obj->inner; /* Return a meaningful error when no parameters were passed */ @@ -1124,7 +1125,7 @@ static PHP_METHOD(PDO, query) 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(getThis()); + pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS); char *str; size_t str_len; zend_long paramtype = PDO_PARAM_STR; @@ -1154,22 +1155,6 @@ static PHP_METHOD(PDO, quote) } /* }}} */ -/* {{{ proto PDO::__wakeup() - Prevents use of a PDO instance that has been unserialized */ -static PHP_METHOD(PDO, __wakeup) -{ - zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances"); -} -/* }}} */ - -/* {{{ proto int PDO::__sleep() - Prevents serialization of a PDO instance */ -static PHP_METHOD(PDO, __sleep) -{ - zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances"); -} -/* }}} */ - /* {{{ proto array PDO::getAvailableDrivers() Return array of available PDO drivers */ static PHP_METHOD(PDO, getAvailableDrivers) @@ -1242,8 +1227,6 @@ const zend_function_entry pdo_dbh_functions[] = /* {{{ */ { 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, __wakeup, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(PDO, __sleep, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(PDO, getAvailableDrivers, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; @@ -1336,7 +1319,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind) return 1; } -static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key) +static zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key) { zend_function *fbc = NULL; pdo_dbh_object_t *dbh_obj = php_pdo_dbh_fetch_object(*object); @@ -1385,6 +1368,8 @@ void pdo_dbh_init(void) INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions); pdo_dbh_ce = zend_register_internal_class(&ce); pdo_dbh_ce->create_object = pdo_dbh_new; + pdo_dbh_ce->serialize = zend_class_serialize_deny; + pdo_dbh_ce->unserialize = zend_class_unserialize_deny; memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pdo_dbh_object_handlers.offset = XtOffsetOf(pdo_dbh_object_t, std); @@ -1573,12 +1558,3 @@ ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor) /* {{{ */ } } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c deleted file mode 100644 index 779a70280a..0000000000 --- a/ext/pdo/pdo_sql_parser.c +++ /dev/null @@ -1,739 +0,0 @@ -/* Generated by re2c 1.0.3 */ -#line 1 "ext/pdo/pdo_sql_parser.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" - -#define PDO_PARSER_TEXT 1 -#define PDO_PARSER_BIND 2 -#define PDO_PARSER_BIND_POS 3 -#define PDO_PARSER_EOI 4 - -#define RET(i) {s->cur = cursor; return i; } -#define SKIP_ONE(i) {s->cur = s->tok + 1; return i; } - -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT s->end -#define YYMARKER s->ptr -#define YYFILL(n) { RET(PDO_PARSER_EOI); } - -typedef struct Scanner { - char *ptr, *cur, *tok, *end; -} Scanner; - -static int scan(Scanner *s) -{ - char *cursor = s->cur; - - s->tok = cursor; - #line 53 "ext/pdo/pdo_sql_parser.re" - - - -#line 53 "ext/pdo/pdo_sql_parser.c" -{ - YYCTYPE yych; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - switch (yych) { - case 0x00: goto yy2; - case '"': goto yy6; - case '\'': goto yy8; - case '(': - case ')': - case '*': - case '+': - case ',': - case '.': goto yy9; - case '-': goto yy10; - case '/': goto yy11; - case ':': goto yy12; - case '?': goto yy13; - default: goto yy3; - } -yy2: - YYCURSOR = YYMARKER; - goto yy7; -yy3: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case 0x00: - case '"': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': - case '/': - case ':': - case '?': goto yy5; - default: goto yy3; - } -yy5: -#line 63 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_TEXT); } -#line 100 "ext/pdo/pdo_sql_parser.c" -yy6: - yych = *(YYMARKER = ++YYCURSOR); - if (yych >= 0x01) goto yy16; -yy7: -#line 61 "ext/pdo/pdo_sql_parser.re" - { SKIP_ONE(PDO_PARSER_TEXT); } -#line 107 "ext/pdo/pdo_sql_parser.c" -yy8: - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x00) goto yy7; - goto yy21; -yy9: - ++YYCURSOR; - goto yy7; -yy10: - yych = *++YYCURSOR; - switch (yych) { - case '-': goto yy25; - default: goto yy7; - } -yy11: - yych = *++YYCURSOR; - switch (yych) { - case '*': goto yy28; - default: goto yy7; - } -yy12: - yych = *++YYCURSOR; - switch (yych) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy30; - case ':': goto yy33; - default: goto yy7; - } -yy13: - yych = *++YYCURSOR; - switch (yych) { - case '?': goto yy36; - default: goto yy14; - } -yy14: -#line 60 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_BIND_POS); } -#line 205 "ext/pdo/pdo_sql_parser.c" -yy15: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy16: - switch (yych) { - case 0x00: goto yy2; - case '"': goto yy17; - case '\\': goto yy19; - default: goto yy15; - } -yy17: - ++YYCURSOR; -#line 56 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_TEXT); } -#line 221 "ext/pdo/pdo_sql_parser.c" -yy19: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= 0x00) goto yy2; - goto yy15; -yy20: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy21: - switch (yych) { - case 0x00: goto yy2; - case '\'': goto yy22; - case '\\': goto yy24; - default: goto yy20; - } -yy22: - ++YYCURSOR; -#line 57 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_TEXT); } -#line 243 "ext/pdo/pdo_sql_parser.c" -yy24: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= 0x00) goto yy2; - goto yy20; -yy25: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case '\n': - case '\r': goto yy27; - default: goto yy25; - } -yy27: -#line 62 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_TEXT); } -#line 262 "ext/pdo/pdo_sql_parser.c" -yy28: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case '*': goto yy38; - default: goto yy28; - } -yy30: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy30; - default: goto yy32; - } -yy32: -#line 59 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_BIND); } -#line 344 "ext/pdo/pdo_sql_parser.c" -yy33: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case ':': goto yy33; - default: goto yy35; - } -yy35: -#line 58 "ext/pdo/pdo_sql_parser.re" - { RET(PDO_PARSER_TEXT); } -#line 356 "ext/pdo/pdo_sql_parser.c" -yy36: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case '?': goto yy36; - default: goto yy35; - } -yy38: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - switch (yych) { - case '*': goto yy38; - case '/': goto yy40; - default: goto yy28; - } -yy40: - ++YYCURSOR; - goto yy27; -} -#line 64 "ext/pdo/pdo_sql_parser.re" - -} - -struct placeholder { - char *pos; - size_t len; - size_t qlen; /* quoted length of value */ - char *quoted; /* quoted value */ - int freeq; - int bindno; - struct placeholder *next; -}; - -static void free_param_name(zval *el) { - efree(Z_PTR_P(el)); -} - -PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len, - char **outquery, size_t *outquery_len) -{ - Scanner s; - char *ptr, *newbuffer; - ptrdiff_t t; - uint32_t bindno = 0; - int ret = 0; - size_t newbuffer_len; - HashTable *params; - struct pdo_bound_param_data *param; - int query_type = PDO_PLACEHOLDER_NONE; - struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL; - - ptr = *outquery; - s.cur = inquery; - s.end = inquery + inquery_len + 1; - - /* phase 1: look for args */ - while((t = scan(&s)) != PDO_PARSER_EOI) { - if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) { - if (t == PDO_PARSER_BIND) { - ptrdiff_t len = s.cur - s.tok; - if ((inquery < (s.cur - len)) && isalnum(*(s.cur - len - 1))) { - continue; - } - query_type |= PDO_PLACEHOLDER_NAMED; - } else { - query_type |= PDO_PLACEHOLDER_POSITIONAL; - } - - plc = emalloc(sizeof(*plc)); - memset(plc, 0, sizeof(*plc)); - plc->next = NULL; - plc->pos = s.tok; - plc->len = s.cur - s.tok; - plc->bindno = bindno++; - - if (placetail) { - placetail->next = plc; - } else { - placeholders = plc; - } - placetail = plc; - } - } - - if (bindno == 0) { - /* nothing to do; good! */ - return 0; - } - - /* did the query make sense to me? */ - if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) { - /* they mixed both types; punt */ - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters"); - ret = -1; - goto clean_up; - } - - if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) { - /* query matches native syntax */ - ret = 0; - goto clean_up; - } - - if (stmt->named_rewrite_template) { - /* magic/hack. - * We we pretend that the query was positional even if - * it was named so that we fall into the - * named rewrite case below. Not too pretty, - * but it works. */ - query_type = PDO_PLACEHOLDER_POSITIONAL; - } - - params = stmt->bound_params; - - /* Do we have placeholders but no bound params */ - if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound"); - ret = -1; - goto clean_up; - } - - if (params && bindno != zend_hash_num_elements(params) && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - /* extra bit of validation for instances when same params are bound more than once */ - if (query_type != PDO_PLACEHOLDER_POSITIONAL && bindno > zend_hash_num_elements(params)) { - int ok = 1; - for (plc = placeholders; plc; plc = plc->next) { - if ((param = zend_hash_str_find_ptr(params, plc->pos, plc->len)) == NULL) { - ok = 0; - break; - } - } - if (ok) { - goto safe; - } - } - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens"); - ret = -1; - goto clean_up; - } -safe: - /* what are we going to do ? */ - if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - /* query generation */ - - newbuffer_len = inquery_len; - - /* let's quote all the values */ - for (plc = placeholders; plc; plc = plc->next) { - if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - param = zend_hash_index_find_ptr(params, plc->bindno); - } else { - param = zend_hash_str_find_ptr(params, plc->pos, plc->len); - } - if (param == NULL) { - /* parameter was not defined */ - ret = -1; - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); - goto clean_up; - } - if (stmt->dbh->methods->quoter) { - zval *parameter; - if (Z_ISREF(param->parameter)) { - parameter = Z_REFVAL(param->parameter); - } else { - parameter = ¶m->parameter; - } - if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(parameter) == IS_RESOURCE) { - php_stream *stm; - - php_stream_from_zval_no_verify(stm, parameter); - if (stm) { - zend_string *buf; - - buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0); - if (!buf) { - buf = ZSTR_EMPTY_ALLOC(); - } - if (!stmt->dbh->methods->quoter(stmt->dbh, ZSTR_VAL(buf), ZSTR_LEN(buf), &plc->quoted, &plc->qlen, - param->param_type)) { - /* bork */ - ret = -1; - strncpy(stmt->error_code, stmt->dbh->error_code, 6); - if (buf) { - zend_string_release_ex(buf, 0); - } - goto clean_up; - } - if (buf) { - zend_string_release_ex(buf, 0); - } - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource"); - ret = -1; - goto clean_up; - } - plc->freeq = 1; - } else { - enum pdo_param_type param_type = param->param_type; - zend_string *buf = NULL; - - /* assume all types are nullable */ - if (Z_TYPE_P(parameter) == IS_NULL) { - param_type = PDO_PARAM_NULL; - } - - switch (param_type) { - case PDO_PARAM_BOOL: - plc->quoted = zend_is_true(parameter) ? "1" : "0"; - plc->qlen = sizeof("1")-1; - plc->freeq = 0; - break; - - case PDO_PARAM_INT: - buf = zend_long_to_str(zval_get_long(parameter)); - - plc->qlen = ZSTR_LEN(buf); - plc->quoted = estrdup(ZSTR_VAL(buf)); - plc->freeq = 1; - break; - - case PDO_PARAM_NULL: - plc->quoted = "NULL"; - plc->qlen = sizeof("NULL")-1; - plc->freeq = 0; - break; - - default: - buf = zval_get_string(parameter); - if (!stmt->dbh->methods->quoter(stmt->dbh, ZSTR_VAL(buf), - ZSTR_LEN(buf), &plc->quoted, &plc->qlen, - param_type)) { - /* bork */ - ret = -1; - strncpy(stmt->error_code, stmt->dbh->error_code, 6); - if (buf) { - zend_string_release_ex(buf, 0); - } - goto clean_up; - } - plc->freeq = 1; - } - - if (buf) { - zend_string_release_ex(buf, 0); - } - } - } else { - zval *parameter; - if (Z_ISREF(param->parameter)) { - parameter = Z_REFVAL(param->parameter); - } else { - parameter = ¶m->parameter; - } - plc->quoted = Z_STRVAL_P(parameter); - plc->qlen = Z_STRLEN_P(parameter); - } - newbuffer_len += plc->qlen; - } - -rewrite: - /* allocate output buffer */ - newbuffer = emalloc(newbuffer_len + 1); - *outquery = newbuffer; - - /* and build the query */ - plc = placeholders; - ptr = inquery; - - do { - t = plc->pos - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - memcpy(newbuffer, plc->quoted, plc->qlen); - newbuffer += plc->qlen; - ptr = plc->pos + plc->len; - - plc = plc->next; - } while (plc); - - t = (inquery + inquery_len) - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - *newbuffer = '\0'; - *outquery_len = newbuffer - *outquery; - - ret = 1; - goto clean_up; - - } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - /* rewrite ? to :pdoX */ - char *name, *idxbuf; - const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d"; - int bind_no = 1; - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, free_param_name, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - int skip_map = 0; - char *p; - name = estrndup(plc->pos, plc->len); - - /* check if bound parameter is already available */ - if (!strcmp(name, "?") || (p = zend_hash_str_find_ptr(stmt->bound_param_map, name, plc->len)) == NULL) { - spprintf(&idxbuf, 0, tmpl, bind_no++); - } else { - idxbuf = estrdup(p); - skip_map = 1; - } - - plc->quoted = idxbuf; - plc->qlen = strlen(plc->quoted); - plc->freeq = 1; - newbuffer_len += plc->qlen; - - if (!skip_map && stmt->named_rewrite_template) { - /* create a mapping */ - zend_hash_str_update_mem(stmt->bound_param_map, name, plc->len, idxbuf, plc->qlen + 1); - } - - /* map number to name */ - zend_hash_index_update_mem(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1); - - efree(name); - } - - goto rewrite; - - } else { - /* rewrite :name to ? */ - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, free_param_name, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - char *name; - name = estrndup(plc->pos, plc->len); - zend_hash_index_update_mem(stmt->bound_param_map, plc->bindno, name, plc->len + 1); - efree(name); - plc->quoted = "?"; - plc->qlen = 1; - } - - goto rewrite; - } - -clean_up: - - while (placeholders) { - plc = placeholders; - placeholders = plc->next; - - if (plc->freeq) { - efree(plc->quoted); - } - - efree(plc); - } - - return ret; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker ft=c - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index b5f5b71638..5950cdc38e 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -414,12 +414,3 @@ clean_up: return ret; } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker ft=c - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c index 36ea9d494c..0b3fe7172c 100644 --- a/ext/pdo/pdo_sqlstate.c +++ b/ext/pdo/pdo_sqlstate.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index a28f1c3666..c3e79f5b68 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -106,7 +106,7 @@ ZEND_END_ARG_INFO() /* }}} */ #define PHP_STMT_GET_OBJ \ - pdo_stmt_t *stmt = Z_PDO_STMT_P(getThis()); \ + pdo_stmt_t *stmt = Z_PDO_STMT_P(ZEND_THIS); \ if (!stmt->dbh) { \ RETURN_FALSE; \ } \ @@ -2004,7 +2004,7 @@ static PHP_METHOD(PDOStatement, setFetchMode) RETVAL_BOOL( pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, - stmt, 0) == SUCCESS ? 1 : 0 + stmt, 0) == SUCCESS ); } /* }}} */ @@ -2152,22 +2152,6 @@ static PHP_METHOD(PDOStatement, debugDumpParams) } /* }}} */ -/* {{{ proto PDOStatement::__wakeup() - Prevents use of a PDOStatement instance that has been unserialized */ -static PHP_METHOD(PDOStatement, __wakeup) -{ - zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances"); -} -/* }}} */ - -/* {{{ proto int PDOStatement::__sleep() - Prevents serialization of a PDOStatement instance */ -static PHP_METHOD(PDOStatement, __sleep) -{ - zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances"); -} -/* }}} */ - 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) @@ -2188,13 +2172,11 @@ const zend_function_entry pdo_dbstmt_functions[] = { 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, __wakeup, arginfo_pdostatement__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(PDOStatement, __sleep, arginfo_pdostatement__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; /* {{{ overloaded handlers for PDOStatement class */ -static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot) +static zval *dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot) { pdo_stmt_t *stmt = Z_PDO_STMT_P(object); @@ -2202,8 +2184,9 @@ static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **ca if (strcmp(Z_STRVAL_P(member), "queryString") == 0) { pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only"); + return value; } else { - zend_std_write_property(object, member, value, cache_slot); + return zend_std_write_property(object, member, value, cache_slot); } } @@ -2220,7 +2203,7 @@ static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot) } } -static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key) +static zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key) { zend_function *fbc = NULL; zend_string *lc_method_name; @@ -2280,36 +2263,7 @@ static zend_object *dbstmt_clone_obj(zval *zobject) } zend_object_handlers pdo_dbstmt_object_handlers; -static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data); - -void pdo_stmt_init(void) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions); - pdo_dbstmt_ce = zend_register_internal_class(&ce); - pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get; - pdo_dbstmt_ce->create_object = pdo_dbstmt_new; - zend_class_implements(pdo_dbstmt_ce, 1, zend_ce_traversable); - zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC); - - memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - pdo_dbstmt_object_handlers.offset = XtOffsetOf(pdo_stmt_t, std); - pdo_dbstmt_object_handlers.dtor_obj = zend_objects_destroy_object; - pdo_dbstmt_object_handlers.free_obj = pdo_dbstmt_free_storage; - pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write; - pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete; - pdo_dbstmt_object_handlers.get_method = dbstmt_method_get; - pdo_dbstmt_object_handlers.compare_objects = dbstmt_compare; - pdo_dbstmt_object_handlers.clone_obj = dbstmt_clone_obj; - - INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions); - pdo_row_ce = zend_register_internal_class(&ce); - pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */ - pdo_row_ce->create_object = pdo_row_new; - pdo_row_ce->serialize = pdo_row_serialize; - pdo_row_ce->unserialize = zend_class_unserialize_deny; -} +zend_object_handlers pdo_row_object_handlers; PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt) { @@ -2428,7 +2382,7 @@ static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key) { struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter; - if (I->key == (ulong)-1) { + if (I->key == (zend_ulong)-1) { ZVAL_NULL(key); } else { ZVAL_LONG(key, I->key); @@ -2448,7 +2402,7 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter) PDO_FETCH_ORI_NEXT, 0, 0)) { PDO_HANDLE_STMT_ERR(); - I->key = (ulong)-1; + I->key = (zend_ulong)-1; ZVAL_UNDEF(&I->fetch_ahead); return; @@ -2485,7 +2439,7 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int if (!do_fetch(stmt, 1, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT, PDO_FETCH_ORI_NEXT, 0, 0)) { PDO_HANDLE_STMT_ERR(); - I->key = (ulong)-1; + I->key = (zend_ulong)-1; ZVAL_UNDEF(&I->fetch_ahead); } @@ -2546,9 +2500,10 @@ static zval *row_dim_read(zval *object, zval *member, int type, zval *rv) return row_prop_read(object, member, type, NULL, rv); } -static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot) +static zval *row_prop_write(zval *object, zval *member, zval *value, void **cache_slot) { php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set"); + return value; } static void row_dim_write(zval *object, zval *member, zval *value) @@ -2609,30 +2564,31 @@ static void row_dim_delete(zval *object, zval *offset) php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow"); } -static HashTable *row_get_properties(zval *object) +static HashTable *row_get_properties_for(zval *object, zend_prop_purpose purpose) { pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object); pdo_stmt_t *stmt = row->stmt; + HashTable *props; int i; - if (stmt == NULL) { - return NULL; + if (purpose != ZEND_PROP_PURPOSE_DEBUG || stmt == NULL) { + return zend_std_get_properties_for(object, purpose); } if (!stmt->std.properties) { rebuild_object_properties(&stmt->std); } + props = zend_array_dup(stmt->std.properties); for (i = 0; i < stmt->column_count; i++) { zval val; fetch_value(stmt, &val, i, NULL); - zend_hash_update(stmt->std.properties, stmt->columns[i].name, &val); + zend_hash_update(props, stmt->columns[i].name, &val); } - - return stmt->std.properties; + return props; } -static union _zend_function *row_method_get( +static zend_function *row_method_get( zend_object **object_pp, zend_string *method_name, const zval *key) { @@ -2656,7 +2612,7 @@ static int row_call_method(zend_string *method, zend_object *object, INTERNAL_FU return FAILURE; } -static union _zend_function *row_get_ctor(zend_object *object) +static zend_function *row_get_ctor(zend_object *object) { zend_throw_exception_ex(php_pdo_get_exception(), 0, "You may not create a PDORow manually"); return NULL; @@ -2672,37 +2628,6 @@ static int row_compare(zval *object1, zval *object2) return -1; } -const zend_object_handlers pdo_row_object_handlers = { - 0, - zend_objects_destroy_object, - pdo_row_free_storage, - NULL, - row_prop_read, - row_prop_write, - row_dim_read, - row_dim_write, - NULL, - NULL, - NULL, - row_prop_exists, - row_prop_delete, - row_dim_exists, - row_dim_delete, - row_get_properties, - row_method_get, - row_call_method, - row_get_ctor, - row_get_classname, - row_compare, - NULL, /* cast */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; - void pdo_row_free_storage(zend_object *std) { pdo_row_t *row = (pdo_row_t *)std; @@ -2721,18 +2646,52 @@ zend_object *pdo_row_new(zend_class_entry *ce) return &row->std; } -static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) +void pdo_stmt_init(void) { - php_error_docref(NULL, E_WARNING, "PDORow instances may not be serialized"); - return FAILURE; -} -/* }}} */ + zend_class_entry ce; -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ + INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions); + pdo_dbstmt_ce = zend_register_internal_class(&ce); + pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get; + pdo_dbstmt_ce->create_object = pdo_dbstmt_new; + pdo_dbstmt_ce->serialize = zend_class_serialize_deny; + pdo_dbstmt_ce->unserialize = zend_class_unserialize_deny; + zend_class_implements(pdo_dbstmt_ce, 1, zend_ce_traversable); + zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC); + + memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + pdo_dbstmt_object_handlers.offset = XtOffsetOf(pdo_stmt_t, std); + pdo_dbstmt_object_handlers.dtor_obj = zend_objects_destroy_object; + pdo_dbstmt_object_handlers.free_obj = pdo_dbstmt_free_storage; + pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write; + pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete; + pdo_dbstmt_object_handlers.get_method = dbstmt_method_get; + pdo_dbstmt_object_handlers.compare_objects = dbstmt_compare; + pdo_dbstmt_object_handlers.clone_obj = dbstmt_clone_obj; + + INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions); + pdo_row_ce = zend_register_internal_class(&ce); + pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */ + pdo_row_ce->create_object = pdo_row_new; + pdo_row_ce->serialize = zend_class_serialize_deny; + pdo_row_ce->unserialize = zend_class_unserialize_deny; + + memcpy(&pdo_row_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + pdo_row_object_handlers.free_obj = pdo_row_free_storage; + pdo_row_object_handlers.clone_obj = NULL; + pdo_row_object_handlers.get_property_ptr_ptr = NULL; + pdo_row_object_handlers.read_property = row_prop_read; + pdo_row_object_handlers.write_property = row_prop_write; + pdo_row_object_handlers.has_property = row_prop_exists; + pdo_row_object_handlers.unset_property = row_prop_delete; + pdo_row_object_handlers.read_dimension = row_dim_read; + pdo_row_object_handlers.write_dimension = row_dim_write; + pdo_row_object_handlers.has_dimension = row_dim_exists; + pdo_row_object_handlers.unset_dimension = row_dim_delete; + pdo_row_object_handlers.get_properties_for = row_get_properties_for; + pdo_row_object_handlers.get_method = row_method_get; + pdo_row_object_handlers.call_method = row_call_method; + pdo_row_object_handlers.get_constructor = row_get_ctor; + pdo_row_object_handlers.get_class_name = row_get_classname; + pdo_row_object_handlers.compare_objects = row_compare; +} diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h index 77d49001ad..27c9c984d6 100644 --- a/ext/pdo/php_pdo.h +++ b/ext/pdo/php_pdo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -49,16 +49,6 @@ PHP_MINIT_FUNCTION(pdo); PHP_MSHUTDOWN_FUNCTION(pdo); PHP_MINFO_FUNCTION(pdo); -ZEND_BEGIN_MODULE_GLOBALS(pdo) - zend_long global_value; -ZEND_END_MODULE_GLOBALS(pdo) - -#ifdef ZTS -# define PDOG(v) TSRMG(pdo_globals_id, zend_pdo_globals *, v) -#else -# define PDOG(v) (pdo_globals.v) -#endif - #define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \ zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value); @@ -73,13 +63,3 @@ ZEND_END_MODULE_GLOBALS(pdo) #endif /* PHP_PDO_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 3350211a5e..d17b168c2d 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -692,11 +692,3 @@ PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt); #endif /* PHP_PDO_DRIVER_H */ -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h index 44e4af830f..b9702833dd 100644 --- a/ext/pdo/php_pdo_error.h +++ b/ext/pdo/php_pdo_error.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -35,11 +35,3 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt); #define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); } #endif /* PHP_PDO_ERROR_H */ -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 17e3bd8a24..20c373bd24 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -49,7 +49,7 @@ extern zend_object *pdo_row_new(zend_class_entry *ce); extern const zend_function_entry pdo_row_functions[]; extern zend_class_entry *pdo_row_ce; void pdo_row_free_storage(zend_object *std); -extern const zend_object_handlers pdo_row_object_handlers; +extern zend_object_handlers pdo_row_object_handlers; zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object); @@ -59,13 +59,3 @@ int pdo_sqlstate_init_error_table(void); void pdo_sqlstate_fini_error_table(void); const char *pdo_sqlstate_state_to_description(char *state); int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind); - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/tests/bug_34630.phpt b/ext/pdo/tests/bug_34630.phpt index 070217bafe..32a60643db 100644 --- a/ext/pdo/tests/bug_34630.phpt +++ b/ext/pdo/tests/bug_34630.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #34630 (inserting streams as LOBs) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_34687.phpt b/ext/pdo/tests/bug_34687.phpt index dbb1471f09..f25da54893 100644 --- a/ext/pdo/tests/bug_34687.phpt +++ b/ext/pdo/tests/bug_34687.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #34687 (query doesn't return error information) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_35671.phpt b/ext/pdo/tests/bug_35671.phpt index 8d1e11419a..fae84652f8 100644 --- a/ext/pdo/tests/bug_35671.phpt +++ b/ext/pdo/tests/bug_35671.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #35671 (binding by name breakage) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_36428.phpt b/ext/pdo/tests/bug_36428.phpt index d21f7071f8..3cb32d47e8 100644 --- a/ext/pdo/tests/bug_36428.phpt +++ b/ext/pdo/tests/bug_36428.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #36428 (Incorrect error message for PDO::fetchAll()) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); if (!extension_loaded('simplexml')) die('skip SimpleXML not loaded'); $dir = getenv('REDIR_TEST_DIR'); @@ -11,7 +11,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_36798.phpt b/ext/pdo/tests/bug_36798.phpt index 0ca0beaa8e..1ce192acc9 100644 --- a/ext/pdo/tests/bug_36798.phpt +++ b/ext/pdo/tests/bug_36798.phpt @@ -17,7 +17,7 @@ if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))){ --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_38253.phpt b/ext/pdo/tests/bug_38253.phpt index 78519a0805..f20ec2385a 100644 --- a/ext/pdo/tests/bug_38253.phpt +++ b/ext/pdo/tests/bug_38253.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #38253 (PDO produces segfault with default fetch mode) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $pdo = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_38394.phpt b/ext/pdo/tests/bug_38394.phpt index e786bdbd15..6ec897fed7 100644 --- a/ext/pdo/tests/bug_38394.phpt +++ b/ext/pdo/tests/bug_38394.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #38394 (Prepared statement error stops subsequent statements) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -11,7 +11,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_39398.phpt b/ext/pdo/tests/bug_39398.phpt index 0ad46f4131..7d76adca55 100644 --- a/ext/pdo/tests/bug_39398.phpt +++ b/ext/pdo/tests/bug_39398.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #39398 (Booleans are not automatically translated to integers) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_39656.phpt b/ext/pdo/tests/bug_39656.phpt index eacb693918..a33e285432 100644 --- a/ext/pdo/tests/bug_39656.phpt +++ b/ext/pdo/tests/bug_39656.phpt @@ -11,7 +11,7 @@ PDOTest::skip(); --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_40285.phpt b/ext/pdo/tests/bug_40285.phpt index 213777a808..35d6850d4a 100644 --- a/ext/pdo/tests/bug_40285.phpt +++ b/ext/pdo/tests/bug_40285.phpt @@ -11,7 +11,7 @@ PDOTest::skip(); --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_42917.phpt b/ext/pdo/tests/bug_42917.phpt index d4b71f57da..814086a56a 100644 --- a/ext/pdo/tests/bug_42917.phpt +++ b/ext/pdo/tests/bug_42917.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #42917 (PDO::FETCH_KEY_PAIR doesn't work with setFetchMode) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_43130.phpt b/ext/pdo/tests/bug_43130.phpt index 15c77b4180..4fea1a78ae 100644 --- a/ext/pdo/tests/bug_43130.phpt +++ b/ext/pdo/tests/bug_43130.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #43130 (Bound parameters cannot have - in their name) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -15,7 +15,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_43139.phpt b/ext/pdo/tests/bug_43139.phpt index 87bfd4e587..066eb2ed18 100644 --- a/ext/pdo/tests/bug_43139.phpt +++ b/ext/pdo/tests/bug_43139.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #43139 (PDO ignore ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll()) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_43663.phpt b/ext/pdo/tests/bug_43663.phpt index f8e968f717..9e72a384d0 100644 --- a/ext/pdo/tests/bug_43663.phpt +++ b/ext/pdo/tests/bug_43663.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #43663 (__call on classes derived from PDO) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); if (!extension_loaded('pdo_sqlite')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); @@ -20,7 +20,7 @@ class test extends PDO{ } } -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $a = new test('sqlite::memory:'); diff --git a/ext/pdo/tests/bug_44159.phpt b/ext/pdo/tests/bug_44159.phpt index 4382fbddda..26b0e33b60 100644 --- a/ext/pdo/tests/bug_44159.phpt +++ b/ext/pdo/tests/bug_44159.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip PDO not available'); try { $pdo = new PDO("sqlite:".__DIR__."/foo.db"); diff --git a/ext/pdo/tests/bug_44173.phpt b/ext/pdo/tests/bug_44173.phpt index ecb76127d6..abf9ac7275 100644 --- a/ext/pdo/tests/bug_44173.phpt +++ b/ext/pdo/tests/bug_44173.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #44173 (PDO->query() parameter parsing/checking needs an update) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_44409.phpt b/ext/pdo/tests/bug_44409.phpt index 64d385b26c..f32eb879bd 100644 --- a/ext/pdo/tests/bug_44409.phpt +++ b/ext/pdo/tests/bug_44409.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #44409 (PDO::FETCH_SERIALIZE calls __construct()) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_44861.phpt b/ext/pdo/tests/bug_44861.phpt index cb8e657e9b..ec2d779fb5 100644 --- a/ext/pdo/tests/bug_44861.phpt +++ b/ext/pdo/tests/bug_44861.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #44861 (scrollable cursor don't work with pgsql) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -20,7 +20,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_50458.phpt b/ext/pdo/tests/bug_50458.phpt index 7dbfec3593..f248f5f387 100644 --- a/ext/pdo/tests/bug_50458.phpt +++ b/ext/pdo/tests/bug_50458.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #50458 (PDO::FETCH_FUNC fails with Closures) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_52098.phpt b/ext/pdo/tests/bug_52098.phpt index 00fd94ec76..681af4c594 100644 --- a/ext/pdo/tests/bug_52098.phpt +++ b/ext/pdo/tests/bug_52098.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #52098 Own PDOStatement implementation ignore __call() --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_60665.phpt b/ext/pdo/tests/bug_60665.phpt index bae3d603d7..99cc07171a 100644 --- a/ext/pdo/tests/bug_60665.phpt +++ b/ext/pdo/tests/bug_60665.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); switch ($db->getAttribute(PDO::ATTR_DRIVER_NAME)) { diff --git a/ext/pdo/tests/bug_61292.phpt b/ext/pdo/tests/bug_61292.phpt index 0a6885cf7c..f82619d20e 100644 --- a/ext/pdo/tests/bug_61292.phpt +++ b/ext/pdo/tests/bug_61292.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; class Database_SQL extends PDO diff --git a/ext/pdo/tests/bug_64172.phpt b/ext/pdo/tests/bug_64172.phpt index 266ff6a33b..9a729c90c1 100644 --- a/ext/pdo/tests/bug_64172.phpt +++ b/ext/pdo/tests/bug_64172.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: Bug #64172 errorInfo is not properly cleaned up --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_65946.phpt b/ext/pdo/tests/bug_65946.phpt index 447af58517..db7671de99 100644 --- a/ext/pdo/tests/bug_65946.phpt +++ b/ext/pdo/tests/bug_65946.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); diff --git a/ext/pdo/tests/bug_69356.phpt b/ext/pdo/tests/bug_69356.phpt index 6c9b14c8a4..4fca242a91 100644 --- a/ext/pdo/tests/bug_69356.phpt +++ b/ext/pdo/tests/bug_69356.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_71447.phpt b/ext/pdo/tests/bug_71447.phpt index 8b5c0732f1..8705717df1 100644 --- a/ext/pdo/tests/bug_71447.phpt +++ b/ext/pdo/tests/bug_71447.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/bug_72788.phpt b/ext/pdo/tests/bug_72788.phpt index 80609a21ba..975d303065 100644 --- a/ext/pdo/tests/bug_72788.phpt +++ b/ext/pdo/tests/bug_72788.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; putenv("PDOTEST_ATTR=" . serialize(array(PDO::ATTR_PERSISTENT => true))); diff --git a/ext/pdo/tests/bug_73234.phpt b/ext/pdo/tests/bug_73234.phpt index 43b484e9b2..451cc4849c 100644 --- a/ext/pdo/tests/bug_73234.phpt +++ b/ext/pdo/tests/bug_73234.phpt @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/debug_emulated_prepares.phpt b/ext/pdo/tests/debug_emulated_prepares.phpt index 13252382fe..57cf937578 100644 --- a/ext/pdo/tests/debug_emulated_prepares.phpt +++ b/ext/pdo/tests/debug_emulated_prepares.phpt @@ -14,7 +14,7 @@ if (!$db->getAttribute(PDO::ATTR_EMULATE_PREPARES) && !$db->setAttribute(PDO::AT ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt index 3b79a09a9d..f4131b69bc 100644 --- a/ext/pdo/tests/pdo_001.phpt +++ b/ext/pdo/tests/pdo_001.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_ASSOC --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_002.phpt b/ext/pdo/tests/pdo_002.phpt index 047fd59410..740c51e2de 100644 --- a/ext/pdo/tests/pdo_002.phpt +++ b/ext/pdo/tests/pdo_002.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_NUM --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_003.phpt b/ext/pdo/tests/pdo_003.phpt index ccd23c8ebe..8b340d6ef3 100644 --- a/ext/pdo/tests/pdo_003.phpt +++ b/ext/pdo/tests/pdo_003.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_BOTH --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_004.phpt b/ext/pdo/tests/pdo_004.phpt index 933629eea0..39323f9c36 100644 --- a/ext/pdo/tests/pdo_004.phpt +++ b/ext/pdo/tests/pdo_004.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_OBJ --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_005.phpt b/ext/pdo/tests/pdo_005.phpt index c7c18a91a5..6e89aad744 100644 --- a/ext/pdo/tests/pdo_005.phpt +++ b/ext/pdo/tests/pdo_005.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_CLASS --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_006.phpt b/ext/pdo/tests/pdo_006.phpt index fc83301725..816102ffb6 100644 --- a/ext/pdo/tests/pdo_006.phpt +++ b/ext/pdo/tests/pdo_006.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_GROUP --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_007.phpt b/ext/pdo/tests/pdo_007.phpt index 291e863208..33932212bb 100644 --- a/ext/pdo/tests/pdo_007.phpt +++ b/ext/pdo/tests/pdo_007.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_UNIQUE --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_008.phpt b/ext/pdo/tests/pdo_008.phpt index 3e9e12e777..4c850ae0eb 100644 --- a/ext/pdo/tests/pdo_008.phpt +++ b/ext/pdo/tests/pdo_008.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_UNIQUE conflict --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_009.phpt b/ext/pdo/tests/pdo_009.phpt index 509a7d44db..bc63aa66fd 100644 --- a/ext/pdo/tests/pdo_009.phpt +++ b/ext/pdo/tests/pdo_009.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_CLASSTYPE --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_010.phpt b/ext/pdo/tests/pdo_010.phpt index e00f901abe..f5b6bafbb9 100644 --- a/ext/pdo/tests/pdo_010.phpt +++ b/ext/pdo/tests/pdo_010.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_CLASSTYPE and GROUP/UNIQUE --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_011.phpt b/ext/pdo/tests/pdo_011.phpt index ffeac5bd8d..e014ff9c9b 100644 --- a/ext/pdo/tests/pdo_011.phpt +++ b/ext/pdo/tests/pdo_011.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_FUNC and statement overloading --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_012.phpt b/ext/pdo/tests/pdo_012.phpt index ac87a384b5..0570f446cf 100644 --- a/ext/pdo/tests/pdo_012.phpt +++ b/ext/pdo/tests/pdo_012.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement::setFetchMode --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_013.phpt b/ext/pdo/tests/pdo_013.phpt index f4dcea5a2a..ab40738051 100644 --- a/ext/pdo/tests/pdo_013.phpt +++ b/ext/pdo/tests/pdo_013.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement iterator --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_014.phpt b/ext/pdo/tests/pdo_014.phpt index 46841512a9..5c7774f2cd 100644 --- a/ext/pdo/tests/pdo_014.phpt +++ b/ext/pdo/tests/pdo_014.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement SPL iterator --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_015.phpt b/ext/pdo/tests/pdo_015.phpt index ac6a61f1fb..bc19309670 100644 --- a/ext/pdo/tests/pdo_015.phpt +++ b/ext/pdo/tests/pdo_015.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_COLUMN --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_016.phpt b/ext/pdo/tests/pdo_016.phpt index abbe93f0bf..6879faa5b9 100644 --- a/ext/pdo/tests/pdo_016.phpt +++ b/ext/pdo/tests/pdo_016.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_BOUND --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -11,7 +11,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_016a.phpt b/ext/pdo/tests/pdo_016a.phpt index 4703981173..9f07516f8e 100644 --- a/ext/pdo/tests/pdo_016a.phpt +++ b/ext/pdo/tests/pdo_016a.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_BOUND w/o : --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -11,7 +11,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt index 2b8568fb46..32018da6e1 100644 --- a/ext/pdo/tests/pdo_017.phpt +++ b/ext/pdo/tests/pdo_017.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: transactions --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -16,7 +16,7 @@ try { } if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); if (false === MySQLPDOTest::detect_transactional_mysql_engine($db)) { die('skip your mysql configuration does not support working transactions'); } @@ -24,12 +24,12 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); $suf = ' ENGINE=' . MySQLPDOTest::detect_transactional_mysql_engine($db); } else { $suf = ''; diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index 54e83ddcd7..b99cb80968 100644 --- a/ext/pdo/tests/pdo_018.phpt +++ b/ext/pdo/tests/pdo_018.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: serializing --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_019.phpt b/ext/pdo/tests/pdo_019.phpt index eb3bb22c88..68c5311b41 100644 --- a/ext/pdo/tests/pdo_019.phpt +++ b/ext/pdo/tests/pdo_019.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: fetch() and while() --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_020.phpt b/ext/pdo/tests/pdo_020.phpt index 9c35da6adf..32f53d840e 100644 --- a/ext/pdo/tests/pdo_020.phpt +++ b/ext/pdo/tests/pdo_020.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement::columnCount --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt index b1c18fbefd..10b8029c20 100644 --- a/ext/pdo/tests/pdo_021.phpt +++ b/ext/pdo/tests/pdo_021.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement::execute with parameters --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_022.phpt b/ext/pdo/tests/pdo_022.phpt index 28a07994dd..bf3b40b4a8 100644 --- a/ext/pdo/tests/pdo_022.phpt +++ b/ext/pdo/tests/pdo_022.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement::getColumnMeta --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -21,7 +21,7 @@ PDOTest::skip(); This feature is not yet finalized, no test makes sense --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt index 8b4df3293b..e021e67881 100644 --- a/ext/pdo/tests/pdo_023.phpt +++ b/ext/pdo/tests/pdo_023.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: extending PDO --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; class PDOStatementX extends PDOStatement diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt index 5f4baf243d..042322871f 100644 --- a/ext/pdo/tests/pdo_024.phpt +++ b/ext/pdo/tests/pdo_024.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: assert that bindParam does not modify parameter --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_025.phpt b/ext/pdo/tests/pdo_025.phpt index de6f0ad841..43cc542a00 100644 --- a/ext/pdo/tests/pdo_025.phpt +++ b/ext/pdo/tests/pdo_025.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_INTO --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt index 78121c926a..8f72aff6e1 100644 --- a/ext/pdo/tests/pdo_026.phpt +++ b/ext/pdo/tests/pdo_026.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: extending PDO (2) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $data = array( diff --git a/ext/pdo/tests/pdo_027.phpt b/ext/pdo/tests/pdo_027.phpt index 1d9990d3fd..e10ab0aa75 100644 --- a/ext/pdo/tests/pdo_027.phpt +++ b/ext/pdo/tests/pdo_027.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_LAZY --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_028.phpt b/ext/pdo/tests/pdo_028.phpt index 0d1058dc59..726c28b2b8 100644 --- a/ext/pdo/tests/pdo_028.phpt +++ b/ext/pdo/tests/pdo_028.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: bindValue --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_029.phpt b/ext/pdo/tests/pdo_029.phpt index 8e495de3bd..8204de236a 100644 --- a/ext/pdo/tests/pdo_029.phpt +++ b/ext/pdo/tests/pdo_029.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: extending PDO (3) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $data = array( diff --git a/ext/pdo/tests/pdo_030.phpt b/ext/pdo/tests/pdo_030.phpt index a2a9207e77..bc697d7108 100644 --- a/ext/pdo/tests/pdo_030.phpt +++ b/ext/pdo/tests/pdo_030.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: extending PDO (4) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $data = array( diff --git a/ext/pdo/tests/pdo_031.phpt b/ext/pdo/tests/pdo_031.phpt index 11894e9708..689f7624ce 100644 --- a/ext/pdo/tests/pdo_031.phpt +++ b/ext/pdo/tests/pdo_031.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDOStatement SPL iterator --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $data = array( diff --git a/ext/pdo/tests/pdo_032.phpt b/ext/pdo/tests/pdo_032.phpt index aed6dd3976..9fc0cf1117 100644 --- a/ext/pdo/tests/pdo_032.phpt +++ b/ext/pdo/tests/pdo_032.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::ATTR_CASE --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_033.phpt b/ext/pdo/tests/pdo_033.phpt index 983ee0b212..22f0e15ccb 100644 --- a/ext/pdo/tests/pdo_033.phpt +++ b/ext/pdo/tests/pdo_033.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::quote() --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -11,7 +11,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_034.phpt b/ext/pdo/tests/pdo_034.phpt index 3803c2f4ef..dafcca1c71 100644 --- a/ext/pdo/tests/pdo_034.phpt +++ b/ext/pdo/tests/pdo_034.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PDO::FETCH_KEY_PAIR fetch mode test --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pdo_038.phpt b/ext/pdo/tests/pdo_038.phpt index 5a8b2ab63e..3ff2d090a8 100644 --- a/ext/pdo/tests/pdo_038.phpt +++ b/ext/pdo/tests/pdo_038.phpt @@ -1,7 +1,7 @@ --TEST-- PDOStatement::fetchColumn() invalid column index --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; function fetchColumn($stmt, $index) { diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt index 7fe2bf4af7..458092d25f 100644 --- a/ext/pdo/tests/pecl_bug_5217.phpt +++ b/ext/pdo/tests/pecl_bug_5217.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PECL Bug #5217 (serialize/unserialize safety) --SKIPIF-- -<?php # vim:ft=php +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); try { @@ -25,5 +25,5 @@ try { echo "PHP Didn't crash!\n"; ?> --EXPECT-- -Safely caught You cannot serialize or unserialize PDO instances +Safely caught Serialization of 'PDO' is not allowed PHP Didn't crash! diff --git a/ext/pdo/tests/pecl_bug_5772.phpt b/ext/pdo/tests/pecl_bug_5772.phpt index 1b5dbb3bd2..5363d80cee 100644 --- a/ext/pdo/tests/pecl_bug_5772.phpt +++ b/ext/pdo/tests/pecl_bug_5772.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PECL Bug #5772 (PDO::FETCH_FUNC breaks on mixed case func name) --SKIPIF-- -<?php # vim:ft=php: +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); diff --git a/ext/pdo/tests/pecl_bug_5809.phpt b/ext/pdo/tests/pecl_bug_5809.phpt index f9d3f75ea7..60bde2859f 100644 --- a/ext/pdo/tests/pecl_bug_5809.phpt +++ b/ext/pdo/tests/pecl_bug_5809.phpt @@ -1,7 +1,7 @@ --TEST-- PDO Common: PECL Bug #5809 (PDOStatement::execute(array()) changes param) --SKIPIF-- -<?php # vim:ft=php: +<?php if (!extension_loaded('pdo')) die('skip'); $dir = getenv('REDIR_TEST_DIR'); if (false == $dir) die('skip no driver'); @@ -10,7 +10,7 @@ PDOTest::skip(); ?> --FILE-- <?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); |