xref: /PHP-7.1/ext/pdo_sqlite/pdo_sqlite.c (revision ccd4716e)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2018 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 /* {{{ pdo_sqlite_functions[] */
35 const zend_function_entry pdo_sqlite_functions[] = {
36 	PHP_FE_END
37 };
38 /* }}} */
39 
40 /* {{{ pdo_sqlite_deps
41  */
42 static const zend_module_dep pdo_sqlite_deps[] = {
43 	ZEND_MOD_REQUIRED("pdo")
44 	ZEND_MOD_END
45 };
46 /* }}} */
47 
48 /* {{{ pdo_sqlite_module_entry
49  */
50 zend_module_entry pdo_sqlite_module_entry = {
51 	STANDARD_MODULE_HEADER_EX, NULL,
52 	pdo_sqlite_deps,
53 	"pdo_sqlite",
54 	pdo_sqlite_functions,
55 	PHP_MINIT(pdo_sqlite),
56 	PHP_MSHUTDOWN(pdo_sqlite),
57 	NULL,
58 	NULL,
59 	PHP_MINFO(pdo_sqlite),
60 	PHP_PDO_SQLITE_VERSION,
61 	STANDARD_MODULE_PROPERTIES
62 };
63 /* }}} */
64 
65 #if defined(COMPILE_DL_PDO_SQLITE) || defined(COMPILE_DL_PDO_SQLITE_EXTERNAL)
66 ZEND_GET_MODULE(pdo_sqlite)
67 #endif
68 
69 /* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(pdo_sqlite)70 PHP_MINIT_FUNCTION(pdo_sqlite)
71 {
72 #ifdef SQLITE_DETERMINISTIC
73 	REGISTER_PDO_CLASS_CONST_LONG("SQLITE_DETERMINISTIC", (zend_long)SQLITE_DETERMINISTIC);
74 #endif
75 
76 	return php_pdo_register_driver(&pdo_sqlite_driver);
77 }
78 /* }}} */
79 
80 /* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(pdo_sqlite)81 PHP_MSHUTDOWN_FUNCTION(pdo_sqlite)
82 {
83 	php_pdo_unregister_driver(&pdo_sqlite_driver);
84 	return SUCCESS;
85 }
86 /* }}} */
87 
88 /* {{{ PHP_MINFO_FUNCTION
89  */
PHP_MINFO_FUNCTION(pdo_sqlite)90 PHP_MINFO_FUNCTION(pdo_sqlite)
91 {
92 	php_info_print_table_start();
93 	php_info_print_table_header(2, "PDO Driver for SQLite 3.x", "enabled");
94 	php_info_print_table_row(2, "SQLite Library", sqlite3_libversion());
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