Esempio n. 1
0
 /**
  * Set language to environement file.
  *
  * @param string $language
  */
 protected function setLanguageToEnv($language)
 {
     env_replace('APP_LOCALE', $language);
 }
Esempio n. 2
0
 private function rewriteEnv($newValues)
 {
     foreach ($newValues as $key => $value) {
         env_replace($key, $value);
     }
     $this->reloadConfig($newValues);
 }
Esempio n. 3
0
 /**
  * set a new active Theme.
  *
  * @param string $theme
  *
  * @return bool
  */
 public function setActive($theme)
 {
     if (!$this->exists($theme)) {
         throw new Exception("Theme {$theme} doesn't exist!");
     }
     umask(0);
     $this->cleanActiveTheme();
     $themePath = base_path('themes' . DIRECTORY_SEPARATOR . $theme);
     @symlink($themePath . '/task.js', base_path('tasks/frontend.js'));
     @symlink($themePath . '/widgets', base_path('widgets/Frontend/Theme'));
     env_replace('APP_FRONTEND_THEME', $theme);
     $this->saveThemePartials();
     if (Template::all()->isEmpty()) {
         TemplateHelper::saveTemplates($theme);
     }
     Artisan::call('theme:publish', ['--force' => true]);
 }