diff --git a/Dockerfile b/Dockerfile index 82277b4..09c6e25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,4 +47,6 @@ RUN cd /opt/rancherize-package \ && COMPOSER_ALLOW_SUPERUSER=1 ./composer.phar install \ && rm composer.phar +COPY docker/plugin_path.php /opt/rancherize-package + ENTRYPOINT ["/bin/sh", "/opt/rancherize/docker-entrypoint.sh"] diff --git a/app/Plugin/Composer/ComposerPacketPathMaker.php b/app/Plugin/Composer/ComposerPacketPathMaker.php index 8b5a01d..d957aed 100644 --- a/app/Plugin/Composer/ComposerPacketPathMaker.php +++ b/app/Plugin/Composer/ComposerPacketPathMaker.php @@ -15,7 +15,9 @@ public function makePath(ComposerPacket $packet) { $namespace = $packet->getNamespace(); $name = $packet->getName(); - return "vendor/$namespace/$name"; + $basePath = container( 'plugin_path' ); + + return "$basePath/vendor/$namespace/$name"; } } \ No newline at end of file diff --git a/app/Plugin/Installer/ComposerPluginInstaller.php b/app/Plugin/Installer/ComposerPluginInstaller.php index 4dc524c..576a8fb 100644 --- a/app/Plugin/Installer/ComposerPluginInstaller.php +++ b/app/Plugin/Installer/ComposerPluginInstaller.php @@ -39,7 +39,6 @@ public function __construct(ComposerPacketNameParser $nameParser, ComposerPacket * @param $name * @param InputInterface $input * @param OutputInterface $output - * @return mixed */ public function install($name, InputInterface $input, OutputInterface $output) { @@ -63,7 +62,7 @@ public function getClasspath($name) { $composerPacket = $this->nameParser->parse($name); $path = $this->pathMaker->makePath($composerPacket); - $composerJson = getcwd().'/'.$path.'/composer.json'; + $composerJson = $path . '/composer.json'; $composerContent = file_get_contents( $composerJson ); $composerData = json_decode( $composerContent, true ); diff --git a/app/bootstrap.php b/app/bootstrap.php index 7873931..20142e5 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -11,3 +11,4 @@ require __DIR__.'/container.php'; +require_once __DIR__ . '/../plugin_path.php'; diff --git a/docker/plugin_path.php b/docker/plugin_path.php new file mode 100644 index 0000000..78a0e76 --- /dev/null +++ b/docker/plugin_path.php @@ -0,0 +1,4 @@ +