excel_writer.c 2.8 KB

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