myvesta/bin/v-php-func

22 lines
616 B
Bash

#!/bin/bash
# info: calling myVesta PHP functions
# options: FUNCTION
#
# The function is calling myVesta or standard PHP functions directly from bash
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ "$1" == "--stdin" ] && [ -p /dev/stdin ]; then
STDIN=$(cat -)
if [ ! -z "$STDIN" ]; then
echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php "$@"
exit $?
fi
fi
php /usr/local/vesta/func/bash-to-php-interpreter.php "$@"
exit $?