1 : /*
2 : +----------------------------------------------------------------------+
3 : | PHP Version 5 |
4 : +----------------------------------------------------------------------+
5 : | Copyright (c) 1997-2009 The PHP Group |
6 : +----------------------------------------------------------------------+
7 : | This source file is subject to version 3.01 of the PHP license, |
8 : | that is bundled with this package in the file LICENSE, and is |
9 : | available through the world-wide-web at the following url: |
10 : | http://www.php.net/license/3_01.txt |
11 : | If you did not receive a copy of the PHP license and are unable to |
12 : | obtain it through the world-wide-web, please send a note to |
13 : | license@php.net so we can mail you a copy immediately. |
14 : +----------------------------------------------------------------------+
15 : | Author: Edin Kadribasic <edink@emini.dk> |
16 : +----------------------------------------------------------------------+
17 : */
18 :
19 : /* $Id: pdo_pgsql.c 289287 2009-10-07 17:40:16Z mbeccati $ */
20 :
21 : #ifdef HAVE_CONFIG_H
22 : #include "config.h"
23 : #endif
24 :
25 : #include "php.h"
26 : #include "php_ini.h"
27 : #include "ext/standard/info.h"
28 : #include "pdo/php_pdo.h"
29 : #include "pdo/php_pdo_driver.h"
30 : #include "php_pdo_pgsql.h"
31 : #include "php_pdo_pgsql_int.h"
32 :
33 : #ifdef HAVE_PG_CONFIG_H
34 : #include <pg_config.h>
35 : #endif
36 :
37 : /* {{{ pdo_pgsql_functions[] */
38 : zend_function_entry pdo_pgsql_functions[] = {
39 : {NULL, NULL, NULL}
40 : };
41 : /* }}} */
42 :
43 : /* {{{ pdo_sqlite_deps
44 : */
45 : #if ZEND_MODULE_API_NO >= 20050922
46 : static zend_module_dep pdo_pgsql_deps[] = {
47 : ZEND_MOD_REQUIRED("pdo")
48 : {NULL, NULL, NULL}
49 : };
50 : #endif
51 : /* }}} */
52 :
53 : /* {{{ pdo_pgsql_module_entry */
54 : zend_module_entry pdo_pgsql_module_entry = {
55 : #if ZEND_MODULE_API_NO >= 20050922
56 : STANDARD_MODULE_HEADER_EX, NULL,
57 : pdo_pgsql_deps,
58 : #else
59 : STANDARD_MODULE_HEADER,
60 : #endif
61 : "pdo_pgsql",
62 : pdo_pgsql_functions,
63 : PHP_MINIT(pdo_pgsql),
64 : PHP_MSHUTDOWN(pdo_pgsql),
65 : PHP_RINIT(pdo_pgsql),
66 : PHP_RSHUTDOWN(pdo_pgsql),
67 : PHP_MINFO(pdo_pgsql),
68 : "1.0.2",
69 : STANDARD_MODULE_PROPERTIES
70 : };
71 : /* }}} */
72 :
73 : #ifdef COMPILE_DL_PDO_PGSQL
74 : ZEND_GET_MODULE(pdo_pgsql)
75 : #endif
76 :
77 : /* true global environment */
78 :
79 : /* {{{ PHP_MINIT_FUNCTION
80 : */
81 : PHP_MINIT_FUNCTION(pdo_pgsql)
82 13565 : {
83 13565 : REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT", PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT);
84 13565 : php_pdo_register_driver(&pdo_pgsql_driver);
85 13565 : return SUCCESS;
86 : }
87 : /* }}} */
88 :
89 : /* {{{ PHP_MSHUTDOWN_FUNCTION
90 : */
91 : PHP_MSHUTDOWN_FUNCTION(pdo_pgsql)
92 13598 : {
93 13598 : php_pdo_unregister_driver(&pdo_pgsql_driver);
94 13598 : return SUCCESS;
95 : }
96 : /* }}} */
97 :
98 : /* {{{ PHP_RINIT_FUNCTION
99 : */
100 : PHP_RINIT_FUNCTION(pdo_pgsql)
101 13551 : {
102 : /* php_pdo_register_driver(&pdo_pgsql_driver); */
103 13551 : return SUCCESS;
104 : }
105 : /* }}} */
106 :
107 : /* {{{ PHP_MSHUTDOWN_FUNCTION
108 : */
109 : PHP_RSHUTDOWN_FUNCTION(pdo_pgsql)
110 13584 : {
111 : /* php_pdo_unregister_driver(&pdo_pgsql_driver); */
112 13584 : return SUCCESS;
113 : }
114 : /* }}} */
115 :
116 : /* {{{ PHP_MINFO_FUNCTION
117 : */
118 : PHP_MINFO_FUNCTION(pdo_pgsql)
119 6 : {
120 6 : php_info_print_table_start();
121 6 : php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled");
122 : #ifdef HAVE_PG_CONFIG_H
123 6 : php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
124 : #endif
125 6 : php_info_print_table_row(2, "Module version", pdo_pgsql_module_entry.version);
126 6 : php_info_print_table_row(2, "Revision", " $Id: pdo_pgsql.c 289287 2009-10-07 17:40:16Z mbeccati $ ");
127 :
128 6 : php_info_print_table_end();
129 6 : }
130 : /* }}} */
131 :
132 : /*
133 : * Local variables:
134 : * tab-width: 4
135 : * c-basic-offset: 4
136 : * End:
137 : * vim600: noet sw=4 ts=4 fdm=marker
138 : * vim<600: noet sw=4 ts=4
139 : */
|