1
0
Fork 0

Merge remote-tracking branch 'mattsah/master'

pull/2604/merge
Jordi Boggiano 2014-12-29 20:21:43 +00:00
commit b8f4960f0d
4 changed files with 32 additions and 8 deletions

View File

@ -88,6 +88,7 @@ resolution.
installation and show you what would happen. installation and show you what would happen.
* **--dev:** Install packages listed in `require-dev` (this is the default behavior). * **--dev:** Install packages listed in `require-dev` (this is the default behavior).
* **--no-dev:** Skip installing packages listed in `require-dev`. * **--no-dev:** Skip installing packages listed in `require-dev`.
* **--no-autoloader:** Skips autoloader generation.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--no-plugins:** Disables plugins. * **--no-plugins:** Disables plugins.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some
@ -130,6 +131,7 @@ php composer.phar update vendor/*
* **--dry-run:** Simulate the command without actually doing anything. * **--dry-run:** Simulate the command without actually doing anything.
* **--dev:** Install packages listed in `require-dev` (this is the default behavior). * **--dev:** Install packages listed in `require-dev` (this is the default behavior).
* **--no-dev:** Skip installing packages listed in `require-dev`. * **--no-dev:** Skip installing packages listed in `require-dev`.
* **--no-autoloader:** Skips autoloader generation.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--no-plugins:** Disables plugins. * **--no-plugins:** Disables plugins.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some

View File

@ -41,6 +41,7 @@ class InstallCommand extends Command
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'), new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'), new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
@ -113,6 +114,7 @@ EOT
->setPreferSource($preferSource) ->setPreferSource($preferSource)
->setPreferDist($preferDist) ->setPreferDist($preferDist)
->setDevMode(!$input->getOption('no-dev')) ->setDevMode(!$input->getOption('no-dev'))
->setRunAutoloader(!$input->getOption('no-autoloader'))
->setRunScripts(!$input->getOption('no-scripts')) ->setRunScripts(!$input->getOption('no-scripts'))
->setOptimizeAutoloader($optimize) ->setOptimizeAutoloader($optimize)
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))

View File

@ -41,6 +41,7 @@ class UpdateCommand extends Command
new InputOption('lock', null, InputOption::VALUE_NONE, 'Only updates the lock file hash to suppress warning about the lock file being out of date.'), new InputOption('lock', null, InputOption::VALUE_NONE, 'Only updates the lock file hash to suppress warning about the lock file being out of date.'),
new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'), new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'), new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'), new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'),
@ -117,6 +118,7 @@ EOT
->setPreferSource($preferSource) ->setPreferSource($preferSource)
->setPreferDist($preferDist) ->setPreferDist($preferDist)
->setDevMode(!$input->getOption('no-dev')) ->setDevMode(!$input->getOption('no-dev'))
->setRunAutoloader(!$input->getOption('no-autoloader'))
->setRunScripts(!$input->getOption('no-scripts')) ->setRunScripts(!$input->getOption('no-scripts'))
->setOptimizeAutoloader($optimize) ->setOptimizeAutoloader($optimize)
->setUpdate(true) ->setUpdate(true)

View File

@ -105,6 +105,7 @@ class Installer
protected $dryRun = false; protected $dryRun = false;
protected $verbose = false; protected $verbose = false;
protected $update = false; protected $update = false;
protected $runAutoloader = true;
protected $runScripts = true; protected $runScripts = true;
protected $ignorePlatformReqs = false; protected $ignorePlatformReqs = false;
protected $preferStable = false; protected $preferStable = false;
@ -317,16 +318,18 @@ class Installer
} }
} }
// write autoloader if ($this->runAutoloader) {
if ($this->optimizeAutoloader) { // write autoloader
$this->io->write('<info>Generating optimized autoload files</info>'); if ($this->optimizeAutoloader) {
} else { $this->io->write('<info>Generating optimized autoload files</info>');
$this->io->write('<info>Generating autoload files</info>'); } else {
$this->io->write('<info>Generating autoload files</info>');
}
$this->autoloadGenerator->setDevMode($this->devMode);
$this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader);
} }
$this->autoloadGenerator->setDevMode($this->devMode);
$this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader);
if ($this->runScripts) { if ($this->runScripts) {
// dispatch post event // dispatch post event
$eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD; $eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD;
@ -1163,6 +1166,21 @@ class Installer
return $this; return $this;
} }
/**
* set whether to run autoloader or not
*
* @param boolean $runAutoloader
* @return Installer
*/
public function setRunAutoloader($runAutoloader = true)
{
$this->runAutoloader = (boolean) $runAutoloader;
return $this;
}
/** /**
* set whether to run scripts or not * set whether to run scripts or not
* *