diff --git a/src/Bundle/Resources/config/local-commands.xml b/src/Bundle/Resources/config/local-commands.xml index d7ec459..724c5cb 100644 --- a/src/Bundle/Resources/config/local-commands.xml +++ b/src/Bundle/Resources/config/local-commands.xml @@ -48,7 +48,7 @@ - + diff --git a/src/Core/Config/JsonLoader.php b/src/Core/Config/JsonLoader.php index d01b01a..3ce428b 100644 --- a/src/Core/Config/JsonLoader.php +++ b/src/Core/Config/JsonLoader.php @@ -5,6 +5,7 @@ use Composer\Json\JsonFile; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\Exception\BadMethodCallException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Loader\FileLoader; use Webmozart\PathUtil\Path; @@ -42,7 +43,7 @@ public function load($resource, string $type = null) $importFilename = Path::join([dirname($path), $import]); } - $this->import($importFilename, null, false, $file->getPath()); + $this->import($importFilename, null, true, $file->getPath()); } unset($content['imports']); diff --git a/src/Core/Storage/LocalStorage.php b/src/Core/Storage/LocalStorage.php index aedc23a..c0966a0 100644 --- a/src/Core/Storage/LocalStorage.php +++ b/src/Core/Storage/LocalStorage.php @@ -23,42 +23,42 @@ class LocalStorage implements StorageInterface /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $environment; + protected $environment; /** * @var TemporaryFilesystemInterface */ - private $temporaryFileSystem; + protected $temporaryFileSystem; /** * @var Filesystem */ - private $localFilesystem; + protected $localFilesystem; /** * @var string */ - private $localDirectory; + protected $localDirectory; /** * @var Filesystem */ - private $remoteFilesystem; + protected $remoteFilesystem; /** * @var SlugifyInterface */ - private $slugify; + protected $slugify; /** * @var SymfonyFilesystem */ - private $filesystem; + protected $filesystem; /** * @param string $name @@ -96,13 +96,13 @@ public function __construct( public function start() { $filename = $this->temporaryFileSystem->createTemporaryFile(); - $filesystem = new Filesystem($this->createZipAdapter($filename)); + $filesystem = new Filesystem($this->createBackupAdapter($filename)); $filesystem->addPlugin(new ListFiles()); return $filesystem; } - protected function createZipAdapter(string $filename): AdapterInterface + protected function createBackupAdapter(string $filename): AdapterInterface { return new ZipAdapter($filename); } @@ -154,12 +154,17 @@ public function open($name) $fileName = $this->path($name); } - $filesystem = new Filesystem(new ReadonlyAdapter($this->createZipAdapter($fileName))); + $filesystem = new Filesystem($this->createRestoreAdapter($fileName)); $filesystem->addPlugin(new ListFiles()); return $filesystem; } + protected function createRestoreAdapter(string $filename): AdapterInterface + { + return new ReadonlyAdapter(new ZipAdapter($filename)); + } + /** * {@inheritdoc} */