diff --git a/App.php b/App.php index 813abe3..3c5beff 100644 --- a/App.php +++ b/App.php @@ -33,6 +33,16 @@ set_error_handler(function ( class App { + /** + * plugins path in vendor + * @var string + */ + public const PLUGINS_PATH = 'vendor/picocms/plugins/'; + /** + * themes path in vendor + * @var string + */ + public const THEMES_PATH = 'vendor/picocms/themes/'; /** * Pico instance. * @var Pico @@ -61,13 +71,22 @@ class App $this->pico = new Pico( $cwd, // root dir $contentFolderFromRoot, // config dir - 'vendor/picocms/plugins/', // plugins dir - 'vendor/picocms/themes/' // themes dir + self::PLUGINS_PATH, // plugins dir + self::THEMES_PATH // themes dir ); } public function runPico(): string { + if (!empty($GLOBALS['PicoVendorsDirectoryRelativeLevels']) && + intval($GLOBALS['PicoVendorsDirectoryRelativeLevels']) > 0){ + $previous = implode('',array_fill(0,intval($GLOBALS['PicoVendorsDirectoryRelativeLevels']),'../')); + $this->pico->setConfig([ + 'themes_url' => $previous.self::THEMES_PATH, + 'plugins_url' => $previous.self::PLUGINS_PATH + ]); + + } return $this->pico->run(); }