xref: /PHP-5.5/ext/pdo_sqlite/pdo_sqlite.c (revision 73c1be26)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 5                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2015 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: Wez Furlong <wez@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_sqlite.h"
31 #include "php_pdo_sqlite_int.h"
32 #include "zend_exceptions.h"
33 
34 #define PHP_PDO_SQLITE_MODULE_VERSION	"1.0.1"
35 
36 /* {{{ pdo_sqlite_functions[] */
37 const zend_function_entry pdo_sqlite_functions[] = {
38 	PHP_FE_END
39 };
40 /* }}} */
41 
42 /* {{{ pdo_sqlite_deps
43  */
44 #if ZEND_MODULE_API_NO >= 20050922
45 static const zend_module_dep pdo_sqlite_deps[] = {
46 	ZEND_MOD_REQUIRED("pdo")
47 	ZEND_MOD_END
48 };
49 #endif
50 /* }}} */
51 
52 /* {{{ pdo_sqlite_module_entry
53  */
54 zend_module_entry pdo_sqlite_module_entry = {
55 #if ZEND_MODULE_API_NO >= 20050922
56 	STANDARD_MODULE_HEADER_EX, NULL,
57 	pdo_sqlite_deps,
58 #else
59 	STANDARD_MODULE_HEADER,
60 #endif
61 	"pdo_sqlite",
62 	pdo_sqlite_functions,
63 	PHP_MINIT(pdo_sqlite),
64 	PHP_MSHUTDOWN(pdo_sqlite),
65 	NULL,
66 	NULL,
67 	PHP_MINFO(pdo_sqlite),
68 	PHP_PDO_SQLITE_MODULE_VERSION,
69 	STANDARD_MODULE_PROPERTIES
70 };
71 /* }}} */
72 
73 #if defined(COMPILE_DL_PDO_SQLITE) || defined(COMPILE_DL_PDO_SQLITE_EXTERNAL)
74 ZEND_GET_MODULE(pdo_sqlite)
75 #endif
76 
77 /* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(pdo_sqlite)78 PHP_MINIT_FUNCTION(pdo_sqlite)
79 {
80 	return php_pdo_register_driver(&pdo_sqlite_driver);
81 }
82 /* }}} */
83 
84 /* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(pdo_sqlite)85 PHP_MSHUTDOWN_FUNCTION(pdo_sqlite)
86 {
87 	php_pdo_unregister_driver(&pdo_sqlite_driver);
88 	return SUCCESS;
89 }
90 /* }}} */
91 
92 /* {{{ PHP_MINFO_FUNCTION
93  */
PHP_MINFO_FUNCTION(pdo_sqlite)94 PHP_MINFO_FUNCTION(pdo_sqlite)
95 {
96 	php_info_print_table_start();
97 	php_info_print_table_header(2, "PDO Driver for SQLite 3.x", "enabled");
98 	php_info_print_table_row(2, "SQLite Library", sqlite3_libversion());
99 	php_info_print_table_end();
100 }
101 /* }}} */
102 
103 /*
104  * Local variables:
105  * tab-width: 4
106  * c-basic-offset: 4
107  * End:
108  * vim600: noet sw=4 ts=4 fdm=marker
109  * vim<600: noet sw=4 ts=4
110  */
111