mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Add public folder for plugins
This commit is contained in:
@@ -50,6 +50,13 @@ class AddPlugin extends AbstractPluginCommand
|
||||
$this->container['filesystem']->mirror($temporaryDir, $targetDir);
|
||||
$output->writeln(" <comment>OK</comment>");
|
||||
|
||||
$output->write("Copying public files <info>".$manifest->getName()."</info>...");
|
||||
$this->container['filesystem']->mirror(
|
||||
$targetDir . DIRECTORY_SEPARATOR . 'public',
|
||||
$this->container['root.path'] . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $manifest->getName()
|
||||
);
|
||||
$output->writeln(" <comment>OK</comment>");
|
||||
|
||||
$output->write("Removing temporary directory...");
|
||||
$this->container['filesystem']->remove($temporaryDir);
|
||||
$output->writeln(" <comment>OK</comment>");
|
||||
|
@@ -29,6 +29,7 @@ class PluginValidator
|
||||
{
|
||||
$this->ensureComposer($directory);
|
||||
$this->ensureManifest($directory);
|
||||
$this->ensureDir($directory . DIRECTORY_SEPARATOR . 'public');
|
||||
|
||||
$manifest = $directory . DIRECTORY_SEPARATOR . 'manifest.json';
|
||||
$data = @json_decode(@file_get_contents($manifest));
|
||||
@@ -58,6 +59,13 @@ class PluginValidator
|
||||
$this->ensureFile($composer);
|
||||
}
|
||||
|
||||
private function ensureDir($dir)
|
||||
{
|
||||
if (!file_exists($dir) || !is_dir($dir) || !is_readable($dir)) {
|
||||
throw new PluginValidationException(sprintf('Missing mandatory directory %s', $dir));
|
||||
}
|
||||
}
|
||||
|
||||
private function ensureFile($file)
|
||||
{
|
||||
if (!file_exists($file) || !is_file($file) || !is_readable($file)) {
|
||||
|
Reference in New Issue
Block a user