vtiful.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Vtiful Extension |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 2017-2017 The Viest |
  6. +----------------------------------------------------------------------+
  7. | http://www.vtiful.com |
  8. +----------------------------------------------------------------------+
  9. | Author: viest <[email protected]> |
  10. +----------------------------------------------------------------------+
  11. */
  12. #ifdef HAVE_CONFIG_H
  13. #include "config.h"
  14. #endif
  15. #include "php.h"
  16. #include "php_ini.h"
  17. #include "php_vtiful.h"
  18. #include "ext/standard/info.h"
  19. #include "kernel/excel.h"
  20. #include "kernel/exception.h"
  21. int le_vtiful;
  22. PHP_MINIT_FUNCTION(vtiful)
  23. {
  24. /* If you have INI entries, uncomment these lines
  25. REGISTER_INI_ENTRIES();
  26. */
  27. VTIFUL_STARTUP_MODULE(vtiful_exception);
  28. VTIFUL_STARTUP_MODULE(excel);
  29. le_vtiful = zend_register_list_destructors_ex(_php_vtiful_excel_close, NULL, VTIFUL_RESOURCE_NAME, module_number);
  30. return SUCCESS;
  31. }
  32. /* }}} */
  33. /* {{{ PHP_MSHUTDOWN_FUNCTION
  34. */
  35. PHP_MSHUTDOWN_FUNCTION(vtiful)
  36. {
  37. /* uncomment this line if you have INI entries
  38. UNREGISTER_INI_ENTRIES();
  39. */
  40. return SUCCESS;
  41. }
  42. /* }}} */
  43. /* Remove if there's nothing to do at request start */
  44. /* {{{ PHP_RINIT_FUNCTION
  45. */
  46. PHP_RINIT_FUNCTION(vtiful)
  47. {
  48. #if defined(COMPILE_DL_VTIFUL) && defined(ZTS)
  49. ZEND_TSRMLS_CACHE_UPDATE();
  50. #endif
  51. return SUCCESS;
  52. }
  53. /* }}} */
  54. /* Remove if there's nothing to do at request end */
  55. /* {{{ PHP_RSHUTDOWN_FUNCTION
  56. */
  57. PHP_RSHUTDOWN_FUNCTION(vtiful)
  58. {
  59. return SUCCESS;
  60. }
  61. /* }}} */
  62. /* {{{ PHP_MINFO_FUNCTION
  63. */
  64. PHP_MINFO_FUNCTION(vtiful)
  65. {
  66. php_info_print_table_start();
  67. php_info_print_table_header(2, "vtiful support", "enabled");
  68. php_info_print_table_end();
  69. /* Remove comments if you have entries in php.ini
  70. DISPLAY_INI_ENTRIES();
  71. */
  72. }
  73. /* }}} */
  74. /* {{{ _php_fss_close
  75. *
  76. * List destructor for FSS handles
  77. */
  78. //static void _php_vtiful_excel_close(zend_resource *rsrc TSRMLS_DC)
  79. //{
  80. // excel_resource_t * res = (excel_resource_t *)rsrc->ptr;
  81. // /* Destroy the resource structure itself */
  82. // efree(res);
  83. //}
  84. /* }}} */
  85. /* {{{ vtiful_functions[]
  86. *
  87. * Every user visible function must have an entry in vtiful_functions[].
  88. */
  89. const zend_function_entry vtiful_functions[] = {
  90. PHP_FE_END
  91. };
  92. /* }}} */
  93. /* {{{ vtiful_module_entry
  94. */
  95. zend_module_entry vtiful_module_entry = {
  96. STANDARD_MODULE_HEADER,
  97. "vtiful",
  98. vtiful_functions,
  99. PHP_MINIT(vtiful),
  100. PHP_MSHUTDOWN(vtiful),
  101. PHP_RINIT(vtiful), /* Replace with NULL if there's nothing to do at request start */
  102. PHP_RSHUTDOWN(vtiful), /* Replace with NULL if there's nothing to do at request end */
  103. PHP_MINFO(vtiful),
  104. PHP_VTIFUL_VERSION,
  105. STANDARD_MODULE_PROPERTIES
  106. };
  107. /* }}} */
  108. #ifdef COMPILE_DL_VTIFUL
  109. #ifdef ZTS
  110. ZEND_TSRMLS_CACHE_DEFINE();
  111. #endif
  112. ZEND_GET_MODULE(vtiful)
  113. #endif
  114. /*
  115. * Local variables:
  116. * tab-width: 4
  117. * c-basic-offset: 4
  118. * End:
  119. * vim600: noet sw=4 ts=4 fdm=marker
  120. * vim<600: noet sw=4 ts=4
  121. */