Merge branch '1.8'
commit
40cf7cb2f7
|
@ -216,7 +216,6 @@ class Config
|
||||||
case 'cache-vcs-dir':
|
case 'cache-vcs-dir':
|
||||||
case 'cafile':
|
case 'cafile':
|
||||||
case 'capath':
|
case 'capath':
|
||||||
case 'htaccess-protect':
|
|
||||||
// convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config
|
// convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config
|
||||||
$env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
|
$env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
|
||||||
|
|
||||||
|
@ -230,6 +229,13 @@ class Config
|
||||||
|
|
||||||
return (($flags & self::RELATIVE_PATHS) == self::RELATIVE_PATHS) ? $val : $this->realpath($val);
|
return (($flags & self::RELATIVE_PATHS) == self::RELATIVE_PATHS) ? $val : $this->realpath($val);
|
||||||
|
|
||||||
|
case 'htaccess-protect':
|
||||||
|
$value = $this->getComposerEnv('COMPOSER_HTACCESS_PROTECT');
|
||||||
|
if (false === $value) {
|
||||||
|
$value = $this->config[$key];
|
||||||
|
}
|
||||||
|
return $value !== 'false' && (bool) $value;
|
||||||
|
|
||||||
case 'cache-ttl':
|
case 'cache-ttl':
|
||||||
return (int) $this->config[$key];
|
return (int) $this->config[$key];
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,16 @@ class Factory
|
||||||
'data-dir' => self::getDataDir($home),
|
'data-dir' => self::getDataDir($home),
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
// load global config
|
||||||
|
$file = new JsonFile($config->get('home').'/config.json');
|
||||||
|
if ($file->exists()) {
|
||||||
|
if ($io && $io->isDebug()) {
|
||||||
|
$io->writeError('Loading config file ' . $file->getPath());
|
||||||
|
}
|
||||||
|
$config->merge($file->read());
|
||||||
|
}
|
||||||
|
$config->setConfigSource(new JsonConfigSource($file));
|
||||||
|
|
||||||
$htaccessProtect = (bool) $config->get('htaccess-protect');
|
$htaccessProtect = (bool) $config->get('htaccess-protect');
|
||||||
if ($htaccessProtect) {
|
if ($htaccessProtect) {
|
||||||
// Protect directory against web access. Since HOME could be
|
// Protect directory against web access. Since HOME could be
|
||||||
|
@ -180,16 +190,6 @@ class Factory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load global config
|
|
||||||
$file = new JsonFile($config->get('home').'/config.json');
|
|
||||||
if ($file->exists()) {
|
|
||||||
if ($io && $io->isDebug()) {
|
|
||||||
$io->writeError('Loading config file ' . $file->getPath());
|
|
||||||
}
|
|
||||||
$config->merge($file->read());
|
|
||||||
}
|
|
||||||
$config->setConfigSource(new JsonConfigSource($file));
|
|
||||||
|
|
||||||
// load global auth file
|
// load global auth file
|
||||||
$file = new JsonFile($config->get('home').'/auth.json');
|
$file = new JsonFile($config->get('home').'/auth.json');
|
||||||
if ($file->exists()) {
|
if ($file->exists()) {
|
||||||
|
|
|
@ -147,8 +147,13 @@ class ArchiveManager
|
||||||
$sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
|
$sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
|
||||||
$filesystem->ensureDirectoryExists($sourcePath);
|
$filesystem->ensureDirectoryExists($sourcePath);
|
||||||
|
|
||||||
// Download sources
|
try {
|
||||||
$this->downloadManager->download($package, $sourcePath);
|
// Download sources
|
||||||
|
$this->downloadManager->download($package, $sourcePath);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$filesystem->removeDirectory($sourcePath);
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
// Check exclude from downloaded composer.json
|
// Check exclude from downloaded composer.json
|
||||||
if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
|
if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
|
||||||
|
|
Loading…
Reference in New Issue