Skip to content

Commit

Permalink
fix service id of local install cammand (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes authored Jan 26, 2021
1 parent 7d0f8bc commit e34d33c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Bundle/Resources/config/local-commands.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<tag name="nanbando.server_command" server="local" command="plugins:install"/>
</service>

<service id="nanbando.server.local.plugins_install" class="Nanbando\Core\Server\Command\Local\LocalComposerCommand">
<service id="nanbando.server.local.plugins_update" class="Nanbando\Core\Server\Command\Local\LocalComposerCommand">
<argument type="service" id="input"/>
<argument type="service" id="output"/>
<argument type="service" id="embedded_composer"/>
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Config/JsonLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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']);
Expand Down
27 changes: 16 additions & 11 deletions src/Core/Storage/LocalStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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}
*/
Expand Down

0 comments on commit e34d33c

Please sign in to comment.