本文整理汇总了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');
}
示例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');
示例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')) {
示例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;