diff --git a/config.m4 b/config.m4 index 990b4bf..e762900 100644 --- a/config.m4 +++ b/config.m4 @@ -21,14 +21,14 @@ if test "$PHP_LUA" != "no"; then AC_MSG_ERROR(Please reinstall the lua distribution - lua.h should be in /include/) fi - LUA_LIB_NAME=liblua.a + LUA_LIB_NAME=liblua - if test -r $PHP_LUA/$PHP_LIBDIR/${LUA_LIB_NAME}; then + if test -r $PHP_LUA/$PHP_LIBDIR/${LUA_LIB_NAME}.${SHLIB_SUFFIX_NAME} -o -r $PHP_LUA/$PHP_LIBDIR/${LUA_LIB_NAME}.a; then LUA_LIB_DIR=$PHP_LUA/$PHP_LIBDIR else AC_MSG_CHECKING(for lua library in default path) - for i in /usr/lib /usr/lib64; do - if test -r $i/${LUA_LIB_NAME}; then + for i in /usr/$PHP_LIBDIR /usr/lib /usr/lib64; do + if test -r $i/${LUA_LIB_NAME}.${SHLIB_SUFFIX_NAME} -o -r $i/${LUA_LIB_NAME}.a; then LUA_LIB_DIR=$i AC_MSG_RESULT(found in $i) break diff --git a/lua.c b/lua.c index 2f6f3a9..9a0c18a 100644 --- a/lua.c +++ b/lua.c @@ -511,8 +511,8 @@ int php_lua_send_zval_to_lua(lua_State *L, zval *val TSRMLS_DC) { zend_hash_get_current_data(ht, (void **)&ppzval) == SUCCESS; zend_hash_move_forward(ht)) { char *key = NULL; - int len = 0; - long idx = 0; + uint len = 0; + ulong idx = 0; zval *zkey= NULL; switch(zend_hash_get_current_key_ex(ht, &key, &len, &idx, 0, NULL)) { @@ -892,7 +892,9 @@ PHP_MINIT_FUNCTION(lua) { REGISTER_LONG_CONSTANT("LUA_ERRRUN", LUA_ERRRUN, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LUA_ERRSYNTAX", LUA_ERRSYNTAX, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LUA_ERRMEM", LUA_ERRMEM, CONST_PERSISTENT | CONST_CS); +#ifdef LUA_ERRGCMM REGISTER_LONG_CONSTANT("LUA_ERRGCMM", LUA_ERRGCMM, CONST_PERSISTENT | CONST_CS); +#endif REGISTER_LONG_CONSTANT("LUA_ERRERR", LUA_ERRERR, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LUA_ERRFILE", LUA_ERRFILE, CONST_PERSISTENT | CONST_CS); diff --git a/package.xml b/package.xml index 6e90c83..33ddadc 100644 --- a/package.xml +++ b/package.xml @@ -1,68 +1,201 @@ - - - + + lua + pecl.php.net Embedded lua interpreter - "Lua is a powerful, fast, light-weight, embeddable scripting language." - This extension embeds the lua interpreter and offers an OO-API to lua variables and functions. - - - - johannes - Johannes Schlüter - johannes@php.net - lead - - - laruence - Xinchen Hui - laruence@php.net - lead - - - msaraujo - Marcelo Araujo - msaraujo@php.net - developer - - - - 1.1.0 - 2013-10-23 - PHP - beta - - Fixed #65097 (nApplyCount release missing) (emptyhua at gmail dot com) -- Trigger E_STRICT when pass an array with index '0' to lua instead of ignoring it -- added support for callable functions and closures as values returned injected into lua engine (harald at octris dot org) - - - - - + "Lua is a powerful, fast, light-weight, embeddable scripting language." + This extension embeds the lua interpreter and offers an OO-API to lua variables and functions. + + Johannes Schlüter + johannes + johannes@php.net + yes + + + Xinchen Hui + laruence + laruence@php.net + yes + + + Marcelo Araujo + msaraujo + msaraujo@php.net + yes + + 2013-10-23 + + + 1.1.0 + 1.1.0 + + + beta + beta + + PHP + + - Fixed #65097 (nApplyCount release missing) (emptyhua at gmail dot com) + - Trigger E_STRICT when pass an array with index '0' to lua instead of ignoring it + - added support for callable functions and closures as values returned injected into lua engine (harald at octris dot org) + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + 5.1.0 + + + 1.4.0 + + + + lua + + + + 2012-10-23 + + 1.1.0 + 1.1.0 + + + beta + beta + + PHP License + + - Fixed #65097 (nApplyCount release missing) (emptyhua at gmail dot com) + - Trigger E_STRICT when pass an array with index '0' to lua instead of ignoring it + - added support for callable functions and closures as values returned injected into lua engine (harald at octris dot org) + + + + + 2012-06-24 + + 1.0.0 + 1.0.0 + + + stable + stable + + PHP License + + - Release stable version + + + + 2012-03-19 + + 0.9.4 + 0.9.4 + + + beta + beta + + PHP License + + - Compatible with lua 5.2 + + + + 2012-01-12 + + 0.9.3 + 0.9.3 + + + beta + beta + + PHP License + + - Fix build on windows + - Fix build when building lua with static + + + + 2012-01-06 + + 0.9.2 + 0.9.2 + + + beta + beta + + PHP License + + - Fixed bug #60641 PECL install lua with lua5.1 packages + + + + 2011-11-24 + + 0.9.1 + 0.9.1 + + + beta + beta + + PHP License + + - Compatible with PHP5.3+ + - Fix ZTS build + - Fix mem leak when get value from lua + + + + 2011-08-03 + + 0.9.0 + 0.9.0 + + + beta + beta + + PHP License + + - Merge Plua into Lua + - Api changes + - Add supporting for LUA_TFUNCTION + + + + + diff --git a/package2.xml b/package2.xml deleted file mode 100644 index 426cd75..0000000 --- a/package2.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - lua - pecl.php.net - Embedded lua interpreter - "Lua is a powerful, fast, light-weight, embeddable scripting language." - This extension embeds the lua interpreter and offers an OO-API to lua variables and functions. - - Johannes Schlüter - johannes - johannes@php.net - yes - - - Xinchen Hui - laruence - laruence@php.net - yes - - - Marcelo Araujo - msaraujo - msaraujo@php.net - yes - - 2013-10-23 - - - 1.1.0 - 1.1.0 - - - beta - beta - - PHP - - - Fixed #65097 (nApplyCount release missing) (emptyhua at gmail dot com) - - Trigger E_STRICT when pass an array with index '0' to lua instead of ignoring it - - added support for callable functions and closures as values returned injected into lua engine (harald at octris dot org) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.1.0 - - - 1.4.0 - - - - lua - - - - 2012-10-23 - - 1.1.0 - 1.1.0 - - - beta - beta - - PHP License - - - Fixed #65097 (nApplyCount release missing) (emptyhua at gmail dot com) - - Trigger E_STRICT when pass an array with index '0' to lua instead of ignoring it - - added support for callable functions and closures as values returned injected into lua engine (harald at octris dot org) - - - - - 2012-06-24 - - 1.0.0 - 1.0.0 - - - stable - stable - - PHP License - - - Release stable version - - - - 2012-03-19 - - 0.9.4 - 0.9.4 - - - beta - beta - - PHP License - - - Compatible with lua 5.2 - - - - 2012-01-12 - - 0.9.3 - 0.9.3 - - - beta - beta - - PHP License - - - Fix build on windows - - Fix build when building lua with static - - - - 2012-01-06 - - 0.9.2 - 0.9.2 - - - beta - beta - - PHP License - - - Fixed bug #60641 PECL install lua with lua5.1 packages - - - - 2011-11-24 - - 0.9.1 - 0.9.1 - - - beta - beta - - PHP License - - - Compatible with PHP5.3+ - - Fix ZTS build - - Fix mem leak when get value from lua - - - - 2011-08-03 - - 0.9.0 - 0.9.0 - - - beta - beta - - PHP License - - - Merge Plua into Lua - - Api changes - - Add supporting for LUA_TFUNCTION - - - - - diff --git a/php_lua.h b/php_lua.h index 8290694..0370014 100644 --- a/php_lua.h +++ b/php_lua.h @@ -24,6 +24,11 @@ #include "lauxlib.h" #include "lualib.h" +/* LUA_OK is defined sinc 5.2 */ +#ifndef LUA_OK +#define LUA_OK 0 +#endif + extern zend_module_entry lua_module_entry; #define phpext_lua_ptr &lua_module_entry diff --git a/tests/001.phpt b/tests/001.phpt index 89e89b4..6b9abc2 100644 --- a/tests/001.phpt +++ b/tests/001.phpt @@ -18,4 +18,4 @@ try { --EXPECTF-- 12 -0.53657291800043 -[string "line"]:1: syntax error near 'code' +[string "line"]:1: %s near 'code' diff --git a/tests/006.phpt b/tests/006.phpt index fde0aec..4b22ad8 100644 --- a/tests/006.phpt +++ b/tests/006.phpt @@ -32,7 +32,7 @@ Testing fine Hello PHP Testing broken -%s:%d: syntax error near 'fdrg' +%s:%d: %s near 'fdrg' Testing return Array ( diff --git a/tests/bug65097.phpt b/tests/bug65097.phpt index f072d31..48faa6b 100644 --- a/tests/bug65097.phpt +++ b/tests/bug65097.phpt @@ -1,7 +1,10 @@ --TEST-- Bug #65097 (nApplyCount release missing) --SKIPIF-- - + --INI-- error_reporting=E_ALL&~E_STRICT --FILE--