/** * initialize file publisher instance * @param string $profile the profile name * @param string $alias the alias name */ function __construct($profile = null, $alias = null) { $this->profileName = $profile; $this->alias = $alias; $temp = ConfigurationManager::Get("profiles.{$this->getProfileName()}.ignores"); $temp[] = ConfigurationManager::Get("publishRoot"); $this->ignores = []; foreach ($temp as $ignoreItem) { $this->ignores[] = Utility::normalizePath($ignoreItem); } }
/** * fixing laravel bootstrapper * @param string $public alias public directory * @param string $core alias core directory * @return void */ protected function fixBootstrapper($public, $core) { $_core = Utility::getCorePath($this->getAlias(), $core); $_public = Utility::getPublicPath($this->getAlias(), $public); $core = Utility::findRelativePath($_public, $_core); $indexPath = Utility::combinePath(Utility::getPublicPath($this->getAlias(), $public), 'index.php'); # Auto Loader $autoLoader = \file_get_contents(__DIR__ . '/../Stubs/autoLoader.tpl'); $autoLoader = Utility::renderTemplate($autoLoader, ['{{CORE_PATH}}' => $core]); $autoLoader = Utility::normalizePath($autoLoader); # Bootstrap $bootstrapper = \file_get_contents(__DIR__ . '/../Stubs/bootstrapper.tpl'); $bootstrapper = Utility::renderTemplate($bootstrapper, ['{{CORE_PATH}}' => $core]); $bootstrapper = Utility::normalizePath($bootstrapper); Utility::replaceInFile($indexPath, ['require __DIR__.\'/../bootstrap/autoload.php\';' => $autoLoader, '$app = require_once __DIR__.\'/../bootstrap/app.php\';' => $bootstrapper]); }