Exemplo n.º 1
0
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $this->dispatch(new LoadThemeVariables($variables = new Collection()));
     $compiler = new Compiler();
     if ($dir = $asset->getSourceDirectory()) {
         $compiler->addImportPath($dir);
     }
     $compiler->setVariables($variables->all());
     $asset->setContent($this->parser->parse($compiler->compile($asset->getContent())));
 }
Exemplo n.º 2
0
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $compiler = new \lessc();
     $this->dispatch(new LoadThemeVariables($variables = new Collection()));
     $compiler->setVariables($variables->all());
     if ($dir = $asset->getSourceDirectory()) {
         $compiler->importDir = $dir;
     }
     foreach ($this->loadPaths as $loadPath) {
         $compiler->addImportDir($loadPath);
     }
     $asset->setContent($compiler->parse($this->parser->parse($asset->getContent())));
 }
 /**
  * Install the system.
  *
  * @param array $parameters
  * @return bool
  */
 public function install(array $parameters)
 {
     $data = new Collection();
     $this->dispatch(new SetStreamsData($data));
     $data->put('DB_DRIVER', $parameters['database_driver']);
     $data->put('DB_HOST', $parameters['database_host']);
     $data->put('DB_DATABASE', $parameters['database_name']);
     $data->put('DB_USERNAME', $parameters['database_username']);
     $data->put('DB_PASSWORD', $parameters['database_password']);
     $data->put('APPLICATION_NAME', $parameters['application_name']);
     $data->put('APPLICATION_DOMAIN', $parameters['application_domain']);
     $data->put('APPLICATION_REFERENCE', $parameters['application_reference']);
     $data->put('ADMIN_THEME', config('streams::themes.admin'));
     $data->put('STANDARD_THEME', config('streams::themes.standard'));
     $data->put('LOCALE', $parameters['application_locale']);
     $data->put('APP_TIMEZONE', $parameters['application_timezone']);
     $data->put('ADMIN_USERNAME', $parameters['admin_username']);
     $data->put('ADMIN_EMAIL', $parameters['admin_email']);
     $data->put('ADMIN_PASSWORD', $parameters['admin_password']);
     $this->dispatch(new WriteEnvironmentFile($data->all()));
 }
Exemplo n.º 4
0
 /**
  * Execute the console command.
  */
 public function fire(Dispatcher $events, Application $application, AddonManager $manager)
 {
     $this->dispatch(new ConfirmLicense($this));
     $data = new Collection();
     $this->dispatch(new SetStreamsData($data));
     $this->dispatch(new SetDatabaseData($data, $this));
     $this->dispatch(new SetApplicationData($data, $this));
     $this->dispatch(new SetAdminData($data, $this));
     $this->dispatch(new SetOtherData($data, $this));
     $this->dispatch(new WriteEnvironmentFile($data->all()));
     $this->dispatch(new ReloadEnvironmentFile());
     $this->dispatch(new ConfigureDatabase());
     $this->dispatch(new SetDatabasePrefix());
     $this->dispatch(new LocateApplication());
     $installers = new InstallerCollection();
     $this->dispatch(new LoadCoreInstallers($installers));
     $this->dispatch(new LoadApplicationInstallers($installers));
     $this->dispatch(new LoadModuleInstallers($installers));
     $this->dispatch(new LoadExtensionInstallers($installers));
     $this->dispatch(new RunInstallers($installers, $this));
     $this->call('env:set', ['line' => 'INSTALLED=true']);
     $this->dispatch(new ReloadEnvironmentFile());
     $installers->add(new Installer('streams::installer.running_migrations', function (Kernel $console) {
         $console->call('migrate', ['--force' => true, '--no-addons' => true]);
     }));
     $manager->register();
     // Register all of our addons.
     $events->fire(new StreamsHasInstalled($installers));
     $this->info('Running post installation tasks.');
     $this->dispatch(new LoadModuleSeeders($installers));
     $this->dispatch(new LoadExtensionSeeders($installers));
     $installers->add(new Installer('streams::installer.running_seeds', function (Kernel $console) {
         $console->call('db:seed', ['--force' => true]);
     }));
     $this->dispatch(new RunInstallers($installers, $this));
 }