pdo_oci.c 3.2 KB

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