xls_writer.c 2.7 KB

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