mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -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
|
@ -28,7 +28,7 @@ function myvesta_check_args ($requried_arguments, $arguments) {
|
|||
$argument_counter=count($argv);
|
||||
$argument_counter--;
|
||||
$argv[0]=str_replace('/usr/local/vesta/bin/', '', $argv[0]);
|
||||
echo "-------------------- ".$argv[0]." --------------------\n";
|
||||
// echo "-------------------- ".$argv[0]." --------------------\n";
|
||||
if ($argument_counter<$requried_arguments) {
|
||||
$arguments=str_replace(" ", "' '", $arguments);
|
||||
$arguments="'".$arguments."'";
|
||||
|
@ -42,8 +42,25 @@ function myvesta_check_args ($requried_arguments, $arguments) {
|
|||
}
|
||||
}
|
||||
|
||||
function myvesta_fix_args() {
|
||||
global $argv;
|
||||
$i=0;
|
||||
foreach ($argv as $argument) {
|
||||
if ($i==0) {$i++; continue;}
|
||||
$argv[$i]=myvesta_fix_backslashes($argv[$i]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
function myvesta_exit($code) {
|
||||
global $argv;
|
||||
echo "==================== ".$argv[0].": ".$code." ====================\n";
|
||||
// echo "==================== ".$argv[0].": ".$code." ====================\n";
|
||||
exit($code);
|
||||
}
|
||||
|
||||
function myvesta_test_func () {
|
||||
$args=func_get_args();
|
||||
echo "You said: ";
|
||||
print_r ($args);
|
||||
echo "\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue