excel_writer.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 "ext/standard/info.h"
  17. #include "kernel/include.h"
  18. excel_resource_t *excel_res;
  19. int le_excel_writer;
  20. /* {{{ PHP_MINIT_FUNCTION
  21. */
  22. PHP_MINIT_FUNCTION(excel_writer)
  23. {
  24. VTIFUL_STARTUP_MODULE(exception);
  25. VTIFUL_STARTUP_MODULE(excel);
  26. VTIFUL_STARTUP_MODULE(format);
  27. excel_res = malloc(sizeof(excel_resource_t));
  28. le_excel_writer = zend_register_list_destructors_ex(_php_vtiful_excel_close, NULL, VTIFUL_RESOURCE_NAME, module_number);
  29. return SUCCESS;
  30. }
  31. /* }}} */
  32. /* {{{ PHP_MSHUTDOWN_FUNCTION
  33. */
  34. PHP_MSHUTDOWN_FUNCTION(excel_writer)
  35. {
  36. return SUCCESS;
  37. }
  38. /* }}} */
  39. /* {{{ PHP_RINIT_FUNCTION
  40. */
  41. PHP_RINIT_FUNCTION(excel_writer)
  42. {
  43. #if defined(COMPILE_DL_VTIFUL) && defined(ZTS)
  44. ZEND_TSRMLS_CACHE_UPDATE();
  45. #endif
  46. return SUCCESS;
  47. }
  48. /* }}} */
  49. /* {{{ PHP_RSHUTDOWN_FUNCTION
  50. */
  51. PHP_RSHUTDOWN_FUNCTION(excel_writer)
  52. {
  53. return SUCCESS;
  54. }
  55. /* }}} */
  56. /* {{{ PHP_MINFO_FUNCTION
  57. */
  58. PHP_MINFO_FUNCTION(excel_writer)
  59. {
  60. php_info_print_table_start();
  61. php_info_print_table_header(2, "excel_writer support", "enabled");
  62. #if defined(PHP_VTIFUL_VERSION)
  63. php_info_print_table_row(2, "Version", PHP_VTIFUL_VERSION);
  64. #endif
  65. php_info_print_table_end();
  66. }
  67. /* }}} */
  68. /* {{{ vtiful_functions[]
  69. *
  70. * Every user visible function must have an entry in vtiful_functions[].
  71. */
  72. const zend_function_entry excel_writer_functions[] = {
  73. PHP_FE_END
  74. };
  75. /* }}} */
  76. /* {{{ vtiful_module_entry
  77. */
  78. zend_module_entry excel_writer_module_entry = {
  79. STANDARD_MODULE_HEADER,
  80. "excel_writer",
  81. excel_writer_functions,
  82. PHP_MINIT(excel_writer),
  83. PHP_MSHUTDOWN(excel_writer),
  84. PHP_RINIT(excel_writer), /* Replace with NULL if there's nothing to do at request start */
  85. PHP_RSHUTDOWN(excel_writer), /* Replace with NULL if there's nothing to do at request end */
  86. PHP_MINFO(excel_writer),
  87. PHP_EXCEL_WRITER_VERSION,
  88. STANDARD_MODULE_PROPERTIES
  89. };
  90. /* }}} */
  91. #ifdef COMPILE_DL_EXCEL_WRITER
  92. #ifdef ZTS
  93. ZEND_TSRMLS_CACHE_DEFINE();
  94. #endif
  95. ZEND_GET_MODULE(excel_writer)
  96. #endif
  97. /*
  98. * Local variables:
  99. * tab-width: 4
  100. * c-basic-offset: 4
  101. * End:
  102. * vim600: noet sw=4 ts=4 fdm=marker
  103. * vim<600: noet sw=4 ts=4
  104. */