├── .travis.yml ├── CREDITS ├── EXPERIMENTAL ├── README.md ├── config.m4 ├── config.w32 ├── images └── ali.png ├── php_zqf.h ├── travis └── compile.sh ├── zqf.c └── zqf.php /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | compiler: 4 | - gcc 5 | - clang 6 | 7 | os: 8 | - linux 9 | # - osx 10 | 11 | php: 12 | - 5.4 13 | - 5.5 14 | - 5.6 15 | - 7.0 16 | 17 | notifications: 18 | email: 904208360@qq.com 19 | 20 | #env: 21 | # - REPORT_EXIT_STATUS=1 NO_INTERACTION=1 22 | 23 | #Compile 24 | #before_script: 25 | # - ./travis/compile.sh 26 | 27 | script: 28 | - exit 0 29 | 30 | 31 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | zqf -------------------------------------------------------------------------------- /EXPERIMENTAL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qieangel2013/zqf/9021999a494a8fb5adaaf64c027efa20672384da/EXPERIMENTAL -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### php扩展zqf (兼容php7) 2 | 全局变量适用于高并发抢购、秒杀,红包生成,数组算法处理等,由于添加了二维码生成功能 3 | 安装本扩展之前需要安装libqrencode 4 | 依赖安装方法如下: 5 | wget http://fukuchi.org/works/qrencode/qrencode-3.4.4.tar.gz 6 | tar zxvf qrencode-3.4.4.tar.gz 7 | cd qrencode-3.4.4/ 8 | ./configure 9 | make && make install 10 | 如果没有安装libpng和libgd,也需要安装 11 | 安装方法如下: 12 | sudo apt-get install libpng-dev 13 | sudo apt-get install libgd-dev 14 | 致力于做工具类,其他的正在开发中 15 |    zqf扩展安装(兼容php7) 16 |    首先下载源码git clone https://github.com/qieangel2013/zqf.git或者composer安装 17 |    然后cd到当前目录/usr/local/php/bin/phpize 18 | ./configure --with-php-config=/usr/local/php/bin/php-config 19 | make && make install 20 |    make过程中如果出现 21 | error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘qrcode_png’ 22 | /home/zqf-master/zqf.c: In function ‘zim_zqf_savefile’: 23 | /home/zqf-master/zqf.c:525: error: ‘gdImagePtr’ undeclared (first use in this function) 24 | /home/zqf-master/zqf.c:525: error: (Each undeclared identifier is reported only once 25 | /home/zqf-master/zqf.c:525: error: for each function it appears in.) 26 | /home/zqf-master/zqf.c:525: error: expected ‘;’ before ‘im’ 27 | /home/zqf-master/zqf.c:571: error: ‘im’ undeclared (first use in this function) 28 |    说明没有安装gd库 29 |    yum install gd-devel 30 |    然后重新make && make install 31 |    修改php.ini添加extension=zqf.so 32 |    重启php-fpm 33 | =================================== 34 | ### 红包生成算法(拼手气红包和普通红包) 35 | $obj=new zqf(); 36 | 第一个参数是红包总额,第二个人参数红包数量,第三个参数默认代表拼手气红包,设置为1的话为普通红包 37 | 拼手气红包 38 | $hongb= $obj->hongbao(10,8);或者$hongb= $obj->hongbao(10,8,0);返回数组为Array ( [0] => 1.33 [1] => 1.02 [2] => 1.28 [3] => 0.44 [4] => 1.37 [5] => 0.81 [6] => 1.81 [7] => 1.94 ) 39 | 普通红包,每个人数额一样设置第三个参数 40 | $hongb= $obj->hongbao(10,8,1);返回数组为Array ( [0] => 1.25 [1] => 1.25 [2] => 1.25 [3] => 1.25 [4] => 1.25 [5] => 1.25 [6] => 1.25 [7] => 1.25 ) 41 | var_dump($hongb); 42 | ### 高并发计数器使用方法如下: 43 | 首先安装php扩展zqf.so 44 | phpize来安装 45 | 然后在php文件调用 46 | dl('zqf.so');或者phpini里加载 47 | $obj=new zqf(); 48 | $counter= $obj->autoadd(0,1,0);(声明只针对多线程) 49 | echo $counter; 50 | ### 数组快速排序使用方法如下: 51 | $asd=array(23,1,21,4,19,89,200,1,78,3,4,7,1,0,88); 52 | $obj=new zqf(); 53 | $quick= $obj->quicksort($asd); 54 | print_r($quick);Array ( [0] => 0 [1] => 1 [2] => 1 [3] => 1 [4] => 3 [5] => 4 [6] => 4 [7] => 7 [8] => 19 [9] => 21 [10] => 23 [11] => 78 [12] => 88 [13] => 89 [14] => 200 ) 55 | ### 查找数组重复元素使用方法如下: 56 | $arr=array(10,20,4,12,69,1,90,56,23,12,89,78); 57 | $obj=new zqf(); 58 | $result= $obj->findrepetition($arr);查找$arr重复项算法 59 | var_dump($result);//结果是Array ( [3] => 12 [9] => 12 ) 60 | ### 二分法查找数组元素使用方法如下: 61 | $arr=array(10,20,4,12,69,1,90,56,23,12,89,78); 62 | $obj=new zqf(); 63 | $result= $obj->findval($arr,69);二分法快速查找$arr里的元素69,c底层会给数据进行排序 64 | var_dump($result);//结果是Array ( [8] => 69 [result] => Array ( [0] => 1 [1] => 4 [2] => 10 [3] => 12 [4] => 12 [5] => 20 [6] => 23 [7] => 56 [8] => 69 [9] => 78 [10] => 89 [11] => 90 ) ) 65 | ### 二维码生成使用方法如下: 66 | $obj=new zqf(); 67 | $obj->savefile('https://www.baidu.com/s?wd=昌平香堂','./test.png',500);第一个参数是url,第二参数是保存路径,第三个参数是二维码长或者宽 68 | 生成透明二维码: 69 | $obj->savefile('https://www.baidu.com/s?wd=昌平香堂','./test.png',500,1);第四个参数默认不生成透明,要想生成透明得传一个参数 70 |     生成带有logo的二维码: 71 |     $obj->savefile('https://www.baidu.com/s?wd=昌平香堂','./test.png',500,0,"./logo.png");第五个参数是logo的路径,现在只支持png格式的logo图片 72 | ### 和phpqrcode对比 73 | php-qrencode代码: 74 | savefile('https://www.baidu.com/s?wd=昌平香堂','./test.png',500); 78 | $t2 = microtime(true); 79 | echo (($t2-$t1)*1000).':ms'; 80 | ?> 81 | 82 | 运行时间:0.60701370239258:ms 83 | 84 | phpqrcode代码: 85 | 86 | 93 | 运行时间:23.189067840576:ms 94 | ### 项目地址 95 | github:https://github.com/qieangel2013/zqf 96 | oschina:https://gitee.com/qieangel2013/zqf 97 | ### 交流使用 98 | 交流群:337937322 99 | ### 如果你对我的辛勤劳动给予肯定,请给我捐赠,你的捐赠是我最大的动力 100 | ![](https://github.com/qieangel2013/zys/blob/master/public/images/pw.jpg) 101 | ![](https://github.com/qieangel2013/zys/blob/master/public/images/pay.png) 102 | [项目捐赠列表](https://github.com/qieangel2013/zys/wiki/%E9%A1%B9%E7%9B%AE%E6%8D%90%E8%B5%A0) 103 | -------------------------------------------------------------------------------- /config.m4: -------------------------------------------------------------------------------- 1 | PHP_ARG_WITH(zqf, for zqf support, 2 | Make sure that the comment is aligned: 3 | [ --with-zqf Include zqf support]) 4 | PHP_ARG_ENABLE(zqf, whether to enable zqf support, 5 | [ --enable-zqf Enable zqf support]) 6 | if test "$PHP_ZQF" != "no"; then 7 | SEARCH_PATH="/usr/local /usr" 8 | SEARCH_FOR="/include/qrencode.h" 9 | if test -r $PHP_ZQF/$SEARCH_FOR; then # path given as parameter 10 | ZQF_DIR=$PHP_ZQF 11 | else 12 | AC_MSG_CHECKING([for qrencode files in default path]) 13 | for i in $SEARCH_PATH ; do 14 | if test -r $i/$SEARCH_FOR; then 15 | ZQF_DIR=$i 16 | AC_MSG_RESULT(found in $i) 17 | fi 18 | done 19 | fi 20 | 21 | if test -z "$ZQF_DIR"; then 22 | AC_MSG_RESULT([not found]) 23 | AC_MSG_ERROR([Please reinstall the qrencode wget http://fukuchi.org/works/qrencode/qrencode-3.4.4.tar.gz]) 24 | fi 25 | 26 | 27 | PHP_ADD_INCLUDE($ZQF_DIR/include) 28 | 29 | 30 | LIBNAME=qrencode 31 | LIBSYMBOL=QRcode_APIVersionString 32 | 33 | PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, 34 | [ 35 | PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $ZQF_DIR/$PHP_LIBDIR, ZQF_SHARED_LIBADD) 36 | PHP_ADD_LIBRARY_WITH_PATH(gd, $ZQF_DIR/$PHP_LIBDIR, ZQF_SHARED_LIBADD) 37 | AC_DEFINE(HAVE_ZQFLIB,1,[ ]) 38 | ],[ 39 | AC_MSG_ERROR([wrong qrencode lib version or lib not found]) 40 | ],[ 41 | -L$ZQF_DIR/$PHP_LIBDIR -lm 42 | ]) 43 | 44 | 45 | PHP_SUBST(ZQF_SHARED_LIBADD) 46 | 47 | PHP_NEW_EXTENSION(zqf, zqf.c, $ext_shared) 48 | fi 49 | if test -z "$PHP_DEBUG"; then 50 | AC_ARG_ENABLE(debug, 51 | [ --enable-debug compile with debugging symbols],[ 52 | PHP_DEBUG=$enableval 53 | ],[ PHP_DEBUG=no 54 | ]) 55 | fi 56 | -------------------------------------------------------------------------------- /config.w32: -------------------------------------------------------------------------------- 1 | // $Id$ 2 | // vim:ft=javascript 3 | 4 | // If your extension references something external, use ARG_WITH 5 | // ARG_WITH("zqf", "for zqf support", "no"); 6 | 7 | // Otherwise, use ARG_ENABLE 8 | // ARG_ENABLE("zqf", "enable zqf support", "no"); 9 | 10 | if (PHP_ZQF != "no") { 11 | EXTENSION("zqf", "zqf.c"); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /images/ali.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qieangel2013/zqf/9021999a494a8fb5adaaf64c027efa20672384da/images/ali.png -------------------------------------------------------------------------------- /php_zqf.h: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 5 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 1997-2015 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Author: zqf 904208360@qq.com | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | /* $Id$ */ 20 | 21 | #ifndef PHP_ZQF_H 22 | #define PHP_ZQF_H 23 | 24 | #define phpext_zqf_ptr &zqf_module_entry 25 | 26 | #define ZQF_VERSION "2.0.0" /* Replace with version number for your extension */ 27 | 28 | #ifdef PHP_WIN32 29 | # define PHP_ZQF_API __declspec(dllexport) 30 | #elif defined(__GNUC__) && __GNUC__ >= 4 31 | # define PHP_ZQF_API __attribute__ ((visibility("default"))) 32 | #else 33 | # define PHP_ZQF_API 34 | #endif 35 | 36 | #ifdef ZTS 37 | #include "TSRM.h" 38 | #endif 39 | #if PHP_MAJOR_VERSION <7 40 | static zval* zqf_get_datas(HashTable *ht){ 41 | zval **zqf_itemm; 42 | zend_hash_get_current_data(ht,(void**)&zqf_itemm); 43 | return zqf_itemm; 44 | } 45 | #else 46 | #define zqf_get_data zend_hash_get_current_data 47 | #endif 48 | /* 49 | Declare any global variables you may need between the BEGIN 50 | and END macros here: */ 51 | 52 | ZEND_BEGIN_MODULE_GLOBALS(zqf) 53 | /*HashTable *configs;*/ 54 | long counter,zqfflag,level,hint,casesensitive; 55 | ZEND_END_MODULE_GLOBALS(zqf) 56 | /* In every utility function you add that needs to use variables 57 | in php_zqf_globals, call TSRMLS_FETCH(); after declaring other 58 | variables used by that function, or better yet, pass in TSRMLS_CC 59 | after the last function argument and declare your utility function 60 | with TSRMLS_DC after the last declared argument. Always refer to 61 | the globals in your function as ZQF_G(variable). You are 62 | encouraged to rename these macros something shorter, see 63 | examples in any other php module directory. 64 | */ 65 | 66 | #ifdef ZTS 67 | #define ZQF_G(v) TSRMG(zqf_globals_id, zend_zqf_globals *, v) 68 | #else 69 | #define ZQF_G(v) (zqf_globals.v) 70 | #endif 71 | extern zend_module_entry zqf_module_entry; 72 | #define phpext_zqf_ptr &zqf_module_entry 73 | #endif /* PHP_ZQF_H */ 74 | 75 | 76 | /* 77 | * Local variables: 78 | * tab-width: 4 79 | * c-basic-offset: 4 80 | * End: 81 | * vim600: noet sw=4 ts=4 fdm=marker 82 | * vim<600: noet sw=4 ts=4 83 | */ 84 | -------------------------------------------------------------------------------- /travis/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | phpize && ./configure && make clean && make 3 | -------------------------------------------------------------------------------- /zqf.c: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 5 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 1997-2015 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Author: zqf 904208360@qq.com | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | /* $Id$ */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "php.h" 29 | #include "php_ini.h" 30 | #include "ext/standard/info.h" 31 | #include "php_zqf.h" 32 | #include 33 | #define ZQF_RES_NAME "zqf_resource" 34 | #define gdImageCreate gdImageCreate 35 | #define gdImagePng gdImagePng 36 | #define gdImageDestroy gdImageDestroy 37 | #define gdImageColorAllocate gdImageColorAllocate 38 | #define gdImageColorAllocateAlpha gdImageColorAllocateAlpha 39 | #define gdImageFill gdImageFill 40 | #define gdImageFilledRectangle gdImageFilledRectangle 41 | #define gdImageCopyResampled gdImageCopyResampled 42 | #define gdImageCreateFromPng gdImageCreateFromPng 43 | #define gdImageTrueColorToPalette gdImageTrueColorToPalette 44 | #define INT_MAX 2147483647 45 | #define E_MAX 255 46 | /* If you declare any globals in php_zqf.h uncomment this: 47 | ZEND_DECLARE_MODULE_GLOBALS(zqf) 48 | */ 49 | ZEND_DECLARE_MODULE_GLOBALS(zqf) 50 | /* True global resources - no need for thread safety here */ 51 | static int le_zqf; 52 | zend_class_entry *zqf_ce; 53 | typedef struct _qrencode { 54 | QRcode *code; 55 | }qrencode; 56 | ZEND_BEGIN_ARG_INFO_EX(zqf_autoadd_arginfo, 0, 0, 1) 57 | ZEND_ARG_INFO(0,zqfjishu) 58 | ZEND_ARG_INFO(0,zqfsort) 59 | ZEND_ARG_INFO(0,is_zqfsets) 60 | ZEND_END_ARG_INFO() 61 | ZEND_BEGIN_ARG_INFO_EX(zqf_savefile_arginfo, 0, 0, 1) 62 | ZEND_ARG_INFO(0, str) 63 | ZEND_ARG_INFO(0, path) 64 | ZEND_ARG_INFO(0, size) 65 | ZEND_ARG_INFO(0, is_tr) 66 | ZEND_ARG_INFO(0, logopath) 67 | ZEND_ARG_INFO(0, level) 68 | ZEND_ARG_INFO(0, hint) 69 | ZEND_ARG_INFO(0, red) 70 | ZEND_ARG_INFO(0, green) 71 | ZEND_ARG_INFO(0, blue) 72 | ZEND_END_ARG_INFO() 73 | ZEND_BEGIN_ARG_INFO_EX(zqf_findrepetition_arginfo, 0, 0, 1) 74 | ZEND_ARG_INFO(0,zqf_arr) 75 | ZEND_END_ARG_INFO() 76 | ZEND_BEGIN_ARG_INFO_EX(zqf_findval_arginfo, 0, 0, 1) 77 | ZEND_ARG_INFO(0,zqfarr) 78 | ZEND_ARG_INFO(0,zqfval) 79 | ZEND_END_ARG_INFO() 80 | ZEND_BEGIN_ARG_INFO_EX(zqf_hongbao_arginfo, 0, 0, 1) 81 | ZEND_ARG_INFO(0,zqfmoney) 82 | ZEND_ARG_INFO(0,zqfcount) 83 | ZEND_ARG_INFO(0,zqftype) 84 | ZEND_END_ARG_INFO() 85 | ZEND_BEGIN_ARG_INFO_EX(zqf_quicksort_arginfo, 0, 0, 1) 86 | ZEND_ARG_INFO(0,zqf_arr) 87 | ZEND_END_ARG_INFO() 88 | 89 | static void php_zqf_init_globals(zend_zqf_globals *zqf_globals) 90 | { 91 | zqf_globals->zqfflag = 0; 92 | } 93 | /*static void qrencode_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { 94 | qrencode *q = (qrencode *)rsrc->ptr; 95 | if (q->code != NULL) { 96 | //QRcode_free(q->code); 97 | q->code = NULL; 98 | } 99 | efree(q); 100 | } 101 | /* }}} */ 102 | 103 | /** {{{ PHP_INI 104 | */ 105 | /*PHP_INI_BEGIN() 106 | STD_PHP_INI_ENTRY("zqfbase","0", PHP_INI_ALL, OnUpdateLong, zqfbase, zend_zqf_globals, zqf_globals) 107 | STD_PHP_INI_ENTRY("zqftype","0", PHP_INI_ALL, OnUpdateLong, zqftype, zend_zqf_globals, zqf_globals) 108 | PHP_INI_END();*/ 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | /* {{{ PHP_INI 117 | */ 118 | /* Remove comments and fill if you need to have entries in php.ini 119 | PHP_INI_BEGIN() 120 | STD_PHP_INI_ENTRY("zqf.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_zqf_globals, zqf_globals) 121 | STD_PHP_INI_ENTRY("zqf.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_zqf_globals, zqf_globals) 122 | PHP_INI_END() 123 | */ 124 | /* }}} */ 125 | 126 | /* Remove the following function when you have successfully modified config.m4 127 | so that your module can be compiled into PHP, it exists only for testing 128 | purposes. */ 129 | 130 | /* Every user-visible function in PHP should document itself in the source */ 131 | /* {{{ proto string confirm_zqf_compiled(string arg) 132 | Return a string to confirm that the module is compiled in */ 133 | /* }}} */ 134 | /* The previous line is meant for vim and emacs, so it can correctly fold and 135 | unfold functions in source code. See the corresponding marks just before 136 | function definition, where the functions purpose is also documented. Please 137 | follow this convention for the convenience of others editing your code. 138 | */ 139 | 140 | 141 | /* {{{ php_zqf_init_globals 142 | */ 143 | /* Uncomment this function if you have INI entries 144 | static void php_zqf_init_globals(zend_zqf_globals *zqf_globals) 145 | { 146 | zqf_globals->global_value = 0; 147 | zqf_globals->global_string = NULL; 148 | } 149 | */ 150 | /* }}} */ 151 | 152 | /* {{{ PHP_MINIT_FUNCTION 153 | */ 154 | 155 | int my_rand(int min, int max) 156 | { 157 | static int _seed = 0; 158 | assert(max > min); 159 | 160 | if (_seed == 0) 161 | { 162 | _seed = time(NULL); 163 | srand(_seed); 164 | } 165 | int _rand = rand(); 166 | _rand = min + (int) ((double) ((double) (max) - (min) + 1.0) * ((_rand) / ((RAND_MAX) + 1.0))); 167 | return _rand; 168 | } 169 | /* }}} */ 170 | 171 | /* {{{ PHP_MINFO_FUNCTION 172 | */ 173 | /*红包简单算法*/ 174 | PHP_METHOD(zqf,hongbao) 175 | { 176 | zval *zqfmoney; 177 | double moneyss; 178 | long zqfcount; 179 | long zqftype=0; 180 | const double min=0.01; 181 | double safe_total; 182 | double moneys; 183 | int i; 184 | char buf[10]; 185 | char* pEnd; 186 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|l", &zqfmoney,&zqfcount,&zqftype) == FAILURE) { 187 | php_error_docref(NULL TSRMLS_CC, E_WARNING, "参数不正确!!!"); 188 | RETURN_FALSE; 189 | } 190 | switch(Z_TYPE_P(zqfmoney)){ 191 | case IS_LONG: 192 | moneyss=(double)Z_LVAL_P(zqfmoney); 193 | break; 194 | case IS_DOUBLE: 195 | moneyss=((int)Z_DVAL_P(zqfmoney)*100)/100.0; 196 | break; 197 | default: 198 | php_error_docref(NULL TSRMLS_CC, E_WARNING, "参数不正确!!!"); 199 | RETURN_FALSE; 200 | break; 201 | } 202 | array_init(return_value); 203 | if(zqftype){ 204 | moneys=((int)(moneyss*100/zqfcount))/100.0; 205 | for (i = 0; i < zqfcount; ++i) 206 | { 207 | sprintf(buf, "%.2f", moneys); 208 | sscanf(buf, "%f", &moneys); 209 | #if PHP_MAJOR_VERSION <7 210 | add_index_string(return_value,i,buf,1); 211 | #else 212 | add_index_string(return_value,i,buf); 213 | #endif 214 | moneys=strtof(buf, &pEnd); 215 | memset(buf,0,sizeof(buf)); 216 | } 217 | }else{ 218 | for (i = 1; i < zqfcount; ++i) 219 | { 220 | safe_total=(moneyss-(zqfcount-i)*min)/(zqfcount-i); 221 | moneys=my_rand((int)(min*100),(int)(safe_total*100))/100.0; 222 | moneyss -=moneys; 223 | sprintf(buf, "%.2f", moneys); 224 | sscanf(buf, "%f", &moneys); 225 | #if PHP_MAJOR_VERSION <7 226 | add_index_string(return_value,i-1,buf,1); 227 | #else 228 | add_index_string(return_value,i-1,buf); 229 | #endif 230 | moneys=strtof(buf, &pEnd); 231 | memset(buf,0,sizeof(buf)); 232 | } 233 | sprintf(buf, "%.2f", moneyss); 234 | sscanf(buf, "%f", &moneyss); 235 | #if PHP_MAJOR_VERSION <7 236 | add_index_string(return_value,zqfcount-1,buf,1); 237 | #else 238 | add_index_string(return_value,zqfcount-1,buf); 239 | #endif 240 | memset(buf,0,sizeof(buf)); 241 | } 242 | /*efree(zqfmoney);*/ 243 | } 244 | 245 | void quiksort(int a[],int low,int high) 246 | { 247 | int i = low; 248 | int j = high; 249 | int temp = a[i]; 250 | if( low < high) 251 | { 252 | while(i < j) 253 | { 254 | while((a[j] >= temp) && (i < j)) 255 | { 256 | j--; 257 | } 258 | a[i] = a[j]; 259 | while((a[i] <= temp) && (i < j)) 260 | { 261 | i++; 262 | } 263 | a[j]= a[i]; 264 | } 265 | a[i] = temp; 266 | quiksort(a,low,i-1); 267 | quiksort(a,j+1,high); 268 | } 269 | else 270 | { 271 | return; 272 | } 273 | } 274 | 275 | /*快速排序算法*/ 276 | PHP_METHOD(zqf,quicksort) 277 | { 278 | 279 | zval *zqf_arr; 280 | int zqf_arr_count; 281 | HashTable *zqf_arr_hash; 282 | zval **zqf_item; 283 | zval *zqf_items; 284 | ulong i,idx; 285 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &zqf_arr) == FAILURE) { 286 | RETURN_NULL(); 287 | } 288 | zqf_arr_hash = Z_ARRVAL_P(zqf_arr); 289 | zqf_arr_count = zend_hash_num_elements(zqf_arr_hash); 290 | int data[zqf_arr_count]; 291 | #if PHP_MAJOR_VERSION <7 292 | zend_hash_internal_pointer_reset(zqf_arr_hash); 293 | for (i = 0; i < zqf_arr_count; ++i) 294 | { 295 | zqf_item=zqf_get_data(zqf_arr_hash); 296 | data[i]=(int)Z_STRVAL_PP(zqf_item); 297 | zend_hash_move_forward(zqf_arr_hash); 298 | } 299 | #else 300 | ZEND_HASH_FOREACH_KEY_VAL(zqf_arr_hash,idx,i,zqf_items) 301 | { if(Z_TYPE_P(zqf_items) == IS_LONG) { 302 | data[idx]=Z_LVAL_P(zqf_items); 303 | } 304 | } ZEND_HASH_FOREACH_END(); 305 | #endif 306 | quiksort(data,0,zqf_arr_count-1); 307 | array_init(return_value); 308 | for (i = 0; i < zqf_arr_count; ++i) 309 | { 310 | add_index_long(return_value,i,data[i]); 311 | } 312 | /*efree(zqf_arr);*/ 313 | } 314 | static int getzqfv(long val,int arr[],int len){ 315 | int low; 316 | int high; 317 | int mid; 318 | low=0; 319 | high=(int)(len-1); 320 | while(low<=high){ 321 | mid=(int)((low+high)/2); 322 | if(arr[mid]val){ 325 | high=(int)(mid-1); 326 | }else{ 327 | return mid; 328 | } 329 | } 330 | return -1; 331 | } 332 | 333 | 334 | /*二分法查找一维数组一个数*/ 335 | PHP_METHOD(zqf,findval) 336 | { 337 | zval *zqfarr; 338 | long zqfval; 339 | int zqf_arr_count; 340 | HashTable *zqf_arr_hash; 341 | zval **zqf_item; 342 | zval *zqf_items; 343 | char* key; 344 | ulong idx; 345 | int rmid,i,j,tmp; 346 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al", &zqfarr,&zqfval) == FAILURE) { 347 | RETURN_NULL(); 348 | } 349 | zqf_arr_hash = Z_ARRVAL_P(zqfarr); 350 | zqf_arr_count = zend_hash_num_elements(zqf_arr_hash); 351 | int data[zqf_arr_count]; 352 | #if PHP_MAJOR_VERSION <7 353 | zend_hash_internal_pointer_reset(zqf_arr_hash); 354 | for (i = 0; i < zqf_arr_count; ++i) 355 | { 356 | zqf_item=zqf_get_data(zqf_arr_hash); 357 | data[i]=(int)Z_STRVAL_PP(zqf_item); 358 | zend_hash_move_forward(zqf_arr_hash); 359 | } 360 | #else 361 | ZEND_HASH_FOREACH_KEY_VAL(zqf_arr_hash,idx,i,zqf_items) 362 | { if(Z_TYPE_P(zqf_items) == IS_LONG) { 363 | data[idx]=Z_LVAL_P(zqf_items); 364 | } 365 | } ZEND_HASH_FOREACH_END(); 366 | #endif 367 | for (i = 0; i < zqf_arr_count; ++i) 368 | { 369 | for (j = 0; j < zqf_arr_count; ++j) 370 | { 371 | if(data[i]width; 442 | code_size = (code_size == 0) ? 1 : code_size; 443 | int img_width = code->width * code_size + 2 * margin; 444 | gdImagePtr img = gdImageCreate (img_width,img_width); 445 | int img_bgcolor; 446 | if(is_tr){ 447 | img_bgcolor = gdImageColorAllocateAlpha(img,0,0,0,gdAlphaTransparent); 448 | }else{ 449 | img_bgcolor = gdImageColorAllocate(img,bg_color[0],bg_color[1],bg_color[2]); 450 | } 451 | int img_fgcolor = gdImageColorAllocate(img,fg_color[0],fg_color[1],fg_color[2]); 452 | gdImageFill(img,0,0,img_bgcolor); 453 | unsigned char *p = code->data; 454 | int x,y ,posx,posy; 455 | for (y = 0 ; y < code->width ; y++) 456 | { 457 | for (x = 0 ; x < code->width ; x++) 458 | { 459 | if (*p & 1) 460 | { 461 | posx = x * code_size + margin; 462 | posy = y * code_size + margin; 463 | gdImageFilledRectangle(img,posx,posy,posx + code_size,posy + code_size,img_fgcolor); 464 | } 465 | p++; 466 | } 467 | } 468 | if(logopath_len>0){ 469 | FILE * logoinput = fopen(logopath,"rb"); 470 | if (logoinput == NULL){ 471 | php_error_docref (NULL TSRMLS_CC, E_WARNING, "can not open the file"); 472 | return ; 473 | } 474 | gdImagePtr logoimg = gdImageCreateFromPng(logoinput); 475 | gdImageTrueColorToPalette(logoimg,0,65535); 476 | rewind(logoinput); 477 | int place = 0,index = 0,i; 478 | char data; 479 | int size[8]; 480 | while(place<=24) 481 | { 482 | place++; 483 | data = fgetc(logoinput); 484 | if(place>16){ 485 | size[index] =(int) data; 486 | index++; 487 | } 488 | } 489 | for(i=0;i<4;i++) if(size[i]<0) size[i] = (size[i]&INT_MAX)&E_MAX; 490 | int logo_width = 256*size[2]+size[3]; 491 | int logo_height = 256*size[6]+size[7]; 492 | int tmpwidth=img_width/5; 493 | int scale = logo_width/tmpwidth; 494 | gdImageCopyResampled(img,logoimg,(img_width-tmpwidth)/2,(img_width-tmpwidth)/2,0,0,tmpwidth,logo_height/scale,logo_width,logo_height); 495 | fclose(logoinput); 496 | } 497 | return img; 498 | } 499 | 500 | 501 | 502 | PHP_METHOD(zqf,savefile) 503 | { 504 | char *str; 505 | int str_len; 506 | qrencode *qe; 507 | 508 | long level = 2; 509 | long hint = 0; 510 | char *path; 511 | int path_len; 512 | char *logopath; 513 | int logopath_len; 514 | long is_tr = 0; 515 | int int_bg_color[3] = {255,255,255} ; 516 | 517 | int size = 100; 518 | int margin = 2; 519 | 520 | int red = 0; 521 | int green = 0; 522 | int blue = 0; 523 | int version = 3; 524 | int casesensitive = 1; 525 | gdImagePtr im; 526 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl|lslllll", &str,&str_len,&path, &path_len,&size,&is_tr,&logopath, &logopath_len,&level, &hint,&red, &green, &blue) == FAILURE) { 527 | php_error_docref(NULL TSRMLS_CC, E_WARNING, "参数不正确!!!"); 528 | RETURN_FALSE; 529 | } 530 | QRecLevel q_level = (int)ZQF_G(level); 531 | //QRencodeMode q_hint = (int)ZQF_G(hint); 532 | QRencodeMode q_hint = QR_MODE_8; 533 | if (level >= 0 && level <= 3) { 534 | q_level = level; 535 | }else{ 536 | q_level = 2; 537 | } 538 | 539 | if (hint){ 540 | q_hint = hint; 541 | }else{ 542 | q_hint = QR_MODE_8; 543 | } 544 | if (red<0 || red>255) { 545 | red = 0; 546 | } 547 | if (green<0 || green>255) { 548 | green = 0; 549 | } 550 | if (blue<0 || blue>255) { 551 | blue = 0; 552 | } 553 | if(is_tr){ 554 | }else{ 555 | is_tr=0; 556 | } 557 | int int_fg_color [3] = {red,green,blue}; 558 | QRcode *code = QRcode_encodeString(str, version, q_level, q_hint, casesensitive); 559 | if (code == NULL) { 560 | php_error_docref(NULL TSRMLS_CC, E_WARNING, "字符串编码错误!!!"); 561 | RETURN_FALSE; 562 | } 563 | 564 | qe = emalloc(sizeof(qrencode)); 565 | qe->code = code; 566 | FILE * out = fopen(path,"w+"); 567 | if (out == NULL){ 568 | php_error_docref (NULL TSRMLS_CC, E_WARNING, "can not open the file"); 569 | RETURN_FALSE; 570 | } 571 | im = qrcode_png(qe->code,int_fg_color,int_bg_color,size,margin,is_tr,logopath,logopath_len); 572 | gdImagePng(im,out); 573 | QRcode_free(qe->code); 574 | qe->code = NULL; 575 | gdImageDestroy(im); 576 | fclose(out); 577 | 578 | /*ZEND_REGISTER_RESOURCE(res,fp,zqf_resource_descriptor); 579 | fwrite(Z_STRVAL_P(zqfbasestatic), 1,Z_STRLEN_P(zqfbasestatic),fp); 580 | /*fprintf(fp,"%ld\n",Z_LVAL_P(zqfbasestatic)); 581 | fclose(fp); */ 582 | /*zend_hash_index_del(&EG(regular_list),res);*/ 583 | RETURN_TRUE; 584 | 585 | 586 | /*zval *zqfbasee; 587 | /*if (zend_hash_find(ZQF_G(configs),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS) { */ 588 | /*if(zend_hash_find(&EG(symbol_table),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS) { 589 | convert_to_long(zqfbasee); 590 | /*RETURN_LONG(Z_LVAL_P(zqfbasee)); 591 | /*php_printf(estrndup(Z_STRVAL_P(zqfbasee),Z_STRLEN_P(zqfbasee))); 592 | /*convert_to_long(zqfbasee); */ 593 | /*convert_to_string(zqfbasee);*/ 594 | /*zend_update_property(Z_OBJCE_P(getThis()), getThis(),ZEND_STRL("zqfbase"),zqfbasee TSRMLS_CC); 595 | /*php_printf("%ld",Z_LVAL_P(zqfbasee)); 596 | /*zend_update_property(Z_OBJCE_P(getThis()), getThis(),"zqfbasestatic",sizeof("zqfbasestatic")-1,zqfbases TSRMLS_CC); */ 597 | /*} 598 | efree(zqfbasee);*/ 599 | 600 | } 601 | 602 | PHP_METHOD(zqf,autoadd) 603 | { 604 | long *zqfjishu=NULL;/*代表基数默认为0*/ 605 | long *zqfsort=NULL;/*0代表递减 1代表递增*/ 606 | long *is_zqfsets=NULL;/*代表是否设置基数0代表不设置 1代表设置*/ 607 | zval *zqflong; 608 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &zqfjishu,&zqfsort,&is_zqfsets) == FAILURE) { 609 | RETURN_NULL(); 610 | } 611 | if(is_zqfsets){ 612 | if(ZQF_G(zqfflag)){ 613 | }else{ 614 | ZQF_G(counter)=zqfjishu; 615 | ZQF_G(zqfflag)=1; 616 | } 617 | }else{ 618 | ZQF_G(zqfflag)=0; 619 | } 620 | 621 | if(zqfsort){ 622 | ZQF_G(counter)++; 623 | }else{ 624 | ZQF_G(counter)--; 625 | } 626 | /*MAKE_STD_ZVAL(zqflong); 627 | ZVAL_LONG(zqflong,ZQF_G(counter)); 628 | zend_update_property(Z_OBJCE_P(getThis()), getThis(),ZEND_STRL("zqfbasestatic"),zqflong TSRMLS_CC);*/ 629 | RETURN_LONG(ZQF_G(counter)); 630 | /*zval *zqfbase; 631 | zval *zqfbasestatic; 632 | zval *zqfbaseS; 633 | zval *zqfbasee; 634 | long basezqf; 635 | long basezqfstatic; 636 | zqfbase = zend_read_property(Z_OBJCE_P(getThis()), getThis(), ZEND_STRL("zqfbase"),0 TSRMLS_DC); 637 | /*convert_to_long(zqfbase);*/ 638 | /*basezqf=Z_LVAL_P(zqfbase); 639 | php_printf("%ld",Z_LVAL_P(zqfbase)); 640 | php_printf("%s","\n"); 641 | zqfbasestatic = zend_read_static_property(Z_OBJCE_P(getThis()),ZEND_STRL("zqfbasestatic"),0 TSRMLS_DC); 642 | /*convert_to_long(zqfbasestatic);*/ 643 | /*basezqfstatic=Z_LVAL_P(zqfbasestatic); 644 | ++basezqfstatic; 645 | ++basezqf; 646 | MAKE_STD_ZVAL(zqfbaseS); 647 | ZVAL_LONG(zqfbaseS,basezqf); 648 | php_printf("%ld",basezqf); 649 | php_printf("%s","\n"); 650 | zend_update_property(Z_OBJCE_P(getThis()), getThis(),ZEND_STRL("zqfbase"),zqfbaseS TSRMLS_CC); 651 | /*zend_update_property(Z_OBJCE_P(getThis()), getThis(),ZEND_STRL("zqfbasestatic"),zqfbaseS TSRMLS_CC); */ 652 | /*if(zend_hash_update(&EG(symbol_table), "zqfbase", sizeof("zqfbase"), (void*)&basezqf, sizeof(zval*), NULL)== SUCCESS){ 653 | /*if(zend_hash_update(ZQF_G(configs), "zqfbase", sizeof("zqfbase"), (void*)&basezqf, sizeof(zval*), NULL)== SUCCESS){*/ 654 | /*array_init(return_value); 655 | add_assoc_long(return_value,"zqfbase",basezqf); 656 | php_printf("%s","\n"); 657 | if(zend_hash_find(&EG(symbol_table),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS){ 658 | /*if (zend_hash_find(ZQF_G(configs),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS) { */ 659 | /*convert_to_long(zqfbasee); 660 | php_printf("%ld",Z_LVAL_P(zqfbasee)); 661 | }else{ 662 | php_printf("%s","读取失败\n"); 663 | } 664 | }else{ 665 | php_printf("%s","更新失败\n"); 666 | } 667 | 668 | /*add_assoc_long(return_value,"zqfbasestatic",basezqfstatic); 669 | /*efree(zqfbase);*/ 670 | /*efree(zqfbaseS); 671 | efree(zqfbasestatic); 672 | /*efree(zqfbasearr); 673 | RETURN_LONG(basezqf);*/ 674 | } 675 | 676 | PHP_METHOD(zqf,__construct) 677 | { 678 | /*zval *zqfbasee; 679 | /*if (zend_hash_find(ZQF_G(configs),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS) { */ 680 | /*if(zend_hash_find(&EG(symbol_table),"zqfbase",sizeof("zqfbase"), (void **)&zqfbasee) == SUCCESS) { 681 | convert_to_long(zqfbasee); 682 | /*RETURN_LONG(Z_LVAL_P(zqfbasee)); 683 | /*php_printf(estrndup(Z_STRVAL_P(zqfbasee),Z_STRLEN_P(zqfbasee))); 684 | /*convert_to_long(zqfbasee); */ 685 | /*convert_to_string(zqfbasee);*/ 686 | /*zend_update_property(Z_OBJCE_P(getThis()), getThis(),ZEND_STRL("zqfbase"),zqfbasee TSRMLS_CC); 687 | /*php_printf("%ld",Z_LVAL_P(zqfbasee)); 688 | /*zend_update_property(Z_OBJCE_P(getThis()), getThis(),"zqfbasestatic",sizeof("zqfbasestatic")-1,zqfbases TSRMLS_CC); */ 689 | /*} 690 | efree(zqfbasee);*/ 691 | 692 | } 693 | 694 | static zend_function_entry zqf_method[] = { 695 | PHP_ME(zqf,quicksort,zqf_quicksort_arginfo,ZEND_ACC_PUBLIC) 696 | PHP_ME(zqf,hongbao,zqf_hongbao_arginfo,ZEND_ACC_PUBLIC) 697 | PHP_ME(zqf,findval,zqf_findval_arginfo,ZEND_ACC_PUBLIC) 698 | PHP_ME(zqf,findrepetition,zqf_findrepetition_arginfo,ZEND_ACC_PUBLIC) 699 | PHP_ME(zqf,savefile,zqf_savefile_arginfo,ZEND_ACC_PUBLIC) 700 | PHP_ME(zqf,autoadd,zqf_autoadd_arginfo,ZEND_ACC_PUBLIC) 701 | PHP_ME(zqf,__construct,NULL,ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) 702 | { NULL, NULL, NULL } 703 | }; 704 | PHP_MINIT_FUNCTION(zqf) 705 | { 706 | /* If you have INI entries, uncomment these lines 707 | REGISTER_INI_ENTRIES(); 708 | */ 709 | zend_class_entry ce; 710 | INIT_CLASS_ENTRY(ce,"zqf",zqf_method); 711 | zqf_ce=zend_register_internal_class(&ce TSRMLS_CC); 712 | zend_declare_property_long(zqf_ce, ZEND_STRL("zqfbase"),0,ZEND_ACC_PUBLIC TSRMLS_CC); 713 | zend_declare_property_long(zqf_ce, ZEND_STRL("zqfbasestatic"),0,ZEND_ACC_STATIC TSRMLS_CC); 714 | /*REGISTER_LONG_CONSTANT("QRENCODE_QRECLEVEL_L", QR_ECLEVEL_L, CONST_CS|CONST_PERSISTENT); 715 | REGISTER_LONG_CONSTANT("QRENCODE_QRECLEVEL_M", QR_ECLEVEL_M, CONST_CS|CONST_PERSISTENT); 716 | REGISTER_LONG_CONSTANT("QRENCODE_QRECLEVEL_Q", QR_ECLEVEL_Q, CONST_CS|CONST_PERSISTENT); 717 | REGISTER_LONG_CONSTANT("QRENCODE_QRECLEVEL_H", QR_ECLEVEL_H, CONST_CS|CONST_PERSISTENT); 718 | 719 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_NUL", QR_MODE_NUL, CONST_CS|CONST_PERSISTENT); 720 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_NUM", QR_MODE_NUM, CONST_CS|CONST_PERSISTENT); 721 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_AN", QR_MODE_AN, CONST_CS|CONST_PERSISTENT); 722 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_8", QR_MODE_8, CONST_CS|CONST_PERSISTENT); 723 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_KANJI", QR_MODE_KANJI, CONST_CS|CONST_PERSISTENT); 724 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_STRUCTURE", QR_MODE_STRUCTURE, CONST_CS|CONST_PERSISTENT); 725 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_ECI", QR_MODE_ECI, CONST_CS|CONST_PERSISTENT); 726 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_FNC1FIRST", QR_MODE_FNC1FIRST, CONST_CS|CONST_PERSISTENT); 727 | REGISTER_LONG_CONSTANT("QRENCODE_MODE_FNC1SECOND", QR_MODE_FNC1SECOND, CONST_CS|CONST_PERSISTENT); 728 | 729 | //zqf_resource_descriptor=zend_register_list_destructors_ex(qrencode_dtor, NULL, ZQF_RES_NAME, module_number); 730 | /*zend_declare_property_null(zqf_ce, "zqftype", sizeof("zqftype"), ZEND_ACC_PUBLIC TSRMLS_CC);*/ 731 | /*if (!ZQF_G(configs)) { 732 | ZQF_G(configs) = (HashTable *)pemalloc(sizeof(HashTable), 1); 733 | zend_hash_init(ZQF_G(configs), 8, NULL, NULL, 1); 734 | } 735 | zval *zqflong; 736 | MAKE_STD_ZVAL(zqflong); 737 | ZVAL_LONG(zqflong,0); 738 | convert_to_string(zqflong); 739 | zend_hash_add(&EG(symbol_table), "zqfbase", sizeof("zqfbase"), (void**)&zqflong, sizeof(zval*), NULL); 740 | /*zend_hash_add(ZQF_G(configs), "zqfbase", sizeof("zqfbase"), (void**)&zqflong, sizeof(zval*), NULL); 741 | /*zend_hash_add(ZQF_G(configs), "zqftype", sizeof("zqftype"), (void**)&ZQF_G(zqftype), sizeof(zval*), NULL);*/ 742 | ZEND_INIT_MODULE_GLOBALS(zqf,php_zqf_init_globals,NULL); 743 | /*efree(zqflong);*/ 744 | return SUCCESS; 745 | } 746 | /* }}} */ 747 | 748 | /* {{{ PHP_MSHUTDOWN_FUNCTION 749 | */ 750 | PHP_MSHUTDOWN_FUNCTION(zqf) 751 | { 752 | /* uncomment this line if you have INI entries 753 | UNREGISTER_INI_ENTRIES(); 754 | */ 755 | /*if (ZQF_G(configs)) { 756 | zend_hash_destroy(ZQF_G(configs)); 757 | pefree(ZQF_G(configs), 1); 758 | }*/ 759 | return SUCCESS; 760 | } 761 | /* }}} */ 762 | 763 | /* Remove if there's nothing to do at request start */ 764 | /* {{{ PHP_RINIT_FUNCTION 765 | */ 766 | PHP_RINIT_FUNCTION(zqf) 767 | { 768 | return SUCCESS; 769 | } 770 | /* }}} */ 771 | 772 | /* Remove if there's nothing to do at request end */ 773 | /* {{{ PHP_RSHUTDOWN_FUNCTION 774 | */ 775 | PHP_RSHUTDOWN_FUNCTION(zqf) 776 | { 777 | return SUCCESS; 778 | } 779 | 780 | PHP_MINFO_FUNCTION(zqf) 781 | { 782 | php_info_print_table_start(); 783 | php_info_print_table_header(2, "zqf support", "enabled"); 784 | php_info_print_table_row(2, "version", "2.0.1"); 785 | php_info_print_table_row(2, "Author", "qieangel2013"); 786 | php_info_print_table_row(2, "adress", "904208360@qq.com"); 787 | php_info_print_table_end(); 788 | /*DISPLAY_INI_ENTRIES();*/ 789 | /* Remove comments if you have entries in php.ini 790 | DISPLAY_INI_ENTRIES(); 791 | */ 792 | } 793 | /* }}} */ 794 | 795 | /* {{{ zqf_functions[] 796 | * 797 | * Every user visible function must have an entry in zqf_functions[]. 798 | */ 799 | /*const zend_function_entry zqf_functions[] = { 800 | PHP_FE(confirm_zqf_compiled, NULL) /* For testing, remove later. */ 801 | /*PHP_FE_END /* Must be the last line in zqf_functions[] */ 802 | /*}; 803 | /* }}} */ 804 | 805 | /* {{{ zqf_module_entry 806 | */ 807 | zend_module_entry zqf_module_entry = { 808 | STANDARD_MODULE_HEADER, 809 | "zqf", 810 | NULL, 811 | PHP_MINIT(zqf), 812 | PHP_MSHUTDOWN(zqf), 813 | PHP_RINIT(zqf), /* Replace with NULL if there's nothing to do at request start */ 814 | PHP_RSHUTDOWN(zqf), /* Replace with NULL if there's nothing to do at request end */ 815 | PHP_MINFO(zqf), 816 | ZQF_VERSION, 817 | STANDARD_MODULE_PROPERTIES 818 | }; 819 | /* }}} */ 820 | 821 | #ifdef COMPILE_DL_ZQF 822 | ZEND_GET_MODULE(zqf) 823 | #endif 824 | 825 | /* 826 | * Local variables: 827 | * tab-width: 4 828 | * c-basic-offset: 4 829 | * End: 830 | * vim600: noet sw=4 ts=4 fdm=marker 831 | * vim<600: noet sw=4 ts=4 832 | */ 833 | -------------------------------------------------------------------------------- /zqf.php: -------------------------------------------------------------------------------- 1 | 4 | --------------------------------------------------------------------------------