-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
600c811
commit 10d6285
Showing
12 changed files
with
109 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
composer() { | ||
run -- composer $@ | ||
} | ||
|
||
new() { | ||
run -- composer create-project $@ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
doctor() { | ||
echo PHP_VERSION="$PHP_VERSION" | ||
echo PHPCTL_IMAGE="$PHPCTL_IMAGE" | ||
echo -e "\033[0;32mPHP_VERSION\033[0m=$PHP_VERSION" | ||
echo -e "PHPCTL_IMAGE=\033[0;33m$PHPCTL_IMAGE\033[0m" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
php() { | ||
$(run "$PHPCTL_TTY" php) ${@:--v} | ||
} | ||
|
||
composer() { | ||
$(run "$PHPCTL_TTY" composer) $@ | ||
run -- php ${@--v} | ||
} | ||
|
||
repl() { | ||
# shellcheck disable=SC2091 | ||
$(run "$PHPCTL_TTY" psysh) | ||
run -- psysh | ||
} | ||
|
||
server() { | ||
port=${1:-80} | ||
dir=${2:-.} | ||
at "$port" php -S 0.0.0.0:"$port" -t "$dir" | ||
fix() { | ||
run -- php-cs-fixer fix $@ | ||
} | ||
|
||
at() { | ||
port=${1:-80} | ||
$(run "$PHPCTL_TTY -p$port:$port" "$2") ${@:3} | ||
run "-p$1:$1" ${@:2} | ||
} | ||
|
||
fix() { | ||
if [ -n "$1" ]; then | ||
$(run "$PHPCTL_TTY" php-cs-fixer) fix $@ | ||
exit 0 | ||
fi | ||
|
||
$(run "$PHPCTL_TTY" php-cs-fixer) help fix | ||
server() { | ||
port=${1:-80} | ||
dir=${2:-.} | ||
at "$port" php -S 0.0.0.0:"$port" -t "$dir" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
sh() { | ||
if [ -z "$1" ]; then | ||
# shellcheck disable=SC2091 | ||
$(run "$PHPCTL_TTY" sh) | ||
run -- sh | ||
else | ||
$(run "$PHPCTL_TTY" sh) -c "$*" | ||
run -- "$*" | ||
fi | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
function test_doctor() { | ||
assert_contains "PHP_VERSION=" "$(./phpctl doctor)" | ||
assert_contains "PHPCTL_IMAGE=" "$(./phpctl doctor)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function test_help_is_default() { | ||
assert_contains "Usage: phpctl" "$(./phpctl)" | ||
assert_contains "phpctl <command> [arguments]" "$(./phpctl)" | ||
} |