Allow for disabling autoloader on Installer

main
Matthew J. Sahagian 10 years ago
parent b23a3cd368
commit 5896f283be

@ -105,6 +105,7 @@ class Installer
protected $dryRun = false;
protected $verbose = false;
protected $update = false;
protected $runAutoloader = true;
protected $runScripts = true;
protected $ignorePlatformReqs = false;
/**
@ -311,16 +312,18 @@ class Installer
}
}
// write autoloader
if ($this->optimizeAutoloader) {
$this->io->write('<info>Generating optimized autoload files</info>');
} else {
$this->io->write('<info>Generating autoload files</info>');
if ($this->runAutoloader) {
// write autoloader
if ($this->optimizeAutoloader) {
$this->io->write('<info>Generating optimized 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) {
// dispatch post event
$eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD;
@ -1152,6 +1155,21 @@ class Installer
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
*

Loading…
Cancel
Save