Closed m4n50n closed 8 months ago
Not that I can think of off the top of my head, but it would potentially be an intriguing feature to be able to observe what is actually executed in the sandbox via some sort of hook system. Food for thought for future development.
@m4n50n Actually I think one way you could handle this is by adding a custom function validator that simply logs the functions it checks but returns true
for all inputs. You would need the validate_functions
flag set to true
of course.
Like so:
$logger = new Logger(); //example logger object
$sandbox->setFuncValdiator(function(string $function, PHPSandbox $instance)use($logger){
$logger->debug($function);
return true;
});
@fieryprophet your solution works for now, thanks!
Hello,
is there any way to get, at the end of the execution, all the functions that have been executed? Something similar to saving in an array all the $name that pass through the checkFunc method of PHPSandbox.php.
Thanks!