mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
Interpreter for calling myVesta PHP functions
This commit is contained in:
parent
d84a021354
commit
09dcc123be
4 changed files with 95 additions and 6 deletions
21
func/bash-to-php-interpreter.php
Normal file
21
func/bash-to-php-interpreter.php
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue