소스 검색

modify the extension name

viest 7 년 전
부모
커밋
0df5925097
8개의 변경된 파일54개의 추가작업 그리고 68개의 파일을 삭제
  1. 9 10
      config.m4
  2. 0 13
      config.w32
  3. 22 22
      excel_writer.c
  4. 8 8
      kernel/excel.c
  5. 1 1
      kernel/excel.h
  6. 2 2
      kernel/exception.c
  7. 1 1
      kernel/exception.h
  8. 11 11
      php_excel_writer.h

+ 9 - 10
config.m4

@@ -1,8 +1,8 @@
-PHP_ARG_ENABLE(vtiful, whether to enable vtiful support,
-[  --enable-vtiful           Enable vtiful support])
+PHP_ARG_ENABLE(excel_writer, whether to enable excel_writer support,
+[  --enable-excel_writer           Enable excel_writer support])
 
-if test "$PHP_VTIFUL" != "no"; then
-    vtiful_sources="vtiful.c \
+if test "$PHP_EXCEL_WRITER" != "no"; then
+    excel_writer_sources="excel_writer.c \
     kernel/exception.c \
     "
 
@@ -15,9 +15,8 @@ if test "$PHP_VTIFUL" != "no"; then
             PHP_ADD_INCLUDE($i/include)
             PHP_CHECK_LIBRARY(xlsxwriter, worksheet_write_string,
             [
-                PHP_ADD_LIBRARY_WITH_PATH(xlsxwriter, $i/$PHP_LIBDIR, VTIFUL_SHARED_LIBADD)
-                AC_DEFINE([VTIFUL_XLSX_WRITER], [1], [Have libxlsxwriter support])
-                vtiful_sources="$vtiful_sources kernel/excel.c kernel/write.c"
+                PHP_ADD_LIBRARY_WITH_PATH(xlsxwriter, $i/$PHP_LIBDIR, EXCEL_WRITER_SHARED_LIBADD)
+                excel_writer_sources="$excel_writer_sources kernel/excel.c kernel/write.c"
             ],[
                 AC_MSG_ERROR([Wrong libxlsxwriter version or library not found])
             ],[
@@ -35,12 +34,12 @@ if test "$PHP_VTIFUL" != "no"; then
     fi
 
     if test -z "$PHP_DEBUG"; then
-        AC_ARG_ENABLE(debug, [--enable-debug compile with debugging system], [PHP_DEBUG=$enableval],[PHP_DEBUG=no] )
+        AC_ARG_ENABLE(debug, [--enable-debug compile with debugging system], [PHP_DEBUG=$enableval],[PHP_DEBUG=no])
     fi
 
-    PHP_SUBST(VTIFUL_SHARED_LIBADD)
+    PHP_SUBST(EXCEL_WRITER_SHARED_LIBADD)
 
-    PHP_NEW_EXTENSION(vtiful, $vtiful_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+    PHP_NEW_EXTENSION(excel_writer, $excel_writer_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
 
     PHP_ADD_BUILD_DIR([$ext_builddir/kernel])
 fi

+ 0 - 13
config.w32

@@ -1,13 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-// If your extension references something external, use ARG_WITH
-// ARG_WITH("vtiful", "for vtiful support", "no");
-
-// Otherwise, use ARG_ENABLE
-// ARG_ENABLE("vtiful", "enable vtiful support", "no");
-
-if (PHP_VTIFUL != "no") {
-	EXTENSION("vtiful", "vtiful.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
-}
-

+ 22 - 22
vtiful.c → excel_writer.c

@@ -16,22 +16,22 @@
 
 #include "php.h"
 #include "php_ini.h"
-#include "php_vtiful.h"
+#include "php_excel_writer.h"
 #include "ext/standard/info.h"
 
 #include "kernel/excel.h"
 #include "kernel/exception.h"
 
-int le_vtiful;
+int le_excel_writer;
 
 /* {{{ PHP_MINIT_FUNCTION
  */
-PHP_MINIT_FUNCTION(vtiful)
+PHP_MINIT_FUNCTION(excel_writer)
 {
-    VTIFUL_STARTUP_MODULE(vtiful_exception);
+    VTIFUL_STARTUP_MODULE(exception);
 	VTIFUL_STARTUP_MODULE(excel);
 
-	le_vtiful = zend_register_list_destructors_ex(_php_vtiful_excel_close, NULL, VTIFUL_RESOURCE_NAME, module_number);
+    le_excel_writer = zend_register_list_destructors_ex(_php_vtiful_excel_close, NULL, VTIFUL_RESOURCE_NAME, module_number);
 
 	return SUCCESS;
 }
@@ -40,7 +40,7 @@ PHP_MINIT_FUNCTION(vtiful)
 
 /* {{{ PHP_MSHUTDOWN_FUNCTION
  */
-PHP_MSHUTDOWN_FUNCTION(vtiful)
+PHP_MSHUTDOWN_FUNCTION(excel_writer)
 {
 	return SUCCESS;
 }
@@ -48,7 +48,7 @@ PHP_MSHUTDOWN_FUNCTION(vtiful)
 
 /* {{{ PHP_RINIT_FUNCTION
  */
-PHP_RINIT_FUNCTION(vtiful)
+PHP_RINIT_FUNCTION(excel_writer)
 {
 #if defined(COMPILE_DL_VTIFUL) && defined(ZTS)
 	ZEND_TSRMLS_CACHE_UPDATE();
@@ -59,7 +59,7 @@ PHP_RINIT_FUNCTION(vtiful)
 
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
-PHP_RSHUTDOWN_FUNCTION(vtiful)
+PHP_RSHUTDOWN_FUNCTION(excel_writer)
 {
 	return SUCCESS;
 }
@@ -68,10 +68,10 @@ PHP_RSHUTDOWN_FUNCTION(vtiful)
 
 /* {{{ PHP_MINFO_FUNCTION
  */
-PHP_MINFO_FUNCTION(vtiful)
+PHP_MINFO_FUNCTION(excel_writer)
 {
 	php_info_print_table_start();
-	php_info_print_table_header(2, "vtiful support", "enabled");
+	php_info_print_table_header(2, "excel_writer support", "enabled");
 #if defined(PHP_VTIFUL_VERSION)
     php_info_print_table_row(2, "Version", PHP_VTIFUL_VERSION);
 #endif
@@ -83,32 +83,32 @@ PHP_MINFO_FUNCTION(vtiful)
  *
  * Every user visible function must have an entry in vtiful_functions[].
  */
-const zend_function_entry vtiful_functions[] = {
+const zend_function_entry excel_writer_functions[] = {
 	PHP_FE_END
 };
 /* }}} */
 
 /* {{{ vtiful_module_entry
  */
-zend_module_entry vtiful_module_entry = {
+zend_module_entry excel_writer_module_entry = {
 	STANDARD_MODULE_HEADER,
-	"vtiful",
-	vtiful_functions,
-	PHP_MINIT(vtiful),
-	PHP_MSHUTDOWN(vtiful),
-	PHP_RINIT(vtiful),		/* Replace with NULL if there's nothing to do at request start */
-	PHP_RSHUTDOWN(vtiful),	/* Replace with NULL if there's nothing to do at request end */
-	PHP_MINFO(vtiful),
-	PHP_VTIFUL_VERSION,
+	"excel_writer",
+    excel_writer_functions,
+	PHP_MINIT(excel_writer),
+	PHP_MSHUTDOWN(excel_writer),
+	PHP_RINIT(excel_writer),		/* Replace with NULL if there's nothing to do at request start */
+	PHP_RSHUTDOWN(excel_writer),	/* Replace with NULL if there's nothing to do at request end */
+	PHP_MINFO(excel_writer),
+    PHP_EXCEL_WRITER_VERSION,
 	STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
 
-#ifdef COMPILE_DL_VTIFUL
+#ifdef COMPILE_DL_EXCEL_WRITER
 #ifdef ZTS
 ZEND_TSRMLS_CACHE_DEFINE();
 #endif
-ZEND_GET_MODULE(vtiful)
+ZEND_GET_MODULE(excel_writer)
 #endif
 
 /*

+ 8 - 8
kernel/excel.c

@@ -72,7 +72,7 @@ excel_resource_t * zval_get_resource(zval *handle)
 {
     excel_resource_t *res;
 
-    if((res = (excel_resource_t *)zend_fetch_resource(Z_RES_P(handle), VTIFUL_RESOURCE_NAME, le_vtiful)) == NULL) {
+    if((res = (excel_resource_t *)zend_fetch_resource(Z_RES_P(handle), VTIFUL_RESOURCE_NAME, le_excel_writer)) == NULL) {
         zend_throw_exception(vtiful_exception_ce, "Excel resources resolution fail", 210);
     }
 
@@ -137,7 +137,7 @@ PHP_METHOD(vtiful_excel, fileName)
     res->worksheet = workbook_add_worksheet(res->workbook, NULL);
     zval_ptr_dtor(&file_path);
 
-    ZVAL_RES(&handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&handle, zend_register_resource(res, le_excel_writer));
 
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_FIL), &file_path);
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &handle);
@@ -167,7 +167,7 @@ PHP_METHOD(vtiful_excel, header)
          zval_ptr_dtor(header_value);
     } ZEND_HASH_FOREACH_END();
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */
@@ -198,7 +198,7 @@ PHP_METHOD(vtiful_excel, data)
         }
     } ZEND_HASH_FOREACH_END();
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */
@@ -257,7 +257,7 @@ PHP_METHOD(vtiful_excel, insertText)
 
     type_writer(data, row, column, res);
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */
@@ -284,7 +284,7 @@ PHP_METHOD(vtiful_excel, insertImage)
 
     image_writer(image, row, column, res);
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */
@@ -311,7 +311,7 @@ PHP_METHOD(vtiful_excel, insertFormula)
 
     formula_writer(formula, row, column, res);
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */
@@ -336,7 +336,7 @@ PHP_METHOD(vtiful_excel, autoFilter)
 
     auto_filter(range, res);
 
-    ZVAL_RES(&res_handle, zend_register_resource(res, le_vtiful));
+    ZVAL_RES(&res_handle, zend_register_resource(res, le_excel_writer));
     zend_update_property(vtiful_excel_ce, return_value, ZEND_STRL(V_EXCEL_HANDLE), &res_handle);
 }
 /* }}} */

+ 1 - 1
kernel/excel.h

@@ -13,7 +13,7 @@
 #ifndef VTIFUL_EXCEL_H
 #define VTIFUL_EXCEL_H
 
-#include "php_vtiful.h"
+#include "php_excel_writer.h"
 #include "xlsxwriter.h"
 
 typedef struct {

+ 2 - 2
kernel/exception.c

@@ -12,7 +12,7 @@
 
 #include <php.h>
 #include "zend_exceptions.h"
-#include "php_vtiful.h"
+#include "php_excel_writer.h"
 #include "exception.h"
 
 zend_class_entry *vtiful_exception_ce;
@@ -26,7 +26,7 @@ zend_function_entry exception_methods[] = {
 
 /** {{{ VTIFUL_STARTUP_FUNCTION
 */
-VTIFUL_STARTUP_FUNCTION(vtiful_exception) {
+VTIFUL_STARTUP_FUNCTION(exception) {
     zend_class_entry ce;
 
     INIT_NS_CLASS_ENTRY(ce, "Vtiful\\Kernel", "Exception", exception_methods);

+ 1 - 1
kernel/exception.h

@@ -15,6 +15,6 @@
 
 extern zend_class_entry *vtiful_exception_ce;
 
-VTIFUL_STARTUP_FUNCTION(vtiful_exception);
+VTIFUL_STARTUP_FUNCTION(exception);
 
 #endif

+ 11 - 11
php_vtiful.h → php_excel_writer.h

@@ -13,10 +13,10 @@
 #ifndef PHP_VTIFUL_H
 #define PHP_VTIFUL_H
 
-extern zend_module_entry vtiful_module_entry;
-#define phpext_vtiful_ptr &vtiful_module_entry
+extern zend_module_entry excel_writer_module_entry;
+#define phpext_excel_writer_ptr &excel_writer_module_entry
 
-#define PHP_VTIFUL_VERSION "1.0.0"
+#define PHP_EXCEL_WRITER_VERSION "1.0.0"
 
 #ifdef PHP_WIN32
 #	define PHP_VTIFUL_API __declspec(dllexport)
@@ -32,10 +32,10 @@ extern zend_module_entry vtiful_module_entry;
 
 #define VTIFUL_RESOURCE_NAME "vtiful"
 
-extern int le_vtiful;
+extern int le_excel_writer;
 
-#define VTIFUL_STARTUP_MODULE(module) ZEND_MODULE_STARTUP_N(vtiful_##module)(INIT_FUNC_ARGS_PASSTHRU)
-#define VTIFUL_STARTUP_FUNCTION(module) ZEND_MINIT_FUNCTION(vtiful_##module)
+#define VTIFUL_STARTUP_MODULE(module) ZEND_MODULE_STARTUP_N(excel_writer_##module)(INIT_FUNC_ARGS_PASSTHRU)
+#define VTIFUL_STARTUP_FUNCTION(module) ZEND_MINIT_FUNCTION(excel_writer_##module)
 #define VTIFUL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(vtiful, v)
 
 void _php_vtiful_excel_close(zend_resource *rsrc TSRMLS_DC);
@@ -44,11 +44,11 @@ void _php_vtiful_excel_close(zend_resource *rsrc TSRMLS_DC);
 ZEND_TSRMLS_CACHE_EXTERN();
 #endif
 
-PHP_MINIT_FUNCTION(vtiful);
-PHP_MSHUTDOWN_FUNCTION(vtiful);
-PHP_RINIT_FUNCTION(vtiful);
-PHP_RSHUTDOWN_FUNCTION(vtiful);
-PHP_MINFO_FUNCTION(vtiful);
+PHP_MINIT_FUNCTION(excel_writer);
+PHP_MSHUTDOWN_FUNCTION(excel_writer);
+PHP_RINIT_FUNCTION(excel_writer);
+PHP_RSHUTDOWN_FUNCTION(excel_writer);
+PHP_MINFO_FUNCTION(excel_writer);
 
 #endif