vtiful.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. PHP_MINIT_FUNCTION(vtiful)
  22. {
  23. /* If you have INI entries, uncomment these lines
  24. REGISTER_INI_ENTRIES();
  25. */
  26. VTIFUL_STARTUP_MODULE(vtiful_exception);
  27. VTIFUL_STARTUP_MODULE(excel);
  28. le_vtiful = zend_register_list_destructors_ex(_php_vtiful_excel_close, NULL, "vtiful", module_number);
  29. return SUCCESS;
  30. }
  31. /* }}} */
  32. /* {{{ PHP_MSHUTDOWN_FUNCTION
  33. */
  34. PHP_MSHUTDOWN_FUNCTION(vtiful)
  35. {
  36. /* uncomment this line if you have INI entries
  37. UNREGISTER_INI_ENTRIES();
  38. */
  39. return SUCCESS;
  40. }
  41. /* }}} */
  42. /* Remove if there's nothing to do at request start */
  43. /* {{{ PHP_RINIT_FUNCTION
  44. */
  45. PHP_RINIT_FUNCTION(vtiful)
  46. {
  47. #if defined(COMPILE_DL_VTIFUL) && defined(ZTS)
  48. ZEND_TSRMLS_CACHE_UPDATE();
  49. #endif
  50. return SUCCESS;
  51. }
  52. /* }}} */
  53. /* Remove if there's nothing to do at request end */
  54. /* {{{ PHP_RSHUTDOWN_FUNCTION
  55. */
  56. PHP_RSHUTDOWN_FUNCTION(vtiful)
  57. {
  58. return SUCCESS;
  59. }
  60. /* }}} */
  61. /* {{{ PHP_MINFO_FUNCTION
  62. */
  63. PHP_MINFO_FUNCTION(vtiful)
  64. {
  65. php_info_print_table_start();
  66. php_info_print_table_header(2, "vtiful support", "enabled");
  67. php_info_print_table_end();
  68. /* Remove comments if you have entries in php.ini
  69. DISPLAY_INI_ENTRIES();
  70. */
  71. }
  72. /* }}} */
  73. /* {{{ _php_fss_close
  74. *
  75. * List destructor for FSS handles
  76. */
  77. static void _php_vtiful_excel_close(zend_resource *rsrc TSRMLS_DC)
  78. {
  79. // int i;
  80. // fss_resource_t * res = (fss_resource_t *)rsrc->ptr;
  81. // /* Destroy the replace strings */
  82. // for (i = 0; i < res->replace_size; i++) {
  83. // if (res->replace[i]) {
  84. // zval_ptr_dtor(res->replace[i]);
  85. // }
  86. // }
  87. // /* Destroy the kwset structure */
  88. // kwsfree(res->set);
  89. // /* Destroy the resource structure itself */
  90. // efree(res);
  91. }
  92. /* }}} */
  93. /* {{{ vtiful_functions[]
  94. *
  95. * Every user visible function must have an entry in vtiful_functions[].
  96. */
  97. const zend_function_entry vtiful_functions[] = {
  98. PHP_FE_END
  99. };
  100. /* }}} */
  101. /* {{{ vtiful_module_entry
  102. */
  103. zend_module_entry vtiful_module_entry = {
  104. STANDARD_MODULE_HEADER,
  105. "vtiful",
  106. vtiful_functions,
  107. PHP_MINIT(vtiful),
  108. PHP_MSHUTDOWN(vtiful),
  109. PHP_RINIT(vtiful), /* Replace with NULL if there's nothing to do at request start */
  110. PHP_RSHUTDOWN(vtiful), /* Replace with NULL if there's nothing to do at request end */
  111. PHP_MINFO(vtiful),
  112. PHP_VTIFUL_VERSION,
  113. STANDARD_MODULE_PROPERTIES
  114. };
  115. /* }}} */
  116. #ifdef COMPILE_DL_VTIFUL
  117. #ifdef ZTS
  118. ZEND_TSRMLS_CACHE_DEFINE();
  119. #endif
  120. ZEND_GET_MODULE(vtiful)
  121. #endif
  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. */