Skip to content

Commit

Permalink
Merge pull request #245 from niksamokhvalov/bitrix_bugfix
Browse files Browse the repository at this point in the history
Bitrix bugfix
  • Loading branch information
Seldaek committed Jun 13, 2015
2 parents 9e5aafc + c3604cb commit e420b53
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/Composer/Installers/BitrixInstaller.php
Expand Up @@ -17,7 +17,10 @@ class BitrixInstaller extends BaseInstaller
'theme' => 'bitrix/templates/{$name}/',
);

protected static $isInstall = 1;
/**
* @var array Storage for informations about duplicates at all the time of installation packages
*/
private static $checkedDuplicates = [];

/**
* {@inheritdoc}
Expand All @@ -38,12 +41,6 @@ protected function templatePath($path, array $vars = array())
*/
protected function checkDuplicates($templatePath, array $vars = array())
{
if (static::$isInstall === 0) {
return;
}

static::$isInstall--;

/**
* Incorrect paths for backward compatibility
*/
Expand All @@ -56,6 +53,10 @@ protected function checkDuplicates($templatePath, array $vars = array())
$packageType = substr($vars['type'], strlen('bitrix') + 1);
$oldLocation = str_replace('{$name}', $vars['name'], $oldLocations[$packageType]);

if (in_array($oldLocation, static::$checkedDuplicates)) {
return;
}

if ($oldLocation !== $templatePath && file_exists($oldLocation) && $this->io && $this->io->isInteractive()) {

$this->io->writeError(' <error>Duplication of packages:</error>');
Expand All @@ -82,5 +83,7 @@ protected function checkDuplicates($templatePath, array $vars = array())
}
}
}

static::$checkedDuplicates[] = $oldLocation;
}
}

0 comments on commit e420b53

Please sign in to comment.