« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 4 of about 4 for frobnosticate (0.001 sec.)
Basic usage for LuaSandbox 11077
« 例 LuaSandbox » PHP Manual 例 Basic usage for LuaSandbox 検索 Basic usage for LuaSandbox Once you've compiled PHP with LuaSandbox support, you can begin using LuaSandbox to safely run user-provided Lua code. 例1 Execute some Lua code <?ph ... moryLimit ( 50 * 1024 * 1024 ); $sandbox -> setCPULimit ( 10 ); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ... ing callbacks into PHP and into Lua $luaCode = <<<EOF php.output( "Hello, world" ); return "Hi", function ( v ) return php.frobnosticate( v + 200 ) end EOF; list( $hi , $frob ) = $sandbox -> loadString ( $luaCode )-> call (); assert ( $frob -> call ( 4000 ) = ... (); assert ( ! $ok ); assert ( $message === 'Something is wrong' ); ?> 関連キーワード: LuaSandbox Lua sandbox php function frobnosticate return usage code call assert Execute new output string error LuaSandboxRuntimeError Something wrong luaCode ...
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
Basic usage for LuaSandbox 11077
« 例 LuaSandbox » PHP Manual 例 Basic usage for LuaSandbox 検索 Basic usage for LuaSandbox Once you've compiled PHP with LuaSandbox support, you can begin using LuaSandbox to safely run user-provided Lua code. 例1 Execute some Lua code <?ph ... moryLimit ( 50 * 1024 * 1024 ); $sandbox -> setCPULimit ( 10 ); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ... ing callbacks into PHP and into Lua $luaCode = <<<EOF php.output( "Hello, world" ); return "Hi", function ( v ) return php.frobnosticate( v + 200 ) end EOF; list( $hi , $frob ) = $sandbox -> loadString ( $luaCode )-> call (); assert ( $frob -> call ( 4000 ) = ... rror )' )-> call (); assert ( ! $ok ); assert ( $message === 'Something is wrong' ); ?> 関連キーワード: LuaSandbox sandbox frobnosticate return usage code call assert Execute output LuaSandboxRuntimeError Something wrong luaCode list frob loadString message O ...
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
Register a set of PHP functions as a Lua library 7526
« LuaSandbox::pauseUsageTimer LuaSandbox::setCPULimit » PHP Manual LuaSandbox Register a set of PHP functions as a Lua library 検索 LuaSandbox::registerLibrary (PECL luasandbox >= 1.0.0) LuaSandbox::registerLibrary — Register a set of PHP f ... <?php // create a new LuaSandbox $sandbox = new LuaSandbox (); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ... andboxFunction 関連キーワード: functions Lua LuaSandbox set library function Register registerLibrary new string call name frobnosticate libname array code return LuaSandboxFunction table callable ...
https://man.mtool.work/php/8.3/luasandbox.registerlibrary.html
Register a set of PHP functions as a Lua library 7249
« LuaSandbox::pauseUsageTimer LuaSandbox::setCPULimit » PHP Manual LuaSandbox Register a set of PHP functions as a Lua library 検索 LuaSandbox::registerLibrary (PECL luasandbox >= 1.0.0) LuaSandbox::registerLibrary — Register a set of PHP f ... <?php // create a new LuaSandbox $sandbox = new LuaSandbox (); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ... ) - Wrap a PHP callable in a LuaSandboxFunction 関連キーワード: functions LuaSandbox library Register registerLibrary call frobnosticate libname code return LuaSandboxFunction table callable sandbox environment pauseUsageTimer setCPULimit luasandbox Registers ...
https://man.mtool.work/php/8.3/luasandbox.registerlibrary.html
PREV 1 NEXT