Merge pull request #4615 from staabm/xdebugwarn
add a warning when xdebug is loaded while running composer commandspull/2232/merge
commit
4071b09091
|
@ -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.
|
||||
|
|
|
@ -111,6 +111,10 @@ class Application extends BaseApplication
|
|||
$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 = '';
|
||||
if ($name = $this->getCommandName($input)) {
|
||||
|
|
Loading…
Reference in New Issue