On 24/09/18 22:45, Remi Collet wrote:
> Hi,
>
> Le 24/09/2018 à 07:15, Tim Starling a écrit :
>> I think it's about time we added LuaSandbox to PECL.
> The only minor I see is compatibility with lua 5.1 only
> Newer version doesn't seems to be supported.
>
> Which mean we can't be able to load both lua and luasandbox extension
> simultenaously, as lua works with recent version (5.2 and 5.3)

It works for me:

php > print Lua::LUA_VERSION;
Lua 5.2.4
php > $ls = new LuaSandbox;
php > var_dump($ls->getVersionInfo());
array(2) {
  ["LuaSandbox"]=>
  string(5) "3.0.1"
  ["Lua"]=>
  string(9) "Lua 5.1.5"
}

# lsof -c php | grep lua
php       32331 tstarling  mem       REG              253,1   203624 
4878828 /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0
php       32331 tstarling  mem       REG              253,1   133176 
4900596 /usr/lib/php/20170718/lua.so
php       32331 tstarling  mem       REG              253,1   183928 
4855544 /usr/lib/x86_64-linux-gnu/liblua5.1.so.0.0.0
php       32331 tstarling  mem       REG              253,1    81760 
4900588 /usr/lib/php/20170718/luasandbox.so

The dynamic linker doesn't have a single global namespace for symbols,
it is smarter than that. Maybe if you statically linked it to the PHP
binary then you would have trouble, but my understanding is that that
is not possible with PECL extensions.

We have no plans to switch to a later version of Lua at this time. You
can read more about this decision at
https://phabricator.wikimedia.org/T178146 .

-- Tim Starling

-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to