-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/use rename for php debugger switch (#107)
* Don't install pysed * Don't disable blackfire by default * Delete PHP debugger ini files instead of disabling Because the container is stateless, removing is good enough. * Update documentation
- Loading branch information
Showing
136 changed files
with
1,308 additions
and
2,465 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
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
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
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
71 changes: 32 additions & 39 deletions
71
docker/php-apache-dev/alpine-3-php7/conf/provision/entrypoint.d/10-php-debugger.sh
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,63 +1,56 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Debugger switch | ||
# | ||
|
||
function phpModuleEnable() { | ||
for PHP_FILE in $*; do | ||
if [[ -f "$PHP_FILE" ]]; then | ||
pysed -r '^[; ]*((zend_)?(extension=.*))$' '\1' "$PHP_FILE" --write | ||
fi | ||
done | ||
} | ||
PHP_CONF_PATHS=" | ||
/etc/php5/conf.d | ||
/etc/php7/conf.d | ||
/etc/php.d | ||
/etc/php5/mods-available | ||
/etc/php5/cli/conf.d | ||
/etc/php5/cli/conf.d | ||
/etc/php5/fpm/conf.d | ||
/etc/php5/fpm/conf.d | ||
/etc/php/7.0/mods-available | ||
/etc/php/7.0/cli/conf.d | ||
/etc/php/7.0/fpm/conf.d" | ||
|
||
function phpModuleRemove() { | ||
if [ "$#" -ne 1 ]; then | ||
echo "You must specify the name of the PHP module which you want to disable" | ||
exit 1 | ||
fi | ||
|
||
function phpModuleDisable() { | ||
for PHP_FILE in $*; do | ||
if [[ -f "$PHP_FILE" ]]; then | ||
pysed -r '^[; ]*((zend_)?(extension=.*))$' ';\1' "$PHP_FILE" --write | ||
fi | ||
echo " - Removing PHP module ${1}" | ||
for CONF_PATH in $PHP_CONF_PATHS; do | ||
rm -f "${CONF_PATH}"/*"${1}".ini | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
done | ||
} | ||
|
||
PHP_XDEBUG_FILES=" | ||
/etc/php5/conf.d/xdebug.ini | ||
/etc/php7/conf.d/xdebug.ini | ||
/etc/php.d/xdebug.ini | ||
/etc/php5/mods-available/xdebug.ini | ||
/etc/php5/cli/conf.d/20-xdebug.ini | ||
/etc/php5/cli/conf.d/xdebug.ini | ||
/etc/php5/fpm/conf.d/20-xdebug.ini | ||
/etc/php5/fpm/conf.d/xdebug.ini | ||
/etc/php/7.0/mods-available/xdebug.ini | ||
/etc/php/7.0/cli/conf.d/20-xdebug.ini | ||
/etc/php/7.0/fpm/conf.d/20-xdebug.ini" | ||
|
||
PHP_BLACKFIRE_FILES=" | ||
/etc/php.d/zz-blackfire.ini | ||
/etc/php5/conf.d/90-blackfire.ini | ||
/etc/php5/conf.d/zz-blackfire.ini | ||
/etc/php5/cli/conf.d/90-blackfire.ini | ||
/etc/php5/cli/conf.d/zz-blackfire.ini | ||
/etc/php5/fpm/conf.d/90-blackfire.ini | ||
/etc/php5/fpm/conf.d/zz-blackfire.ini | ||
/etc/php/7.0/cli/conf.d/90-blackfire.ini | ||
/etc/php/7.0/fpm/conf.d/90-blackfire.ini" | ||
|
||
if [[ -n "${PHP_DEBUGGER+x}" ]]; then | ||
case "$PHP_DEBUGGER" in | ||
xdebug) | ||
echo "PHP-Debugger: Xdebug enabled" | ||
phpModuleRemove "blackfire" | ||
;; | ||
|
||
blackfire) | ||
echo "PHP-Debugger: Blackfire enabled" | ||
phpModuleEnable $PHP_BLACKFIRE_FILES | ||
phpModuleDisable $PHP_XDEBUG_FILES | ||
phpModuleRemove "xdebug" | ||
;; | ||
|
||
none) | ||
echo "PHP-Debugger: none" | ||
phpModuleDisable $PHP_BLACKFIRE_FILES | ||
phpModuleDisable $PHP_XDEBUG_FILES | ||
phpModuleRemove "blackfire" | ||
phpModuleRemove "xdebug" | ||
;; | ||
esac | ||
|
||
else | ||
|
||
echo "PHP-Debugger: not specified - default is xdebug" | ||
phpModuleRemove "blackfire" | ||
|
||
fi |
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
21 changes: 0 additions & 21 deletions
21
...ne-3-php7/conf/provision/roles/webdevops-php-dev/tasks/bootstrap/php-module.blackfire.yml
This file was deleted.
Oops, something went wrong.
71 changes: 32 additions & 39 deletions
71
docker/php-apache-dev/alpine-3/conf/provision/entrypoint.d/10-php-debugger.sh
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,63 +1,56 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Debugger switch | ||
# | ||
|
||
function phpModuleEnable() { | ||
for PHP_FILE in $*; do | ||
if [[ -f "$PHP_FILE" ]]; then | ||
pysed -r '^[; ]*((zend_)?(extension=.*))$' '\1' "$PHP_FILE" --write | ||
fi | ||
done | ||
} | ||
PHP_CONF_PATHS=" | ||
/etc/php5/conf.d | ||
/etc/php7/conf.d | ||
/etc/php.d | ||
/etc/php5/mods-available | ||
/etc/php5/cli/conf.d | ||
/etc/php5/cli/conf.d | ||
/etc/php5/fpm/conf.d | ||
/etc/php5/fpm/conf.d | ||
/etc/php/7.0/mods-available | ||
/etc/php/7.0/cli/conf.d | ||
/etc/php/7.0/fpm/conf.d" | ||
|
||
function phpModuleRemove() { | ||
if [ "$#" -ne 1 ]; then | ||
echo "You must specify the name of the PHP module which you want to disable" | ||
exit 1 | ||
fi | ||
|
||
function phpModuleDisable() { | ||
for PHP_FILE in $*; do | ||
if [[ -f "$PHP_FILE" ]]; then | ||
pysed -r '^[; ]*((zend_)?(extension=.*))$' ';\1' "$PHP_FILE" --write | ||
fi | ||
echo " - Removing PHP module ${1}" | ||
for CONF_PATH in $PHP_CONF_PATHS; do | ||
rm -f "${CONF_PATH}"/*"${1}".ini | ||
done | ||
} | ||
|
||
PHP_XDEBUG_FILES=" | ||
/etc/php5/conf.d/xdebug.ini | ||
/etc/php7/conf.d/xdebug.ini | ||
/etc/php.d/xdebug.ini | ||
/etc/php5/mods-available/xdebug.ini | ||
/etc/php5/cli/conf.d/20-xdebug.ini | ||
/etc/php5/cli/conf.d/xdebug.ini | ||
/etc/php5/fpm/conf.d/20-xdebug.ini | ||
/etc/php5/fpm/conf.d/xdebug.ini | ||
/etc/php/7.0/mods-available/xdebug.ini | ||
/etc/php/7.0/cli/conf.d/20-xdebug.ini | ||
/etc/php/7.0/fpm/conf.d/20-xdebug.ini" | ||
|
||
PHP_BLACKFIRE_FILES=" | ||
/etc/php.d/zz-blackfire.ini | ||
/etc/php5/conf.d/90-blackfire.ini | ||
/etc/php5/conf.d/zz-blackfire.ini | ||
/etc/php5/cli/conf.d/90-blackfire.ini | ||
/etc/php5/cli/conf.d/zz-blackfire.ini | ||
/etc/php5/fpm/conf.d/90-blackfire.ini | ||
/etc/php5/fpm/conf.d/zz-blackfire.ini | ||
/etc/php/7.0/cli/conf.d/90-blackfire.ini | ||
/etc/php/7.0/fpm/conf.d/90-blackfire.ini" | ||
|
||
if [[ -n "${PHP_DEBUGGER+x}" ]]; then | ||
case "$PHP_DEBUGGER" in | ||
xdebug) | ||
echo "PHP-Debugger: Xdebug enabled" | ||
phpModuleRemove "blackfire" | ||
;; | ||
|
||
blackfire) | ||
echo "PHP-Debugger: Blackfire enabled" | ||
phpModuleEnable $PHP_BLACKFIRE_FILES | ||
phpModuleDisable $PHP_XDEBUG_FILES | ||
phpModuleRemove "xdebug" | ||
;; | ||
|
||
none) | ||
echo "PHP-Debugger: none" | ||
phpModuleDisable $PHP_BLACKFIRE_FILES | ||
phpModuleDisable $PHP_XDEBUG_FILES | ||
phpModuleRemove "blackfire" | ||
phpModuleRemove "xdebug" | ||
;; | ||
esac | ||
|
||
else | ||
|
||
echo "PHP-Debugger: not specified - default is xdebug" | ||
phpModuleRemove "blackfire" | ||
|
||
fi |
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
21 changes: 0 additions & 21 deletions
21
.../alpine-3/conf/provision/roles/webdevops-php-dev/tasks/bootstrap/php-module.blackfire.yml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
It's not a disable function :(
A simple
mv
would have is enough.What would have allowed to change between xdebug/blacfire without restart the container.