public static function createUdpApplication($config) { AutoLoad::addRoot(dirname(dirname($config))); SysLog::init(UserConfig::getConfig('log')); return new YaafUdpServ(); // return $class; //进行路由解析等 }
protected function _getIncludes() { $config = array(); $config['js']['core'] = json_decode($this->getModule('FS')->read(self::INCLUDES_PATH), TRUE); $core_css = $this->getModule('FS')->readDir("system/ui/core/interface", TRUE, array('file_type' => 'css', 'path_type' => FS::FILESYSTEM_PATH)); if ($this->isSession()) { $user_config = new UserConfig(); $ui = $user_config->getConfig('ui', TRUE); foreach (array('interface', 'icons') as $value) { $this->set_session_value($value, $ui[$value]); } $user_css = $this->getModule('FS')->readDir("system/ui/" . $this->session['interface'] . "/interface", TRUE, array('file_type' => 'css', 'path_type' => FS::FILESYSTEM_PATH)); $user_js = []; //$this->getModule('FS')->readDir("system/ui/".$this->session['interface']."/interface", TRUE, array('file_type' => 'js', 'path_type' => FS::FILESYSTEM_PATH)); } else { $user_css = $this->getModule('FS')->readDir("system/ui/flatos/interface", TRUE, array('file_type' => 'css', 'path_type' => FS::FILESYSTEM_PATH)); $user_js = $this->getModule('FS')->readDir("system/ui/flatos/interface", TRUE, array('file_type' => 'js', 'path_type' => FS::FILESYSTEM_PATH)); } $config['css']['core'] = $core_css; $config['css']['user'] = $user_css; $config['js']['user'] = $user_js; return $config; }
# Uncomment the following line if you like to count the hits, then make sure # that the path /counter/hits/ and the file /counter/hitcount.txt are system writeable # // include('./counter/count.php'); if (isset($boot) && $boot || !isset($HTTP_COOKIE_VARS['ck_config']) || empty($HTTP_COOKIE_VARS['ck_config'])) { configNew($bname, $bversion, $user_id, $ip, $cfgid); } else { $user_id = $HTTP_COOKIE_VARS['ck_config']; } # # Load user config API. Get the user config data from db # require_once 'include/care_api_classes/class_userconfig.php'; $cfg_obj = new UserConfig(); if ($cfg_obj->exists($user_id)) { $cfg_obj->getConfig($user_id); $USERCONFIG = $cfg_obj->buffer; $config_exists = true; // Flag that user config is existing } else { $cfg_obj->_getDefault(); $USERCONFIG = $cfg_obj->buffer; } # Load global configurations API require_once 'include/care_api_classes/class_globalconfig.php'; $glob_cfg = new GlobalConfig($GLOBALCONFIG); # Get the global config for language usage $glob_cfg->getConfig('language_%'); # Get the global config for frames $glob_cfg->getConfig('gui_frame_left_nav_width'); # Get the global config for lev nav border
* * See the file "copy_notice.txt" for the licence notice */ $lang_tables = array('stdpass.php'); define('LANG_FILE', 'specials.php'); //$local_user='******'; define('NO_2LEVEL_CHK', 1); require_once $root_path . 'include/inc_front_chain_lang.php'; $breakfile = 'config_options.php' . URL_APPEND; $thisfile = basename($_SERVER['PHP_SELF']); if (isset($mode) && $mode == 'save') { // Save to user config table $config_new['template_smarty'] = $template_smarty; include_once $root_path . 'include/care_api_classes/class_userconfig.php'; $user = new UserConfig(); if ($user->getConfig($_COOKIE['ck_config'])) { $config =& $user->getConfigData(); $config = array_merge($config, $config_new); if ($user->saveConfig($_COOKIE['ck_config'], $config)) { header('location:' . basename(__FILE__) . URL_REDIRECT_APPEND . '&saved=1'); exit; } } } elseif (!isset($cfg['template_smarty']) || empty($cfg['template_smarty'])) { if (!isset($GLOBAL_CONFIG)) { $GLOBAL_CONFIG = array(); } include_once $root_path . 'include/care_api_classes/class_globalconfig.php'; $gc = new GlobalConfig($GLOBAL_CONFIG); $gc->getConfig('template_smarty'); if (!empty($GLOBAL_CONFIG['template_smarty'])) {
<?php # Get the config depending on the current logged user id require_once $root_path . 'include/care_api_classes/class_config.php'; $userobj = new UserConfig(); $globobj = new GlobalConfig($GLOBALCONFIG); $USERCONFIG =& $userobj->getConfig($user_id); $globobj->getConfig('news_%'); while (list($x, $v) = each($GLOBALCONFIG)) { ${$x} = $USERCONFIG[$x] ? $USERCONFIG[$x] : $GLOBALCONFIG[$x]; } if (!$news_normal_preview_maxlen) { $news_normal_preview_maxlen = 300; } # Load editor functions require_once $root_path . 'include/inc_editor_fx.php'; require_once $root_path . 'include/inc_date_format_functions.php'; ?>
protected function __construct() { $config = \UserConfig::getConfig("db"); if (empty($config['host']) || empty($config['database']) || empty($config['user'])) { echo "require host, database, user, password config"; //throw new \Exception("require host, database, user, password config."); } if (!function_exists('swoole_get_mysqli_sock')) { echo "require swoole_get_mysqli_sock function."; //throw new \Exception("require swoole_get_mysqli_sock function."); } if (empty($config['port'])) { $config['port'] = 3306; } $this->config = $config; $this->pool_size = $config['pool']; }