當前位置: 首頁>>代碼示例>>PHP>>正文


PHP load::config方法代碼示例

本文整理匯總了PHP中load::config方法的典型用法代碼示例。如果您正苦於以下問題:PHP load::config方法的具體用法?PHP load::config怎麽用?PHP load::config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在load的用法示例。


在下文中一共展示了load::config方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: config

 static function config()
 {
     parent::config();
     // load the default panel config file
     self::file(c::get('root.panel') . '/defaults/config/config.php');
     $root = c::get('root.site') . '/' . c::get('panel.folder') . '/config';
     self::file($root . '/config.php');
     self::file($root . '/config.' . server::get('server_name') . '.php');
 }
開發者ID:nilshendriks,項目名稱:kirbycms-panel,代碼行數:9,代碼來源:load.php

示例2: die

<?php

if (!defined('DINGO')) {
    die('External Access to File Denied');
}
/**
 * DB Library For Dingo Framework
 *
 * @author          Evan Byrne
 * @copyright       2008 - 2010
 * @project page    http://www.dingoframework.com
 */
load::config('db');
function db($table = FALSE, $orm = FALSE, $connection = 'default')
{
    // If no table given, return connection
    if (!$table) {
        return db::connection($connection);
    }
    // Otherwise, return table
    return $orm ? db::connection($connection)->table($table)->orm($orm) : db::connection($connection)->table($table);
}
class db
{
    private static $connections = array();
    private static $pdo = array('mysql', 'pgsql');
    // Add Connection
    // ---------------------------------------------------------------------------
    public static function add_connection($name)
    {
        $config = config::get('db');
開發者ID:reang,項目名稱:Dingo-Framework,代碼行數:31,代碼來源:db.php

示例3: define

define('KIRBY', true);
// check for a proper phpversion
if (floatval(phpversion()) < 5.2) {
    die('Please upgrade to PHP 5.2 or higher');
}
// include kirby
require_once $rootKirby . '/lib/kirby.php';
// set the root
c::set('root', $root);
c::set('root.kirby', $rootKirby);
c::set('root.site', $rootSite);
c::set('root.content', $rootContent);
require_once $rootKirby . '/lib/load.php';
// load the rest of the system
load::lib();
load::config();
load::parsers();
load::plugins();
// check for an exisiting content dir
if (!is_dir(c::get('root.content'))) {
    die('The Kirby content directory could not be found');
}
// check for an exisiting site dir
if (!is_dir(c::get('root.site'))) {
    die('The Kirby site directory could not be found');
}
// set the timezone to make sure we
// avoid errors in php 5.3
@date_default_timezone_set(c::get('timezone'));
// switch on errors
if (c::get('debug')) {
開發者ID:nilshendriks,項目名稱:kirbycms,代碼行數:31,代碼來源:system.php

示例4: save

    // Save
    // ---------------------------------------------------------------------------
    public function save()
    {
        $this->table->update(array('id' => $this->id, 'email' => $this->email, 'username' => $this->username, 'password' => $this->password, 'type' => $this->type, 'data' => json_encode($this->data)))->where('id', '=', $this->id)->execute();
        return $this;
    }
    // Hash
    // ---------------------------------------------------------------------------
    public function hash($i)
    {
        return sha1($i);
    }
}
// Load config file
load::config('user');
user::$types = config::get('user_types');
// Set database table
user::$table = db(config::get('user_table'), NULL, config::get('user_connection'));
// Get session data
user::$_email = session::get('user_email');
user::$_password = session::get('user_password');
// Get information about current user
if (user::$_email and user::$_password) {
    $user = user::$table->select('*')->where('email', '=', user::$_email)->clause('AND')->where('password', '=', user::$_password)->limit(1)->execute();
    // If valid login credentials
    if (!empty($user[0])) {
        $user = $user[0];
        user::$_id = $user->id;
        user::$_email = $user->email;
        user::$_username = $user->username;
開發者ID:reang,項目名稱:Dingo-Framework,代碼行數:31,代碼來源:user.php


注:本文中的load::config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。