32 lines
904 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
2020-03-02 16:14:20 +08:00
2021-06-16 00:17:30 +08:00
# shellcheck disable=SC2068
# shellcheck disable=SC2181
# author: crazywhalecc
# since: 2.5.0
2022-05-14 23:52:37 +08:00
if [ "$ZM_CUSTOM_PHP_PATH" != "" ]; then
echo "* Using PHP executable: ""$ZM_CUSTOM_PHP_PATH"
executable="$ZM_CUSTOM_PHP_PATH"
elif [ -f "$(pwd)/runtime/php" ]; then
executable="$(pwd)/runtime/php"
echo "* Framework started with built-in php."
else
2021-06-16 00:17:30 +08:00
which php >/dev/null 2>&1
if [ $? -eq 0 ]; then
2021-06-16 00:17:30 +08:00
executable=$(which php)
else
2021-06-16 00:17:30 +08:00
echo '[ErrCode:E00014] Cannot find any PHP runtime, please use command "./install-runtime.sh" or install PHP manually!'
exit 1
fi
fi
if [ -f "$(pwd)/src/entry.php" ]; then
2021-06-16 00:17:30 +08:00
$executable "$(pwd)/src/entry.php" $@
elif [ -f "$(pwd)/vendor/zhamao/framework/src/entry.php" ]; then
2021-06-16 00:17:30 +08:00
$executable "$(pwd)/vendor/zhamao/framework/src/entry.php" $@
else
2021-06-16 00:17:30 +08:00
echo "[ErrCode:E00015] Cannot find zhamao-framework entry file!"
exit 1
fi