Interpreter for calling myVesta PHP functions

This commit is contained in:
myvesta 2023-03-26 03:40:33 +02:00 committed by GitHub
parent d84a021354
commit 09dcc123be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 95 additions and 6 deletions

View file

@ -0,0 +1,21 @@
<?php
if (!isset($argv)) exit;
include ("/usr/local/vesta/func/main.php");
include ("/usr/local/vesta/func/string.php");
$counter=count($argv);
if ($counter<1) myvesta_throw_error(2, 'Function is missing');
$func="myvesta_".$argv[1];
if (!function_exists($func)) myvesta_throw_error(2, 'Function does not exists');
$params=array();
for ($i=2; $i<$counter; $i++) {
$argv[$i]=myvesta_fix_backslashes($argv[$i]);
$params[]=$argv[$i];
}
// echo $func."\n"; print_r($params);
$r=call_user_func_array($func, $params);