/** * 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 testFindNoInstalledThemes() { $themes = []; $filesystem = $this->getFilesystem(); $filesystem->expects($this->once())->method('directories')->with($this->equalTo(storage_path() . '/boomcms/themes'))->will($this->returnValue(null)); $manager = new Manager($filesystem, $this->getTemplateRepository(), false); $this->assertEquals($themes, $manager->findInstalledThemes()); }