Mitesh Shah
11 years ago
3 changed files with 32 additions and 64 deletions
@ -0,0 +1,32 @@ |
|||
# PHP debug |
|||
|
|||
function ee_mod_debug_php() |
|||
{ |
|||
if [ "$1" = "start" ]; then |
|||
grep -B2 9001 /etc/nginx/conf.d/upstream.conf | grep php &>> $EE_COMMAND_LOG |
|||
if [ $? -ne 0 ]; then |
|||
ee_lib_echo "Setup PHP5-FPM slow log, please wait..." |
|||
sed -i "5 s/9000/9001/" /etc/nginx/conf.d/upstream.conf \ |
|||
|| ee_lib_error "Unable to setup PHP5-FPM slow log, exit status = " $? |
|||
|
|||
# NGINX reload trigger |
|||
EE_TRIGGER_NGINX="true" |
|||
else |
|||
# Display message |
|||
ee_lib_echo "PHP5-FPM slow log already enabled" |
|||
fi |
|||
elif [ "$1" = "stop" ]; then |
|||
grep -B2 9001 /etc/nginx/conf.d/upstream.conf | grep php &>> $EE_COMMAND_LOG |
|||
if [ $? -eq 0 ]; then |
|||
ee_lib_echo "Disable PHP5-FPM slow log, please wait..." |
|||
sed -i "5 s/9001/9000/" /etc/nginx/conf.d/upstream.conf \ |
|||
|| ee_lib_error "Unable to disable PHP5-FPM slow log, exit status = " $? |
|||
|
|||
# NGINX reload trigger |
|||
EE_TRIGGER_NGINX="true" |
|||
else |
|||
# Display message |
|||
ee_lib_echo "PHP5-FPM slow log already disabled" |
|||
fi |
|||
fi |
|||
} |
@ -1,32 +0,0 @@ |
|||
# Enables PHP debug mode |
|||
|
|||
function ee_mod_debug_php_start() |
|||
{ |
|||
# Lets disable PHP restart trigger |
|||
EE_DEBUG_PHP="" |
|||
|
|||
if [ -z $EE_DEBUG_SITENAME ]; then |
|||
grep -B2 9001 /etc/nginx/conf.d/upstream.conf \ |
|||
| grep php &>> $EE_COMMAND_LOG |
|||
if [ $? -ne 0 ]; then |
|||
ee_lib_echo "Enable PHP5-FPM slow log, please wait..." |
|||
sed -i "4 s/9000/9001/" /etc/nginx/conf.d/upstream.conf |
|||
|
|||
# Lets trigger the NGINX reload |
|||
EE_DEBUG_NGINX="--nginx" |
|||
else |
|||
ee_lib_echo "PHP5-FPM slow log already enabled" |
|||
fi |
|||
else |
|||
grep 9001 /etc/nginx/sites-available/$EE_DOMAIN &>> $EE_COMMAND_LOG |
|||
if [ $? -ne 0 ]; then |
|||
ee_lib_echo "Enable PHP5-FPM slow log for $EE_DOMAIN, please wait..." |
|||
sed -i "s/fastcgi_pass.*/fastcgi_pass debug;/g" /etc/nginx/sites-available/$EE_DOMAIN |
|||
|
|||
# Lets trigger the NGINX reload |
|||
EE_DEBUG_NGINX="--nginx" |
|||
else |
|||
ee_lib_echo "PHP5-FPM slow log already enabled for $EE_DOMAIN" |
|||
fi |
|||
fi |
|||
} |
@ -1,32 +0,0 @@ |
|||
# Disables PHP debug mode |
|||
|
|||
function ee_mod_debug_php_stop() |
|||
{ |
|||
# Lets disable PHP restart trigger |
|||
EE_DEBUG_PHP="" |
|||
|
|||
if [ -z $EE_DEBUG_SITENAME ]; then |
|||
grep -B2 9001 /etc/nginx/conf.d/upstream.conf \ |
|||
| grep php &>> $EE_COMMAND_LOG |
|||
if [ $? -eq 0 ]; then |
|||
ee_lib_echo "Disable PHP5-FPM slow log, please wait..." |
|||
sed -i "4 s/9001/9000/" /etc/nginx/conf.d/upstream.conf |
|||
|
|||
# Lets trigger the NGINX reload |
|||
EE_DEBUG_NGINX="--nginx" |
|||
else |
|||
ee_lib_echo "PHP5-FPM slow log already disabled" |
|||
fi |
|||
else |
|||
grep "fastcgi_pass debug;" /etc/nginx/sites-available/$EE_DOMAIN &>> $EE_COMMAND_LOG |
|||
if [ $? -eq 0 ]; then |
|||
ee_lib_echo "Disable PHP5-FPM slow log for $EE_DOMAIN, please wait..." |
|||
sed -i "s/fastcgi_pass.*/fastcgi_pass php;/g" /etc/nginx/sites-available/$EE_DOMAIN |
|||
|
|||
# Lets trigger NGINX reload |
|||
EE_DEBUG_NGINX="--nginx" |
|||
else |
|||
ee_lib_echo "PHP5-FPM slow log already disabled for $EE_DOMAIN" |
|||
fi |
|||
fi |
|||
} |
Loading…
Reference in new issue