Back to index

php5  5.3.10
pdo_oci.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: Wez Furlong <wez@php.net>                                    |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: pdo_oci.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_oci.h"
00031 #include "php_pdo_oci_int.h"
00032 
00033 /* {{{ pdo_oci_functions[] */
00034 const zend_function_entry pdo_oci_functions[] = {
00035        PHP_FE_END
00036 };
00037 /* }}} */
00038 
00039 /* {{{ pdo_oci_module_entry */
00040 
00041 #if ZEND_MODULE_API_NO >= 20050922
00042 static const zend_module_dep pdo_oci_deps[] = {
00043        ZEND_MOD_REQUIRED("pdo")
00044        ZEND_MOD_END
00045 };
00046 #endif
00047 
00048 zend_module_entry pdo_oci_module_entry = {
00049 #if ZEND_MODULE_API_NO >= 20050922
00050        STANDARD_MODULE_HEADER_EX, NULL,
00051        pdo_oci_deps,
00052 #else
00053        STANDARD_MODULE_HEADER,
00054 #endif
00055        "PDO_OCI",
00056        pdo_oci_functions,
00057        PHP_MINIT(pdo_oci),
00058        PHP_MSHUTDOWN(pdo_oci),
00059        NULL,
00060        NULL,
00061        PHP_MINFO(pdo_oci),
00062        "1.0.1",
00063        STANDARD_MODULE_PROPERTIES
00064 };
00065 /* }}} */
00066 
00067 #ifdef COMPILE_DL_PDO_OCI
00068 ZEND_GET_MODULE(pdo_oci)
00069 #endif
00070 
00071 const ub4 PDO_OCI_INIT_MODE = 
00072 #if 0 && defined(OCI_SHARED)
00073                      /* shared mode is known to be bad for PHP */
00074                      OCI_SHARED
00075 #else
00076                      OCI_DEFAULT
00077 #endif
00078 #ifdef OCI_OBJECT
00079                      |OCI_OBJECT
00080 #endif
00081 #ifdef ZTS
00082                      |OCI_THREADED
00083 #endif
00084                      ;
00085 
00086 /* true global environment */
00087 OCIEnv *pdo_oci_Env = NULL;
00088 
00089 /* {{{ PHP_MINIT_FUNCTION
00090  */
00091 PHP_MINIT_FUNCTION(pdo_oci)
00092 {
00093        php_pdo_register_driver(&pdo_oci_driver);
00094 
00095 #if HAVE_OCIENVCREATE
00096        OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL);
00097 #else
00098        OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
00099        OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL);
00100 #endif
00101 
00102        return SUCCESS;
00103 }
00104 /* }}} */
00105 
00106 /* {{{ PHP_MSHUTDOWN_FUNCTION
00107  */
00108 PHP_MSHUTDOWN_FUNCTION(pdo_oci)
00109 {
00110        php_pdo_unregister_driver(&pdo_oci_driver);
00111        OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV);
00112        return SUCCESS;
00113 }
00114 /* }}} */
00115 
00116 /* {{{ PHP_MINFO_FUNCTION
00117  */
00118 PHP_MINFO_FUNCTION(pdo_oci)
00119 {
00120        php_info_print_table_start();
00121        php_info_print_table_header(2, "PDO Driver for OCI 8 and later", "enabled");
00122        php_info_print_table_end();
00123 }
00124 /* }}} */
00125 
00126 /*
00127  * Local variables:
00128  * tab-width: 4
00129  * c-basic-offset: 4
00130  * End:
00131  * vim600: noet sw=4 ts=4 fdm=marker
00132  * vim<600: noet sw=4 ts=4
00133  */