add a warning when xdebug is loaded while running composer commands

main
Markus Staab 9 years ago
parent d7d91269ec
commit a59f0a7ca8

@ -131,6 +131,23 @@ Or, you can increase the limit with a command-line argument:
php -d memory_limit=-1 composer.phar <...>
```
## Xdebug impact on Composer
Running Composer console commands while the php extension "xdebug" is loaded reduces speed considerably.
This is even the case when all "xdebug" related features are disabled per php.ini flags,
but the php extension itself is loaded into the PHP engine.
Compared to a cli command run with "xdebug" enabled a speed improvement by a factor of up to 3 is not uncommon.
> **Note:** This is a general issue when running PHP with "xdebug" enabled. You shouldn't
> load the extension in production like environments per se.
Disable "xdebug" in your `php.ini` (ex. `/etc/php5/cli/php.ini` for Debian-like systems) by
locating the related `zend_extension` directive and prepending it with `;` (semicolon):
```sh
;zend_extension = "/path/to/my/xdebug.so"
```
## "The system cannot find the path specified" (Windows)
1. Open regedit.

@ -94,6 +94,10 @@ class Application extends BaseApplication
if (PHP_VERSION_ID < 50302) {
$io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>');
}
if (extension_loaded('xdebug')) {
$io->write('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
}
if (defined('COMPOSER_DEV_WARNING_TIME')) {
$commandName = '';

Loading…
Cancel
Save