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


PHP config::load方法代码示例

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


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

示例1: style

 /**
  * Generates a style tag
  * @param  string $name style name
  * @return void
  */
 public static function style($name)
 {
     $format = '<link rel="stylesheet" href="%s" />';
     $name .= '.css';
     config::load('locations');
     $location = config::item('location_css');
     printf($format, BASE . $location . $name);
 }
开发者ID:42Khane,项目名称:PHP-Framework,代码行数:13,代码来源:view.php

示例2: connect

 /**
  * Connect to the database
  * Private
  * @param  String $host The Database host (normaly localhost)
  * @param  String $user The Database username
  * @param  String $pass Said User's Password
  * @param  String $db   The database we are going to work on
  * @return [type]       [description]
  */
 private static function connect($host = null, $user = null, $pass = null, $db = null)
 {
     //Set Defaults from config
     config::load('database');
     $host = $host === NULL ? config::item('db_host') : $host;
     $user = $user === NULL ? config::item('db_user') : $user;
     $pass = $pass === NULL ? config::item('db_pass') : $pass;
     $db = $db === NULL ? config::item('db_db') : $db;
     self::$link = @mysql_connect($host, $user, $pass);
     mysql_select_db($db);
 }
开发者ID:42Khane,项目名称:Steam-Grid,代码行数:20,代码来源:mysql.php

示例3: init_kern_environment

 protected static function init_kern_environment()
 {
     clock::stop();
     config::load();
     self::$log_execute_time = config::get_kern('log_execute_time', true);
     if (self::$log_execute_time) {
         self::$begin_microtime = clock::get_micro_stamp();
     }
     clock::set_timezone(config::get_kern('time_zone', 'Asia/Shanghai'));
     i18n::set_locale(config::get_kern('locale', 'en_us'));
     self::$is_debug = config::get_kern('is_debug', false);
     ini_set('display_errors', config::get_kern('display_errors', self::$is_debug));
     set_exception_handler([__CLASS__, 'exception_handler']);
     $error_reporting = config::get_kern('error_reporting', self::$is_debug ? E_ALL | E_STRICT : E_ALL & ~E_NOTICE);
     set_error_handler([__CLASS__, 'error_handler'], $error_reporting);
     loader::init();
 }
开发者ID:xpd1437,项目名称:swap,代码行数:17,代码来源:kern.php

示例4: config

}
foreach ($_POST as $key => $val) {
    if (array_search($key, $blockKeys) === false) {
        ${$key} = $val;
    }
}
foreach ($_COOKIE as $key => $val) {
    if (array_search($key, $blockKeys) === false) {
        ${$key} = $val;
    }
}
// +--------------------------------------------------
// | Config
// +--------------------------------------------------
$cfg = new config();
$cfg->load();
switch ($error_reporting) {
    case 0:
        error_reporting(0);
        @ini_set("display_errors", 0);
        break;
    case 1:
        error_reporting(E_ERROR | E_PARSE | E_COMPILE_ERROR);
        @ini_set("display_errors", 1);
        break;
    case 2:
        error_reporting(E_ALL);
        @ini_set("display_errors", 1);
        break;
}
if (!isset($current_dir)) {
开发者ID:Kavir91,项目名称:Convocatoria,代码行数:31,代码来源:index.php

示例5: config

<?php

require_once 'lib/lib-config.php';
$config = new config();
$twig = $config->load();
//do stuff
echo $twig->render('home.html.twig', array('title' => 'Some Awesome Content'));
$config->destroy();
开发者ID:rjhilgefort,项目名称:SiteFoundations-BootstrapTwig,代码行数:8,代码来源:home.php

示例6: CDatabase

<?php

//инициализируем класс БД
require PATH_CORE . 'database/database.php';
$oDb = new CDatabase('mysql', 'mysql:host=' . DB_HOST_SYSGEN . ';dbname=' . DB_NAME_SYSGEN, DB_USER_SYSGEN, DB_PASS_SYSGEN);
//$oDb = new CDatabase('pgsql', 'pgsql:port=5432 dbname='.DB_NAME_SYSGEN, DB_USER_SYSGEN, DB_PASS_SYSGEN);
$oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$oDb->connect();
//инициализируем Config
config::load();
$oConfig =& config::$data;
if (BFF_DEBUG || FORDEV) {
    include PATH_CORE . 'vardump.php';
    $oDb->bShowStatistic = true;
    $oDb->bMakeStatistic = true;
}
//инициализируем Smarty
require PATH_CORE . 'external/smarty/smarty.class.php';
$oSm = new Smarty();
$oSm->force_compile = false;
$oSm->compile_check = true;
$oSm->debugging = false;
$oSm->compile_dir = PATH_BASE . 'tpl_c';
$oSm->config_dir = PATH_BASE . 'config';
$oSm->plugins_dir = array('plugins', 'plugins/bff');
Module::adminCustomCenterArea(false);
$oSm->assign('fordev', FORDEV);
$oSm->assign('site_url', SITEURL);
$oSm->assign_by_ref('config', $oConfig);
开发者ID:Sywooch,项目名称:dobox,代码行数:29,代码来源:init.php

示例7: filemanager_visualiza

function filemanager_visualiza($dominio)
{
    global $cfg, $doc_root, $path_info, $url_info, $dir_actual, $islinux, $filename, $is_reachable, $fm_color, $fm_root_atual, $islinux, $quota_mb, $resolveIDs, $mat_passwd, $mat_group;
    // +--------------------------------------------------
    // | Header and Globals
    // +--------------------------------------------------
    header("Pragma: no-cache");
    header("Cache-Control: no-store");
    foreach ($_GET as $key => $val) {
        ${$key} = filemanager_htmldecode($val);
    }
    foreach ($_POST as $key => $val) {
        ${$key} = filemanager_htmldecode($val);
    }
    foreach ($_COOKIE as $key => $val) {
        ${$key} = filemanager_htmldecode($val);
    }
    if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
        $ip = $_SERVER["REMOTE_ADDR"];
    } else {
        $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
    }
    //usa proxy
    $islinux = !(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
    //$url_info = parse_url($_SERVER["HTTP_REFERER"]);
    $url_info = parse_url("http://www." . $dominio);
    $doc_root = $islinux ? _CFG_APACHE_DOCUMENTROOT : ucfirst(_CFG_APACHE_DOCUMENTROOT);
    $script_filename = _CFG_INTERFACE_DIR . "admin_panel/webpanel/sistema/filemanager/filemanager.php";
    $path_info = pathinfo($script_filename);
    $fm_root_atual = _CFG_APACHE_DOCUMENTROOT . $dominio . "/";
    //Actualiza quota y obtiene quota
    filemanager_quotacalculate($dominio);
    $quota_mb = filemanager_quotasize($dominio);
    // +--------------------------------------------------
    // | Config
    // +--------------------------------------------------
    $cfg = new config();
    $cfg->load();
    ini_set("display_errors", 1);
    ini_set("error_reporting", $error_reporting);
    if (!isset($dir_actual)) {
        $dir_actual = _CFG_APACHE_DOCUMENTROOT . $dominio . "/";
        if (!$islinux) {
            $dir_actual = ucfirst($dir_actual);
        }
        @chmod($dir_actual, 0777);
    } else {
        $dir_actual = filemanager_formatpath($dir_actual);
    }
    $is_reachable = stristr($dir_actual, $doc_root) !== false;
    // Auto Expand Local Path
    if (!isset($expanded_dir_list)) {
        $expanded_dir_list = "";
        $mat = explode("/", $path_info["dirname"]);
        for ($x = 0; $x < count($mat); $x++) {
            $expanded_dir_list .= ":" . $mat[$x];
        }
        setcookie("expanded_dir_list", $expanded_dir_list, 0, "/");
    }
    if (!isset($fm_root_atual)) {
        if (strlen($fm_root)) {
            $fm_root_atual = $fm_root;
        } else {
            if (!$islinux) {
                $fm_root_atual = ucfirst($path_info["dirname"] . "/");
            } else {
                $fm_root_atual = $doc_root . "/";
            }
        }
        setcookie("fm_root_atual", $fm_root_atual, 0, "/");
    } elseif (isset($set_fm_root_atual)) {
        if (!$islinux) {
            $fm_root_atual = ucfirst($set_fm_root_atual);
        }
        setcookie("fm_root_atual", $fm_root_atual, 0, "/");
    }
    if (!isset($resolveIDs)) {
        setcookie("resolveIDs", 0, $cookie_cache_time, "/");
    } elseif (isset($set_resolveIDs)) {
        $resolveIDs = $resolveIDs ? 0 : 1;
        setcookie("resolveIDs", $resolveIDs, $cookie_cache_time, "/");
    }
    if ($resolveIDs) {
        exec("cat /etc/passwd", $mat_passwd);
        exec("cat /etc/group", $mat_group);
    }
    $fm_color['Bg'] = "EEEEEE";
    $fm_color['Text'] = "000000";
    $fm_color['Link'] = "992929";
    $fm_color['Mark'] = "A7D2E4";
    $fm_color['Dir'] = "FFFFCC";
    $fm_color['File'] = "FFFFFF";
    $fm_color['Ext'] = "CCCC99";
    $fm_color['Title'] = "CC6666";
    $fm_color['Action'] = "CC6666";
    $fm_color['FileFirstCell'] = "FFFFFF";
    foreach ($fm_color as $tag => $color) {
        $fm_color[$tag] = strtolower($color);
    }
    // +--------------------------------------------------
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:baifox-svn,代码行数:101,代码来源:include_funciones.php

示例8:

<?php

/**
 * 功能:引导MVC模式
 * $Id$
 */
//包含核心文件
require_once SYSTEMPATH . 'sf/sf.class.php';
require_once SYSTEMPATH . 'sf/config.class.php';
require_once SYSTEMPATH . 'sf/sfexception.class.php';
require_once SYSTEMPATH . 'sf/router.class.php';
require_once SYSTEMPATH . 'sf/loader.class.php';
require_once SYSTEMPATH . 'sf/language.class.php';
require_once SYSTEMPATH . 'sf/input.class.php';
//加载配置文件
config::load('default');
//加载必要库文件
loader::lib(array("controller", "model"));
//加载默认helper
loader::helper(config::get("auto_load_helper", 'url'));
//加载默认插件
config::get("auto_load_plugin") && loader::plugin(config::get("auto_load_plugin"));
//初始化pathinfo
router::parse();
//加载语言文件
lang::setLang(config::get("default_lang", "chinese"));
lang::load("global");
//执行控制器
$controller = sf::getController(router::getController());
try {
    method_exists($controller, "load") && $controller->load();
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:31,代码来源:mvc.class.php

示例9: config

require_once "db/connect.php";
require_once "classes/functions.php";
//USED CLASSES
require_once "classes/settings.php";
require_once "classes/user.php";
//LOGGED IN? / SESSION
$loginform = TRUE;
require "inc/user.php";
//PAGETITLE
$pagetitle = "Home";
//PAGE CODE
//Custom front page content
$pagecontent = "";
$content = new config($sql);
$content->name = "frontContent";
if ($content->load()) {
    if (isset($content->value) && $content->value != "") {
        $pagecontent .= '<div class="content">' . $content->value . '</div>';
    }
}
//news list
$newsq = $sql->query("SELECT * FROM wolfvtc_announcements WHERE divid=0 ORDER BY datetime DESC");
$news = "";
if ($newsq->num_rows >= 1) {
    $news .= "<h3>Latest news:</h3>";
}
while ($row = $newsq->fetch_assoc()) {
    $author = new user($sql, "id", $row['userid']);
    if ($author->load()) {
        $news .= '<p><span class="title"><a href="news.php?art=' . $row['id'] . '" class="news">' . $row['title'] . '</a></span> <span class="by">by ' . $author->username . ' on ' . $row['datetime'] . '</p>';
    }
开发者ID:HumaneWolf,项目名称:WolfVTCStandalone,代码行数:31,代码来源:index.php

示例10: config

<?php

//Footer copyright year
$copy = new config($sql);
$copy->name = "startDate";
$copy->load();
echo '<span class="copyright">&copy; ' . $website['name'] . ' ' . date("Y", strtotime($copy->value)) . ' - ' . date("Y") . '</span>';
?>
<span class="powered">Powered by <a href="https://github.com/HumaneWolf/WolfVTC">WolfVTC</a></span>
开发者ID:HumaneWolf,项目名称:WolfVTCStandalone,代码行数:9,代码来源:footer.php


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