Skip to content

Commit f2da2bc

Browse files
committed
-updated recurring script
1 parent 4c08aa2 commit f2da2bc

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

scripts/provision/configure_environment_recurring.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
function process_php_config () {
44
php_ini_paths=$1
5+
56
for php_ini_path in "${php_ini_paths[@]}"
67
do
7-
echo "date.timezone = America/Chicago" >> ${php_ini_path}
8-
sed -i "s|;include_path = \".:/usr/share/php\"|include_path = \".:/usr/share/php:${guest_magento_dir}/vendor/phpunit/phpunit\"|g" ${php_ini_path}
9-
sed -i "s|display_errors = Off|display_errors = On|g" ${php_ini_path}
10-
sed -i "s|display_startup_errors = Off|display_startup_errors = On|g" ${php_ini_path}
11-
sed -i "s|error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT|error_reporting = E_ALL|g" ${php_ini_path}
8+
if [ -f ${php_ini_path} ]; then
9+
echo "date.timezone = America/Chicago" >> ${php_ini_path}
10+
sed -i "s|;include_path = \".:/usr/share/php\"|include_path = \".:/usr/share/php:${guest_magento_dir}/vendor/phpunit/phpunit\"|g" ${php_ini_path}
11+
sed -i "s|display_errors = Off|display_errors = On|g" ${php_ini_path}
12+
sed -i "s|display_startup_errors = Off|display_startup_errors = On|g" ${php_ini_path}
13+
sed -i "s|error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT|error_reporting = E_ALL|g" ${php_ini_path}
14+
fi
1215
done
1316
}
1417

@@ -56,7 +59,11 @@ php_ini_paths=( /etc/php/7.0/cli/php.ini /etc/php/5.6/cli/php.ini )
5659
process_php_config ${php_ini_paths}
5760

5861
if [ ${use_php7} -eq 1 ]; then
59-
update-alternatives --set php /usr/bin/php7.0 && a2dismod php5.6 && a2enmod php7.0
62+
update-alternatives --set php /usr/bin/php7.0
63+
if [ -d "/etc/php/5.6" ]; then
64+
a2dismod php5.6
65+
fi
66+
a2enmod php7.0
6067
else
6168
if [ ! -d "/etc/php/5.6" ]; then
6269
init_php56

0 commit comments

Comments
 (0)