diff options
author | SVN Migration <svn@php.net> | 2004-06-07 14:23:46 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2004-06-07 14:23:46 +0000 |
commit | aff15d154d8c653126df64ef994aff2091745830 (patch) | |
tree | 709caec5580c75176e2bdc6de619c03501f2a8f1 /ext/pdo_mysql | |
parent | 6f4715622895dc77d06f094b4006a219b3bf8709 (diff) | |
download | php-git-php-5.0.0RC3.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_0RC3'.php-5.0.0RC3
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-x | ext/pdo_mysql/CREDITS | 2 | ||||
-rwxr-xr-x | ext/pdo_mysql/config.m4 | 70 | ||||
-rw-r--r-- | ext/pdo_mysql/config.w32 | 15 | ||||
-rwxr-xr-x | ext/pdo_mysql/mysql_driver.c | 341 | ||||
-rwxr-xr-x | ext/pdo_mysql/mysql_statement.c | 165 | ||||
-rw-r--r-- | ext/pdo_mysql/package.xml | 48 | ||||
-rwxr-xr-x | ext/pdo_mysql/pdo_mysql.c | 94 | ||||
-rwxr-xr-x | ext/pdo_mysql/php_pdo_mysql.h | 53 | ||||
-rwxr-xr-x | ext/pdo_mysql/php_pdo_mysql_int.h | 69 |
9 files changed, 0 insertions, 857 deletions
diff --git a/ext/pdo_mysql/CREDITS b/ext/pdo_mysql/CREDITS deleted file mode 100755 index 0735d9a1e8..0000000000 --- a/ext/pdo_mysql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mySQL 3.x driver for PDO -George Schlossnagle diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 deleted file mode 100755 index 5d35fea380..0000000000 --- a/ext/pdo_mysql/config.m4 +++ /dev/null @@ -1,70 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN(MYSQL_LIB_CHK, [ - str="$MYSQL_DIR/$1/libmysqlclient.*" - for j in `echo $str`; do - if test -r $j; then - MYSQL_LIB_DIR=$MYSQL_DIR/$1 - break 2 - fi - done -]) - -PHP_ARG_WITH(pdo_mysql, for MySQL support, -[ --with-pdo_mysql[=DIR] Include MySQL support. DIR is the MySQL base directory.]) - -if test "$PHP_PDO_MYSQL" != "no"; then - AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) - - for i in $PHP_PDO_MYSQL /usr/local /usr ; do - MYSQL_DIR=$i - PDO_MYSQL_CONFIG=$MYSQL_DIR/bin/mysql_config - if test -r $i/include/mysql; then - MYSQL_INC_DIR=$i/include/mysql - else - MYSQL_INC_DIR=$i/include - fi - if test -r $i/lib/mysql; then - MYSQL_LIBS=$i/lib/mysql - else - MYSQL_LIBS=$i/lib - fi - if test -x $PDO_MYSQL_CONFIG; then - break - fi - done - - if test -z "$MYSQL_DIR"; then - AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL. -Note that the MySQL client library is not bundled anymore.]) - fi - - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs` - PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` - - AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ]) - - PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($MYSQL_INC_DIR) - - if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f ext/pdo/php_pdo_driver.h; then - pdo_inc_path=ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - - PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path) - PDO_MYSQL_MODULE_TYPE=external - PDO_MYSQL_INCLUDE=-I$MYSQL_INC_DIR - - PHP_SUBST(PDO_MYSQL_SHARED_LIBADD) - PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE) - PHP_SUBST_OLD(PDO_MYSQL_LIBS) - PHP_SUBST_OLD(PDO_MYSQL_INCLUDE) -fi diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32 deleted file mode 100644 index 24b2f7cf53..0000000000 --- a/ext/pdo_mysql/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-mysql", "MySQL support for PDO", "no"); - -if (PHP_PDO_MYSQL != "no") { - if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) && - CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) { - EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c"); - ADD_FLAG('CFLAGS_PDO_MYSQL', "/I ..\\pecl"); - } else { - WARNING("pdo_mysql not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_mysql', 'pdo'); -} diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c deleted file mode 100755 index a5607e9cb5..0000000000 --- a/ext/pdo_mysql/mysql_driver.c +++ /dev/null @@ -1,341 +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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $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_mysql.h" -#include "php_pdo_mysql_int.h" - -int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - enum pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; - pdo_mysql_error_info *einfo = &H->einfo; - - einfo->errcode = mysql_errno(H->server); - einfo->file = file; - einfo->line = line; - - if (einfo->errmsg) { - efree(einfo->errmsg); - einfo->errmsg = NULL; - } - - if (einfo->errcode) { - einfo->errmsg = estrdup(mysql_error(H->server)); - } else { /* no error */ - *pdo_err = PDO_ERR_NONE; - return 0; - } - - switch (einfo->errcode) { - case 1007: /* database already exists */ - case 1050: /* table already exists */ - case 1086: /* file already exists */ - case 1125: /* function already exists */ - *pdo_err = PDO_ERR_ALREADY_EXISTS; - break; - - case 1008: /* database does not exist */ - case 1029: /* view does not exist */ - case 1072: /* key column does not exist */ - case 1091: /* column/key does not exist */ - case 1146: /* table does not exist */ - case 1176: /* key not found in table */ - *pdo_err = PDO_ERR_NOT_FOUND; - break; - - case 1152: /* aborted connection */ - case 1154: /* cannot read from connection pipe */ - case 1184: /* aborted new connection */ - case 1159: /* timeout */ - case 1160: /* timeout */ - case 1161: /* timeout */ - *pdo_err = PDO_ERR_DISCONNECTED; - break; - - case 1089: /* unsupported sub-key */ - case 1163: /* blob/text not supported inside table */ - case 1164: /* no auto-incremenet support */ - case 1174: /* no RAID support */ - case 1178: /* table handler does not support something */ - case 1185: /* binary dump not supported */ - case 1214: /* FULLTEXT not supported */ - case 1235: /* something not supported by MySQL version */ - *pdo_err = PDO_ERR_NOT_IMPLEMENTED; - break; - - case 1252: /* character set mismatch */ - *pdo_err = PDO_ERR_MISMATCH; - break; - - case 1264: /* data truncated */ - *pdo_err = PDO_ERR_TRUNCATED; - break; - - case 1169: /* unique constraint */ - case 1216: /* foreign key constraint */ - case 1217: /* foreign key constraint */ - *pdo_err = PDO_ERR_CONSTRAINT; - break; - - case 1064: /* query parse error */ - case 1065: /* empty query */ - /* XXX: MySQL has all sorts of errors that can be considered syntax errors, specifically - dealing with table creation & modifications, do we want to include them here? - */ - *pdo_err = PDO_ERR_SYNTAX; - break; - - default: - *pdo_err = PDO_ERR_CANT_MAP; - break; - } - - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(), *pdo_err TSRMLS_CC, "[%d] %s", - einfo->errcode, einfo->errmsg); - } - - return einfo->errcode; -} -/* }}} */ - -static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_mysql_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 mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - if (H) { - if (H->server) { - mysql_close(H->server); - H->server = NULL; - } - if (H->einfo.errmsg) { - efree(H->einfo.errmsg); - H->einfo.errmsg = NULL; - } - efree(H); - H = NULL; - } - return 0; -} -/* }}} */ - -static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, long options, zval *driver_options TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt)); - - S->H = H; - stmt->driver_data = S; - stmt->methods = &mysql_stmt_methods; - - return 1; -} - -static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - if (mysql_real_query(H->server, sql, sql_len)) { - pdo_mysql_error(dbh); - return -1; - } else { - return mysql_affected_rows(H->server); - } -} - -static long pdo_mysql_last_insert_id(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - return (long) mysql_insert_id(H->server); -} - -static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - *quoted = emalloc(2*unquotedlen + 3); - (*quoted)[0] = '"'; - *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen); - (*quoted)[*quotedlen + 1] = '"'; - (*quoted)[*quotedlen + 2] = '\0'; - *quotedlen += 2; - return 1; -} - -static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - ZVAL_STRING(return_value, (char *)mysql_get_client_info(), 1); - break; - - case PDO_ATTR_SERVER_VERSION: - ZVAL_STRING(return_value, (char *)mysql_get_server_info(H->server), 1); - break; - - case PDO_ATTR_CONNECTION_STATUS: - ZVAL_STRING(return_value, (char *)mysql_get_host_info(H->server), 1); - break; - - case PDO_ATTR_SERVER_INFO: { - char *tmp; - - if ((tmp = (char *)mysql_stat(H->server))) { - ZVAL_STRING(return_value, tmp, 1); - } else { - pdo_mysql_error(dbh); - return -1; - } - } - break; - - default: - return 0; - } - - return 1; -} - -static struct pdo_dbh_methods mysql_methods = { - mysql_handle_closer, - mysql_handle_preparer, - mysql_handle_doer, - mysql_handle_quoter, - NULL, - NULL, - NULL, - NULL, - pdo_mysql_last_insert_id, - pdo_mysql_fetch_error_func, - pdo_mysql_get_attribute -}; - -#ifndef PDO_MYSQL_UNIX_ADDR -# define PDO_MYSQL_UNIX_ADDR "MySQL" -#endif - -static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H; - int i, ret = 0; - char *host = NULL, *unix_socket = NULL; - unsigned int port; - char *dbname; - struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "dbname", "", 0 }, - { "host", "localhost", 0 }, - { "port", "3306", 0 }, - { "unix_socket", PDO_MYSQL_UNIX_ADDR, 0 }, - }; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 4); - - H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent); - - H->einfo.errcode = 0; - H->einfo.errmsg = NULL; - - /* allocate an environment */ - - /* handle for the server */ - H->server = mysql_init(NULL); - dbh->driver_data = H; - - /* handle MySQL options */ - if (driver_options) { - long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC); - - if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) { - pdo_mysql_error(dbh); - goto cleanup; - } - } - - if (vars[2].optval && strcmp("localhost", vars[2].optval)) { - host = vars[2].optval; - port = atoi(vars[3].optval); - } else { - host = "."; - unix_socket = vars[4].optval; - } - dbname = vars[1].optval; - if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, 0) == NULL) { - pdo_mysql_error(dbh); - goto cleanup; - } - - H->attached = 1; - - dbh->methods = &mysql_methods; - dbh->alloc_own_columns = 1; - dbh->supports_placeholders = 0; - dbh->max_escaped_char_length = 2; - - ret = 1; - -cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_mysql_driver = { - PDO_DRIVER_HEADER(mysql), - pdo_mysql_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_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c deleted file mode 100755 index b8e19854e9..0000000000 --- a/ext/pdo_mysql/mysql_statement.c +++ /dev/null @@ -1,165 +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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $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_mysql.h" -#include "php_pdo_mysql_int.h" - - -static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - int i; - - if (S->result) { - /* free the resource */ - mysql_free_result(S->result); - S->result = NULL; - } - if(S->cols) { - efree(S->cols); - S->cols = NULL; - } - efree(S); - return 1; -} - -static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_dbh_t *dbh = stmt->dbh; - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - pdo_mysql_db_handle *H = S->H; - - if (stmt->executed) { - /* ensure that we free any previous unfetched results */ - if(S->result) { - mysql_free_result(S->result); - S->result = NULL; - } - } - if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) { - pdo_mysql_error_stmt(stmt); - return 0; - } - if ((S->result = mysql_use_result(H->server)) == NULL) { - pdo_mysql_error_stmt(stmt); - return 0; - } - if (!stmt->executed) { - stmt->column_count = (int) mysql_num_fields(S->result); - S->cols = ecalloc(stmt->column_count, sizeof(pdo_mysql_column)); - } - return 1; -} - -static int pdo_mysql_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 pdo_mysql_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - if (!S->result) { - return 0; - } - if((S->current_data = mysql_fetch_row(S->result)) == NULL) { - /* there seems to be no way of distinguishing 'no data' from 'error' */ - pdo_mysql_error_stmt(stmt); - return 0; - } - S->current_lengths = mysql_fetch_lengths(S->result); - return 1; -} - -static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - MYSQL_RES *R = S->result; - MYSQL_FIELD *F; - struct pdo_column_data *cols = stmt->columns; - unsigned int num_fields, i; - - if (!S->result) { - return 0; - } - /* fetch all on demand, this seems easiest - ** if we've been here before bail out - */ - if(cols[0].name) { - return 1; - } - num_fields = mysql_num_fields(R); - F = mysql_fetch_fields(R); - for(i=0; i < num_fields; i++) { - int namelen; - namelen = strlen(F[i].name); - cols[i].precision = F[i].decimals; - cols[i].maxlen = F[i].length; - cols[i].namelen = namelen; - /* FIXME where does this get freed? */ - cols[i].name = estrndup(F[i].name, namelen + 1); - cols[i].param_type = PDO_PARAM_STR; - } - return 1; -} - -static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - if(S->current_data == NULL || !S->result) { - return 0; - } - if(colno >= mysql_num_fields(S->result)) { - /* error invalid column */ - pdo_mysql_error_stmt(stmt); - return 0; - } - *ptr = S->current_data[colno]; - *len = S->current_lengths[colno]; - return 1; -} - -struct pdo_stmt_methods mysql_stmt_methods = { - pdo_mysql_stmt_dtor, - pdo_mysql_stmt_execute, - pdo_mysql_stmt_fetch, - pdo_mysql_stmt_describe, - pdo_mysql_stmt_get_col, - pdo_mysql_stmt_param_hook -}; - -/* - * 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_mysql/package.xml b/ext/pdo_mysql/package.xml deleted file mode 100644 index 0ac427e985..0000000000 --- a/ext/pdo_mysql/package.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package version="1.0">
- <name>pdo_mysql</name>
- <summary>Mysql 3.x/4.0 driver for PDO</summary>
- <maintainers>
- <maintainer>
- <user>gschlossnagle</user>
- <name>George Schlossnagle</name>
- <email>george@omniti.com</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 a Mysql 3.x/4.0 driver for PDO.
- </description>
- <license>PHP</license>
- <release>
- <state>alpha</state>
- <version>0.1</version>
- <date>2004-05-18</date>
-
- <notes>
- Hope it works!
- </notes>
-
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="pdo_mysql.c"/>
- <file role="src" name="mysql_driver.c"/>
- <file role="src" name="mysql_statement.c"/>
- <file role="src" name="php_pdo_mysql.h"/>
- <file role="src" name="php_pdo_mysql_int.h"/>
-
- <file role="doc" name="CREDITS"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5.0.0"/>
- <dep type="ext" name="pdo" rel="ge" version="0.1"/>
- </deps>
- </release>
-</package>
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c deleted file mode 100755 index 25583db845..0000000000 --- a/ext/pdo_mysql/pdo_mysql.c +++ /dev/null @@ -1,94 +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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $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_mysql.h" -#include "php_pdo_mysql_int.h" - -/* {{{ pdo_mysql_functions[] */ -function_entry pdo_mysql_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_mysql_module_entry */ -zend_module_entry pdo_mysql_module_entry = { - STANDARD_MODULE_HEADER, - "pdo_mysql", - pdo_mysql_functions, - PHP_MINIT(pdo_mysql), - PHP_MSHUTDOWN(pdo_mysql), - NULL, - NULL, - PHP_MINFO(pdo_mysql), - "0.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_MYSQL -ZEND_GET_MODULE(pdo_mysql) -#endif - -/* true global environment */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pdo_mysql) -{ - return php_pdo_register_driver(&pdo_mysql_driver); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_mysql) -{ - php_pdo_unregister_driver(&pdo_mysql_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_mysql) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for MySQL 3.x Client Libraries", "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_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h deleted file mode 100755 index 1fed28bd5e..0000000000 --- a/ext/pdo_mysql/php_pdo_mysql.h +++ /dev/null @@ -1,53 +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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_MYSQL_H -#define PHP_PDO_MYSQL_H - -extern zend_module_entry pdo_mysql_module_entry; -#define phpext_pdo_mysql_ptr &pdo_mysql_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_MYSQL_API __declspec(dllexport) -#else -#define PHP_PDO_MYSQL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_mysql); -PHP_MSHUTDOWN_FUNCTION(pdo_mysql); -PHP_RINIT_FUNCTION(pdo_mysql); -PHP_RSHUTDOWN_FUNCTION(pdo_mysql); -PHP_MINFO_FUNCTION(pdo_mysql); - -#endif /* PHP_PDO_MYSQL_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_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h deleted file mode 100755 index 8498bb0f89..0000000000 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ /dev/null @@ -1,69 +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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_MYSQL_INT_H -#define PHP_PDO_MYSQL_INT_H - -#include <mysql.h> - -typedef struct { - const char *file; - int line; - unsigned int errcode; - char *errmsg; -} pdo_mysql_error_info; - -/* stuff we use in a mySQL database handle */ -typedef struct { - MYSQL *server; - - unsigned attached:1; - unsigned _reserved:31; - - pdo_mysql_error_info einfo; -} pdo_mysql_db_handle; - -typedef struct { - MYSQL_FIELD *def; -} pdo_mysql_column; - -typedef struct { - pdo_mysql_db_handle *H; - MYSQL_RES *result; - MYSQL_ROW current_data; - long *current_lengths; - pdo_mysql_column *cols; -} pdo_mysql_stmt; - -typedef struct { - char *repr; - long repr_len; - int mysql_type; - void *thing; /* for LOBS, REFCURSORS etc. */ -} pdo_mysql_bound_param; - -extern pdo_driver_t pdo_mysql_driver; - -extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC); -#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods mysql_stmt_methods; -#endif |