Beispiel #1
0
 public static function build_config()
 {
     self::$menu = \System\Settings::read(self::DIR_ADMIN);
     self::$routes = \System\Settings::read(self::DIR_ROUTES);
     self::$cfg = array();
     $prefix = cfg('godmode', 'path_prefix');
     // Add godmode path prefix
     foreach (self::$routes as &$route) {
         $route['url'] = $prefix . $route['url'];
     }
     self::save();
 }
Beispiel #2
0
 /** Load all messages by language
  * @param string $lang
  * @return void
  */
 public function load_messages($locale = null)
 {
     if (is_null($locale)) {
         $locale = $this->locale;
     }
     if (!isset($this->messages[$locale])) {
         $list = $this::get_available();
         if (in_array($locale, $list)) {
             $file = BASE_DIR . self::DIR_CACHE . '/' . $locale . '.json';
             if (file_exists($file)) {
                 $this->messages[$locale] = \System\Json::read($file);
             } else {
                 $this->messages[$locale] = \System\Settings::read(self::DIR . '/' . $locale, false, $this->files);
             }
         } else {
             throw new \System\Error\Locales(sprintf('Unknown language %s', $locale));
         }
     }
     return $this;
 }
Beispiel #3
0
 public static function cmd_seed(array $params = array())
 {
     \System\Init::full();
     \Helper\Cli::out('Seeding initial system data ..');
     \System\Database::seed_initial_data();
     $data = \System\Settings::read(\System\Database::DIR_INITIAL_DATA, true);
     if ($data) {
         \Helper\Cli::out("Injecting initial data ..");
         foreach ($data as $data_set_name => $data_set_models) {
             self::seed_data($data_set_name, $data_set_models);
         }
     }
 }