Skip to content

Commit d6ace58

Browse files
committed
Add command to run the built PHP cli
1 parent e14f991 commit d6ace58

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

bin/php-src-devtools

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ case "$1" in
1313
"test")
1414
runInContainer test "${@:2}"
1515
;;
16+
"php")
17+
runInContainer run-cli "${@:2}"
18+
;;
1619
*)
1720
echo "Unknown command"
1821
exit 2

docker/php-src-devtools-entrypoint

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,28 @@ function doConfigure()
1111

1212
function doBuild()
1313
{
14-
if [ ! -f Makefile ]; then
15-
doConfigure
16-
fi;
17-
make -j`nproc`
14+
if [ ! -f Makefile ]; then
15+
doConfigure
16+
fi;
17+
make -j`nproc`
1818
}
1919

2020
function doTest()
2121
{
22-
if [ ! -f Makefile ]; then
22+
if [ ! -f Makefile ]; then
2323
doConfigure
2424
fi;
2525
TESTS="$1" make -j`nproc` test
2626
}
2727

28+
function doRunCli()
29+
{
30+
if [ ! -f sapi/cli/php ]; then
31+
doBuild
32+
fi;
33+
sapi/cli/php "$@"
34+
}
35+
2836
case "$1" in
2937
"build")
3038
doBuild
@@ -35,6 +43,9 @@ case "$1" in
3543
"test")
3644
doTest "$1"
3745
;;
46+
"run-cli")
47+
doRunCli "${@:2}"
48+
;;
3849
*)
3950
echo "Unknown command"
4051
exit 2

0 commit comments

Comments
 (0)