当前位置: 首页>>代码示例>>PHP>>正文


PHP config::read方法代码示例

本文整理汇总了PHP中config::read方法的典型用法代码示例。如果您正苦于以下问题:PHP config::read方法的具体用法?PHP config::read怎么用?PHP config::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config的用法示例。


在下文中一共展示了config::read方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 private function __construct()
 {
     $options = array(PDO::ATTR_PERSISTENT => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
     $dsn = 'mysql:host=' . config::read('db.host') . ';dbname=' . config::read('db.basename') . ';port=' . config::read('db.port');
     $user = config::read('db.user');
     $password = config::read('db.password');
     $this->dbh = new PDO($dsn, $user, $password, $options);
 }
开发者ID:asucrews,项目名称:nostarchBot,代码行数:8,代码来源:SHDtest.php

示例2: __construct

 function __construct()
 {
     parent::__construct();
     $this->tz_offset_s = $GLOBALS['egw']->datetime->tz_offset;
     $this->now = time() + $this->tz_offset_s;
     // time() is server-time and we need a user-time
     $this->config = config::read('courseprotocol');
     if (isset($this->config['customfields']) && is_array($this->config['customfields'])) {
         $this->customfields = $this->config['customfields'];
     }
 }
开发者ID:ralfbecker,项目名称:courseprotocol,代码行数:11,代码来源:class.bocourseprotocol.inc.php

示例3: _get_navbar

 /**
  * Get navbar as array to eg. set as vars for a template (from idots' navbar.inc.php)
  *
  * Reimplemented so set the vars for the navbar itself (uses $this->tpl and the blocks a and b)
  *
  * @internal PHP5 protected
  * @param array $apps navbar apps from _get_navbar_apps
  * @return array
  */
 function _get_navbar($apps)
 {
     $var = parent::_get_navbar($apps);
     if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover') {
         $var['show_menu_event'] = 'onMouseOver';
     } else {
         $var['show_menu_event'] = 'onClick';
     }
     if ($GLOBALS['egw_info']['user']['userid'] == 'anonymous') {
         $config_reg = config::read('registration');
         $this->tpl->set_var(array('url' => $GLOBALS['egw']->link('/logout.php'), 'title' => lang('Login')));
         $this->tpl->fp('upper_tabs', 'upper_tab_block');
         if ($config_reg[enable_registration] == 'True' && $config_reg[register_link] == 'True') {
             $this->tpl->set_var(array('url' => $GLOBALS['egw']->link('/registration/index.php'), 'title' => lang('Register')));
         }
     }
     if (!($max_icons = $GLOBALS['egw_info']['user']['preferences']['common']['max_icons'])) {
         $max_icons = 30;
     }
     if ($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] == 'no') {
         $tdwidth = 100 / $max_icons;
     } else {
         $tdwidth = 100 / ($max_icons + 1);
         // +1 for logout
     }
     $this->tpl->set_var('tdwidth', round($tdwidth));
     // not shown in the navbar
     foreach ($apps as $app => $app_data) {
         if ($app != 'preferences' && $app != 'about' && $app != 'logout' && $app != 'manual' && ($app != 'home' || $GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no')) {
             $this->tpl->set_var($app_data);
             if ($i < $max_icons) {
                 $this->tpl->set_var($app_data);
                 if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text') {
                     $this->tpl->fp('app_icons', 'app_icon_block', true);
                 }
                 if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons') {
                     $this->tpl->fp('app_titles', 'app_title_block', true);
                 }
             } else {
                 $this->tpl->fp('app_extra_icons', 'app_extra_block', true);
             }
             $i++;
         }
     }
     // settings for the extra icons dif
     if ($i <= $max_icons) {
         $this->tpl->set_var('app_extra_icons_div', '');
         $this->tpl->set_var('app_extra_icons_icon', '');
     } else {
         $var['lang_close'] = lang('Close');
         $var['lang_show_more_apps'] = lang('show_more_apps');
     }
     if ($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no' && $GLOBALS['egw_info']['user']['userid'] != 'anonymous') {
         $this->tpl->set_var($apps['logout']);
         if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text') {
             $this->tpl->fp('app_icons', 'app_icon_block', true);
         }
         if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons') {
             $this->tpl->fp('app_titles', 'app_title_block', true);
         }
     }
     if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] == 'icons') {
         $var['app_titles'] = '<td colspan="' . $max_icons . '">&nbsp;</td>';
     }
     return $var;
 }
开发者ID:ThomasPerraudin,项目名称:ALIX-EDC-SOLUTIONS,代码行数:75,代码来源:class.idots_framework.inc.php

示例4: config

// Start the current session
$cp = session_get_cookie_params();
session_set_cookie_params($cp['lifetime'], $cp['path'], _BASE_DOMAIN_);
session_start();
// Read the basic configuration variables
$config = new config();
// Connect to the SQL server
if (!sql::connect(_MYSQL_HOST_, _MYSQL_USER_, _MYSQL_PASS_, _MYSQL_DB_)) {
    // We need the following objects initialized
    // Does not matter that then don't actually do anything
    $lang = new language(_DEFAULT_LANGUAGE_, _DEFAULT_SITE_, true);
    $theme =& new theme();
    $theme->showError(_OFFLINE_MESSAGE_, 1);
}
// Read additional configuration variables from the database
$config->read();
if (strlen($path) > 1) {
    if (substr($path, 0, 1) == '/') {
        $path = substr($path, 1, strlen($path) - 1);
    }
    if (substr($path, -1, 1) == '/') {
        $path = substr($path, 0, strlen($path) - 1);
    }
    $args = explode('/', $path);
} else {
    $args = array();
}
if (count($args) > 0 && $args[0] == 'admin') {
    // The first thing we need to do is check if we need to install ourselves
    if (count($args) > 1 && $args[1] == 'install') {
        // Check to see if we are locked down...
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:31,代码来源:core.library.php

示例5: __construct

 function __construct()
 {
     $this->config = config::read('courseprotocol');
 }
开发者ID:ralfbecker,项目名称:courseprotocol,代码行数:4,代码来源:class.cp_admin_prefs_sidebox_hooks.inc.php


注:本文中的config::read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。