diff options
author | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
commit | 02889a1980340caaa4f2450c834da87fb675f848 (patch) | |
tree | 2e0b0f07f6810a635d5ecba89f63b6bfb63126f8 /ext/pdo_pgsql | |
parent | 3b1f8e9ad74ad07580e4248b39fd0db261c31aa0 (diff) | |
download | php-git-php-5.0.1b1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_1b1'.php-5.0.1b1
Diffstat (limited to 'ext/pdo_pgsql')
38 files changed, 0 insertions, 3053 deletions
diff --git a/ext/pdo_pgsql/CREDITS b/ext/pdo_pgsql/CREDITS deleted file mode 100644 index bbb7b94428..0000000000 --- a/ext/pdo_pgsql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -PostgreSQL driver for PDO -Edin Kadribasic, Ilia Alshanetsky diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 deleted file mode 100644 index 0d9955f640..0000000000 --- a/ext/pdo_pgsql/config.m4 +++ /dev/null @@ -1,119 +0,0 @@ -dnl -dnl $Id$ -dnl - -if test "$PHP_PDO" != "no"; then - -AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[ -]) - -PHP_ARG_WITH(pdo-pgsql,for PostgreSQL support for PDO, -[ --with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base - install directory or the path to pg_config]) - -if test "$PHP_PDO_PGSQL" != "no"; then - PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE) - - AC_MSG_CHECKING(for pg_config) - for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do - if test -x $i/pg_config; then - PG_CONFIG="$i/pg_config" - break; - fi - done - - if test -n "$PG_CONFIG"; then - AC_MSG_RESULT([$PG_CONFIG]) - PGSQL_INCLUDE=`$PG_CONFIG --includedir` - PGSQL_LIBDIR=`$PG_CONFIG --libdir` - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - else - AC_MSG_RESULT(not found) - if test "$PHP_PDO_PGSQL" = "yes"; then - PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" - else - PGSQL_SEARCH_PATHS=$PHP_PDO_PGSQL - fi - - for i in $PGSQL_SEARCH_PATHS; do - for j in include include/pgsql include/postgres include/postgresql ""; do - if test -r "$i/$j/libpq-fe.h"; then - PGSQL_INC_BASE=$i - PGSQL_INCLUDE=$i/$j - if test -r "$i/$j/pg_config.h"; then - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - fi - fi - done - - for j in lib lib/pgsql lib/postgres lib/postgresql ""; do - if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then - PGSQL_LIBDIR=$i/$j - fi - done - done - fi - - if test -z "$PGSQL_INCLUDE"; then - AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_LIBDIR"; then - AC_MSG_ERROR(Cannot find libpq.so. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then - AC_MSG_ERROR([Unable to find libpq anywhere under $withval]) - fi - - AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not]) - - AC_MSG_CHECKING([for openssl dependencies]) - if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then - AC_MSG_RESULT([yes]) - if pkg-config openssl ; then - PDO_PGSQL_CFLAGS="`pkg-config openssl --cflags`" - fi - else - AC_MSG_RESULT([no]) - fi - - old_LIBS=$LIBS - old_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR" - AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 or later])) - AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows])) - AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL])) - AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte])) - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - - PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PDO_PGSQL_SHARED_LIBADD) - PHP_SUBST(PDO_PGSQL_SHARED_LIBADD) - - PHP_ADD_INCLUDE($PGSQL_INCLUDE) - - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - - PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS) - PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo) -fi - -fi diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32 deleted file mode 100644 index 6af9c98072..0000000000 --- a/ext/pdo_pgsql/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no"); - -if (PHP_PDO_PGSQL != "no") { - if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) && - CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) { - EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c"); - ADD_FLAG('CFLAGS_PDO_PGSQL', "/I ..\\pecl"); - AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library'); - ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1"); - } else { - WARNING("pdo_pgsql not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_pgsql', 'pdo'); -} diff --git a/ext/pdo_pgsql/package.xml b/ext/pdo_pgsql/package.xml deleted file mode 100644 index d6488cb5bb..0000000000 --- a/ext/pdo_pgsql/package.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package version="1.0">
- <name>PDO_PGSQL</name>
- <summary>PostgreSQL driver for PDO</summary>
- <maintainers>
- <maintainer>
- <user>edink</user>
- <name>Edin Kadribasic</name>
- <email>edink@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>iliaa@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
- This extension provides an PostgreSQL driver for PDO.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>0.2</version>
- <date>2005-02-09</date>
-
- <notes>
- You need to install the PDO core module before you can make use of this one.
- You also require PostgreSQL client libraries installed on the machine where you intend to build and/or use it.
-
- If you are running on windows, you can download the binary from here:
- http://snaps.php.net/win32/PECL_5_0/php_pdo_pgsql.dll
- </notes>
-
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="pdo_pgsql.c"/>
- <file role="src" name="pgsql_driver.c"/>
- <file role="src" name="pgsql_statement.c"/>
- <file role="src" name="php_pdo_pgsql.h"/>
- <file role="src" name="php_pdo_pgsql_int.h"/>
-
- <file role="doc" name="CREDITS"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5.0.3"/>
- <dep type="ext" rel="ge" name="pdo" version="0.2"/>
- </deps>
- </release>
-</package>
diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c deleted file mode 100644 index d48bafc5c9..0000000000 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 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_0.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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" - -/* {{{ pdo_pgsql_functions[] */ -function_entry pdo_pgsql_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_pgsql_module_entry */ -zend_module_entry pdo_pgsql_module_entry = { - STANDARD_MODULE_HEADER, - "pdo_pgsql", - pdo_pgsql_functions, - PHP_MINIT(pdo_pgsql), - PHP_MSHUTDOWN(pdo_pgsql), - PHP_RINIT(pdo_pgsql), - PHP_RSHUTDOWN(pdo_pgsql), - PHP_MINFO(pdo_pgsql), - "0.2", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_PGSQL -ZEND_GET_MODULE(pdo_pgsql) -#endif - -/* true global environment */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pdo_pgsql) -{ - php_pdo_register_driver(&pdo_pgsql_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_pgsql) -{ - php_pdo_unregister_driver(&pdo_pgsql_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(pdo_pgsql) -{ - /* php_pdo_register_driver(&pdo_pgsql_driver); */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(pdo_pgsql) -{ - /* php_pdo_unregister_driver(&pdo_pgsql_driver); */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_pgsql) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* - * 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_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c deleted file mode 100644 index f0531db7ff..0000000000 --- a/ext/pdo_pgsql/pgsql_driver.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 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_0.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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" - -#include "pg_config.h" /* needed for PG_VERSION */ -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" -#include "zend_exceptions.h" - -static char * _pdo_pgsql_trim_message(const char *message, int persistent) -{ - register int i = strlen(message)-1; - char *tmp; - - if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') { - --i; - } - while (i>0 && (message[i] == '\r' || message[i] == '\n')) { - --i; - } - ++i; - tmp = pemalloc(i + 1, persistent); - memcpy(tmp, message, i); - tmp[i] = '\0'; - - return tmp; -} - -int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; - pdo_pgsql_error_info *einfo = &H->einfo; - char *errmsg = PQerrorMessage(H->server); - - einfo->errcode = errcode; - einfo->file = file; - einfo->line = line; - - if (einfo->errmsg) { - pefree(einfo->errmsg, dbh->is_persistent); - einfo->errmsg = NULL; - } - - if (sqlstate == NULL) { - strcpy(*pdo_err, "HY000"); - } - else { - strcpy(*pdo_err, sqlstate); - } - - if (errmsg) { - einfo->errmsg = _pdo_pgsql_trim_message(errmsg, dbh->is_persistent); - } - - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", - *pdo_err, einfo->errcode, einfo->errmsg); - } - - return errcode; -} -/* }}} */ - -static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */ -{ -/* pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */ -} -/* }}} */ - -static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_pgsql_error_info *einfo = &H->einfo; - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); - } - - return 1; -} -/* }}} */ - -static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - if (H) { - if (H->server) { - PQfinish(H->server); - H->server = NULL; - } - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - H->einfo.errmsg = NULL; - } - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - } - return 0; -} -/* }}} */ - -static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt)); - int scrollable; - - S->H = H; - stmt->driver_data = S; - stmt->methods = &pgsql_stmt_methods; - stmt->supports_placeholders = PDO_PLACEHOLDER_NONE; - - scrollable = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, - PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL; - - if (scrollable) { - spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt); - } - - return 1; -} - -static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - PGresult *res; - - if (!(res = PQexec(H->server, sql))) { - /* fatal error */ - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - return 0; - } else { - ExecStatusType qs = PQresultStatus(res); - if (qs != PGRES_COMMAND_OK && qs != PGRES_TUPLES_OK) { -#if HAVE_PQRESULTERRORFIELD - char * sqlstate = PQresultErrorField(res, PG_DIAG_SQLSTATE); - pdo_pgsql_error(dbh, qs, (const char *)sqlstate); - PQfreemem(sqlstate); -#else - pdo_pgsql_error(dbh, qs, NULL); -#endif - PQclear(res); - return 0; - } - H->pgoid = PQoidValue(res); - PQclear(res); - } - - return 1; -} - -static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - unsigned char *escaped; - - switch (paramtype) { - case PDO_PARAM_LOB: - /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */ - escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen); - *quotedlen += 1; - *quoted = emalloc(*quotedlen + 1); - memcpy((*quoted)+1, escaped, *quotedlen-2); - (*quoted)[0] = '\''; - (*quoted)[*quotedlen-1] = '\''; - (*quoted)[*quotedlen] = '\0'; - free(escaped); - break; - default: - *quoted = emalloc(2*unquotedlen + 3); - (*quoted)[0] = '\''; - *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen); - (*quoted)[*quotedlen + 1] = '\''; - (*quoted)[*quotedlen + 2] = '\0'; - *quotedlen += 2; - } - return 1; -} - -static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - char *id = NULL; - - if (H->pgoid == InvalidOid) { - return NULL; - } - - /* TODO: if name != NULL, pull out last value for that sequence/column */ - - *len = spprintf(&id, 0, "%lld", H->pgoid); - return id; -} - -static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - ZVAL_STRING(return_value, PG_VERSION, 1); - break; - - case PDO_ATTR_SERVER_VERSION: -#ifdef HAVE_PQPROTOCOLVERSION - if (PQprotocolVersion(H->server) >= 3) { /* PostgreSQL 7.4 or later */ - ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version"), 1); - } else /* emulate above via a query */ -#endif - { - PGresult *res = PQexec(H->server, "SELECT VERSION()"); - if (res && PQresultStatus(res) == PGRES_TUPLES_OK) { - ZVAL_STRING(return_value, (char *)PQgetvalue(res, 0, 0), 1); - } - - if (res) { - PQclear(res); - } - } - break; - - case PDO_ATTR_CONNECTION_STATUS: - switch (PQstatus(H->server)) { - case CONNECTION_STARTED: - ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1); - break; - - case CONNECTION_MADE: - case CONNECTION_OK: - ZVAL_STRINGL(return_value, "Connection OK; waiting to send.", sizeof("Connection OK; waiting to send.")-1, 1); - break; - - case CONNECTION_AWAITING_RESPONSE: - ZVAL_STRINGL(return_value, "Waiting for a response from the server.", sizeof("Waiting for a response from the server.")-1, 1); - break; - - case CONNECTION_AUTH_OK: - ZVAL_STRINGL(return_value, "Received authentication; waiting for backend start-up to finish.", sizeof("Received authentication; waiting for backend start-up to finish.")-1, 1); - break; -#ifdef CONNECTION_SSL_STARTUP - case CONNECTION_SSL_STARTUP: - ZVAL_STRINGL(return_value, "Negotiating SSL encryption.", sizeof("Negotiating SSL encryption.")-1, 1); - break; -#endif - case CONNECTION_SETENV: - ZVAL_STRINGL(return_value, "Negotiating environment-driven parameter settings.", sizeof("Negotiating environment-driven parameter settings.")-1, 1); - break; - - case CONNECTION_BAD: - default: - ZVAL_STRINGL(return_value, "Bad connection.", sizeof("Bad connection.")-1, 1); - break; - } - break; - - case PDO_ATTR_SERVER_INFO: { - int spid = PQbackendPID(H->server); - char *tmp; -#ifdef HAVE_PQPROTOCOLVERSION - spprintf(&tmp, 0, - "PID: %d; Client Encoding: %s; Is Superuser: %s; Session Authorization: %s; Date Style: %s", - spid, - (char*)PQparameterStatus(H->server, "client_encoding"), - (char*)PQparameterStatus(H->server, "is_superuser"), - (char*)PQparameterStatus(H->server, "session_authorization"), - (char*)PQparameterStatus(H->server, "DateStyle")); -#else - spprintf(&tmp, 0, "PID: %d", spid); -#endif - ZVAL_STRING(return_value, tmp, 0); - } - break; - - default: - return 0; - } - - return 1; -} - -static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - PGresult *res; - int ret = 1; - - res = PQexec(H->server, cmd); - - if (PQresultStatus(res) != PGRES_COMMAND_OK) { - ret = 0; - } - - PQclear(res); - return ret; -} - -static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("BEGIN", dbh TSRMLS_CC); -} - -static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); -} - -static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); -} - -static struct pdo_dbh_methods pgsql_methods = { - pgsql_handle_closer, - pgsql_handle_preparer, - pgsql_handle_doer, - pgsql_handle_quoter, - pgsql_handle_begin, - pgsql_handle_commit, - pgsql_handle_rollback, - NULL, /* set_attr */ - pdo_pgsql_last_insert_id, - pdo_pgsql_fetch_error_func, - pdo_pgsql_get_attribute, - NULL, /* check_liveness */ - NULL /* get_driver_methods */ -}; - -static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H; - int ret = 0; - char *conn_str, *p, *e; - - H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent); - dbh->driver_data = H; - - H->einfo.errcode = 0; - H->einfo.errmsg = NULL; - - /* PostgreSQL wants params in the connect string to be separated by spaces, - * if the PDO standard semicolons are used, we convert them to spaces - */ - e = (char *) dbh->data_source + strlen(dbh->data_source); - p = (char *) dbh->data_source; - while ((p = memchr(p, ';', (e - p)))) { - *p = ' '; - } - - /* support both full connection string & connection string + login and/or password */ - if (!dbh->username || !dbh->password) { - conn_str = (char *) dbh->data_source; - } else if (dbh->username && dbh->password) { - spprintf(&conn_str, 0, "%s user=%s password=%s", dbh->data_source, dbh->username, dbh->password); - } else if (dbh->username) { - spprintf(&conn_str, 0, "%s user=%s", dbh->data_source, dbh->username); - } else { - spprintf(&conn_str, 0, "%s password=%s", dbh->data_source, dbh->password); - } - - H->server = PQconnectdb(conn_str); - - if (conn_str != dbh->data_source) { - efree(conn_str); - } - - if (PQstatus(H->server) != CONNECTION_OK) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE); - goto cleanup; - } - - PQsetNoticeProcessor(H->server, (void(*)(void*,const char*))_pdo_pgsql_notice, (void *)&dbh); - - H->attached = 1; - H->pgoid = -1; - - dbh->methods = &pgsql_methods; - dbh->alloc_own_columns = 1; - dbh->max_escaped_char_length = 2; - - ret = 1; - -cleanup: - dbh->methods = &pgsql_methods; - if (!ret) { - pgsql_handle_closer(dbh TSRMLS_CC); - } - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_pgsql_driver = { - PDO_DRIVER_HEADER(pgsql), - pdo_pgsql_handle_factory -}; - -/* - * 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_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c deleted file mode 100644 index 821a053778..0000000000 --- a/ext/pdo_pgsql/pgsql_statement.c +++ /dev/null @@ -1,439 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 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_0.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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" - -/* from postgresql/src/include/catalog/pg_type.h */ -#define BOOLOID 16 -#define BYTEAOID 17 -#define INT8OID 20 -#define INT2OID 21 -#define INT4OID 23 -#define OIDOID 26 - - -static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - - if (S->result) { - /* free the resource */ - PQclear(S->result); - S->result = NULL; - } - - if (S->cursor_name) { - pdo_pgsql_db_handle *H = S->H; - char *q = NULL; - PGresult *res; - - spprintf(&q, 0, "CLOSE %s", S->cursor_name); - res = PQexec(H->server, q); - efree(q); - if (res) PQclear(res); - efree(S->cursor_name); - S->cursor_name = NULL; - } - - if(S->cols) { - efree(S->cols); - S->cols = NULL; - } - efree(S); - return 1; -} - -static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - pdo_pgsql_db_handle *H = S->H; - ExecStatusType status; - - if (stmt->executed) { - /* ensure that we free any previous unfetched results */ - if(S->result) { - PQclear(S->result); - S->result = NULL; - } - } - - S->current_row = 0; - - if (S->cursor_name) { - char *q = NULL; - spprintf(&q, 0, "DECLARE %s FOR %s", S->cursor_name, stmt->active_query_string); - S->result = PQexec(H->server, q); - efree(q); - } else { - S->result = PQexec(H->server, stmt->active_query_string); - } - status = PQresultStatus(S->result); - - if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { -#if HAVE_PQRESULTERRORFIELD - char * sqlstate = PQresultErrorField(S->result, PG_DIAG_SQLSTATE); - pdo_pgsql_error_stmt(stmt, status, (const char *)sqlstate); -#else - pdo_pgsql_error_stmt(stmt, status, NULL); -#endif - - return 0; - } - - if(!stmt->executed) { - stmt->column_count = (int) PQnfields(S->result); - S->cols = ecalloc(stmt->column_count, sizeof(pdo_pgsql_column)); - } - - if (status == PGRES_COMMAND_OK) { - stmt->row_count = (long)atoi(PQcmdTuples(S->result)); - H->pgoid = PQoidValue(S->result); - } else { - stmt->row_count = (long)PQntuples(S->result); - } - - return 1; -} - -static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ - return 1; -} - -static int pgsql_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - - if (S->cursor_name) { - char *ori_str; - char *q = NULL; - ExecStatusType status; - - switch (ori) { - case PDO_FETCH_ORI_NEXT: ori_str = "NEXT"; break; - case PDO_FETCH_ORI_PRIOR: ori_str = "PRIOR"; break; - case PDO_FETCH_ORI_REL: ori_str = "RELATIVE"; break; - default: - return 0; - } - - spprintf(&q, 0, "FETCH %s %ld FROM %s", ori_str, offset, S->cursor_name); - S->result = PQexec(S->H->server, q); - status = PQresultStatus(S->result); - - if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { -#if HAVE_PQRESULTERRORFIELD - char * sqlstate = PQresultErrorField(S->result, PG_DIAG_SQLSTATE); - pdo_pgsql_error_stmt(stmt, status, (const char *)sqlstate); -#else - pdo_pgsql_error_stmt(stmt, status, NULL); -#endif - return 0; - } - - S->current_row = 1; - return 1; - - } else { - if (S->current_row < stmt->row_count) { - S->current_row++; - return 1; - } else { - return 0; - } - } -} - -static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - struct pdo_column_data *cols = stmt->columns; - - if (!S->result) { - return 0; - } - - cols[colno].name = estrdup(PQfname(S->result, colno)); - cols[colno].namelen = strlen(cols[colno].name); - cols[colno].maxlen = PQfsize(S->result, colno); - cols[colno].precision = PQfmod(S->result, colno); - S->cols[colno].pgsql_type = PQftype(S->result, colno); - - switch(S->cols[colno].pgsql_type) { - - case BOOLOID: - cols[colno].param_type = PDO_PARAM_BOOL; - break; - - case INT2OID: - case INT4OID: - case OIDOID: - cols[colno].param_type = PDO_PARAM_INT; - break; - - case INT8OID: - if (sizeof(long)>=8) { - cols[colno].param_type = PDO_PARAM_INT; - } else { - cols[colno].param_type = PDO_PARAM_STR; - } - break; - - case BYTEAOID: - cols[colno].param_type = PDO_PARAM_LOB; - break; - - default: - cols[colno].param_type = PDO_PARAM_STR; - } - - return 1; -} - -/* PQunescapeBytea() from PostgreSQL 7.3 to provide bytea unescape feature to 7.2 users. - Renamed to php_pdo_pgsql_unescape_bytea() */ -/* - * PQunescapeBytea - converts the null terminated string representation - * of a bytea, strtext, into binary, filling a buffer. It returns a - * pointer to the buffer which is NULL on error, and the size of the - * buffer in retbuflen. The pointer may subsequently be used as an - * argument to the function free(3). It is the reverse of PQescapeBytea. - * - * The following transformations are reversed: - * '\0' == ASCII 0 == \000 - * '\'' == ASCII 39 == \' - * '\\' == ASCII 92 == \\ - * - * States: - * 0 normal 0->1->2->3->4 - * 1 \ 1->5 - * 2 \0 1->6 - * 3 \00 - * 4 \000 - * 5 \' - * 6 \\ - */ -static unsigned char *php_pdo_pgsql_unescape_bytea(unsigned char *strtext, size_t *retbuflen) -{ - size_t buflen; - unsigned char *buffer, - *sp, - *bp; - unsigned int state = 0; - - if (strtext == NULL) - return NULL; - buflen = strlen(strtext); /* will shrink, also we discover if - * strtext */ - buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */ - for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++) - { - switch (state) - { - case 0: - if (*sp == '\\') - state = 1; - *bp = *sp; - break; - case 1: - if (*sp == '\'') /* state=5 */ - { /* replace \' with 39 */ - bp--; - *bp = '\''; - buflen--; - state = 0; - } - else if (*sp == '\\') /* state=6 */ - { /* replace \\ with 92 */ - bp--; - *bp = '\\'; - buflen--; - state = 0; - } - else - { - if (isdigit(*sp)) - state = 2; - else - state = 0; - *bp = *sp; - } - break; - case 2: - if (isdigit(*sp)) - state = 3; - else - state = 0; - *bp = *sp; - break; - case 3: - if (isdigit(*sp)) /* state=4 */ - { - unsigned char *start, *end, buf[4]; /* 000 + '\0' */ - - bp -= 3; - memcpy(buf, sp-2, 3); - buf[3] = '\0'; - start = buf; - *bp = (unsigned char)strtoul(start, (char **)&end, 8); - buflen -= 3; - state = 0; - } - else - { - *bp = *sp; - state = 0; - } - break; - } - } - buffer = erealloc(buffer, buflen+1); - buffer[buflen] = '\0'; - - *retbuflen = buflen; - return buffer; -} - -static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - struct pdo_column_data *cols = stmt->columns; - size_t tmp_len; - - if (!S->result) { - return 0; - } - - /* We have already increased count by 1 in pgsql_stmt_fetch() */ - if (PQgetisnull(S->result, S->current_row - 1, colno)) { /* Check if we got NULL */ - *ptr = NULL; - *len = 0; - } else { - *ptr = PQgetvalue(S->result, S->current_row - 1, colno); - *len = PQgetlength(S->result, S->current_row - 1, colno); - - switch(cols[colno].param_type) { - - case PDO_PARAM_INT: - S->cols[colno].intval = atol(*ptr); - *ptr = (char *) &(S->cols[colno].intval); - *len = sizeof(long); - break; - - case PDO_PARAM_BOOL: - S->cols[colno].boolval = **ptr == 't' ? 1: 0; - *ptr = (char *) &(S->cols[colno].boolval); - *len = sizeof(zend_bool); - break; - - case PDO_PARAM_LOB: - *ptr = php_pdo_pgsql_unescape_bytea(*ptr, &tmp_len); - *len = tmp_len; - *caller_frees = 1; - break; - case PDO_PARAM_NULL: - case PDO_PARAM_STR: - case PDO_PARAM_STMT: - case PDO_PARAM_INPUT_OUTPUT: - break; - } - } - - return 1; -} - -static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - PGresult *res; - char *q=NULL; - ExecStatusType status; - - if (!S->result) { - return FAILURE; - } - - if (colno >= stmt->column_count) { - return FAILURE; - } - - array_init(return_value); - add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type); - - /* Fetch metadata from Postgres system catalogue */ - spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type); - res = PQexec(S->H->server, q); - efree(q); - - status = PQresultStatus(res); - - if (status != PGRES_TUPLES_OK) { - /* Failed to get system catalogue, but return success - * with the data we have collected so far - */ - PQclear(res); - return 1; - } - - /* We want exactly one row returned */ - if (1 != PQntuples(res)) { - PQclear(res); - return 1; - } - - add_assoc_string(return_value, "native_type", PQgetvalue(res, 0, 0), 1); - - PQclear(res); - return 1; -} - -struct pdo_stmt_methods pgsql_stmt_methods = { - pgsql_stmt_dtor, - pgsql_stmt_execute, - pgsql_stmt_fetch, - pgsql_stmt_describe, - pgsql_stmt_get_col, - pgsql_stmt_param_hook, - NULL, /* set_attr */ - NULL, /* get_attr */ - pgsql_stmt_get_column_meta, - NULL /* next_rowset */ -}; - -/* - * 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_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h deleted file mode 100644 index eda9bcb14a..0000000000 --- a/ext/pdo_pgsql/php_pdo_pgsql.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 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_0.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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_PGSQL_H -#define PHP_PDO_PGSQL_H - -#include <libpq-fe.h> - -extern zend_module_entry pdo_pgsql_module_entry; -#define phpext_pdo_pgsql_ptr &pdo_pgsql_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_PGSQL_API __declspec(dllexport) -#else -#define PHP_PDO_PGSQL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_pgsql); -PHP_MSHUTDOWN_FUNCTION(pdo_pgsql); -PHP_RINIT_FUNCTION(pdo_pgsql); -PHP_RSHUTDOWN_FUNCTION(pdo_pgsql); -PHP_MINFO_FUNCTION(pdo_pgsql); - -#endif /* PHP_PDO_PGSQL_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_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h deleted file mode 100644 index 54a06011a7..0000000000 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 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_0.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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_PGSQL_INT_H -#define PHP_PDO_PGSQL_INT_H - -#include <libpq-fe.h> - -#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006" - -typedef struct { - const char *file; - int line; - unsigned int errcode; - char *errmsg; -} pdo_pgsql_error_info; - -/* stuff we use in a pgsql database handle */ -typedef struct { - PGconn *server; - unsigned attached:1; - unsigned _reserved:31; - pdo_pgsql_error_info einfo; - Oid pgoid; -} pdo_pgsql_db_handle; - -typedef struct { - char *def; - Oid pgsql_type; - long intval; - zend_bool boolval; -} pdo_pgsql_column; - -typedef struct { - pdo_pgsql_db_handle *H; - PGresult *result; - int current_row; - pdo_pgsql_column *cols; - char *cursor_name; -} pdo_pgsql_stmt; - -typedef struct { - char *repr; - long repr_len; - int pgsql_type; - void *thing; /* for LOBS, REFCURSORS etc. */ -} pdo_pgsql_bound_param; - -extern pdo_driver_t pdo_pgsql_driver; - -extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC); -#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods pgsql_stmt_methods; - -#endif /* PHP_PDO_PGSQL_INT_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_pgsql/tests/connection.inc b/ext/pdo_pgsql/tests/connection.inc deleted file mode 100755 index e2185278c0..0000000000 --- a/ext/pdo_pgsql/tests/connection.inc +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -$HOST = 'localhost'; -$PORT = 5432; -$USER = 'root'; -$PASSWD = ''; -$DBNAME = 'test'; - -$CONNECTION = "pgsql:host=$HOST port=$PORT dbname=$DBNAME user=$USER password=$PASSWD"; - -$PDO_TESTS = dirname(__FILE__) . '/../../pdo/tests/'; - -?> diff --git a/ext/pdo_pgsql/tests/pdo_001.phpt b/ext/pdo_pgsql/tests/pdo_001.phpt deleted file mode 100755 index 67ff5b1086..0000000000 --- a/ext/pdo_pgsql/tests/pdo_001.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_ASSOC ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_001.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -array(3) { - [0]=> - array(2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - array(2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - [2]=> - array(2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_002.phpt b/ext/pdo_pgsql/tests/pdo_002.phpt deleted file mode 100755 index 02d5a2034e..0000000000 --- a/ext/pdo_pgsql/tests/pdo_002.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_NUM ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_002.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -array(3) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - string(1) "A" - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - string(1) "B" - } - [2]=> - array(2) { - [0]=> - int(3) - [1]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_003.phpt b/ext/pdo_pgsql/tests/pdo_003.phpt deleted file mode 100755 index bdddb14979..0000000000 --- a/ext/pdo_pgsql/tests/pdo_003.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_BOTH ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_003.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -array(3) { - [0]=> - array(4) { - ["id"]=> - int(1) - [0]=> - int(1) - ["val"]=> - string(1) "A" - [1]=> - string(1) "A" - } - [1]=> - array(4) { - ["id"]=> - int(2) - [0]=> - int(2) - ["val"]=> - string(1) "B" - [1]=> - string(1) "B" - } - [2]=> - array(4) { - ["id"]=> - int(3) - [0]=> - int(3) - ["val"]=> - string(1) "C" - [1]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_004.phpt b/ext/pdo_pgsql/tests/pdo_004.phpt deleted file mode 100755 index d9f66a9d96..0000000000 --- a/ext/pdo_pgsql/tests/pdo_004.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_OBJ ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_004.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - object(stdClass)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - [2]=> - object(stdClass)#%d (2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_005.phpt b/ext/pdo_pgsql/tests/pdo_005.phpt deleted file mode 100755 index 3243084b05..0000000000 --- a/ext/pdo_pgsql/tests/pdo_005.phpt +++ /dev/null @@ -1,120 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_CLASS ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_005.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (3) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - ["val2"]=> - string(2) "AA" - } - [1]=> - object(stdClass)#%d (3) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - ["val2"]=> - string(2) "BB" - } - [2]=> - object(stdClass)#%d (3) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - ["val2"]=> - string(2) "CC" - } -} -array(3) { - [0]=> - object(TestBase)#%d (3) { - ["id"]=> - int(1) - ["val:protected"]=> - string(1) "A" - ["val2:private"]=> - string(2) "AA" - } - [1]=> - object(TestBase)#%d (3) { - ["id"]=> - int(2) - ["val:protected"]=> - string(1) "B" - ["val2:private"]=> - string(2) "BB" - } - [2]=> - object(TestBase)#%d (3) { - ["id"]=> - int(3) - ["val:protected"]=> - string(1) "C" - ["val2:private"]=> - string(2) "CC" - } -} -TestDerived::__construct(0,1) -TestDerived::__construct(1,2) -TestDerived::__construct(2,3) -array(3) { - [0]=> - object(TestDerived)#%d (5) { - ["row:protected"]=> - int(0) - ["id"]=> - int(1) - ["val:protected"]=> - string(1) "A" - ["val2:private"]=> - NULL - ["val2"]=> - string(2) "AA" - } - [1]=> - object(TestDerived)#%d (5) { - ["row:protected"]=> - int(1) - ["id"]=> - int(2) - ["val:protected"]=> - string(1) "B" - ["val2:private"]=> - NULL - ["val2"]=> - string(2) "BB" - } - [2]=> - object(TestDerived)#%d (5) { - ["row:protected"]=> - int(2) - ["id"]=> - int(3) - ["val:protected"]=> - string(1) "C" - ["val2:private"]=> - NULL - ["val2"]=> - string(2) "CC" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_006.phpt b/ext/pdo_pgsql/tests/pdo_006.phpt deleted file mode 100755 index 9ea5a563e3..0000000000 --- a/ext/pdo_pgsql/tests/pdo_006.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_GROUP ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_006.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(2) { - ["A"]=> - array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - } - ["C"]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(3) - } - } -} -array(2) { - ["A"]=> - array(2) { - [0]=> - array(1) { - ["id"]=> - int(1) - } - [1]=> - array(1) { - ["id"]=> - int(2) - } - } - ["C"]=> - array(1) { - [0]=> - array(1) { - ["id"]=> - int(3) - } - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_007.phpt b/ext/pdo_pgsql/tests/pdo_007.phpt deleted file mode 100755 index 7cc900be7f..0000000000 --- a/ext/pdo_pgsql/tests/pdo_007.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_UNIQUE ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_007.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(3) { - ["A"]=> - array(1) { - [0]=> - string(1) "A" - } - ["B"]=> - array(1) { - [0]=> - string(1) "A" - } - ["C"]=> - array(1) { - [0]=> - string(1) "C" - } -} -array(3) { - ["A"]=> - array(1) { - ["val"]=> - string(1) "A" - } - ["B"]=> - array(1) { - ["val"]=> - string(1) "A" - } - ["C"]=> - array(1) { - ["val"]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_008.phpt b/ext/pdo_pgsql/tests/pdo_008.phpt deleted file mode 100755 index 35a3ee793f..0000000000 --- a/ext/pdo_pgsql/tests/pdo_008.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_UNIQUE conflict ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_008.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(2) { - ["A"]=> - array(1) { - [0]=> - string(1) "B" - } - ["C"]=> - array(1) { - [0]=> - string(1) "C" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_009.phpt b/ext/pdo_pgsql/tests/pdo_009.phpt deleted file mode 100755 index 9896f9b274..0000000000 --- a/ext/pdo_pgsql/tests/pdo_009.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_CLASSTYPE ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_009.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(4) { - [0]=> - array(3) { - [0]=> - string(8) "stdClass" - [1]=> - int(1) - [2]=> - string(1) "A" - } - [1]=> - array(3) { - [0]=> - string(5) "Test1" - [1]=> - int(2) - [2]=> - string(1) "B" - } - [2]=> - array(3) { - [0]=> - string(5) "Test2" - [1]=> - int(3) - [2]=> - string(1) "C" - } - [3]=> - array(3) { - [0]=> - NULL - [1]=> - int(4) - [2]=> - string(1) "D" - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(4) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - [2]=> - object(Test2)#%d (2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } - [3]=> - object(Test3)#%d (2) { - ["id"]=> - int(4) - ["val"]=> - string(1) "D" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_010.phpt b/ext/pdo_pgsql/tests/pdo_010.phpt deleted file mode 100755 index dfca2b7641..0000000000 --- a/ext/pdo_pgsql/tests/pdo_010.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_(CLASSTYPE and GROUP/UNIQUE) ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_010.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - ["Group1"]=> - array(2) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - } - ["Group2"]=> - array(2) { - [0]=> - object(Test2)#%d (2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } - [1]=> - object(Test3)#%d (2) { - ["id"]=> - int(4) - ["val"]=> - string(1) "D" - } - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - ["Group1"]=> - object(Test1)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - ["Group2"]=> - object(Test3)#%d (2) { - ["id"]=> - int(4) - ["val"]=> - string(1) "D" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_011.phpt b/ext/pdo_pgsql/tests/pdo_011.phpt deleted file mode 100755 index fabadc220b..0000000000 --- a/ext/pdo_pgsql/tests/pdo_011.phpt +++ /dev/null @@ -1,181 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_FUNC and statement overloading ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_011.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Test1::__construct(0,0) -test(1,N/A) -test(2,N/A) -test(3,N/A) -test(4,N/A) -array(2) { - ["Group1"]=> - array(2) { - [0]=> - array(1) { - [1]=> - string(3) "N/A" - } - [1]=> - array(1) { - [2]=> - string(3) "N/A" - } - } - ["Group2"]=> - array(2) { - [0]=> - array(1) { - [3]=> - string(3) "N/A" - } - [1]=> - array(1) { - [4]=> - string(3) "N/A" - } - } -} -test(1,A) -test(2,B) -test(3,C) -test(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - string(1) "A" - } - [1]=> - array(1) { - [2]=> - string(1) "B" - } - [2]=> - array(1) { - [3]=> - string(1) "C" - } - [3]=> - array(1) { - [4]=> - string(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - [2]=> - object(Test1)#%d (2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } - [3]=> - object(Test1)#%d (2) { - ["id"]=> - int(4) - ["val"]=> - string(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - ["id"]=> - int(1) - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - int(2) - ["val"]=> - string(1) "B" - } - [2]=> - object(Test1)#%d (2) { - ["id"]=> - int(3) - ["val"]=> - string(1) "C" - } - [3]=> - object(Test1)#%d (2) { - ["id"]=> - int(4) - ["val"]=> - string(1) "D" - } -} -DerivedStatement::__construct(Overloaded) -string(16) "DerivedStatement" -DerivedStatement::retrieve(1,A) -DerivedStatement::retrieve(2,B) -DerivedStatement::retrieve(3,C) -DerivedStatement::retrieve(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - string(1) "A" - } - [1]=> - array(1) { - [2]=> - string(1) "B" - } - [2]=> - array(1) { - [3]=> - string(1) "C" - } - [3]=> - array(1) { - [4]=> - string(1) "D" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_012.phpt b/ext/pdo_pgsql/tests/pdo_012.phpt deleted file mode 100755 index f7113dce77..0000000000 --- a/ext/pdo_pgsql/tests/pdo_012.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement::setFetchMode ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_012.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(2) { - [0]=> - array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" - } - [1]=> - array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" - } -} -Test::__construct(N/A) -Test::__construct(N/A) -array(2) { - [0]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" - } -} -Test::__construct(Changed) -Test::__construct(Changed) -array(2) { - [0]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_013.phpt b/ext/pdo_pgsql/tests/pdo_013.phpt deleted file mode 100755 index 8956e6de08..0000000000 --- a/ext/pdo_pgsql/tests/pdo_013.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement is Traversable ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_013.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" -} -array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" -} -Test::__construct(N/A) -object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(N/A) -object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} -Test::__construct(WOW) -object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(WOW) -object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_014.phpt b/ext/pdo_pgsql/tests/pdo_014.phpt deleted file mode 100755 index eed5575c85..0000000000 --- a/ext/pdo_pgsql/tests/pdo_014.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement and SPL Iterators ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -if (!extension_loaded('SPL')) die('skip SPL not available'); -if (!class_exists('IteratorIterator')) die ('skip Class IteratorIterator does not exist'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_014.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Test::__construct(WOW) -object(Test)#4 (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(WOW) -object(Test)#6 (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} -NULL -bool(false) -PDOStatementAggregate::__construct -PDOStatementAggregate::getIterator -array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" -} -array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_015.phpt b/ext/pdo_pgsql/tests/pdo_015.phpt deleted file mode 100755 index b3a6b108e4..0000000000 --- a/ext/pdo_pgsql/tests/pdo_015.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_COLUMN ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_015.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -array(2) { - [0]=> - string(2) "A2" - [1]=> - string(2) "B2" -} -array(2) { - [1]=> - array(1) { - [0]=> - string(1) "A" - } - [2]=> - array(1) { - [0]=> - string(1) "A" - } -} -array(2) { - [1]=> - string(1) "A" - [2]=> - string(1) "A" -} -array(2) { - [1]=> - int(1) - [2]=> - int(2) -} -array(2) { - [1]=> - string(1) "A" - [2]=> - string(1) "A" -} -array(2) { - [1]=> - string(2) "A2" - [2]=> - string(2) "B2" -} -array(1) { - ["A"]=> - array(2) { - [0]=> - string(2) "A2" - [1]=> - string(2) "B2" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_016.phpt b/ext/pdo_pgsql/tests/pdo_016.phpt deleted file mode 100755 index f09290ba9b..0000000000 --- a/ext/pdo_pgsql/tests/pdo_016.phpt +++ /dev/null @@ -1,117 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_BOUND ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_016.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===INIT=== -int(1) -int(1) -int(1) -string(1) "3" -array(3) { - [0]=> - string(7) "String0" - [1]=> - string(7) "String1" - [2]=> - string(7) "String2" -} -===WHILE=== -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -===ALONE=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [2]=> - string(7) "String2" -} -===REBIND/SAME=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -string(7) "String0" -bool(true) -bool(true) -int(0) -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -string(7) "String1" -bool(true) -bool(true) -int(1) -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -string(7) "String2" -bool(true) -bool(true) -int(2) -===REBIND/CONFLICT=== -string(7) "String0" -string(7) "String1" -string(7) "String2" -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_017.phpt b/ext/pdo_pgsql/tests/pdo_017.phpt deleted file mode 100755 index 4f48f14da8..0000000000 --- a/ext/pdo_pgsql/tests/pdo_017.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO::beginTransaction / PDO::rollBack ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_017.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -Counted 3 rows after insert. -Counted 0 rows after delete. -Counted 3 rows after rollback. -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_018.phpt b/ext/pdo_pgsql/tests/pdo_018.phpt deleted file mode 100755 index 635d9947b6..0000000000 --- a/ext/pdo_pgsql/tests/pdo_018.phpt +++ /dev/null @@ -1,152 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO Unserializing ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -if (!interface_exists('Serializable')) die ('skip Interface Serializable does not exist'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo.inc'); - -set_sql('create1', 'CREATE TABLE classtypes(id int PRIMARY KEY, name VARCHAR(20) UNIQUE)'); -set_sql('insert1', 'INSERT INTO classtypes VALUES(0, \'stdClass\')'); -set_sql('insert2', 'INSERT INTO classtypes VALUES(1, \'TestBase\')'); -set_sql('insert3', 'INSERT INTO classtypes VALUES(2, \'TestDerived\')'); -set_sql('selectC', 'SELECT COUNT(*) FROM classtypes'); -set_sql('select0', 'SELECT id, name FROM classtypes ORDER by id'); -set_sql('create2', 'CREATE TABLE test(id int PRIMARY KEY, classtype int, val VARCHAR(255))'); -set_sql('insert4', 'INSERT INTO test VALUES(:id, :classtype, :val)'); -set_sql('select1', 'SELECT id FROM classtypes WHERE name=:cname'); -set_sql('select2', 'SELECT test.val FROM test'); -set_sql('select3', 'SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id'); -set_sql('select4', 'SELECT COUNT(*) FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)'); -set_sql('select5', 'SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)'); - -require_once($PDO_TESTS . 'pdo_018.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===INIT=== -int(1) -int(1) -int(1) -string(1) "3" -array(3) { - [0]=> - string(8) "stdClass" - [1]=> - string(8) "TestBase" - [2]=> - string(11) "TestDerived" -} -===TYPES=== -array(4) { - ["stdClass"]=> - int(0) - ["TestBase"]=> - int(1) - ["TestDerived"]=> - int(2) - ["TestLeaf"]=> - NULL -} -===INSERT=== -TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -===DATA=== -array(4) { - [0]=> - NULL - [1]=> - string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - [2]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - [3]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" -} -===FAILURE=== -Exception:SQLSTATE[HY000]: General error: cannot unserialize class -===COUNT=== -string(1) "3" -===DATABASE=== -array(3) { - [0]=> - array(2) { - ["name"]=> - string(8) "TestBase" - ["val"]=> - string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - } - [1]=> - array(2) { - ["name"]=> - string(11) "TestDerived" - ["val"]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } - [2]=> - array(2) { - ["name"]=> - NULL - ["val"]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } -} -===FETCHCLASS=== -TestBase::unserialize[22](a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}) -TestDerived::unserialize() -TestBase::unserialize[22](a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -TestDerived::unserialize() -TestBase::unserialize[22](a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -array(3) { - [0]=> - object(TestBase)#%d (3) { - ["BasePub"]=> - string(7) "#Public" - ["BasePro:protected"]=> - string(10) "#Protected" - ["BasePri:private"]=> - string(8) "#Private" - } - [1]=> - object(TestDerived)#%d (6) { - ["BasePub"]=> - string(14) "#DerivedPublic" - ["BasePro:protected"]=> - string(17) "#DerivdeProtected" - ["DerivedPub"]=> - string(7) "#Public" - ["DerivedPro:protected"]=> - string(10) "#Protected" - ["DerivedPri:private"]=> - string(7) "Private" - ["BasePri:private"]=> - string(7) "Private" - } - [2]=> - object(TestLeaf)#%d (6) { - ["BasePub"]=> - string(14) "#DerivedPublic" - ["BasePro:protected"]=> - string(17) "#DerivdeProtected" - ["DerivedPub"]=> - string(7) "#Public" - ["DerivedPro:protected"]=> - string(10) "#Protected" - ["DerivedPri:private"]=> - string(7) "Private" - ["BasePri:private"]=> - string(7) "Private" - } -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_019.phpt b/ext/pdo_pgsql/tests/pdo_019.phpt deleted file mode 100755 index 21d12a75cd..0000000000 --- a/ext/pdo_pgsql/tests/pdo_019.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -PDO_PGSQL: fetch() and while() ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_019.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===INIT=== -int(1) -int(1) -int(1) -int(1) -string(1) "4" -array(4) { - [0]=> - string(7) "String0" - [1]=> - string(7) "String1" - [2]=> - string(7) "String2" - [3]=> - string(7) "String3" -} -===WHILE=== -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -array(1) { - [3]=> - string(7) "String3" -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_020.phpt b/ext/pdo_pgsql/tests/pdo_020.phpt deleted file mode 100755 index ae5a6a0ef3..0000000000 --- a/ext/pdo_pgsql/tests/pdo_020.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement::columnCount ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_020.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -Counted 2 columns after select1. -Counted 3 columns after select2. -Counted 1 columns after select3. -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_021.phpt b/ext/pdo_pgsql/tests/pdo_021.phpt deleted file mode 100755 index 46f2302ee8..0000000000 --- a/ext/pdo_pgsql/tests/pdo_021.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement::execute with parameter markers. ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_021.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -There are 6 rows in the table. -There are 12 rows in the table. -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_022.phpt b/ext/pdo_pgsql/tests/pdo_022.phpt deleted file mode 100755 index cd4d931c90..0000000000 --- a/ext/pdo_pgsql/tests/pdo_022.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -PDO_PGSQL: PDOStatement::getColumnMeta ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_022.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -array(6) { - ["pgsql:oid"]=> - int(23) - ["native_type"]=> - string(4) "int4" - ["name"]=> - string(2) "id" - ["len"]=> - int(4) - ["precision"]=> - int(-1) - ["pdo_type"]=> - int(1) -} -array(6) { - ["pgsql:oid"]=> - int(1043) - ["native_type"]=> - string(7) "varchar" - ["name"]=> - string(3) "val" - ["len"]=> - int(-1) - ["precision"]=> - int(14) - ["pdo_type"]=> - int(2) -} -array(6) { - ["pgsql:oid"]=> - int(1043) - ["native_type"]=> - string(7) "varchar" - ["name"]=> - string(4) "val2" - ["len"]=> - int(-1) - ["precision"]=> - int(20) - ["pdo_type"]=> - int(2) -} -array(6) { - ["pgsql:oid"]=> - int(20) - ["native_type"]=> - string(4) "int8" - ["name"]=> - string(5) "count" - ["len"]=> - int(8) - ["precision"]=> - int(-1) - ["pdo_type"]=> - int(2) -} -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_023.phpt b/ext/pdo_pgsql/tests/pdo_023.phpt deleted file mode 100755 index 5aa86aa41a..0000000000 --- a/ext/pdo_pgsql/tests/pdo_023.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -PDO_PGSQL: Overloading ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_023_def.inc'); - -$DB = NULL; - -$DB = new PDODatabaseX($CONNECTION); -$DB->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); - -require_once($PDO_TESTS . 'pdo_023.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -int(1) -int(2) -object(PDODatabaseX)#%d (2) { - ["test1"]=> - int(1) - ["test2"]=> - int(22) -} -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -object(PDOStatementX)#%d (3) { - ["test1"]=> - int(1) - ["queryString"]=> - string(24) "SELECT val, id FROM test" - ["test2"]=> - int(22) -} -array(2) { - ["A"]=> - int(0) - ["B"]=> - int(1) -} -PDOStatementX::__destruct() -PDODatabaseX::__destruct() -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_024.phpt b/ext/pdo_pgsql/tests/pdo_024.phpt deleted file mode 100755 index 634e0bca4f..0000000000 --- a/ext/pdo_pgsql/tests/pdo_024.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PDO_PGSQL: Bind does not convert NULL ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_024.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -bind: success -bool(true) -NULL -===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_025.phpt b/ext/pdo_pgsql/tests/pdo_025.phpt deleted file mode 100755 index 1c0892e0d1..0000000000 --- a/ext/pdo_pgsql/tests/pdo_025.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -PDO_PGSQL: PDO_FETCH_INTO ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_025.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -object(Test)#%d (3) { - ["id"]=> - int(10) - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -object(Test)#%d (3) { - ["id"]=> - int(20) - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -object(Test)#%d (3) { - ["id"]=> - int(30) - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -object(Test)#%d (3) { - ["id"]=> - int(40) - ["val"]=> - string(3) "Jkl" - ["val2"]=> - string(3) "qpo" -} -object(Test)#%d (3) { - ["id"]=> - int(50) - ["val"]=> - string(3) "Mno" - ["val2"]=> - string(3) "nml" -} -object(Test)#%d (3) { - ["id"]=> - int(60) - ["val"]=> - string(3) "Pqr" - ["val2"]=> - string(3) "kji" -} -===FAIL=== - -Fatal error: Cannot access protected property Fail::$id in %spdo_025.inc on line %d diff --git a/ext/pdo_pgsql/tests/pdo_026.phpt b/ext/pdo_pgsql/tests/pdo_026.phpt deleted file mode 100755 index 12ac290c52..0000000000 --- a/ext/pdo_pgsql/tests/pdo_026.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -PDO_PGSQL: Deriving PDO ---SKIPIF-- -<?php # vim:ft=php -require_once('skipif.inc'); ?> ---FILE-- -<?php - -require_once('connection.inc'); -require_once('prepare.inc'); - -require_once($PDO_TESTS . 'pdo_026.inc'); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -string(11) "PDODatabase" -string(12) "PDOStatement" -PDODatabase::query() -PDOStatementX::__construct() -string(13) "PDOStatementX" -string(11) "PDODatabase" -array(3) { - ["id"]=> - int(10) - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -array(3) { - ["id"]=> - int(20) - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -array(3) { - ["id"]=> - int(30) - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() diff --git a/ext/pdo_pgsql/tests/prepare.inc b/ext/pdo_pgsql/tests/prepare.inc deleted file mode 100755 index 6e87485799..0000000000 --- a/ext/pdo_pgsql/tests/prepare.inc +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -require_once('connection.inc'); - -$SQL = array(); - -$DB = new pdo($CONNECTION); - -foreach(array('test','classtypes') as $name) -{ - $DB->query('DROP TABLE '.$name.' CASCADE'); -} - -$DB->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); - -?> diff --git a/ext/pdo_pgsql/tests/skipif.inc b/ext/pdo_pgsql/tests/skipif.inc deleted file mode 100755 index 0e19c74480..0000000000 --- a/ext/pdo_pgsql/tests/skipif.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -if (!extension_loaded('pdo_pgsql')) die('skip'); - -require_once('connection.inc'); -require_once('prepare.inc'); - -if (!$DB) { - die('skip cannot open db'); -} - -?> |