Свойство | Тип | Описание | |
---|---|---|---|
$allow_aliases | Should PHPSandbox allow sandboxed code to use namespaces and declare namespace aliases (utilizing the defineAlias function?) | ||
$allow_backticks | Should PHPSandbox allow sandboxed code to use backtick execution? (e.g. $var = \ping google.com\; This will also be disabled if shell_exec is not whitelisted or if it is blacklisted, and will be converted to a defined shell_exec function call if one is defined) | ||
$allow_casting | Should PHPSandbox allow sandboxed code to cast types? (This will still be subject to allowed classes) | ||
$allow_classes | Should PHPSandbox allow sandboxed code to declare classes? | ||
$allow_closures | Should PHPSandbox allow sandboxed code to declare closures? | ||
$allow_constants | Should PHPSandbox allow sandboxed code to define constants? | ||
$allow_error_suppressing | Should PHPSandbox allow sandboxed code to suppress errors (e.g. the @ operator?) | ||
$allow_escaping | Should PHPSandbox allow sandboxed code to escape to HTML? | ||
$allow_functions | Should PHPSandbox allow sandboxed code to declare functions? | ||
$allow_generators | Should PHPSandbox allow sandboxed code to create generators? | ||
$allow_globals | Should PHPSandbox allow sandboxed code to use global keyword to access variables in the global scope? | ||
$allow_halting | Should PHPSandbox allow sandboxed code to halt the PHP compiler? | ||
$allow_includes | Flag to indicate whether the sandbox should allow included files | ||
$allow_interfaces | Should PHPSandbox allow sandboxed code to declare interfaces? | ||
$allow_namespaces | Should PHPSandbox allow sandboxed code to declare namespaces (utilizing the defineNamespace function?) | ||
$allow_objects | Should PHPSandbox allow sandboxed code to create objects of allow classes (e.g. new keyword)? | ||
$allow_references | Should PHPSandbox allow sandboxed code to assign references? | ||
$allow_static_variables | Should PHPSandbox allow sandboxed code to create static variables? | ||
$allow_traits | Should PHPSandbox allow sandboxed code to declare traits? | ||
$allow_variables | Should PHPSandbox allow sandboxed code to create variables? | ||
$arg_funcs | A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions | ||
$auto_define_vars | Should PHPSandbox automagically define variables passed to prepended, appended and prepared code closures? | ||
$auto_whitelist_classes | Should PHPSandbox automagically whitelist classes created in sandboxed code if $allow_classes is true? | ||
$auto_whitelist_constants | Should PHPSandbox automagically whitelist constants created in sandboxed code if $allow_constants is true? | ||
$auto_whitelist_functions | Should PHPSandbox automagically whitelist functions created in sandboxed code if $allow_functions is true? | ||
$auto_whitelist_globals | Should PHPSandbox automagically whitelist global variables created in sandboxed code if $allow_globals is true? (Used to whitelist them in the variables list) | ||
$auto_whitelist_interfaces | Should PHPSandbox automagically whitelist interfaces created in sandboxed code if $allow_interfaces is true? | ||
$auto_whitelist_traits | Should PHPSandbox automagically whitelist traits created in sandboxed code if $allow_traits is true? | ||
$auto_whitelist_trusted_code | Should PHPSandbox automagically whitelist prepended and appended code? | ||
$capture_output | Flag whether to return output via an output buffer | ||
$convert_errors | Flag to indicate whether the sandbox should convert errors to exceptions | ||
$defined_funcs | A static array of defined_* and declared_* functions names used for redefining defined_* and declared_* values | ||
$error_level | The error_reporting level to set the PHPSandbox scope to when executing the generated closure, if set to null it will use parent scope error level. | ||
$magic_constants | A static array of magic constant names used for redefining magic constant values | ||
$name | The randomly generated name of the PHPSandbox variable passed to the generated closure | ||
$overwrite_defined_funcs | Should PHPSandbox overwrite get_define_functions, get_defined_vars, get_defined_constants, get_declared_classes, get_declared_interfaces and get_declared_traits? | ||
$overwrite_func_get_args | Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args? | ||
$overwrite_sandboxed_string_funcs | Should PHPSandbox overwrite functions to help hide SandboxedStrings? | ||
$overwrite_superglobals | Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays. | ||
$restore_error_level | Flag to indicate whether the sandbox should return error_reporting to its previous level after execution | ||
$sandbox_includes | Flag to indicate whether the sandbox should automatically sandbox included files | ||
$sandboxed_string_funcs | A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object, is_scalar and is_callable for redefining those functions | ||
$superglobals | A static array of superglobal names used for redefining superglobal values | ||
$time_limit | Integer value of maximum number of seconds the sandbox should be allowed to execute | ||
$validate_aliases | Flag to indicate whether the sandbox should validate aliases (aka use) | ||
$validate_classes | Flag to indicate whether the sandbox should validate classes | ||
$validate_constants | Flag to indicate whether the sandbox should validate constants | ||
$validate_functions | Flag to indicate whether the sandbox should validate functions | ||
$validate_globals | Flag to indicate whether the sandbox should validate globals | ||
$validate_interfaces | Flag to indicate whether the sandbox should validate interfaces | ||
$validate_keywords | Flag to indicate whether the sandbox should validate keywords | ||
$validate_magic_constants | Flag to indicate whether the sandbox should validate magic constants | ||
$validate_namespaces | Flag to indicate whether the sandbox should validate namespaces | ||
$validate_operators | Flag to indicate whether the sandbox should validate operators | ||
$validate_primitives | Flag to indicate whether the sandbox should validate primitives | ||
$validate_superglobals | Flag to indicate whether the sandbox should validate superglobals | ||
$validate_traits | Flag to indicate whether the sandbox should validate traits | ||
$validate_types | Flag to indicate whether the sandbox should validate types | ||
$validate_variables | Flag to indicate whether the sandbox should validate variables |
Свойство | Тип | Описание | |
---|---|---|---|
$appended_code | String of appended code, will be automagically whitelisted for functions, variables, globals, constants, classes, interfaces and traits if $auto_whitelist_trusted_code is true | ||
$blacklist | Array of blacklisted functions, classes, etc. Any whitelisted array types override their counterpart in this array | ||
$definitions | Array of defined functions, superglobals, etc. If an array type contains elements, then it overwrites its external counterpart | ||
$error_handler | Callable that handles any errors when set | ||
$error_handler_types | Integer value of the error types to handle (default is E_ALL) | ||
$exception_handler | Callable that handles any thrown exceptions when set | ||
$execution_time | Float of the number of microseconds it took to execute the sandbox | ||
$generated_code | String of generated code, for debugging and serialization purposes | ||
$includes | Array of sandboxed included files | ||
$last_error | The last error thrown by the sandbox | ||
$last_exception | The last exception thrown by the sandbox | ||
$last_validation_error | The last validation error thrown by the sandbox | ||
$memory_usage | Int of the number of bytes the sandbox allocates during execution | ||
$parsed_ast | Array of parsed code broken down into AST tokens, for debugging and serialization purposes | ||
$prepare_time | Float of the number of microseconds it took to prepare the sandbox | ||
$prepared_ast | Array of prepared code broken down into AST tokens, for debugging and serialization purposes | ||
$prepared_code | String of prepared code, for debugging and serialization purposes | ||
$preparsed_code | String of preparsed code, for debugging and serialization purposes | ||
$prepended_code | String of prepended code, will be automagically whitelisted for functions, variables, globals, constants, classes, interfaces and traits if $auto_whitelist_trusted_code is true | ||
$sandboxes | Array of PHPSandboxes | ||
$validation | Array of custom validation functions | ||
$validation_error_handler | Callable that handles any thrown validation errors when set | ||
$whitelist | Array of whitelisted functions, classes, etc. If an array type contains elements, then it overrides its blacklist counterpart |
Метод | Описание | |
---|---|---|
__call ( string $method, array $arguments ) : mixed | Magic method to provide API compatibility for v1.* code | |
__construct ( array $options = [], array $functions = [], array $variables = [], array $constants = [], array $namespaces = [], array $aliases = [], array $superglobals = [], array $magic_constants = [], array $classes = [], array $interfaces = [], array $traits = [] ) | PHPSandbox class constructor | |
__invoke ( Closure | callable | string $code ) : mixed | PHPSandbox __invoke magic method | |
__sleep ( ) : array | PHPSandbox __sleep magic method | |
_arrayval ( mixed $value ) : array | Return array value of SandboxedString or mixed value | |
_boolval ( mixed $value ) : boolean | Return boolean value of SandboxedString or mixed value | |
_floatval ( mixed $value ) : float | Return float value of SandboxedString or mixed value | |
_func_get_arg ( array $arguments = [], integer $index ) : array | Get PHPSandbox redefined function argument | |
_func_get_args ( array $arguments = [] ) : array | Get PHPSandbox redefined function arguments array | |
_func_num_args ( array $arguments = [] ) : integer | Get PHPSandbox redefined number of function arguments | |
_get_declared_classes ( array $classes = [] ) : array | Get PHPSandbox redefined classes in place of get_declared_classes(). This is an internal PHPSandbox function but requires public access to work. | |
_get_declared_interfaces ( array $interfaces = [] ) : array | Get PHPSandbox redefined interfaces in place of get_declared_interfaces(). This is an internal PHPSandbox function but requires public access to work. | |
_get_declared_traits ( array $traits = [] ) : array | Get PHPSandbox redefined traits in place of get_declared_traits(). This is an internal PHPSandbox function but requires public access to work. | |
_get_defined_constants ( array $constants = [] ) : array | Get PHPSandbox redefined constants in place of get_defined_constants(). This is an internal PHPSandbox function but requires public access to work. | |
_get_defined_functions ( array $functions = [] ) : array | Get PHPSandbox redefined functions in place of get_defined_functions(). This is an internal PHPSandbox function but requires public access to work. | |
_get_defined_vars ( array $variables = [] ) : array | Get PHPSandbox redefined variables in place of get_defined_vars(). This is an internal PHPSandbox function but requires public access to work. | |
_get_included_files ( ) : array | Return get_included_files() and sandboxed included files | |
_get_magic_const ( string $name ) : array | Get PHPSandbox redefined magic constant. This is an internal PHPSandbox function but requires public access to work. | |
_get_superglobal ( string $name ) : array | Get PHPSandbox redefined superglobal. This is an internal PHPSandbox function but requires public access to work. | |
_include ( string $file ) : mixed | Sandbox included file | |
_include_once ( string $file ) : mixed | Sandbox included once file | |
_intval ( mixed $value ) : integer | Return integer value of SandboxedString or mixed value | |
_is_callable ( mixed $value ) : boolean | Return is_callable value of SandboxedString or mixed value | |
_is_object ( mixed $value ) : boolean | Return is_object value of SandboxedString or mixed value | |
_is_scalar ( mixed $value ) : boolean | Return is_scalar value of SandboxedString or mixed value | |
_is_string ( mixed $value ) : boolean | Return is_string value of SandboxedString or mixed value | |
_objectval ( mixed $value ) : object | Return object value of SandboxedString or mixed value | |
_print_r ( ) : array | Get PHPSandbox redefined print_r | |
_require ( string $file ) : mixed | Sandbox required file | |
_require_once ( string $file ) : mixed | Sandbox required once file | |
_var_dump ( ) : array | Get PHPSandbox redefined var_dump | |
_var_export ( ) : array | Get PHPSandbox redefined var_export | |
append ( string | callable $code ) | Append trusted code | |
blacklist ( string | array $type, string | array | null $name = null ) | Blacklist PHPSandbox definitions, such as functions, constants, classes, etc. to set | |
blacklistAlias ( string | array $name ) | Blacklist alias | |
blacklistClass ( string | array $name ) | Blacklist class | |
blacklistConst ( string | array $name ) | Blacklist constant | |
blacklistFunc ( string | array $name ) | Blacklist function | |
blacklistGlobal ( string | array $name ) | Blacklist global | |
blacklistInterface ( string | array $name ) | Blacklist interface | |
blacklistKeyword ( string | array $name ) | Blacklist keyword | |
blacklistMagicConst ( string | array $name ) | Blacklist magic constant | |
blacklistNamespace ( string | array $name ) | Blacklist namespace | |
blacklistOperator ( string | array $name ) | Blacklist operator | |
blacklistPrimitive ( string | array $name ) | Blacklist primitive | |
blacklistSuperglobal ( string | array $name, string $key = null ) | Blacklist superglobal or superglobal key * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to blacklist | |
blacklistTrait ( string | array $name ) | Blacklist trait | |
blacklistType ( string | array $name ) | Blacklist type | |
blacklistUse ( string | array $name ) | Blacklist use (or alias) | |
blacklistVar ( string | array $name ) | Blacklist variable | |
call_func ( ) : mixed | Get PHPSandbox redefined function. This is an internal PHPSandbox function but requires public access to work. | |
checkAlias ( string $name ) : boolean | Check alias name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkClass ( string $name, boolean $extends = false ) : boolean | Check class name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkConst ( string $name ) : boolean | Check constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkFunc ( string $name ) : boolean | Check function name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkGlobal ( string $name ) : boolean | Check global name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkInterface ( string $name ) : boolean | Check interface name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkKeyword ( string $name ) : boolean | Check keyword name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkMagicConst ( string $name ) : boolean | Check magic constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkNamespace ( string $name ) : boolean | Check namespace name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkOperator ( string $name ) : boolean | Check operator name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkPrimitive ( string $name ) : boolean | Check primitive name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkSuperglobal ( string $name ) : boolean | Check superglobal name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkTrait ( string $name ) : boolean | Check trait name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkType ( string $name ) : boolean | Check type name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkUse ( string $name ) : boolean | Check use (or alias) name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
checkVar ( string $name ) : boolean | Check variable name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work. | |
clear ( ) | Clear all trusted and sandboxed code | |
clearAppend ( ) | Clear all appended trusted code | |
clearAppendedCode ( ) | Clear all appended trusted code | |
clearCode ( ) | Clear generated code | |
clearPrepended ( ) | Clear all prepended trusted code | |
clearPrependedCode ( ) | Clear all prepended trusted code | |
clearTrustedCode ( ) | Clear all trusted code | |
create ( array $options = [], array $functions = [], array $variables = [], array $constants = [], array $namespaces = [], array $aliases = [], array $superglobals = [], array $magic_constants = [], array $classes = [], array $interfaces = [], array $traits = [] ) | PHPSandbox static factory method | |
deblacklist ( string | array $type, string | array | null $name ) | Remove PHPSandbox definitions, such as functions, constants, classes, etc. from blacklist | |
deblacklistAlias ( string | array $name ) | Remove alias from blacklist | |
deblacklistClass ( string | array $name ) | Remove class from blacklist | |
deblacklistConst ( string | array $name ) | Remove constant from blacklist | |
deblacklistFunc ( string | array $name ) | Remove function from blacklist | |
deblacklistGlobal ( string | array $name ) | Remove global from blacklist | |
deblacklistInterface ( string | array $name ) | Remove interface from blacklist | |
deblacklistKeyword ( string | array $name ) | Remove keyword from blacklist | |
deblacklistMagicConst ( string | array $name ) | Remove magic constant from blacklist | |
deblacklistNamespace ( string | array $name ) | Remove namespace from blacklist | |
deblacklistOperator ( string | array $name ) | Remove operator from blacklist | |
deblacklistPrimitive ( string | array $name ) | Remove primitive from blacklist | |
deblacklistSuperglobal ( string | array $name, string $key = null ) | Remove superglobal or superglobal key from blacklist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from blacklist | |
deblacklistTrait ( string | array $name ) | Remove trait from blacklist | |
deblacklistType ( string | array $name ) | Remove type from blacklist | |
deblacklistUse ( string | array $name ) | Remove use (or alias) from blacklist | |
deblacklistVar ( string | array $name ) | Remove function from blacklist | |
define ( string | array $type, string | array | null $name = null, mixed | null $value = null ) | Define PHPSandbox definitions, such as functions, constants, namespaces, etc. | |
defineAlias ( string | array $name, string | null $alias = null ) | Define PHPSandbox alias | |
defineAliases ( array $aliases = [] ) | Define PHPSandbox aliases by array | |
defineClass ( string | array $name, mixed $value ) | Define PHPSandbox class | |
defineClasses ( array $classes = [] ) | Define PHPSandbox classes by array | |
defineConst ( string | array $name, mixed $value ) | Define PHPSandbox constant | |
defineConsts ( array $constants = [] ) | Define PHPSandbox constants by array | |
defineFunc ( string | array $name, callable $function, boolean $pass_sandbox = false ) | Define PHPSandbox function | |
defineFuncs ( array $functions = [] ) | Define PHPSandbox functions by array | |
defineInterface ( string | array $name, mixed $value ) | Define PHPSandbox interface | |
defineInterfaces ( array $interfaces = [] ) | Define PHPSandbox interfaces by array | |
defineMagicConst ( string | array $name, mixed $value ) | Define PHPSandbox magic constant | |
defineMagicConsts ( array $magic_constants = [] ) | Define PHPSandbox magic constants by array | |
defineNamespace ( string | array $name ) | Define PHPSandbox namespace | |
defineNamespaces ( array $namespaces = [] ) | Define PHPSandbox namespaces by array | |
defineSuperglobal ( string | array $name, mixed $value ) | Define PHPSandbox superglobal | |
defineSuperglobals ( array $superglobals = [] ) | Define PHPSandbox superglobals by array | |
defineTrait ( string | array $name, mixed $value ) | Define PHPSandbox trait | |
defineTraits ( array $traits = [] ) | Define PHPSandbox traits by array | |
defineUse ( string | array $name, string | null $alias = null ) | Define PHPSandbox use (or alias) | |
defineUses ( array $uses = [] ) | Define PHPSandbox uses (or aliases) by array | |
defineVar ( string | array $name, mixed $value ) | Define PHPSandbox variable | |
defineVars ( array $variables = [] ) | Define PHPSandbox variables by array | |
dewhitelist ( string | array $type, string | array | null $name ) | Remove PHPSandbox definitions, such as functions, constants, classes, etc. from whitelist | |
dewhitelistAlias ( string | array $name ) | Remove alias from whitelist | |
dewhitelistClass ( string | array $name ) | Remove class from whitelist | |
dewhitelistConst ( string | array $name ) | Remove constant from whitelist | |
dewhitelistFunc ( string | array $name ) | Remove function from whitelist | |
dewhitelistGlobal ( string | array $name ) | Remove global from whitelist | |
dewhitelistInterface ( string | array $name ) | Remove interface from whitelist | |
dewhitelistKeyword ( string | array $name ) | Remove keyword from whitelist | |
dewhitelistMagicConst ( string | array $name ) | Remove magic constant from whitelist | |
dewhitelistNamespace ( string | array $name ) | Remove namespace from whitelist | |
dewhitelistOperator ( string | array $name ) | Remove operator from whitelist | |
dewhitelistPrimitive ( string | array $name ) | Remove primitive from whitelist | |
dewhitelistSuperglobal ( string | array $name, string $key = null ) | Remove superglobal or superglobal key from whitelist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from whitelist | |
dewhitelistTrait ( string | array $name ) | Remove trait from whitelist | |
dewhitelistType ( string | array $name ) | Remove type from whitelist | |
dewhitelistUse ( string | array $name ) | Remove use (or alias) from whitelist | |
dewhitelistVar ( string | array $name ) | Remove variable from whitelist | |
error ( integer $errno, string $errstr, string $errfile, integer $errline, array $errcontext ) : mixed | Invoke sandbox error handler | |
exception ( Exception $exception ) : mixed | Invoke sandbox exception handler | |
execute ( callable | string $callable = null, boolean $skip_validation = false ) : mixed | Prepare and execute callable and return output | |
getAliasValidator ( ) : callable | null | Get validation callable for aliases | |
getAppendedCode ( ) : string | Get PHPSandbox appended code | |
getClassValidator ( ) : callable | null | Get validation callable for classes | |
getCode ( ) : string | Get PHPSandbox generated code | |
getConstValidator ( ) : callable | null | Get validation callable for constants | |
getDefinedClass ( string $name ) : string | Get defined class of $name | |
getDefinedInterface ( string $name ) : string | Get defined interface of $name | |
getDefinedNamespace ( string $name ) : string | Get defined namespace of $name | |
getDefinedTrait ( string $name ) : string | Get defined trait of $name | |
getErrorHandler ( ) : null | callable | Get error handler | |
getExceptionHandler ( ) : null | callable | Get exception handler | |
getExecutionTime ( integer | null $round ) : float | Return the amount of time the sandbox spent executing the sandboxed code | |
getFuncValidator ( ) : callable | null | Get validation for functions | |
getGeneratedCode ( ) : string | Get PHPSandbox generated code | |
getGlobalValidator ( ) : callable | null | Get validation callable for globals | |
getInterfaceValidator ( ) : callable | null | Get validation callable for interfaces | |
getIterator ( ) : array | Get an iterator of all the public PHPSandbox properties | |
getKeywordValidator ( ) : callable | null | Get validation callable for keywords | |
getLastError ( ) : array | Gets the last sandbox error | |
getLastException ( ) : Exception | |
Gets the last exception thrown by the sandbox | |
getLastValidationError ( ) : Exception | |
Gets the last validation error thrown by the sandbox | |
getMagicConstValidator ( ) : callable | null | Get validation callable for magic constants | |
getMemoryUsage ( integer | null $round ) : integer | Return the amount of bytes the sandbox allocated while preparing and executing the sandboxed code | |
getName ( ) : string | Get name of PHPSandbox variable | |
getNamespaceValidator ( ) : callable | null | Get validation callable for namespaces | |
getOperatorValidator ( ) : callable | null | Get validation callable for operators | |
getOption ( string $option ) : boolean | integer | null | Get PHPSandbox option | |
getParsedAST ( ) : array | Get PHPSandbox parsed AST array | |
getPreparedAST ( ) : array | Get PHPSandbox prepared AST array | |
getPreparedCode ( ) : string | Get PHPSandbox prepared code | |
getPreparedTime ( integer | null $round ) : float | Return the amount of time the sandbox spent preparing the sandboxed code | |
getPreparsedCode ( ) : string | Get PHPSandbox preparsed code | |
getPrependedCode ( ) : string | Get PHPSandbox prepended code | |
getPrimitiveValidator ( ) : callable | null | Get validation callable for primitives | |
getSandbox ( string $name ) : null | |
Get a named PHPSandbox instance (used to retrieve the sandbox instance from within sandboxed code) | |
getSuperglobalValidator ( ) : callable | null | Get validation callable for superglobals | |
getTime ( integer | null $round ) : float | Return the amount of time the sandbox spent preparing and executing the sandboxed code | |
getTraitValidator ( ) : callable | null | Get validation callable for traits | |
getTypeValidator ( ) : callable | null | Get validation callable for types | |
getUseValidator ( ) : callable | null | Get validation callable for uses (aka aliases) | |
getValidationErrorHandler ( ) : null | callable | Get validation error handler | |
getValidator ( string $type ) : callable | null | Get validation callable for specified $type | |
getVarValidator ( ) : callable | null | Get validation callable for variables | |
hasBlacklist ( string $type ) : integer | Query whether PHPSandbox instance has blacklist type. | |
hasBlacklistedAliases ( ) : integer | Query whether PHPSandbox instance has blacklisted aliases. | |
hasBlacklistedClasses ( ) : integer | Query whether PHPSandbox instance has blacklisted classes. | |
hasBlacklistedConsts ( ) : integer | Query whether PHPSandbox instance has blacklisted constants. | |
hasBlacklistedFuncs ( ) : integer | Query whether PHPSandbox instance has blacklisted functions. | |
hasBlacklistedGlobals ( ) : integer | Query whether PHPSandbox instance has blacklisted globals. | |
hasBlacklistedInterfaces ( ) : integer | Query whether PHPSandbox instance has blacklisted interfaces. | |
hasBlacklistedKeywords ( ) : integer | Query whether PHPSandbox instance has blacklisted keywords. | |
hasBlacklistedMagicConsts ( ) : integer | Query whether PHPSandbox instance has blacklisted magic constants. | |
hasBlacklistedNamespaces ( ) : integer | Query whether PHPSandbox instance has blacklisted namespaces. | |
hasBlacklistedOperators ( ) : integer | Query whether PHPSandbox instance has blacklisted operators. | |
hasBlacklistedPrimitives ( ) : integer | Query whether PHPSandbox instance has blacklisted primitives. | |
hasBlacklistedSuperglobals ( string $name = null ) : integer | Query whether PHPSandbox instance has blacklisted superglobals, or superglobal keys | |
hasBlacklistedTraits ( ) : integer | Query whether PHPSandbox instance has blacklisted traits. | |
hasBlacklistedTypes ( ) : integer | Query whether PHPSandbox instance has blacklisted types. | |
hasBlacklistedUses ( ) : integer | Query whether PHPSandbox instance has blacklisted uses (or aliases.) | |
hasBlacklistedVars ( ) : integer | Query whether PHPSandbox instance has blacklisted variables. | |
hasDefinedAliases ( ) : integer | Query whether PHPSandbox instance has defined aliases | |
hasDefinedClasses ( ) : integer | Query whether PHPSandbox instance has defined classes | |
hasDefinedConsts ( ) : integer | Query whether PHPSandbox instance has defined constants | |
hasDefinedFuncs ( ) : integer | Query whether PHPSandbox instance has defined functions | |
hasDefinedInterfaces ( ) : integer | Query whether PHPSandbox instance has defined interfaces | |
hasDefinedMagicConsts ( ) : integer | Query whether PHPSandbox instance has defined magic constants | |
hasDefinedNamespaces ( ) : integer | Query whether PHPSandbox instance has defined namespaces | |
hasDefinedSuperglobals ( string | null $name = null ) : integer | boolean | Query whether PHPSandbox instance has defined superglobals, or if superglobal $name has defined keys | |
hasDefinedTraits ( ) : integer | Query whether PHPSandbox instance has defined traits | |
hasDefinedUses ( ) : integer | Query whether PHPSandbox instance has defined uses (or aliases) | |
hasDefinedVars ( ) : integer | Query whether PHPSandbox instance has defined variables | |
hasWhitelist ( string $type ) : integer | Query whether PHPSandbox instance has whitelist type | |
hasWhitelistKeywords ( ) : integer | Query whether PHPSandbox instance has whitelisted keywords. | |
hasWhitelistedAliases ( ) : integer | Query whether PHPSandbox instance has whitelisted aliases. | |
hasWhitelistedClasses ( ) : integer | Query whether PHPSandbox instance has whitelisted classes. | |
hasWhitelistedConsts ( ) : integer | Query whether PHPSandbox instance has whitelisted constants. | |
hasWhitelistedFuncs ( ) : integer | Query whether PHPSandbox instance has whitelisted functions. | |
hasWhitelistedGlobals ( ) : integer | Query whether PHPSandbox instance has whitelisted globals. | |
hasWhitelistedInterfaces ( ) : integer | Query whether PHPSandbox instance has whitelisted interfaces. | |
hasWhitelistedMagicConsts ( ) : integer | Query whether PHPSandbox instance has whitelisted magic constants. | |
hasWhitelistedNamespaces ( ) : integer | Query whether PHPSandbox instance has whitelisted namespaces. | |
hasWhitelistedOperators ( ) : integer | Query whether PHPSandbox instance has whitelisted operators. | |
hasWhitelistedPrimitives ( ) : integer | Query whether PHPSandbox instance has whitelisted primitives. | |
hasWhitelistedSuperglobals ( string $name = null ) : integer | Query whether PHPSandbox instance has whitelisted superglobals, or superglobal keys | |
hasWhitelistedTraits ( ) : integer | Query whether PHPSandbox instance has whitelisted traits. | |
hasWhitelistedTypes ( ) : integer | Query whether PHPSandbox instance has whitelisted types. | |
hasWhitelistedUses ( ) : integer | Query whether PHPSandbox instance has whitelisted uses (or aliases.) | |
hasWhitelistedVars ( ) : integer | Query whether PHPSandbox instance has whitelisted variables. | |
import ( array | string $template, integer $import_flag ) | PHPSandbox __wakeup magic method | |
importJSON ( array | string $template, integer $import_flag ) | Import JSON template into sandbox | |
isBlacklisted ( string $type, string $name ) : boolean | Check if PHPSandbox instance has blacklist type and name set | |
isBlacklistedAlias ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted alias name set | |
isBlacklistedClass ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted class name set | |
isBlacklistedConst ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted constant name set | |
isBlacklistedFunc ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted function name set | |
isBlacklistedGlobal ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted global name set | |
isBlacklistedInterface ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted interface name set | |
isBlacklistedKeyword ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted keyword name set | |
isBlacklistedMagicConst ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted magic constant name set | |
isBlacklistedNamespace ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted namespace name set | |
isBlacklistedOperator ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted operator name set | |
isBlacklistedPrimitive ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted primitive name set | |
isBlacklistedSuperglobal ( string $name, string $key = null ) : boolean | Check if PHPSandbox instance has blacklisted superglobal or superglobal key set | |
isBlacklistedTrait ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted trait name set | |
isBlacklistedType ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted type name set | |
isBlacklistedUse ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted use (or alias) name set | |
isBlacklistedVar ( string $name ) : boolean | Check if PHPSandbox instance has blacklisted variable name set | |
isDefinedAlias ( string $name ) : boolean | Check if PHPSandbox instance has $name alias defined | |
isDefinedClass ( string $name ) : boolean | Check if PHPSandbox instance has $name class defined | |
isDefinedConst ( string $name ) : boolean | Check if PHPSandbox instance has $name constant defined | |
isDefinedFunc ( string $name ) : boolean | Check if PHPSandbox instance has $name function defined | |
isDefinedInterface ( string $name ) : boolean | Check if PHPSandbox instance has $name interface defined | |
isDefinedMagicConst ( string $name ) : boolean | Check if PHPSandbox instance has $name magic constant defined | |
isDefinedNamespace ( string $name ) : boolean | Check if PHPSandbox instance has $name namespace defined | |
isDefinedSuperglobal ( string $name, string | null $key = null ) : boolean | Check if PHPSandbox instance has $name superglobal defined, or if superglobal $name key is defined | |
isDefinedTrait ( string $name ) : boolean | Check if PHPSandbox instance has $name trait defined | |
isDefinedUse ( string $name ) : boolean | Check if PHPSandbox instance has $name uses (or alias) defined | |
isDefinedVar ( string $name ) : boolean | Check if PHPSandbox instance has $name variable defined | |
isWhitelisted ( string $type, string $name ) : boolean | Check if PHPSandbox instance has whitelist type and name set | |
isWhitelistedAlias ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted alias name set | |
isWhitelistedClass ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted class name set | |
isWhitelistedConst ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted constant name set | |
isWhitelistedFunc ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted function name set | |
isWhitelistedGlobal ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted global name set | |
isWhitelistedInterface ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted interface name set | |
isWhitelistedKeyword ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted keyword name set | |
isWhitelistedMagicConst ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted magic constant name set | |
isWhitelistedNamespace ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted namespace name set | |
isWhitelistedOperator ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted operator name set | |
isWhitelistedPrimitive ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted primitive name set | |
isWhitelistedSuperglobal ( string $name, string $key = null ) : boolean | Check if PHPSandbox instance has whitelisted superglobal or superglobal key set | |
isWhitelistedTrait ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted trait name set | |
isWhitelistedType ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted type name set | |
isWhitelistedUse ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted use (or alias) name set | |
isWhitelistedVar ( string $name ) : boolean | Check if PHPSandbox instance has whitelisted variable name set | |
prepare ( callable $code, boolean $skip_validation = false ) : string | Prepare passed callable for execution | |
prepend ( string | callable $code ) | Prepend trusted code | |
resetOptions ( ) | Reset PHPSandbox options to their default values | |
setAliasValidator ( callable $callable ) : |
Set validation callable for aliases | |
setAppendedCode ( string $appended_code = '' ) | Set PHPSandbox appended code | |
setClassValidator ( callable $callable ) : |
Set validation callable for classes | |
setCode ( string $generated_code = '' ) | Set PHPSandbox generated code | |
setConstValidator ( callable $callable ) : |
Set validation callable for constants | |
setErrorHandler ( callable $handler, integer $error_types = E_ALL ) | Set callable to handle errors | |
setExceptionHandler ( callable $handler ) | Set callable to handle thrown exceptions | |
setFuncValidator ( callable $callable ) : |
Set validation callable for functions | |
setGeneratedCode ( string $generated_code = '' ) | Set PHPSandbox generated code | |
setGlobalValidator ( callable $callable ) : |
Set validation callable for globals | |
setInterfaceValidator ( callable $callable ) : |
Set validation callable for interfaces | |
setKeywordValidator ( callable $callable ) : |
Set validation callable for keywords | |
setMagicConstValidator ( callable $callable ) : |
Set validation callable for magic constants | |
setNamespaceValidator ( callable $callable ) : |
Set validation callable for namespaces | |
setOperatorValidator ( callable $callable ) : |
Set validation callable for operators | |
setOption ( string | array $option, boolean | integer | null $value = null ) | Set PHPSandbox option | |
setOptions ( array | string $options, boolean | integer | null $value = null ) | Set PHPSandbox options by array | |
setParsedAST ( array $parsed_ast = [] ) | Set PHPSandbox parsed AST array | |
setPreparedAST ( array $prepared_ast = [] ) | Set PHPSandbox prepared AST array | |
setPreparedCode ( string $prepared_code = '' ) | Set PHPSandbox prepared code | |
setPreparsedCode ( string $preparsed_code = '' ) | Set PHPSandbox preparsed code | |
setPrependedCode ( string $prepended_code = '' ) | Set PHPSandbox prepended code | |
setPrimitiveValidator ( callable $callable ) : |
Set validation callable for primitives | |
setSuperglobalValidator ( callable $callable ) : |
Set validation callable for superglobals | |
setTraitValidator ( callable $callable ) : |
Set validation callable for traits | |
setTypeValidator ( callable $callable ) : |
Set validation callable for types | |
setUseValidator ( callable $callable ) : |
Set validation callable for uses (aka aliases) | |
setValidationErrorHandler ( callable $handler ) | Set callable to handle thrown validation Errors | |
setValidator ( string $type, callable $callable ) : |
Set validation callable for specified $type | |
setVarValidator ( callable $callable ) : |
Set validation callable for variables | |
undefine ( string | array $type, string | array $name = null ) | Undefine PHPSandbox definitions, such as functions, constants, namespaces, etc. | |
undefineAlias ( string | array $name ) | Undefine PHPSandbox alias | |
undefineAliases ( array $aliases = [] ) | Undefine PHPSandbox aliases by array | |
undefineClass ( string | array $name ) | Undefine PHPSandbox class | |
undefineClasses ( array $classes = [] ) | Undefine PHPSandbox classes by array | |
undefineConst ( string | array $name ) | Undefine PHPSandbox constant | |
undefineConsts ( array $constants = [] ) | Undefine PHPSandbox constants by array | |
undefineFunc ( string | array $name ) | Undefine PHPSandbox function | |
undefineFuncs ( array $functions = [] ) | Undefine PHPSandbox functions by array | |
undefineInterface ( string | array $name ) | Undefine PHPSandbox interface | |
undefineInterfaces ( array $interfaces = [] ) | Undefine PHPSandbox interfaces by array | |
undefineMagicConst ( string | array $name ) | Undefine PHPSandbox magic constant | |
undefineMagicConsts ( array $magic_constants = [] ) | Undefine PHPSandbox magic constants by array | |
undefineNamespace ( string | array $name ) | Undefine PHPSandbox namespace | |
undefineNamespaces ( array $namespaces = [] ) | Undefine PHPSandbox namespaces by array | |
undefineSuperglobal ( string | array $name, string | null $key = null ) | Undefine PHPSandbox superglobal or superglobal key | |
undefineSuperglobals ( array $superglobals = [] ) | Undefine PHPSandbox superglobals by array | |
undefineTrait ( string | array $name ) | Undefine PHPSandbox trait | |
undefineTraits ( array $traits = [] ) | Undefine PHPSandbox traits by array | |
undefineUse ( string | array $name ) | Undefine PHPSandbox use (or alias) | |
undefineUses ( array $uses = [] ) | Undefine PHPSandbox uses (or aliases) by array | |
undefineVar ( string | array $name ) | Undefine PHPSandbox variable | |
undefineVars ( array $variables = [] ) | Undefine PHPSandbox variables by array | |
unsetAliasValidator ( ) : |
Unset validation callable for aliases | |
unsetClassValidator ( ) : |
Unset validation callable for classes | |
unsetConstValidator ( ) : |
Unset validation callable for constants | |
unsetErrorHandler ( ) | Unset error handler | |
unsetExceptionHandler ( ) | Unset exception handler | |
unsetFuncValidator ( ) : |
Unset validation callable for functions | |
unsetGlobalValidator ( ) : |
Unset validation callable for globals | |
unsetInterfaceValidator ( ) : |
Unset validation callable for interfaces | |
unsetKeywordValidator ( ) : |
Unset validation callable for keywords | |
unsetMagicConstValidator ( ) : |
Unset validation callable for magic constants | |
unsetNamespaceValidator ( ) : |
Unset validation callable for namespaces | |
unsetOperatorValidator ( ) : |
Unset validation callable for operators | |
unsetPrimitiveValidator ( ) : |
Unset validation callable for primitives | |
unsetSuperglobalValidator ( ) : |
Unset validation callable for superglobals | |
unsetTraitValidator ( ) : |
Unset validation callable for traits | |
unsetTypeValidator ( ) | Unset validation callable for types | |
unsetUseValidator ( ) : |
Unset validation callable for uses (aka aliases) | |
unsetValidationErrorHandler ( ) | Unset validation error handler | |
unsetValidator ( string $type ) : |
Unset validation callable for specified $type | |
unsetVarValidator ( ) : |
Unset validation callable for variables | |
validate ( callable | string $code ) | Validate passed callable for execution | |
validationError ( Exception | |
Invoke sandbox error validation handler if it exists, throw Error otherwise | |
whitelist ( string | array $type, string | array | null $name = null ) | Whitelist PHPSandbox definitions, such as functions, constants, classes, etc. to set | |
whitelistAlias ( string | array $name ) | Whitelist alias | |
whitelistClass ( string | array $name ) | Whitelist class | |
whitelistConst ( string | array $name ) | Whitelist constant | |
whitelistFunc ( string | array $name ) | Whitelist function | |
whitelistGlobal ( string | array $name ) | Whitelist global | |
whitelistInterface ( string | array $name ) | Whitelist interface | |
whitelistKeyword ( string | array $name ) | Whitelist keyword | |
whitelistMagicConst ( string | array $name ) | Whitelist magic constant | |
whitelistNamespace ( string | array $name ) | Whitelist namespace | |
whitelistOperator ( string | array $name ) | Whitelist operator | |
whitelistPrimitive ( string | array $name ) | Whitelist primitive | |
whitelistSuperglobal ( string | array $name, string $key = null ) | Whitelist superglobal or superglobal key | |
whitelistTrait ( string | array $name ) | Whitelist trait | |
whitelistType ( string | array $name ) | Whitelist type | |
whitelistUse ( string | array $name ) | Whitelist use (or alias) | |
whitelistVar ( string | array $name ) | Whitelist variable |
Метод | Описание | |
---|---|---|
autoDefine ( FunctionParser\FunctionParser $disassembled_closure ) | Automatically define variables passed to disassembled closure | |
autoWhitelist ( string $code, boolean $appended = false ) : mixed | Automatically whitelisted trusted code | |
disassemble ( callable $closure ) : string | Disassemble callable to string | |
normalizeAlias ( string | array $name ) : string | array | Normalize alias name. This is an internal PHPSandbox function. | |
normalizeClass ( string | array $name ) : string | array | Normalize class name. This is an internal PHPSandbox function. | |
normalizeFunc ( string | array $name ) : string | array | Normalize function name. This is an internal PHPSandbox function. | |
normalizeInterface ( string | array $name ) : string | array | Normalize interface name. This is an internal PHPSandbox function. | |
normalizeKeyword ( string | array $name ) : string | array | Normalize keyword name. This is an internal PHPSandbox function. | |
normalizeMagicConst ( string | array $name ) : string | array | Normalize magic constant name. This is an internal PHPSandbox function. | |
normalizeNamespace ( string | array $name ) : string | array | Normalize namespace name. This is an internal PHPSandbox function. | |
normalizeOperator ( string | array $name ) : string | array | Normalize operator name. This is an internal PHPSandbox function. | |
normalizePrimitive ( string | array $name ) : string | array | Normalize primitive name. This is an internal PHPSandbox function. | |
normalizeSuperglobal ( string | array $name ) : string | array | Normalize superglobal name. This is an internal PHPSandbox function. | |
normalizeTrait ( string | array $name ) : string | array | Normalize trait name. This is an internal PHPSandbox function. | |
normalizeType ( string | array $name ) : string | array | Normalize type name. This is an internal PHPSandbox function. | |
normalizeUse ( string | array $name ) : string | array | Normalize use (or alias) name. This is an internal PHPSandbox function. | |
prepareAliases ( ) | Prepare defined aliases for execution | |
prepareConsts ( ) | Prepare defined constants for execution | |
prepareNamespaces ( ) | Prepare defined namespaces for execution | |
prepareUses ( ) | Prepare defined uses (or aliases) for execution | |
prepareVars ( ) : string | Prepare defined variables for execution |
public __construct ( array $options = [], array $functions = [], array $variables = [], array $constants = [], array $namespaces = [], array $aliases = [], array $superglobals = [], array $magic_constants = [], array $classes = [], array $interfaces = [], array $traits = [] ) | ||
$options | array | Optional array of options to set for the sandbox |
$functions | array | Optional array of functions to define for the sandbox |
$variables | array | Optional array of variables to define for the sandbox |
$constants | array | Optional array of constants to define for the sandbox |
$namespaces | array | Optional array of namespaces to define for the sandbox |
$aliases | array | Optional array of aliases to define for the sandbox |
$superglobals | array | Optional array of superglobals to define for the sandbox |
$magic_constants | array | Optional array of magic constants to define for the sandbox |
$classes | array | Optional array of classes to define for the sandbox |
$interfaces | array | Optional array of interfaces to define for the sandbox |
$traits | array | Optional array of traits to define for the sandbox |
public _func_get_args ( array $arguments = [] ) : array | ||
$arguments | array | Array result from func_get_args() is passed here |
Результат | array | Returns the redefined arguments array |
public _func_num_args ( array $arguments = [] ) : integer | ||
$arguments | array | Array result from func_get_args() is passed here |
Результат | integer | Returns the redefined number of function arguments |
public _get_declared_classes ( array $classes = [] ) : array | ||
$classes | array | Array result from get_declared_classes() is passed here |
Результат | array | Returns the redefined classes |
public _get_declared_interfaces ( array $interfaces = [] ) : array | ||
$interfaces | array | Array result from get_declared_interfaces() is passed here |
Результат | array | Returns the redefined interfaces |
public _get_declared_traits ( array $traits = [] ) : array | ||
$traits | array | Array result from get_declared_traits() is passed here |
Результат | array | Returns the redefined traits |
public _get_defined_constants ( array $constants = [] ) : array | ||
$constants | array | Array result from get_defined_constants() is passed here |
Результат | array | Returns the redefined constants |
public _get_defined_functions ( array $functions = [] ) : array | ||
$functions | array | Array result from get_defined_functions() is passed here |
Результат | array | Returns the redefined functions array |
public _get_defined_vars ( array $variables = [] ) : array | ||
$variables | array | Array result from get_defined_vars() is passed here |
Результат | array | Returns the redefined variables array |
public _get_included_files ( ) : array | ||
Результат | array | Returns array of get_included_files() and sandboxed included files |
public _get_magic_const ( string $name ) : array | ||
$name | string | Requested magic constant name (e.g. __FILE__, __LINE__, etc.) |
Результат | array | Returns the redefined magic constant |
public _get_superglobal ( string $name ) : array | ||
$name | string | Requested superglobal name (e.g. _GET, _POST, etc.) |
Результат | array | Returns the redefined superglobal |
public _include_once ( string $file ) : mixed | ||
$file | string | Included once file to sandbox |
Результат | mixed | Returns value passed from included once file |
public _is_callable ( mixed $value ) : boolean | ||
$value | mixed | Value to check if is_callable |
Результат | boolean | Returns the is_callable value |
public _is_object ( mixed $value ) : boolean | ||
$value | mixed | Value to check if is_object |
Результат | boolean | Returns the is_object value |
public _is_scalar ( mixed $value ) : boolean | ||
$value | mixed | Value to check if is_scalar |
Результат | boolean | Returns the is_scalar value |
public _is_string ( mixed $value ) : boolean | ||
$value | mixed | Value to check if is_string |
Результат | boolean | Returns the is_string value |
public _objectval ( mixed $value ) : object | ||
$value | mixed | Value to return as object |
Результат | object | Returns the object value |
public _require_once ( string $file ) : mixed | ||
$file | string | Required once file to sandbox |
Результат | mixed | Returns value passed from required once file |
public _var_export ( ) : array | ||
Результат | array | Returns the redefined var_export |
protected autoDefine ( FunctionParser\FunctionParser $disassembled_closure ) | ||
$disassembled_closure | FunctionParser\FunctionParser |
public blacklistAlias ( string | array $name ) | ||
$name | string | array | String of alias name or array of alias names to blacklist |
public blacklistClass ( string | array $name ) | ||
$name | string | array | String of class name or array of class names to blacklist |
public blacklistConst ( string | array $name ) | ||
$name | string | array | String of constant name or array of constant names to blacklist |
public blacklistFunc ( string | array $name ) | ||
$name | string | array | String of function name, or array of function names to blacklist |
public blacklistGlobal ( string | array $name ) | ||
$name | string | array | String of global name or array of global names to blacklist |
public blacklistInterface ( string | array $name ) | ||
$name | string | array | String of interface name or array of interface names to blacklist |
public blacklistKeyword ( string | array $name ) | ||
$name | string | array | String of keyword name or array of keyword names to blacklist |
public blacklistMagicConst ( string | array $name ) | ||
$name | string | array | String of magic constant name or array of magic constant names to blacklist |
public blacklistNamespace ( string | array $name ) | ||
$name | string | array | String of namespace name or array of namespace names to blacklist |
public blacklistOperator ( string | array $name ) | ||
$name | string | array | String of operator name or array of operator names to blacklist |
public blacklistPrimitive ( string | array $name ) | ||
$name | string | array | String of primitive name or array of primitive names to blacklist |
public blacklistTrait ( string | array $name ) | ||
$name | string | array | String of trait name or array of trait names to blacklist |
public blacklistType ( string | array $name ) | ||
$name | string | array | String of type name or array of type names to blacklist |
public blacklistUse ( string | array $name ) | ||
$name | string | array | String of use (or alias) name or array of use (or alias) names to blacklist |
public blacklistVar ( string | array $name ) | ||
$name | string | array | String of variable name or array of variable names to blacklist |
public checkAlias ( string $name ) : boolean | ||
$name | string | String of the alias name to check |
Результат | boolean | Returns true if alias is valid |
public checkConst ( string $name ) : boolean | ||
$name | string | String of the constant name to check |
Результат | boolean | Returns true if constant is valid |
public checkGlobal ( string $name ) : boolean | ||
$name | string | String of the global name to check |
Результат | boolean | Returns true if global is valid |
public checkInterface ( string $name ) : boolean | ||
$name | string | String of the interface name to check |
Результат | boolean | Returns true if interface is valid |
public checkKeyword ( string $name ) : boolean | ||
$name | string | String of the keyword name to check |
Результат | boolean | Returns true if keyword is valid |
public checkMagicConst ( string $name ) : boolean | ||
$name | string | String of the magic constant name to check |
Результат | boolean | Returns true if magic constant is valid |
public checkNamespace ( string $name ) : boolean | ||
$name | string | String of the namespace name to check |
Результат | boolean | Returns true if namespace is valid |
public checkOperator ( string $name ) : boolean | ||
$name | string | String of the type operator to check |
Результат | boolean | Returns true if operator is valid |
public checkPrimitive ( string $name ) : boolean | ||
$name | string | String of the primitive name to check |
Результат | boolean | Returns true if primitive is valid |
public checkSuperglobal ( string $name ) : boolean | ||
$name | string | String of the superglobal name to check |
Результат | boolean | Returns true if superglobal is valid |
public checkTrait ( string $name ) : boolean | ||
$name | string | String of the trait name to check |
Результат | boolean | Returns true if trait is valid |
public static create ( array $options = [], array $functions = [], array $variables = [], array $constants = [], array $namespaces = [], array $aliases = [], array $superglobals = [], array $magic_constants = [], array $classes = [], array $interfaces = [], array $traits = [] ) | ||
$options | array | Optional array of options to set for the sandbox |
$functions | array | Optional array of functions to define for the sandbox |
$variables | array | Optional array of variables to define for the sandbox |
$constants | array | Optional array of constants to define for the sandbox |
$namespaces | array | Optional array of namespaces to define for the sandbox |
$aliases | array | Optional array of aliases to define for the sandbox |
$superglobals | array | Optional array of superglobals to define for the sandbox |
$magic_constants | array | Optional array of magic constants to define for the sandbox |
$classes | array | Optional array of classes to define for the sandbox |
$interfaces | array | Optional array of interfaces to define for the sandbox |
$traits | array | Optional array of traits to define for the sandbox |
public deblacklistAlias ( string | array $name ) | ||
$name | string | array | String of alias name or array of alias names to remove from blacklist |
public deblacklistClass ( string | array $name ) | ||
$name | string | array | String of class name or array of class names to remove from blacklist |
public deblacklistConst ( string | array $name ) | ||
$name | string | array | String of constant name or array of constant names to remove from blacklist |
public deblacklistFunc ( string | array $name ) | ||
$name | string | array | String of function name or array of function names to remove from blacklist |
public deblacklistGlobal ( string | array $name ) | ||
$name | string | array | String of global name or array of global names to remove from blacklist |
public deblacklistInterface ( string | array $name ) | ||
$name | string | array | String of interface name or array of interface names to remove from blacklist |
public deblacklistKeyword ( string | array $name ) | ||
$name | string | array | String of keyword name or array of keyword names to remove from blacklist |
public deblacklistMagicConst ( string | array $name ) | ||
$name | string | array | String of magic constant name or array of magic constant names to remove from blacklist |
public deblacklistNamespace ( string | array $name ) | ||
$name | string | array | String of namespace name or array of namespace names to remove from blacklist |
public deblacklistOperator ( string | array $name ) | ||
$name | string | array | String of operator name or array of operator names to remove from blacklist |
public deblacklistPrimitive ( string | array $name ) | ||
$name | string | array | String of primitive name or array of primitive names to remove from blacklist |
public deblacklistSuperglobal ( string | array $name, string $key = null ) | ||
$name | string | array | String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to remove from blacklist |
$key | string | String of superglobal key to remove from blacklist |
public deblacklistTrait ( string | array $name ) | ||
$name | string | array | String of trait name or array of trait names to remove from blacklist |
public deblacklistType ( string | array $name ) | ||
$name | string | array | String of type name or array of type names to remove from blacklist |
public deblacklistUse ( string | array $name ) | ||
$name | string | array | String of use (or alias) name or array of use (or alias) names to remove from blacklist |
public deblacklistVar ( string | array $name ) | ||
$name | string | array | String of variable name or array of variable names to remove from blacklist |
public define ( string | array $type, string | array | null $name = null, mixed | null $value = null ) | ||
$type | string | array | Associative array or string of definition type to define |
$name | string | array | null | Associative array or string of definition name to define |
$value | mixed | null | Value of definition to define |
public defineAliases ( array $aliases = [] ) | ||
$aliases | array | Array of namespaces to use, or an associative array of namespaces and their aliases to use |
public defineClasses ( array $classes = [] ) | ||
$classes | array | Associative array of $classes to define |
public defineConsts ( array $constants = [] ) | ||
$constants | array | Associative array of $constants to define |
public defineFunc ( string | array $name, callable $function, boolean $pass_sandbox = false ) | ||
$name | string | array | Associative array or string of function $name to define |
$function | callable | Callable to define $function to |
$pass_sandbox | boolean | Pass PHPSandbox instance to defined function when called? Default is false |
public defineFuncs ( array $functions = [] ) | ||
$functions | array | Associative array of $functions to define |
public defineInterfaces ( array $interfaces = [] ) | ||
$interfaces | array | Associative array of $interfaces to define |
public defineMagicConsts ( array $magic_constants = [] ) | ||
$magic_constants | array | Associative array of $magic_constants to define |
public defineNamespace ( string | array $name ) | ||
$name | string | array | String of namespace $name, or an array of namespace names to define |
public defineNamespaces ( array $namespaces = [] ) | ||
$namespaces | array | Array of $namespaces to define |
public defineSuperglobals ( array $superglobals = [] ) | ||
$superglobals | array | Associative array of $superglobals to define |
public defineTraits ( array $traits = [] ) | ||
$traits | array | Associative array of $traits to define |
public defineUses ( array $uses = [] ) | ||
$uses | array | Array of namespaces to use, or an associative array of namespaces and their aliases to use |
public defineVars ( array $variables = [] ) | ||
$variables | array | Associative array of $variables to define |
public dewhitelistAlias ( string | array $name ) | ||
$name | string | array | String of alias name or array of alias names to remove from whitelist |
public dewhitelistClass ( string | array $name ) | ||
$name | string | array | String of class name or array of class names to remove from whitelist |
public dewhitelistConst ( string | array $name ) | ||
$name | string | array | String of constant name or array of constant names to remove from whitelist |
public dewhitelistFunc ( string | array $name ) | ||
$name | string | array | String of function name or array of function names to remove from whitelist |
public dewhitelistGlobal ( string | array $name ) | ||
$name | string | array | String of global name or array of global names to remove from whitelist |
public dewhitelistInterface ( string | array $name ) | ||
$name | string | array | String of interface name or array of interface names to remove from whitelist |
public dewhitelistKeyword ( string | array $name ) | ||
$name | string | array | String of keyword name or array of keyword names to remove from whitelist |
public dewhitelistMagicConst ( string | array $name ) | ||
$name | string | array | String of magic constant name or array of magic constant names to remove from whitelist |
public dewhitelistNamespace ( string | array $name ) | ||
$name | string | array | String of namespace name or array of namespace names to remove from whitelist |
public dewhitelistOperator ( string | array $name ) | ||
$name | string | array | String of operator name or array of operator names to remove from whitelist |
public dewhitelistPrimitive ( string | array $name ) | ||
$name | string | array | String of primitive name or array of primitive names to remove from whitelist |
public dewhitelistSuperglobal ( string | array $name, string $key = null ) | ||
$name | string | array | String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to remove from whitelist |
$key | string | String of superglobal key to remove from whitelist |
public dewhitelistTrait ( string | array $name ) | ||
$name | string | array | String of trait name or array of trait names to remove from whitelist |
public dewhitelistType ( string | array $name ) | ||
$name | string | array | String of type name or array of type names to remove from whitelist |
public dewhitelistUse ( string | array $name ) | ||
$name | string | array | String of use (or alias) name or array of use (or alias) names to remove from whitelist |
public dewhitelistVar ( string | array $name ) | ||
$name | string | array | String of variable name or array of variable names to remove from whitelist |
protected disassemble ( callable $closure ) : string | ||
$closure | callable | The callable to disassemble |
Результат | string | Return the disassembled code string |
public execute ( callable | string $callable = null, boolean $skip_validation = false ) : mixed | ||
$callable | callable | string | Callable or string of PHP code to prepare and execute within the sandbox |
$skip_validation | boolean | Boolean flag to indicate whether the sandbox should skip validation of the pass callable. Default is false. |
Результат | mixed | The output from the executed sandboxed code |
public getAliasValidator ( ) : callable | null | ||
Результат | callable | null |
public getAppendedCode ( ) : string | ||
Результат | string | Returns a string of the appended code |
public getClassValidator ( ) : callable | null | ||
Результат | callable | null |
public getConstValidator ( ) : callable | null | ||
Результат | callable | null |
public getDefinedClass ( string $name ) : string | ||
$name | string | String of class $name to get |
Результат | string | Returns string of defined class value |
public getDefinedInterface ( string $name ) : string | ||
$name | string | String of interface $name to get |
Результат | string | Returns string of defined interface value |
public getDefinedNamespace ( string $name ) : string | ||
$name | string | String of namespace $name to get |
Результат | string | Returns string of defined namespace value |
public getDefinedTrait ( string $name ) : string | ||
$name | string | String of trait $name to get |
Результат | string | Returns string of defined trait value |
public getErrorHandler ( ) : null | callable | ||
Результат | null | callable |
public getExceptionHandler ( ) : null | callable | ||
Результат | null | callable |
public getFuncValidator ( ) : callable | null | ||
Результат | callable | null |
public getGeneratedCode ( ) : string | ||
Результат | string | Returns a string of the generated code |
public getGlobalValidator ( ) : callable | null | ||
Результат | callable | null |
public getInterfaceValidator ( ) : callable | null | ||
Результат | callable | null |
public getIterator ( ) : array | ||
Результат | array |
public getKeywordValidator ( ) : callable | null | ||
Результат | callable | null |
public getLastError ( ) : array | ||
Результат | array |
public getLastException ( ) : Exception | |
||
Результат | Exception | |
public getLastValidationError ( ) : Exception | |
||
Результат | Exception | |
public getMagicConstValidator ( ) : callable | null | ||
Результат | callable | null |
public getNamespaceValidator ( ) : callable | null | ||
Результат | callable | null |
public getOperatorValidator ( ) : callable | null | ||
Результат | callable | null |
public getParsedAST ( ) : array | ||
Результат | array | Returns an array of the parsed AST code |
public getPreparedAST ( ) : array | ||
Результат | array | Returns an array of the prepared AST code |
public getPreparedCode ( ) : string | ||
Результат | string | Returns a string of the prepared code |
public getPreparsedCode ( ) : string | ||
Результат | string | Returns a string of the preparsed code |
public getPrependedCode ( ) : string | ||
Результат | string | Returns a string of the prepended code |
public getPrimitiveValidator ( ) : callable | null | ||
Результат | callable | null |
public static getSandbox ( string $name ) : null | |
||
$name | string | The name of the PHPSandbox instance to retrieve |
Результат | null | |
public getSuperglobalValidator ( ) : callable | null | ||
Результат | callable | null |
public getTraitValidator ( ) : callable | null | ||
Результат | callable | null |
public getTypeValidator ( ) : callable | null | ||
Результат | callable | null |
public getUseValidator ( ) : callable | null | ||
Результат | callable | null |
public getValidationErrorHandler ( ) : null | callable | ||
Результат | null | callable |
public getVarValidator ( ) : callable | null | ||
Результат | callable | null |
public hasBlacklist ( string $type ) : integer | ||
$type | string | The blacklist type to query |
Результат | integer | Returns the number of blacklists this instance has defined |
public hasBlacklistedAliases ( ) : integer | ||
Результат | integer | Returns the number of blacklisted aliases this instance has defined |
public hasBlacklistedClasses ( ) : integer | ||
Результат | integer | Returns the number of blacklisted classes this instance has defined |
public hasBlacklistedConsts ( ) : integer | ||
Результат | integer | Returns the number of blacklisted constants this instance has defined |
public hasBlacklistedFuncs ( ) : integer | ||
Результат | integer | Returns the number of blacklisted functions this instance has defined |
public hasBlacklistedGlobals ( ) : integer | ||
Результат | integer | Returns the number of blacklisted globals this instance has defined |
public hasBlacklistedInterfaces ( ) : integer | ||
Результат | integer | Returns the number of blacklisted interfaces this instance has defined |
public hasBlacklistedKeywords ( ) : integer | ||
Результат | integer | Returns the number of blacklisted keywords this instance has defined |
public hasBlacklistedMagicConsts ( ) : integer | ||
Результат | integer | Returns the number of blacklisted magic constants this instance has defined |
public hasBlacklistedNamespaces ( ) : integer | ||
Результат | integer | Returns the number of blacklisted namespaces this instance has defined |
public hasBlacklistedOperators ( ) : integer | ||
Результат | integer | Returns the number of blacklisted operators this instance has defined |
public hasBlacklistedPrimitives ( ) : integer | ||
Результат | integer | Returns the number of blacklisted primitives this instance has defined |
public hasBlacklistedSuperglobals ( string $name = null ) : integer | ||
$name | string | The blacklist superglobal key to query |
Результат | integer | Returns the number of blacklisted superglobals or superglobal keys this instance has defined |
public hasBlacklistedTraits ( ) : integer | ||
Результат | integer | Returns the number of blacklisted traits this instance has defined |
public hasBlacklistedTypes ( ) : integer | ||
Результат | integer | Returns the number of blacklisted types this instance has defined |
public hasBlacklistedUses ( ) : integer | ||
Результат | integer | Returns the number of blacklisted uses (or aliases) this instance has defined |
public hasBlacklistedVars ( ) : integer | ||
Результат | integer | Returns the number of blacklisted variables this instance has defined |
public hasDefinedAliases ( ) : integer | ||
Результат | integer | Returns the number of aliases this instance has defined |
public hasDefinedClasses ( ) : integer | ||
Результат | integer | Returns the number of classes this instance has defined |
public hasDefinedConsts ( ) : integer | ||
Результат | integer | Returns the number of constants this instance has defined |
public hasDefinedFuncs ( ) : integer | ||
Результат | integer | Returns the number of functions this instance has defined |
public hasDefinedInterfaces ( ) : integer | ||
Результат | integer | Returns the number of interfaces this instance has defined |
public hasDefinedMagicConsts ( ) : integer | ||
Результат | integer | Returns the number of magic constants this instance has defined |
public hasDefinedNamespaces ( ) : integer | ||
Результат | integer | Returns the number of namespaces this instance has defined |
public hasDefinedSuperglobals ( string | null $name = null ) : integer | boolean | ||
$name | string | null | String of superglobal $name to check for keys |
Результат | integer | boolean | Returns the number of superglobals or superglobal keys this instance has defined, or false if invalid superglobal name specified |
public hasDefinedTraits ( ) : integer | ||
Результат | integer | Returns the number of traits this instance has defined |
public hasDefinedUses ( ) : integer | ||
Результат | integer | Returns the number of uses (or aliases) this instance has defined |
public hasDefinedVars ( ) : integer | ||
Результат | integer | Returns the number of variables this instance has defined |
public hasWhitelist ( string $type ) : integer | ||
$type | string | The whitelist type to query |
Результат | integer | Returns the number of whitelists this instance has defined |
public hasWhitelistKeywords ( ) : integer | ||
Результат | integer | Returns the number of whitelisted keywords this instance has defined |
public hasWhitelistedAliases ( ) : integer | ||
Результат | integer | Returns the number of whitelisted aliases this instance has defined |
public hasWhitelistedClasses ( ) : integer | ||
Результат | integer | Returns the number of whitelisted classes this instance has defined |
public hasWhitelistedConsts ( ) : integer | ||
Результат | integer | Returns the number of whitelisted constants this instance has defined |
public hasWhitelistedFuncs ( ) : integer | ||
Результат | integer | Returns the number of whitelisted functions this instance has defined |
public hasWhitelistedGlobals ( ) : integer | ||
Результат | integer | Returns the number of whitelisted globals this instance has defined |
public hasWhitelistedInterfaces ( ) : integer | ||
Результат | integer | Returns the number of whitelisted interfaces this instance has defined |
public hasWhitelistedMagicConsts ( ) : integer | ||
Результат | integer | Returns the number of whitelisted magic constants this instance has defined |
public hasWhitelistedNamespaces ( ) : integer | ||
Результат | integer | Returns the number of whitelisted namespaces this instance has defined |
public hasWhitelistedOperators ( ) : integer | ||
Результат | integer | Returns the number of whitelisted operators this instance has defined |
public hasWhitelistedPrimitives ( ) : integer | ||
Результат | integer | Returns the number of whitelisted primitives this instance has defined |
public hasWhitelistedSuperglobals ( string $name = null ) : integer | ||
$name | string | The whitelist superglobal key to query |
Результат | integer | Returns the number of whitelisted superglobals or superglobal keys this instance has defined |
public hasWhitelistedTraits ( ) : integer | ||
Результат | integer | Returns the number of whitelisted traits this instance has defined |
public hasWhitelistedTypes ( ) : integer | ||
Результат | integer | Returns the number of whitelisted types this instance has defined |
public hasWhitelistedUses ( ) : integer | ||
Результат | integer | Returns the number of whitelisted uses (or aliases) this instance has defined |
public hasWhitelistedVars ( ) : integer | ||
Результат | integer | Returns the number of whitelisted variables this instance has defined |
public isBlacklistedAlias ( string $name ) : boolean | ||
$name | string | String of alias $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted alias $name, false otherwise |
public isBlacklistedClass ( string $name ) : boolean | ||
$name | string | String of class $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted class $name, false otherwise |
public isBlacklistedConst ( string $name ) : boolean | ||
$name | string | String of constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted constant $name, false otherwise |
public isBlacklistedFunc ( string $name ) : boolean | ||
$name | string | String of function $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted function $name, false otherwise |
public isBlacklistedGlobal ( string $name ) : boolean | ||
$name | string | String of global $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted global $name, false otherwise |
public isBlacklistedInterface ( string $name ) : boolean | ||
$name | string | String of interface $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted interface $name, false otherwise |
public isBlacklistedKeyword ( string $name ) : boolean | ||
$name | string | String of keyword $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted keyword $name, false otherwise |
public isBlacklistedMagicConst ( string $name ) : boolean | ||
$name | string | String of magic constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted magic constant $name, false otherwise |
public isBlacklistedNamespace ( string $name ) : boolean | ||
$name | string | String of namespace $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted namespace $name, false otherwise |
public isBlacklistedOperator ( string $name ) : boolean | ||
$name | string | String of operator $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted operator $name, false otherwise |
public isBlacklistedPrimitive ( string $name ) : boolean | ||
$name | string | String of primitive $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted primitive $name, false otherwise |
public isBlacklistedSuperglobal ( string $name, string $key = null ) : boolean | ||
$name | string | String of blacklisted superglobal $name to query |
$key | string | String of blacklisted superglobal $key to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted superglobal key or superglobal, false otherwise |
public isBlacklistedTrait ( string $name ) : boolean | ||
$name | string | String of trait $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted trait $name, false otherwise |
public isBlacklistedType ( string $name ) : boolean | ||
$name | string | String of type $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted type $name, false otherwise |
public isBlacklistedUse ( string $name ) : boolean | ||
$name | string | String of use (or alias) $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted use (or alias) $name, false otherwise |
public isBlacklistedVar ( string $name ) : boolean | ||
$name | string | String of variable $name to query |
Результат | boolean | Returns true if PHPSandbox instance has blacklisted variable $name, false otherwise |
public isDefinedAlias ( string $name ) : boolean | ||
$name | string | String of alias $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined aliases, false otherwise |
public isDefinedClass ( string $name ) : boolean | ||
$name | string | String of class $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined class, false otherwise |
public isDefinedConst ( string $name ) : boolean | ||
$name | string | String of constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined constant, false otherwise |
public isDefinedFunc ( string $name ) : boolean | ||
$name | string | String of function $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined function, false otherwise |
public isDefinedInterface ( string $name ) : boolean | ||
$name | string | String of interface $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined interface, false otherwise |
public isDefinedMagicConst ( string $name ) : boolean | ||
$name | string | String of magic constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined magic constant, false otherwise |
public isDefinedNamespace ( string $name ) : boolean | ||
$name | string | String of namespace $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined namespace, false otherwise |
public isDefinedTrait ( string $name ) : boolean | ||
$name | string | String of trait $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined trait, false otherwise |
public isDefinedUse ( string $name ) : boolean | ||
$name | string | String of use (or alias) $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined uses (or aliases) and false otherwise |
public isDefinedVar ( string $name ) : boolean | ||
$name | string | String of variable $name to query |
Результат | boolean | Returns true if PHPSandbox instance has defined variable, false otherwise |
public isWhitelistedAlias ( string $name ) : boolean | ||
$name | string | String of alias $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted alias $name, false otherwise |
public isWhitelistedClass ( string $name ) : boolean | ||
$name | string | String of class $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted class $name, false otherwise |
public isWhitelistedConst ( string $name ) : boolean | ||
$name | string | String of constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted constant $name, false otherwise |
public isWhitelistedFunc ( string $name ) : boolean | ||
$name | string | String of function $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted function $name, false otherwise |
public isWhitelistedGlobal ( string $name ) : boolean | ||
$name | string | String of global $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted global $name, false otherwise |
public isWhitelistedInterface ( string $name ) : boolean | ||
$name | string | String of interface $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted interface $name, false otherwise |
public isWhitelistedKeyword ( string $name ) : boolean | ||
$name | string | String of keyword $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted keyword $name, false otherwise |
public isWhitelistedMagicConst ( string $name ) : boolean | ||
$name | string | String of magic constant $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted magic constant $name, false otherwise |
public isWhitelistedNamespace ( string $name ) : boolean | ||
$name | string | String of namespace $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted namespace $name, false otherwise |
public isWhitelistedOperator ( string $name ) : boolean | ||
$name | string | String of operator $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted operator $name, false otherwise |
public isWhitelistedPrimitive ( string $name ) : boolean | ||
$name | string | String of primitive $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted primitive $name, false otherwise |
public isWhitelistedSuperglobal ( string $name, string $key = null ) : boolean | ||
$name | string | String of whitelisted superglobal $name to query |
$key | string | String of whitelisted superglobal $key to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted superglobal key or superglobal, false otherwise |
public isWhitelistedTrait ( string $name ) : boolean | ||
$name | string | String of trait $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted trait $name, false otherwise |
public isWhitelistedType ( string $name ) : boolean | ||
$name | string | String of type $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted type $name, false otherwise |
public isWhitelistedUse ( string $name ) : boolean | ||
$name | string | String of use (or alias) $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted use (or alias) $name, false otherwise |
public isWhitelistedVar ( string $name ) : boolean | ||
$name | string | String of variable $name to query |
Результат | boolean | Returns true if PHPSandbox instance has whitelisted variable $name, false otherwise |
public prepare ( callable $code, boolean $skip_validation = false ) : string | ||
$code | callable | The callable to prepare for execution |
$skip_validation | boolean | Boolean flag to indicate whether the sandbox should skip validation. Default is false. |
Результат | string | The generated code (this can also be accessed via $sandbox->generated_code) |
protected prepareAliases ( ) |
protected prepareConsts ( ) |
protected prepareNamespaces ( ) |
protected prepareUses ( ) |
protected prepareVars ( ) : string | ||
Результат | string | Prepared string of variable output |
public resetOptions ( ) |
public setAliasValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed alias name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setAppendedCode ( string $appended_code = '' ) | ||
$appended_code | string | Sets a string of the appended code |
public setClassValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed class name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setConstValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed constant name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setErrorHandler ( callable $handler, integer $error_types = E_ALL ) | ||
$handler | callable | Callable to handle thrown Errors |
$error_types | integer | Integer flag of the error types to handle (default is E_ALL) |
public setExceptionHandler ( callable $handler ) | ||
$handler | callable | Callable to handle thrown exceptions |
public setFuncValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the normalized passed function name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setGeneratedCode ( string $generated_code = '' ) | ||
$generated_code | string | Sets a string of the generated code |
public setGlobalValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed global name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setInterfaceValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed interface name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setKeywordValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed keyword name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setMagicConstValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed magic constant name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setNamespaceValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed namespace name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setOperatorValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed operator name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setOptions ( array | string $options, boolean | integer | null $value = null ) | ||
$options | array | string | Array of strings or associative array of keys of option names to set $value to, or JSON array or string template to import |
$value | boolean | integer | null | Boolean, integer or null $value to set $option to (optional) |
public setParsedAST ( array $parsed_ast = [] ) | ||
$parsed_ast | array | Sets an array of the parsed AST code |
public setPreparedAST ( array $prepared_ast = [] ) | ||
$prepared_ast | array | Sets an array of the prepared AST code |
public setPreparedCode ( string $prepared_code = '' ) | ||
$prepared_code | string | Sets a string of the prepared code |
public setPreparsedCode ( string $preparsed_code = '' ) | ||
$preparsed_code | string | Sets a string of the preparsed code |
public setPrependedCode ( string $prepended_code = '' ) | ||
$prepended_code | string | Sets a string of the prepended code |
public setPrimitiveValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed primitive name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setSuperglobalValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed superglobal name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setTraitValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed trait name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setTypeValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed type name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setUseValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed use (aka alias) name |
Результат | Returns the PHPSandbox instance for fluent querying |
public setValidationErrorHandler ( callable $handler ) | ||
$handler | callable | Callable to handle thrown validation Errors |
public setValidator ( string $type, callable $callable ) : |
||
$type | string | String of $type name to set validator for |
$callable | callable | Callable that validates the passed element |
Результат | Returns the PHPSandbox instance for fluent querying |
public setVarValidator ( callable $callable ) : |
||
$callable | callable | Callable that validates the passed variable name |
Результат | Returns the PHPSandbox instance for fluent querying |
public undefineAlias ( string | array $name ) | ||
$name | string | array | String of alias name, or array of alias names to undefine |
public undefineAliases ( array $aliases = [] ) | ||
$aliases | array | Array of alias names to undefine. Passing an empty array or no argument will result in undefining all aliases |
public undefineClass ( string | array $name ) | ||
$name | string | array | String of class name or an array of class names to undefine |
public undefineClasses ( array $classes = [] ) | ||
$classes | array | Array of class names to undefine. Passing an empty array or no argument will result in undefining all classes |
public undefineConst ( string | array $name ) | ||
$name | string | array | String of constant name or array of constant names to undefine |
public undefineConsts ( array $constants = [] ) | ||
$constants | array | Array of constant names to undefine. Passing an empty array or no argument will result in undefining all constants |
public undefineFunc ( string | array $name ) | ||
$name | string | array | String of function name or array of function names to undefine |
public undefineFuncs ( array $functions = [] ) | ||
$functions | array | Array of function names to undefine. Passing an empty array or no argument will result in undefining all functions |
public undefineInterface ( string | array $name ) | ||
$name | string | array | String of interface name or an array of interface names to undefine |
public undefineInterfaces ( array $interfaces = [] ) | ||
$interfaces | array | Array of interface names to undefine. Passing an empty array or no argument will result in undefining all interfaces |
public undefineMagicConst ( string | array $name ) | ||
$name | string | array | String of magic constant name, or array of magic constant names to undefine |
public undefineMagicConsts ( array $magic_constants = [] ) | ||
$magic_constants | array | Array of magic constant names to undefine. Passing an empty array or no argument will result in undefining all magic constants |
public undefineNamespace ( string | array $name ) | ||
$name | string | array | String of namespace $name, or an array of namespace names to undefine |
public undefineNamespaces ( array $namespaces = [] ) | ||
$namespaces | array | Array of namespace names to undefine. Passing an empty array or no argument will result in undefining all namespaces |
public undefineSuperglobals ( array $superglobals = [] ) | ||
$superglobals | array | Associative array of superglobal names and keys or array of superglobal names to undefine |
public undefineTrait ( string | array $name ) | ||
$name | string | array | String of trait name or an array of trait names to undefine |
public undefineTraits ( array $traits = [] ) | ||
$traits | array | Array of trait names to undefine. Passing an empty array or no argument will result in undefining all traits |
public undefineUse ( string | array $name ) | ||
$name | string | array | String of use (or alias) name, or array of use (or alias) names to undefine |
public undefineUses ( array $uses = [] ) | ||
$uses | array | Array of use (or alias) names to undefine. Passing an empty array or no argument will result in undefining all uses (or aliases) |
public undefineVar ( string | array $name ) | ||
$name | string | array | String of variable name or an array of variable names to undefine |
public undefineVars ( array $variables = [] ) | ||
$variables | array | Array of variable names to undefine. Passing an empty array or no argument will result in undefining all variables |
public unsetAliasValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetClassValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetConstValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetErrorHandler ( ) |
public unsetExceptionHandler ( ) |
public unsetFuncValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetGlobalValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetInterfaceValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetKeywordValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetMagicConstValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetNamespaceValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetOperatorValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetPrimitiveValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetSuperglobalValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetTraitValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetTypeValidator ( ) |
public unsetUseValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetValidationErrorHandler ( ) |
public unsetValidator ( string $type ) : |
||
$type | string | String of $type to unset |
Результат | Returns the PHPSandbox instance for fluent querying |
public unsetVarValidator ( ) : |
||
Результат | Returns the PHPSandbox instance for fluent querying |
public validationError ( Exception | |
||
$error | Exception | |
Error to throw if Error is not handled, or error message string |
$code | integer | The error code |
$node | PhpParser\Node | The error parser node |
$data | mixed | The error data |
$previous | Exception | The previous Error thrown |
Результат | mixed |
public whitelistAlias ( string | array $name ) | ||
$name | string | array | String of alias names or array of alias names to whitelist |
public whitelistClass ( string | array $name ) | ||
$name | string | array | String of class name or array of class names to whitelist |
public whitelistConst ( string | array $name ) | ||
$name | string | array | String of constant name or array of constant names to whitelist |
public whitelistFunc ( string | array $name ) | ||
$name | string | array | String of function name, or array of function names to whitelist |
public whitelistGlobal ( string | array $name ) | ||
$name | string | array | String of global name or array of global names to whitelist |
public whitelistInterface ( string | array $name ) | ||
$name | string | array | String of interface name or array of interface names to whitelist |
public whitelistKeyword ( string | array $name ) | ||
$name | string | array | String of keyword name or array of keyword names to whitelist |
public whitelistMagicConst ( string | array $name ) | ||
$name | string | array | String of magic constant name or array of magic constant names to whitelist |
public whitelistNamespace ( string | array $name ) | ||
$name | string | array | String of namespace name or array of namespace names to whitelist |
public whitelistOperator ( string | array $name ) | ||
$name | string | array | String of operator name or array of operator names to whitelist |
public whitelistPrimitive ( string | array $name ) | ||
$name | string | array | String of primitive name or array of primitive names to whitelist |
public whitelistTrait ( string | array $name ) | ||
$name | string | array | String of trait name or array of trait names to whitelist |
public whitelistType ( string | array $name ) | ||
$name | string | array | String of type name or array of type names to whitelist |
public whitelistUse ( string | array $name ) | ||
$name | string | array | String of use (or alias) name or array of use (or alias) names to whitelist |
public whitelistVar ( string | array $name ) | ||
$name | string | array | String of variable name or array of variable names to whitelist |
public $allow_aliases |
public $allow_backticks |
public $allow_casting |
public $allow_classes |
public $allow_closures |
public $allow_constants |
public $allow_error_suppressing |
public $allow_escaping |
public $allow_functions |
public $allow_generators |
public $allow_globals |
public $allow_halting |
public $allow_includes |
public $allow_interfaces |
public $allow_namespaces |
public $allow_objects |
public $allow_references |
public $allow_static_variables |
public $allow_traits |
public $allow_variables |
protected $appended_code |
public static $arg_funcs |
public $auto_define_vars |
public $auto_whitelist_classes |
public $auto_whitelist_constants |
public $auto_whitelist_functions |
public $auto_whitelist_globals |
public $auto_whitelist_interfaces |
public $auto_whitelist_traits |
public $auto_whitelist_trusted_code |
protected $blacklist |
public $capture_output |
public $convert_errors |
public static $defined_funcs |
protected $definitions |
protected $error_handler |
protected $error_handler_types |
public $error_level |
protected $exception_handler |
protected $execution_time |
protected $generated_code |
protected $last_exception |
protected $last_validation_error |
public static $magic_constants |
protected $memory_usage |
public $name |
public $overwrite_defined_funcs |
public $overwrite_func_get_args |
public $overwrite_sandboxed_string_funcs |
public $overwrite_superglobals |
protected $parsed_ast |
protected $prepare_time |
protected $prepared_ast |
protected $prepared_code |
protected $preparsed_code |
protected $prepended_code |
public $restore_error_level |
public $sandbox_includes |
public static $sandboxed_string_funcs |
public static $superglobals |
public $time_limit |
public $validate_aliases |
public $validate_classes |
public $validate_constants |
public $validate_functions |
public $validate_globals |
public $validate_interfaces |
public $validate_keywords |
public $validate_magic_constants |
public $validate_namespaces |
public $validate_operators |
public $validate_primitives |
public $validate_superglobals |
public $validate_traits |
public $validate_types |
public $validate_variables |
protected $validation_error_handler |