|
@@ -1,8 +1,8 @@
|
|
|
/*
|
|
|
+----------------------------------------------------------------------+
|
|
|
- | Vtiful Extension |
|
|
|
+ | XlsWriter Extension |
|
|
|
+----------------------------------------------------------------------+
|
|
|
- | Copyright (c) 2017-2017 The Viest |
|
|
|
+ | Copyright (c) 2017-2018 The Viest |
|
|
|
+----------------------------------------------------------------------+
|
|
|
| http://www.viest.me |
|
|
|
+----------------------------------------------------------------------+
|
|
@@ -16,9 +16,9 @@
|
|
|
|
|
|
#include "include.h"
|
|
|
|
|
|
-zend_class_entry *vtiful_excel_ce;
|
|
|
+zend_class_entry *vtiful_xls_ce;
|
|
|
|
|
|
-static zend_object_handlers vtiful_excel_handlers;
|
|
|
+static zend_object_handlers vtiful_xls_handlers;
|
|
|
|
|
|
static zend_always_inline void *vtiful_object_alloc(size_t obj_size, zend_class_entry *ce) {
|
|
|
void *obj = emalloc(obj_size + zend_object_properties_size(ce));
|
|
@@ -26,26 +26,26 @@ static zend_always_inline void *vtiful_object_alloc(size_t obj_size, zend_class_
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
-/* {{{ excel_objects_new
|
|
|
+/* {{{ xls_objects_new
|
|
|
*/
|
|
|
-PHP_VTIFUL_API zend_object *excel_objects_new(zend_class_entry *ce)
|
|
|
+PHP_VTIFUL_API zend_object *vtiful_xls_objects_new(zend_class_entry *ce)
|
|
|
{
|
|
|
- excel_object *intern = vtiful_object_alloc(sizeof(excel_object), ce);
|
|
|
+ xls_object *intern = vtiful_object_alloc(sizeof(xls_object), ce);
|
|
|
|
|
|
zend_object_std_init(&intern->zo, ce);
|
|
|
object_properties_init(&intern->zo, ce);
|
|
|
|
|
|
- intern->zo.handlers = &vtiful_excel_handlers;
|
|
|
+ intern->zo.handlers = &vtiful_xls_handlers;
|
|
|
|
|
|
return &intern->zo;
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/* {{{ vtiful_excel_objects_free
|
|
|
+/* {{{ vtiful_xls_objects_free
|
|
|
*/
|
|
|
-static void vtiful_excel_objects_free(zend_object *object)
|
|
|
+static void vtiful_xls_objects_free(zend_object *object)
|
|
|
{
|
|
|
- excel_object *intern = php_vtiful_excel_fetch_object(object);
|
|
|
+ xls_object *intern = php_vtiful_xls_fetch_object(object);
|
|
|
|
|
|
lxw_workbook_free(intern->ptr.workbook);
|
|
|
|
|
@@ -55,66 +55,66 @@ static void vtiful_excel_objects_free(zend_object *object)
|
|
|
|
|
|
/* {{{ ARG_INFO
|
|
|
*/
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_construct_arginfo, 0, 0, 1)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_construct_arginfo, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, config)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_file_name_arginfo, 0, 0, 1)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_file_name_arginfo, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, file_name)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_header_arginfo, 0, 0, 1)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_header_arginfo, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, header)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_data_arginfo, 0, 0, 1)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_data_arginfo, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_insert_text_arginfo, 0, 0, 4)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_insert_text_arginfo, 0, 0, 4)
|
|
|
ZEND_ARG_INFO(0, row)
|
|
|
ZEND_ARG_INFO(0, column)
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_insert_image_arginfo, 0, 0, 3)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_insert_image_arginfo, 0, 0, 3)
|
|
|
ZEND_ARG_INFO(0, row)
|
|
|
ZEND_ARG_INFO(0, column)
|
|
|
ZEND_ARG_INFO(0, image)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_insert_formula_arginfo, 0, 0, 3)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_insert_formula_arginfo, 0, 0, 3)
|
|
|
ZEND_ARG_INFO(0, row)
|
|
|
ZEND_ARG_INFO(0, column)
|
|
|
ZEND_ARG_INFO(0, formula)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_auto_filter_arginfo, 0, 0, 1)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_auto_filter_arginfo, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, range)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_merge_cells_arginfo, 0, 0, 2)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_merge_cells_arginfo, 0, 0, 2)
|
|
|
ZEND_ARG_INFO(0, range)
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_set_column_arginfo, 0, 0, 3)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_set_column_arginfo, 0, 0, 3)
|
|
|
ZEND_ARG_INFO(0, format_handle)
|
|
|
ZEND_ARG_INFO(0, range)
|
|
|
ZEND_ARG_INFO(0, width)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
-ZEND_BEGIN_ARG_INFO_EX(excel_set_row_arginfo, 0, 0, 3)
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(xls_set_row_arginfo, 0, 0, 3)
|
|
|
ZEND_ARG_INFO(0, format_handle)
|
|
|
ZEND_ARG_INFO(0, range)
|
|
|
ZEND_ARG_INFO(0, height)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::__construct(array $config)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::__construct(array $config)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, __construct)
|
|
|
+PHP_METHOD(vtiful_xls, __construct)
|
|
|
{
|
|
|
zval *config, *c_path;
|
|
|
|
|
@@ -122,7 +122,7 @@ PHP_METHOD(vtiful_excel, __construct)
|
|
|
Z_PARAM_ARRAY(config)
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
|
|
|
|
|
- if((c_path = zend_hash_str_find(Z_ARRVAL_P(config), ZEND_STRL(V_EXCEL_PAT))) == NULL)
|
|
|
+ if((c_path = zend_hash_str_find(Z_ARRVAL_P(config), ZEND_STRL(V_XLS_PAT))) == NULL)
|
|
|
{
|
|
|
zend_throw_exception(vtiful_exception_ce, "Lack of 'path' configuration", 110);
|
|
|
return;
|
|
@@ -134,13 +134,13 @@ PHP_METHOD(vtiful_excel, __construct)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- add_property_zval(getThis(), V_EXCEL_COF, config);
|
|
|
+ add_property_zval(getThis(), V_XLS_COF, config);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::filename(string $fileName)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::filename(string $fileName)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, fileName)
|
|
|
+PHP_METHOD(vtiful_xls, fileName)
|
|
|
{
|
|
|
zval file_path, *dir_path;
|
|
|
zend_string *file_name;
|
|
@@ -151,26 +151,26 @@ PHP_METHOD(vtiful_excel, fileName)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- GET_CONFIG_PATH(dir_path, vtiful_excel_ce, return_value);
|
|
|
+ GET_CONFIG_PATH(dir_path, vtiful_xls_ce, return_value);
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
if(obj->ptr.workbook == NULL) {
|
|
|
- excel_file_path(file_name, dir_path, &file_path);
|
|
|
+ xls_file_path(file_name, dir_path, &file_path);
|
|
|
|
|
|
obj->ptr.workbook = workbook_new(Z_STRVAL(file_path));
|
|
|
obj->ptr.worksheet = workbook_add_worksheet(obj->ptr.workbook, NULL);
|
|
|
|
|
|
- add_property_zval(return_value, V_EXCEL_FIL, &file_path);
|
|
|
+ add_property_zval(return_value, V_XLS_FIL, &file_path);
|
|
|
|
|
|
zval_ptr_dtor(&file_path);
|
|
|
}
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::constMemory(string $fileName)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::constMemory(string $fileName)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, constMemory)
|
|
|
+PHP_METHOD(vtiful_xls, constMemory)
|
|
|
{
|
|
|
zval file_path, *dir_path;
|
|
|
zend_string *file_name;
|
|
@@ -181,19 +181,19 @@ PHP_METHOD(vtiful_excel, constMemory)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- GET_CONFIG_PATH(dir_path, vtiful_excel_ce, return_value);
|
|
|
+ GET_CONFIG_PATH(dir_path, vtiful_xls_ce, return_value);
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
if(obj->ptr.workbook == NULL) {
|
|
|
- excel_file_path(file_name, dir_path, &file_path);
|
|
|
+ xls_file_path(file_name, dir_path, &file_path);
|
|
|
|
|
|
lxw_workbook_options options = {.constant_memory = LXW_TRUE, .tmpdir = NULL};
|
|
|
|
|
|
obj->ptr.workbook = workbook_new_opt(Z_STRVAL(file_path), &options);
|
|
|
obj->ptr.worksheet = workbook_add_worksheet(obj->ptr.workbook, NULL);
|
|
|
|
|
|
- add_property_zval(return_value, V_EXCEL_FIL, &file_path);
|
|
|
+ add_property_zval(return_value, V_XLS_FIL, &file_path);
|
|
|
|
|
|
zval_ptr_dtor(&file_path);
|
|
|
}
|
|
@@ -201,9 +201,9 @@ PHP_METHOD(vtiful_excel, constMemory)
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::header(array $header)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::header(array $header)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, header)
|
|
|
+PHP_METHOD(vtiful_xls, header)
|
|
|
{
|
|
|
zval *header, *header_value;
|
|
|
zend_long header_l_key;
|
|
@@ -214,7 +214,7 @@ PHP_METHOD(vtiful_excel, header)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(header), header_l_key, header_value) {
|
|
|
type_writer(header_value, 0, header_l_key, &obj->ptr, NULL);
|
|
@@ -223,9 +223,9 @@ PHP_METHOD(vtiful_excel, header)
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::data(array $data)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::data(array $data)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, data)
|
|
|
+PHP_METHOD(vtiful_xls, data)
|
|
|
{
|
|
|
zval *data, *data_r_value, *data_l_value;
|
|
|
zend_long data_r_key, data_l_key;
|
|
@@ -236,7 +236,7 @@ PHP_METHOD(vtiful_excel, data)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(data), data_r_key, data_r_value) {
|
|
|
if(Z_TYPE_P(data_r_value) == IS_ARRAY) {
|
|
@@ -249,38 +249,38 @@ PHP_METHOD(vtiful_excel, data)
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::output()
|
|
|
+/** {{{ \Vtiful\Kernel\xls::output()
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, output)
|
|
|
+PHP_METHOD(vtiful_xls, output)
|
|
|
{
|
|
|
zval rv, *file_path;
|
|
|
|
|
|
- file_path = zend_read_property(vtiful_excel_ce, getThis(), ZEND_STRL(V_EXCEL_FIL), 0, &rv TSRMLS_DC);
|
|
|
+ file_path = zend_read_property(vtiful_xls_ce, getThis(), ZEND_STRL(V_XLS_FIL), 0, &rv TSRMLS_DC);
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
workbook_file(&obj->ptr);
|
|
|
|
|
|
- add_property_null(getThis(), V_EXCEL_HANDLE);
|
|
|
- add_property_null(getThis(), V_EXCEL_PAT);
|
|
|
+ add_property_null(getThis(), V_XLS_HANDLE);
|
|
|
+ add_property_null(getThis(), V_XLS_PAT);
|
|
|
|
|
|
ZVAL_COPY(return_value, file_path);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::getHandle()
|
|
|
+/** {{{ \Vtiful\Kernel\xls::getHandle()
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, getHandle)
|
|
|
+PHP_METHOD(vtiful_xls, getHandle)
|
|
|
{
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
- RETURN_RES(zend_register_resource(&obj->ptr, le_excel_writer));
|
|
|
+ RETURN_RES(zend_register_resource(&obj->ptr, le_xls_writer));
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::insertText(int $row, int $column, string|int|double $data)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::insertText(int $row, int $column, string|int|double $data)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, insertText)
|
|
|
+PHP_METHOD(vtiful_xls, insertText)
|
|
|
{
|
|
|
zval *data;
|
|
|
zend_long row, column;
|
|
@@ -296,15 +296,15 @@ PHP_METHOD(vtiful_excel, insertText)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
type_writer(data, row, column, &obj->ptr, format);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::insertImage(int $row, int $column, string $imagePath)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::insertImage(int $row, int $column, string $imagePath)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, insertImage)
|
|
|
+PHP_METHOD(vtiful_xls, insertImage)
|
|
|
{
|
|
|
zval *image;
|
|
|
zend_long row, column;
|
|
@@ -317,15 +317,15 @@ PHP_METHOD(vtiful_excel, insertImage)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
image_writer(image, row, column, &obj->ptr);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::insertImage(int $row, int $column, string $imagePath)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::insertImage(int $row, int $column, string $imagePath)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, insertFormula)
|
|
|
+PHP_METHOD(vtiful_xls, insertFormula)
|
|
|
{
|
|
|
zval *formula;
|
|
|
zend_long row, column;
|
|
@@ -338,15 +338,15 @@ PHP_METHOD(vtiful_excel, insertFormula)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
formula_writer(formula, row, column, &obj->ptr);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::autoFilter(int $rowStart, int $rowEnd, int $columnStart, int $columnEnd)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::autoFilter(int $rowStart, int $rowEnd, int $columnStart, int $columnEnd)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, autoFilter)
|
|
|
+PHP_METHOD(vtiful_xls, autoFilter)
|
|
|
{
|
|
|
zend_string *range;
|
|
|
|
|
@@ -356,17 +356,16 @@ PHP_METHOD(vtiful_excel, autoFilter)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
auto_filter(range, &obj->ptr);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::mergeCells(string $range, string $data)
|
|
|
+/** {{{ \Vtiful\Kernel\xls::mergeCells(string $range, string $data)
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, mergeCells)
|
|
|
+PHP_METHOD(vtiful_xls, mergeCells)
|
|
|
{
|
|
|
- zval res_handle;
|
|
|
zend_string *range, *data;
|
|
|
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
@@ -376,17 +375,17 @@ PHP_METHOD(vtiful_excel, mergeCells)
|
|
|
|
|
|
ZVAL_COPY(return_value, getThis());
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
merge_cells(range, data, &obj->ptr);
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::setColumn(resource $format, string $range [, int $width])
|
|
|
+/** {{{ \Vtiful\Kernel\xls::setColumn(resource $format, string $range [, int $width])
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, setColumn)
|
|
|
+PHP_METHOD(vtiful_xls, setColumn)
|
|
|
{
|
|
|
- zval *format_handle, res_handle;
|
|
|
+ zval *format_handle;
|
|
|
zend_string *range;
|
|
|
|
|
|
double width = 0;
|
|
@@ -405,17 +404,17 @@ PHP_METHOD(vtiful_excel, setColumn)
|
|
|
width = 10;
|
|
|
}
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
set_column(range, width, &obj->ptr, zval_get_format(format_handle));
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ \Vtiful\Kernel\Excel::setRow(resource $format, string $range [, int $heitght])
|
|
|
+/** {{{ \Vtiful\Kernel\xls::setRow(resource $format, string $range [, int $heitght])
|
|
|
*/
|
|
|
-PHP_METHOD(vtiful_excel, setRow)
|
|
|
+PHP_METHOD(vtiful_xls, setRow)
|
|
|
{
|
|
|
- zval *format_handle, res_handle;
|
|
|
+ zval *format_handle;
|
|
|
zend_string *range;
|
|
|
|
|
|
double height = 0;
|
|
@@ -434,29 +433,29 @@ PHP_METHOD(vtiful_excel, setRow)
|
|
|
height = 18;
|
|
|
}
|
|
|
|
|
|
- excel_object *obj = Z_EXCEL_P(getThis());
|
|
|
+ xls_object *obj = Z_XLS_P(getThis());
|
|
|
|
|
|
set_row(range, height, &obj->ptr, zval_get_format(format_handle));
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
-/** {{{ excel_methods
|
|
|
+/** {{{ xls_methods
|
|
|
*/
|
|
|
-zend_function_entry excel_methods[] = {
|
|
|
- PHP_ME(vtiful_excel, __construct, excel_construct_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
|
|
|
- PHP_ME(vtiful_excel, fileName, excel_file_name_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, constMemory, excel_file_name_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, header, excel_header_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, data, excel_data_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, output, NULL, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, getHandle, NULL, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, autoFilter, excel_auto_filter_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, insertText, excel_insert_text_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, insertImage, excel_insert_image_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, insertFormula, excel_insert_formula_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, mergeCells, excel_merge_cells_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, setColumn, excel_set_column_arginfo, ZEND_ACC_PUBLIC)
|
|
|
- PHP_ME(vtiful_excel, setRow, excel_set_row_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+zend_function_entry xls_methods[] = {
|
|
|
+ PHP_ME(vtiful_xls, __construct, xls_construct_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
|
|
|
+ PHP_ME(vtiful_xls, fileName, xls_file_name_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, constMemory, xls_file_name_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, header, xls_header_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, data, xls_data_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, output, NULL, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, getHandle, NULL, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, autoFilter, xls_auto_filter_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, insertText, xls_insert_text_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, insertImage, xls_insert_image_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, insertFormula, xls_insert_formula_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, mergeCells, xls_merge_cells_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, setColumn, xls_set_column_arginfo, ZEND_ACC_PUBLIC)
|
|
|
+ PHP_ME(vtiful_xls, setRow, xls_set_row_arginfo, ZEND_ACC_PUBLIC)
|
|
|
PHP_FE_END
|
|
|
};
|
|
|
/* }}} */
|
|
@@ -466,16 +465,16 @@ zend_function_entry excel_methods[] = {
|
|
|
VTIFUL_STARTUP_FUNCTION(excel) {
|
|
|
zend_class_entry ce;
|
|
|
|
|
|
- INIT_NS_CLASS_ENTRY(ce, "Vtiful\\Kernel", "Excel", excel_methods);
|
|
|
- ce.create_object = excel_objects_new;
|
|
|
- vtiful_excel_ce = zend_register_internal_class(&ce);
|
|
|
+ INIT_NS_CLASS_ENTRY(ce, "Vtiful\\Kernel", "Excel", xls_methods);
|
|
|
+ ce.create_object = vtiful_xls_objects_new;
|
|
|
+ vtiful_xls_ce = zend_register_internal_class(&ce);
|
|
|
|
|
|
- memcpy(&vtiful_excel_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
|
|
- vtiful_excel_handlers.offset = XtOffsetOf(excel_object, zo);
|
|
|
- vtiful_excel_handlers.free_obj = vtiful_excel_objects_free;
|
|
|
+ memcpy(&vtiful_xls_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
|
|
+ vtiful_xls_handlers.offset = XtOffsetOf(xls_object, zo);
|
|
|
+ vtiful_xls_handlers.free_obj = vtiful_xls_objects_free;
|
|
|
|
|
|
- REGISTER_CLASS_PROPERTY_NULL(vtiful_excel_ce, V_EXCEL_COF, ZEND_ACC_PRIVATE);
|
|
|
- REGISTER_CLASS_PROPERTY_NULL(vtiful_excel_ce, V_EXCEL_FIL, ZEND_ACC_PRIVATE);
|
|
|
+ REGISTER_CLASS_PROPERTY_NULL(vtiful_xls_ce, V_XLS_COF, ZEND_ACC_PRIVATE);
|
|
|
+ REGISTER_CLASS_PROPERTY_NULL(vtiful_xls_ce, V_XLS_FIL, ZEND_ACC_PRIVATE);
|
|
|
|
|
|
return SUCCESS;
|
|
|
}
|