vtiful.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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", 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. // int i;
  81. // fss_resource_t * res = (fss_resource_t *)rsrc->ptr;
  82. // /* Destroy the replace strings */
  83. // for (i = 0; i < res->replace_size; i++) {
  84. // if (res->replace[i]) {
  85. // zval_ptr_dtor(res->replace[i]);
  86. // }
  87. // }
  88. // /* Destroy the kwset structure */
  89. // kwsfree(res->set);
  90. // /* Destroy the resource structure itself */
  91. // efree(res);
  92. }
  93. /* }}} */
  94. /* {{{ vtiful_functions[]
  95. *
  96. * Every user visible function must have an entry in vtiful_functions[].
  97. */
  98. const zend_function_entry vtiful_functions[] = {
  99. PHP_FE_END
  100. };
  101. /* }}} */
  102. /* {{{ vtiful_module_entry
  103. */
  104. zend_module_entry vtiful_module_entry = {
  105. STANDARD_MODULE_HEADER,
  106. "vtiful",
  107. vtiful_functions,
  108. PHP_MINIT(vtiful),
  109. PHP_MSHUTDOWN(vtiful),
  110. PHP_RINIT(vtiful), /* Replace with NULL if there's nothing to do at request start */
  111. PHP_RSHUTDOWN(vtiful), /* Replace with NULL if there's nothing to do at request end */
  112. PHP_MINFO(vtiful),
  113. PHP_VTIFUL_VERSION,
  114. STANDARD_MODULE_PROPERTIES
  115. };
  116. /* }}} */
  117. #ifdef COMPILE_DL_VTIFUL
  118. #ifdef ZTS
  119. ZEND_TSRMLS_CACHE_DEFINE();
  120. #endif
  121. ZEND_GET_MODULE(vtiful)
  122. #endif
  123. /*
  124. * Local variables:
  125. * tab-width: 4
  126. * c-basic-offset: 4
  127. * End:
  128. * vim600: noet sw=4 ts=4 fdm=marker
  129. * vim<600: noet sw=4 ts=4
  130. */