Back to index

php5  5.3.10
pdo_pgsql.c
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author: Edin Kadribasic <edink@emini.dk>                             |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: pdo_pgsql.c 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifdef HAVE_CONFIG_H
00022 #include "config.h"
00023 #endif
00024 
00025 #include "php.h"
00026 #include "php_ini.h"
00027 #include "ext/standard/info.h"
00028 #include "pdo/php_pdo.h"
00029 #include "pdo/php_pdo_driver.h"
00030 #include "php_pdo_pgsql.h"
00031 #include "php_pdo_pgsql_int.h"
00032 
00033 #ifdef HAVE_PG_CONFIG_H
00034 #undef PACKAGE_BUGREPORT
00035 #undef PACKAGE_NAME
00036 #undef PACKAGE_STRING
00037 #undef PACKAGE_TARNAME
00038 #undef PACKAGE_VERSION
00039 #include <pg_config.h>
00040 #endif
00041 
00042 /* {{{ pdo_pgsql_functions[] */
00043 const zend_function_entry pdo_pgsql_functions[] = {
00044        {NULL, NULL, NULL}
00045 };
00046 /* }}} */
00047 
00048 /* {{{ pdo_sqlite_deps
00049  */
00050 #if ZEND_MODULE_API_NO >= 20050922
00051 static const zend_module_dep pdo_pgsql_deps[] = {
00052        ZEND_MOD_REQUIRED("pdo")
00053        ZEND_MOD_END
00054 };
00055 #endif
00056 /* }}} */
00057 
00058 /* {{{ pdo_pgsql_module_entry */
00059 zend_module_entry pdo_pgsql_module_entry = {
00060 #if ZEND_MODULE_API_NO >= 20050922
00061        STANDARD_MODULE_HEADER_EX, NULL,
00062        pdo_pgsql_deps,
00063 #else
00064        STANDARD_MODULE_HEADER,
00065 #endif
00066        "pdo_pgsql",
00067        pdo_pgsql_functions,
00068        PHP_MINIT(pdo_pgsql),
00069        PHP_MSHUTDOWN(pdo_pgsql),
00070        NULL,
00071        NULL,
00072        PHP_MINFO(pdo_pgsql),
00073        "1.0.2",
00074        STANDARD_MODULE_PROPERTIES
00075 };
00076 /* }}} */
00077 
00078 #ifdef COMPILE_DL_PDO_PGSQL
00079 ZEND_GET_MODULE(pdo_pgsql)
00080 #endif
00081 
00082 /* true global environment */
00083 
00084 /* {{{ PHP_MINIT_FUNCTION
00085  */
00086 PHP_MINIT_FUNCTION(pdo_pgsql)
00087 {
00088        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT", PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT);
00089        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_IDLE", (long)PGSQL_TRANSACTION_IDLE);
00090        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_ACTIVE", (long)PGSQL_TRANSACTION_ACTIVE);
00091        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INTRANS", (long)PGSQL_TRANSACTION_INTRANS);
00092        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INERROR", (long)PGSQL_TRANSACTION_INERROR);
00093        REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_UNKNOWN", (long)PGSQL_TRANSACTION_UNKNOWN);
00094 
00095        php_pdo_register_driver(&pdo_pgsql_driver);
00096        return SUCCESS;
00097 }
00098 /* }}} */
00099 
00100 /* {{{ PHP_MSHUTDOWN_FUNCTION
00101  */
00102 PHP_MSHUTDOWN_FUNCTION(pdo_pgsql)
00103 {
00104        php_pdo_unregister_driver(&pdo_pgsql_driver);
00105        return SUCCESS;
00106 }
00107 /* }}} */
00108 
00109 /* {{{ PHP_MINFO_FUNCTION
00110  */
00111 PHP_MINFO_FUNCTION(pdo_pgsql)
00112 {
00113        php_info_print_table_start();
00114        php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled");
00115 #ifdef HAVE_PG_CONFIG_H     
00116        php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
00117 #endif 
00118        php_info_print_table_row(2, "Module version", pdo_pgsql_module_entry.version);
00119        php_info_print_table_row(2, "Revision", " $Id: pdo_pgsql.c 321634 2012-01-01 13:15:04Z felipe $ ");
00120 
00121        php_info_print_table_end();
00122 }
00123 /* }}} */
00124 
00125 /*
00126  * Local variables:
00127  * tab-width: 4
00128  * c-basic-offset: 4
00129  * End:
00130  * vim600: noet sw=4 ts=4 fdm=marker
00131  * vim<600: noet sw=4 ts=4
00132  */