root/ext/pdo_oci/pdo_oci.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. PHP_MINIT_FUNCTION
  2. PHP_MSHUTDOWN_FUNCTION
  3. PHP_MINFO_FUNCTION

   1 /*
   2   +----------------------------------------------------------------------+
   3   | PHP Version 7                                                        |
   4   +----------------------------------------------------------------------+
   5   | Copyright (c) 1997-2016 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_oci.h"
  31 #include "php_pdo_oci_int.h"
  32 
  33 /* {{{ pdo_oci_functions[] */
  34 const zend_function_entry pdo_oci_functions[] = {
  35         PHP_FE_END
  36 };
  37 /* }}} */
  38 
  39 /* {{{ pdo_oci_module_entry */
  40 
  41 #if ZEND_MODULE_API_NO >= 20050922
  42 static const zend_module_dep pdo_oci_deps[] = {
  43         ZEND_MOD_REQUIRED("pdo")
  44         ZEND_MOD_END
  45 };
  46 #endif
  47 
  48 zend_module_entry pdo_oci_module_entry = {
  49         STANDARD_MODULE_HEADER_EX, NULL,
  50         pdo_oci_deps,
  51         "PDO_OCI",
  52         pdo_oci_functions,
  53         PHP_MINIT(pdo_oci),
  54         PHP_MSHUTDOWN(pdo_oci),
  55         NULL,
  56         NULL,
  57         PHP_MINFO(pdo_oci),
  58         PHP_PDO_OCI_VERSION,
  59         STANDARD_MODULE_PROPERTIES
  60 };
  61 /* }}} */
  62 
  63 #ifdef COMPILE_DL_PDO_OCI
  64 ZEND_GET_MODULE(pdo_oci)
  65 #endif
  66 
  67 const ub4 PDO_OCI_INIT_MODE =
  68 #if 0 && defined(OCI_SHARED)
  69                         /* shared mode is known to be bad for PHP */
  70                         OCI_SHARED
  71 #else
  72                         OCI_DEFAULT
  73 #endif
  74 #ifdef OCI_OBJECT
  75                         |OCI_OBJECT
  76 #endif
  77 #ifdef ZTS
  78                         |OCI_THREADED
  79 #endif
  80                         ;
  81 
  82 /* true global environment */
  83 OCIEnv *pdo_oci_Env = NULL;
  84 
  85 /* {{{ PHP_MINIT_FUNCTION
  86  */
  87 PHP_MINIT_FUNCTION(pdo_oci)
  88 {
  89         php_pdo_register_driver(&pdo_oci_driver);
  90 
  91 #if HAVE_OCIENVCREATE
  92         OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL);
  93 #else
  94         OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
  95         OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL);
  96 #endif
  97 
  98         return SUCCESS;
  99 }
 100 /* }}} */
 101 
 102 /* {{{ PHP_MSHUTDOWN_FUNCTION
 103  */
 104 PHP_MSHUTDOWN_FUNCTION(pdo_oci)
 105 {
 106         php_pdo_unregister_driver(&pdo_oci_driver);
 107         OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV);
 108         return SUCCESS;
 109 }
 110 /* }}} */
 111 
 112 /* {{{ PHP_MINFO_FUNCTION
 113  */
 114 PHP_MINFO_FUNCTION(pdo_oci)
 115 {
 116         php_info_print_table_start();
 117         php_info_print_table_header(2, "PDO Driver for OCI 8 and later", "enabled");
 118         php_info_print_table_end();
 119 }
 120 /* }}} */
 121 
 122 /*
 123  * Local variables:
 124  * tab-width: 4
 125  * c-basic-offset: 4
 126  * End:
 127  * vim600: noet sw=4 ts=4 fdm=marker
 128  * vim<600: noet sw=4 ts=4
 129  */

/* [<][>][^][v][top][bottom][index][help] */