Skip to content

Commit fbc399d

Browse files
committed
Add -rfpm & sudo
1 parent 269fa91 commit fbc399d

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

base/hello_world.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,18 @@ do
6161
echo "$opcacherest"
6262

6363
if [ "$param_restart_apache" = true ]; then
64-
echo 'systemctl restart apache2'
64+
echo 'sudo systemctl restart apache2'
6565
sudo systemctl restart apache2
6666
fi
6767

68+
if [ "$param_restart_phpfpm" = true ]; then
69+
phpVer=`php -v | head -n 1 | sed -E 's/PHP ([0-9]+\.[0-9]+).*/\1/'`
70+
echo "sudo systemctl restart \"php$phpVer-fpm\""
71+
sudo systemctl restart "php$phpVer-fpm"
72+
fi
73+
6874
if [ "$param_restart_nginx" = true ]; then
69-
echo 'systemctl restart nginx'
75+
echo 'sudo systemctl restart nginx'
7076
sudo systemctl restart nginx
7177
fi
7278

base/option_target.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function showHelp()
99
{
1010
cat << HEREDOC
1111
12-
Usage: bash check.sh [-t pure-php slim-*]
12+
Usage: bash setup.sh [-t slim-4 symfony-8.0 ...]
13+
Usage: bash check.sh [-t pure-php slim-4 ...]
1314
1415
Optional Arguments:
1516
-h, --help Show this help message and exit

benchmark.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function showHelp()
2727
-f, --fresh Clean all frameworks and install the target framework -fresh install- before benchmark.
2828
-h, --help Show this help message and exit
2929
-rapache, --restart-apache Restart apache "sudo systemctl restart apache2" before each benchmark.
30-
-rnginx, --restart-nginx Restart apache "sudo systemctl restart nginx" before each benchmark.
30+
-rfpm, --restart-fpm Restart php-fpm "sudo systemctl restart php{current-version}-fpm" before each benchmark.
31+
-rnginx, --restart-nginx Restart nginx "sudo systemctl restart nginx" before each benchmark.
3132
-t, --target Specify your target framework/s for benchmarking
3233
Separate them via space.
3334
@@ -37,6 +38,7 @@ HEREDOC
3738
export param_targets="$frameworks_list"
3839
export param_fresh=false
3940
export param_restart_apache=false
41+
export param_restart_phpfpm=false
4042
export param_restart_nginx=false
4143

4244
oldIFS="$IFS"
@@ -58,6 +60,9 @@ do
5860
-rapache|--restart-apache)
5961
param_restart_apache=true
6062
;;
63+
-rfpm|--restart-fpm)
64+
param_restart_phpfpm=true
65+
;;
6166
-rnginx|--restart-nginx)
6267
param_restart_nginx=true
6368
;;

0 commit comments

Comments
 (0)