Page MenuHomeDevCentral

/usr/local/bin/run-php-script

Authored By
dereckson
Feb 8 2022, 17:02
Size
366 B
Referenced Files
None
Subscribers
None

/usr/local/bin/run-php-script

#!/bin/sh
COMMAND=$1
shift
if [ -f vendor/bin/$COMMAND ]; then
echo "Switching to Composer $COMMAND:"
SCRIPT=vendor/bin/$COMMAND
elif [ -f /opt/$COMMAND.phar ]; then
SCRIPT=/opt/$COMMAND.phar
else
SCRIPT=$(which $COMMAND) 2> /dev/null
if [ $? -ne 0 ]; then
echo "No $COMMAND has been found."
exit 1
fi
fi
php $SCRIPT "$@"

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
930103
Default Alt Text
/usr/local/bin/run-php-script (366 B)

Event Timeline