Results of 1 - 7 of about 7 for registerLibrary (0.001 sec.)
- LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library ... 13377
- LuaSandbox::registerLibrary (PECL luasandbox >= 1.0.0) LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library 説明 public function LuaSandbox::registerLibrary ( string $libname , array $functions ): void Registers a
... ox (); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => function ( $string ) { echo " $string \n" ; }, 'error' => fun ...
-
https://man.mtool.work/php/8.3/luasandbox.registerlibrary.html
- The LuaSandbox class | PHP 8.3 9396
- The LuaSandbox class (PECL luasandbox >= 1.0.0) はじめに The LuaSandbox class creates a Lua environment and allows for execution of Lua code. クラス概要 class LuaSandbox { /* 定数 */ const int SAMPLES = 0 ; const int SECONDS = 1 ; const int
... ing ( string $code , string $chunkName = '' ): LuaSandboxFunction public function pauseUsageTimer (): bool public function registerLibrary ( string $libname , array $functions ): void public function setCPULimit ( float | bool $limit ): void public function set ... x::loadString — Load Lua code into the Lua environment LuaSandbox::pauseUsageTimer — Pause the CPU usage timer LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library LuaSandbox::setCPULimit — Set the CPU time limit for the Lua environmen ...
-
https://man.mtool.work/php/8.3/class.luasandbox.html
- LuaSandbox::wrapPhpFunction — Wrap a PHP callable in a LuaSandboxFunction | PHP... 8506
- LuaSandbox::wrapPhpFunction (PECL luasandbox >= 1.2.0) LuaSandbox::wrapPhpFunction — Wrap a PHP callable in a LuaSandboxFunction 説明 public function LuaSandbox::wrapPhpFunction ( callable $function ): LuaSandboxFunction Wraps a PHP callabl
... . 戻り値 Returns a LuaSandboxFunction . 参考 LuaSandbox::loadString() - Load Lua code into the Lua environment LuaSandbox::registerLibrary() - Register a set of PHP functions as a Lua library 他のマニュアルの関連ページ Python exceptions ...
-
https://man.mtool.work/php/8.3/luasandbox.wrapphpfunction.html
- LuaSandbox::loadString — Load Lua code into the Lua environment | PHP 8.3 8360
- LuaSandbox::loadString (PECL luasandbox >= 1.0.0) LuaSandbox::loadString — Load Lua code into the Lua environment 説明 public function LuaSandbox::loadString ( string $code , string $chunkName = '' ): LuaSandboxFunction Loads Lua code into
... ( $function -> call () ); ?> 上の例の出力は以下となります。 array(1) { [0]=> string(12) "Hello, world" } 参考 LuaSandbox::registerLibrary() - Register a set of PHP functions as a Lua library LuaSandbox::wrapPhpFunction() - Wrap a PHP callable in a LuaSandboxFu ...
-
https://man.mtool.work/php/8.3/luasandbox.loadstring.html
- Basic usage for LuaSandbox | PHP 8.3 8215
- 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 <?php $sandbox = new LuaSandbox ; $sandbox -> setMemoryLimit ( 50 *
... 10 ); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => function ( $string ) { echo " $string \n" ; }, 'error' => fun ...
-
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
- LuaSandbox | PHP 8.3 7924
- LuaSandbox はじめに LuaSandbox is an extension for PHP 7 and PHP 8 to allow safely running untrusted Lua 5.1 code from within PHP. Differences compared to the Lua extension: LuaSandbox has support for time and memory limits. LuaSandbox prov
... x::loadString — Load Lua code into the Lua environment LuaSandbox::pauseUsageTimer — Pause the CPU usage timer LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library LuaSandbox::setCPULimit — Set the CPU time limit for the Lua environmen ...
-
https://man.mtool.work/php/8.3/book.luasandbox.html
- LuaSandbox::pauseUsageTimer — Pause the CPU usage timer | PHP 8.3 7779
- LuaSandbox::pauseUsageTimer (PECL luasandbox >= 1.4.0) LuaSandbox::pauseUsageTimer — Pause the CPU usage timer 説明 public function LuaSandbox::pauseUsageTimer (): bool Pauses the CPU usage timer. This only has effect when called from withi
... otime ( true ) + $t ; while ( microtime ( true ) < $end ) { // waste CPU cycles } } // Register a PHP callback $sandbox -> registerLibrary ( 'php' , [ 'test' => function () use ( $sandbox ) { $sandbox -> pauseUsageTimer (); doWait ( 5 ); $sandbox -> unpauseUsag ...
-
https://man.mtool.work/php/8.3/luasandbox.pauseusagetimer.html
PREV
1
NEXT