Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
plugin_path file to be overriden in container
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Speckmaier committed Mar 29, 2018
1 parent c893e97 commit ed8e290
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 3 additions & 1 deletion app/Plugin/Composer/ComposerPacketPathMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

}
3 changes: 1 addition & 2 deletions app/Plugin/Installer/ComposerPluginInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@

require __DIR__.'/container.php';

require_once __DIR__ . '/../plugin_path.php';
4 changes: 4 additions & 0 deletions docker/plugin_path.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$container = container();

$container['plugin_path'] = '/opt/rancherize';
4 changes: 4 additions & 0 deletions plugin_path.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$container = container();

$container['plugin_path'] = getcwd();

0 comments on commit ed8e290

Please sign in to comment.