Skip to content

Commit 0b63daf

Browse files
authored
Merge pull request #219 from mlocati/require-zip-only-when-needed
Check for zip/unzip capability only when needed
2 parents dee49ac + 034d0bf commit 0b63daf

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/Console/Application.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
use Exception;
4040
use Phar;
41-
use Pickle\Base\Archive;
4241
use Symfony\Component\Console\Application as BaseApplication;
4342

4443
class Application extends BaseApplication
@@ -97,8 +96,5 @@ private static function checkExtensions()
9796
throw new Exception("Extension '{$ext}' required but not loaded, full required list: " . implode(', ', $required_exts));
9897
}
9998
}
100-
101-
Archive\Factory::getUnzipperClassName();
102-
Archive\Factory::getZipperClassName();
10399
}
104100
}

src/Console/Command/InstallerCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
use Exception;
4040
use Pickle\Base\Abstracts\Console\Command\BuildCommand;
41+
use Pickle\Base\Archive\Factory;
4142
use Pickle\Base\Util;
4243
use Pickle\Engine;
4344
use Pickle\Package\Command\Install;
@@ -119,6 +120,7 @@ protected function configure()
119120
*/
120121
protected function binaryInstallWindows($path, InputInterface $input, OutputInterface $output)
121122
{
123+
Factory::getUnzipperClassName(); // Be sure we have a way to unzip files
122124
$php = Engine::factory();
123125
$table = new Table($output);
124126
$table

src/Console/Command/ReleaseCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
use Exception;
4040
use Pickle\Base\Abstracts\Console\Command\BuildCommand;
41+
use Pickle\Base\Archive\Factory;
4142
use Pickle\Base\Interfaces;
4243
use Pickle\Base\Util;
4344
use Pickle\Package\Command\Release;
@@ -87,6 +88,9 @@ protected function configure()
8788

8889
protected function execute(InputInterface $input, OutputInterface $output)
8990
{
91+
if (DIRECTORY_SEPARATOR === '\\' || $input->getOption('pack-logs')) {
92+
Factory::getZipperClassName(); // Be sure we have a way to zip files
93+
}
9094
$helper = $this->getHelper('package');
9195
Util\TmpDir::set($input->getOption('tmp-dir'));
9296

0 commit comments

Comments
 (0)