From a274f32530d3a961e391b53a6fd490e145afc27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= <daniel@higidi.de> Date: Wed, 5 Apr 2017 22:29:58 +0200 Subject: [PATCH 1/4] BUGFIX: cksum of ruleset.xml content should be generated not of path --- src/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Installer.php b/src/Installer.php index 9f5d291..38cf44e 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -160,7 +160,7 @@ class Installer extends LibraryInstaller protected function compareStandards(Standard $source, Standard $destination) { return $source->getName() === $destination->getName() - && sha1($source->getRuleSetXmlPath()) === sha1($destination->getRuleSetXmlPath()); + && sha1_file($source->getRuleSetXmlPath()) === sha1_file($destination->getRuleSetXmlPath()); } /** -- GitLab From 817f0dbec55b30947bd0e81bf0b451d709fc6d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= <daniel@higidi.de> Date: Wed, 5 Apr 2017 22:31:04 +0200 Subject: [PATCH 2/4] TASK: If package is currently not installed do not compare standards --- src/Installer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Installer.php b/src/Installer.php index 38cf44e..ec2d67a 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -43,6 +43,9 @@ class Installer extends LibraryInstaller public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { $isInstalled = parent::isInstalled($repo, $package); + if (!$isInstalled) { + return $isInstalled; + } $sourceStandards = $this->getSourceStandards($package); $destinationStandards = $this->getDestinationStandards($repo); -- GitLab From 27c53700185dbc39c4c9808cf583437a094076d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= <daniel@higidi.de> Date: Wed, 5 Apr 2017 22:39:07 +0200 Subject: [PATCH 3/4] TASK: Provide status messages while installing standards --- src/Installer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Installer.php b/src/Installer.php index 9f5d291..6c71829 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -100,11 +100,14 @@ class Installer extends LibraryInstaller $filesystem = new SymfonyFilesystem(); $sourceStandards = $this->getSourceStandards($package); $destStandardsBasePath = $this->getPHPCodeSnifferStandardsBasePath($repo); + $this->io->writeError(' Installing PHP-CodeSniffer Standards:', false); foreach ($sourceStandards as $sourceStandard) { + $this->io->writeError(sprintf(' <info>%s</info>', $sourceStandard->getName())); $sourcePath = $sourceStandard->getPath(); $destPath = $destStandardsBasePath . DIRECTORY_SEPARATOR . $sourceStandard->getName(); $filesystem->mirror($sourcePath, $destPath, null, array('override' => $override)); } + $this->io->writeError(''); } /** -- GitLab From 75e558413b36dcd87d72ad7255b4604cf4c0a57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= <daniel@higidi.de> Date: Wed, 5 Apr 2017 22:39:16 +0200 Subject: [PATCH 4/4] TASK: Provide status messages while removing standards --- src/Installer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Installer.php b/src/Installer.php index 6c71829..dfbbf71 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -119,14 +119,17 @@ class Installer extends LibraryInstaller { $sourceStandards = $this->getSourceStandards($package); $destinationStandards = $this->getDestinationStandards($repo); + $this->io->writeError(' Removing PHP-CodeSniffer Standards:', false); foreach ($sourceStandards as $sourceStandard) { if (!$destinationStandards->hasStandard($sourceStandard)) { continue; } + $this->io->writeError(sprintf(' <info>%s</info>', $sourceStandard->getName())); $destinationStandard = $destinationStandards->getStandard($sourceStandard); $this->filesystem->removeDirectory($destinationStandard->getPath()); } + $this->io->writeError(''); } /** -- GitLab