xref: /PHP-5.3/ext/pdo_firebird/pdo_firebird.c (revision a2045ff3)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 5                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2013 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: Ard Biesheuvel <abies@php.net>                               |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
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_firebird.h"
31 #include "php_pdo_firebird_int.h"
32 
33 const zend_function_entry pdo_firebird_functions[] = { /* {{{ */
34 	PHP_FE_END
35 };
36 /* }}} */
37 
38 /* {{{ pdo_firebird_deps
39  */
40 #if ZEND_MODULE_API_NO >= 20050922
41 static const zend_module_dep pdo_firebird_deps[] = {
42 	ZEND_MOD_REQUIRED("pdo")
43 	ZEND_MOD_END
44 };
45 #endif
46 /* }}} */
47 
48 zend_module_entry pdo_firebird_module_entry = { /* {{{ */
49 #if ZEND_MODULE_API_NO >= 20050922
50 	STANDARD_MODULE_HEADER_EX, NULL,
51 	pdo_firebird_deps,
52 #else
53 	STANDARD_MODULE_HEADER,
54 #endif
55 	"PDO_Firebird",
56 	pdo_firebird_functions,
57 	PHP_MINIT(pdo_firebird),
58 	PHP_MSHUTDOWN(pdo_firebird),
59 	NULL,
60 	NULL,
61 	PHP_MINFO(pdo_firebird),
62 	"0.3",
63 	STANDARD_MODULE_PROPERTIES
64 };
65 /* }}} */
66 
67 #ifdef COMPILE_DL_PDO_FIREBIRD
68 ZEND_GET_MODULE(pdo_firebird)
69 #endif
70 
PHP_MINIT_FUNCTION(pdo_firebird)71 PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */
72 {
73 	REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_DATE_FORMAT", (long) PDO_FB_ATTR_DATE_FORMAT);
74 	REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_TIME_FORMAT", (long) PDO_FB_ATTR_TIME_FORMAT);
75 	REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_TIMESTAMP_FORMAT", (long) PDO_FB_ATTR_TIMESTAMP_FORMAT);
76 
77 	php_pdo_register_driver(&pdo_firebird_driver);
78 
79 	return SUCCESS;
80 }
81 /* }}} */
82 
PHP_MSHUTDOWN_FUNCTION(pdo_firebird)83 PHP_MSHUTDOWN_FUNCTION(pdo_firebird) /* {{{ */
84 {
85 	php_pdo_unregister_driver(&pdo_firebird_driver);
86 
87 	return SUCCESS;
88 }
89 /* }}} */
90 
PHP_MINFO_FUNCTION(pdo_firebird)91 PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
92 {
93 	php_info_print_table_start();
94 	php_info_print_table_header(2, "PDO Driver for Firebird/InterBase", "enabled");
95 	php_info_print_table_end();
96 }
97 /* }}} */
98 
99 /*
100  * Local variables:
101  * tab-width: 4
102  * c-basic-offset: 4
103  * End:
104  * vim600: noet sw=4 ts=4 fdm=marker
105  * vim<600: noet sw=4 ts=4
106  */
107