public function __construct($license = null, $locale = null, $ttl = 600, $force = false) { $this->license = $license; $this->identity_hash = self::getGenericConfig('identity_hash'); if (!$this->identity_hash) { $this->updateGenericConfig(); $this->identity_hash = self::getGenericConfig('identity_hash'); } self::setLocale($locale); self::$cache_ttl = max(0, $ttl); self::$force = $force; if (file_exists(self::$root_path . self::CONFIG_APPS)) { $this->installed_apps = (include self::$root_path . self::CONFIG_APPS); foreach ($this->installed_apps as $app_id => &$enabled) { if ($enabled) { $this->installed_extras[$app_id] = array(); $this->installed_extras[$app_id]['plugins'] = self::getConfig(sprintf(self::CONFIG_APP_PLUGINS, $app_id)); $this->installed_extras[$app_id]['themes'] = self::getItems(sprintf(self::ITEM_EXTRAS_PATH, $app_id, 'themes')); $build_path = self::$root_path . sprintf(self::ITEM_BUILD, $app_id); if (file_exists($build_path)) { $enabled = max(1, include $build_path); } else { $enabled = 1; } } unset($enabled); } } if (file_exists(self::$root_path . self::CONFIG_SOURCES)) { $this->sources = (include self::$root_path . self::CONFIG_SOURCES); } //TODO USE config or etc $this->extras_list['plugins'] = array('info' => 'plugin', 'subpath' => 'lib/config/'); $this->extras_list['themes'] = array('info' => 'theme', 'subpath' => ''); }