/**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $manager = new TemplateManager($this->app['files'], $this->app['boomcms.repositories.template']);
     $this->app->singleton('boomcms.template.manager', function ($app) use($manager) {
         return $manager;
     });
     $this->themes = $manager->findInstalledThemes();
     foreach ($this->themes as $theme) {
         Config::merge($theme->getConfigDirectory() . DIRECTORY_SEPARATOR . 'boomcms.php');
     }
     foreach ($this->themes as $theme) {
         $views = $theme->getViewDirectory();
         $authViews = $views . DIRECTORY_SEPARATOR . 'auth';
         $public = $theme->getPublicDirectory();
         $init = $theme->getDirectory() . DIRECTORY_SEPARATOR . 'init.php';
         $migrations = $theme->getDirectory() . '/migrations/';
         $this->loadViewsFrom($views, $theme->getName());
         $this->loadViewsFrom($views . '/chunks', 'boomcms.chunks');
         if (file_exists($authViews)) {
             $this->publishes([$authViews => base_path('resources/views/auth')], 'boomcms');
         }
         if (file_exists($public)) {
             $this->publishes([$public => public_path('vendor/boomcms/themes/' . $theme)], $theme->getName());
         }
         if (file_exists($migrations)) {
             $this->publishes([$migrations => base_path('/migrations/boomcms')], $theme->getName());
         }
         if (file_exists($init)) {
             include $init;
         }
     }
 }
 public function testTemplateIsNotInstalled()
 {
     $theme = $filename = 'test';
     $provider = $this->getTemplateRepository();
     $provider->shouldReceive('findByThemeAndFilename')->with($theme, $filename)->andReturn(null);
     $manager = new Manager($this->getFilesystem(), $provider, false);
     $this->assertFalse($manager->templateIsInstalled($theme, $filename));
 }
示例#3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire(TemplateManager $manager)
 {
     try {
         $installed = $manager->findAndInstallNewTemplates();
         if (!count($installed)) {
             return $this->info('No templates to install');
         }
         foreach ($installed as $i) {
             list($theme, $template) = $i;
             $this->info("Installed {$template} in theme {$theme}");
         }
     } catch (PDOException $e) {
         $this->info('Unable to install templates: ' . $e->getMessage());
     }
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $manager = new TemplateManager($this->app['files'], $this->app[Template::class], $this->app['cache.store']);
     $this->app->singleton('boomcms.template.manager', function () use($manager) {
         return $manager;
     });
     $this->themes = $manager->getInstalledThemes();
     foreach ($this->themes as $theme) {
         Config::merge($theme->getConfigDirectory() . DIRECTORY_SEPARATOR . 'boomcms.php');
     }
     foreach ($this->themes as $theme) {
         $views = $theme->getViewDirectory();
         $init = $theme->getDirectory() . DIRECTORY_SEPARATOR . 'init.php';
         $this->loadViewsFrom($views, $theme->getName());
         $this->loadViewsFrom($views . '/boomcms', 'boomcms');
         $this->loadViewsFrom($views . '/chunks', 'boomcms.chunks');
         if (file_exists($init)) {
             include $init;
         }
     }
 }
示例#5
0
 public function index()
 {
     $manager = new TemplateManager(App::make('files'), TemplateFacade::getFacadeRoot());
     $manager->findAndInstallNewTemplates();
     return view($this->viewPrefix . 'index', ['templates' => TemplateFacade::findAll()]);
 }