本文整理匯總了PHP中load_config函數的典型用法代碼示例。如果您正苦於以下問題:PHP load_config函數的具體用法?PHP load_config怎麽用?PHP load_config使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了load_config函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gprobe_run
function gprobe_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
load_hooks();
if ($argc != 2) {
return;
}
$url = hex2bin($argv[1]);
$r = q("select * from gcontact where nurl = '%s' limit 1", dbesc(normalise_link($url)));
if (!count($r)) {
$arr = probe_url($url);
if (count($arr) && x($arr, 'network') && $arr['network'] === NETWORK_DFRN) {
q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)\n\t\t\t\tvalues ( '%s', '%s', '%s', '%s') ", dbesc($arr['name']), dbesc($arr['url']), dbesc(normalise_link($arr['url'])), dbesc($arr['photo']));
}
$r = q("select * from gcontact where nurl = '%s' limit 1", dbesc(normalise_link($url)));
}
if (count($r)) {
poco_load(0, 0, $r[0]['id'], str_replace('/profile/', '/poco/', $r[0]['url']));
}
return;
}
示例2: directory_run
function directory_run(&$argv, &$argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "include/dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
load_config('config');
load_config('system');
if ($argc != 2) {
return;
}
load_config('system');
load_hooks();
$a->set_baseurl(get_config('system', 'url'));
$dir = get_config('system', 'directory_submit_url');
if (!strlen($dir)) {
return;
}
$arr = array('url' => $argv[1]);
call_hooks('globaldir_update', $arr);
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
if (strlen($arr['url'])) {
fetch_url($dir . '?url=' . bin2hex($arr['url']));
}
return;
}
示例3: directory_run
function directory_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
load_config('config');
load_config('system');
if ($argc != 2) {
return;
}
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
$dir = get_config('system', 'directory_submit_url');
if (!strlen($dir)) {
return;
}
fetch_url($dir . '?url=' . bin2hex($argv[1]));
return;
}
示例4: expire_run
function expire_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
require_once 'library/simplepie/simplepie.inc';
require_once 'include/items.php';
require_once 'include/Contact.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
logger('expire: start');
$r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
if (count($r)) {
foreach ($r as $rr) {
logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
item_expire($rr['uid'], $rr['expire']);
}
}
return;
}
示例5: expire_run
function expire_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
require_once 'library/simplepie/simplepie.inc';
require_once 'include/items.php';
require_once 'include/Contact.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
// physically remove anything that has been deleted for more than two months
$r = q("delete from item where deleted = 1 and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY");
q("optimize table item");
logger('expire: start');
$r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
if (count($r)) {
foreach ($r as $rr) {
logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
item_expire($rr['uid'], $rr['expire']);
}
}
return;
}
示例6: start
/**
* 應用程序初始化
*/
public static function start()
{
// 注冊AUTOLOAD方法
spl_autoload_register('Think\\Think::autoLoad');
// 設定錯誤和異常處理
register_shutdown_function('Think\\Think::fatalError');
set_error_handler('Think\\Think::appError');
set_exception_handler('Think\\Think::appException');
// 初始化文件存儲方式
Storage::connect(STORAGE_TYPE);
$runtimeFile = RUNTIME_PATH . APP_MODE . '~runtime.php';
if (!APP_DEBUG && Storage::has($runtimeFile)) {
Storage::load($runtimeFile);
} else {
$content = '';
// 讀取應用模式
$mode = (include is_file(CONF_PATH . 'core.php') ? CONF_PATH . 'core.php' : MODE_PATH . APP_MODE . '.php');
// 加載核心文件
foreach ($mode['core'] as $file) {
if (is_file($file)) {
include $file;
if (!APP_DEBUG) {
$content .= compile($file);
}
}
}
// 加載應用模式配置文件
foreach ($mode['config'] as $key => $file) {
is_numeric($key) ? C(load_config($file)) : C($key, load_config($file));
}
}
}
示例7: getForecastingConfig
/**
* Get a forecasting configuration value
* @param type $config_key const CONFIG_KEY_* of this class
* @return type
*/
public static function getForecastingConfig($config_key)
{
if (is_null(self::$forecasting_config)) {
self::$forecasting_config = load_config('forecasting');
}
return self::$forecasting_config[$config_key];
}
示例8: __construct
/**
* __construct method
* @throws Error
* */
public function __construct()
{
$upload = load_config('upload');
self::init($upload);
if (is_null(self::$path)) {
throw new Error('invalidUploadPath', array('invalidPath' => self::$path));
}
}
示例9: __construct
public function __construct()
{
$safeconfig = load_config('config', 'safe');
if (isset($safeconfig['key']) && !empty($safeconfig['key'])) {
$this->crypt_key = $safeconfig['key'];
} else {
$this->crypt_key = 'sunphp';
}
}
示例10: __construct
public function __construct(array $config = array())
{
global $app_dbo;
$config = array_merge($config, load_config('auth'));
$this->table_name = $config['auth_table_name'];
$this->username_field = $config['auth_fields']['user'];
$this->password_field = $config['auth_fields']['pass'];
$this->remember = $config['remember'];
$this->dbo =& $app_dbo;
}
示例11: __construct
public function __construct()
{
$databaseConfig = load_config('database');
if (!isset($this->database)) {
$currentDBConfig = $databaseConfig['default'];
} else {
$currentDBConfig = $databaseConfig[$this->database];
}
$this->db = new DataBase($currentDBConfig);
}
示例12: testModelConnection
function testModelConnection()
{
$model = new Model();
$config = load_config();
$model->config = $config["database"];
$model->load();
global $test;
echo "<br />";
$test->show();
}
示例13: apiAuth
public static function apiAuth($app)
{
load_config('apikey');
if (empty($GLOBALS['config']['apikey'][$app])) {
exit('key config error');
}
if (empty($_REQUEST['time']) || $_REQUEST['time'] + 120 <= time() || $_REQUEST['sign'] != md5($_REQUEST['_c'] . $GLOBALS['config']['apikey'][$app] . $_REQUEST['time'])) {
echo "0";
exit;
}
}
示例14: server_timezone
/**
* 獲得服務器的時區
*
* @return integer
*/
function server_timezone()
{
if (function_exists('load_config')) {
$_CFG = load_config();
return $_CFG['timezone'];
}
if (function_exists('date_default_timezone_get')) {
return date_default_timezone_get();
} else {
return date('Z') / 3600;
}
}
示例15: start
/**
* start method
* @param string $url
* @return array
* */
public static final function start($url)
{
self::$routArray = load_config('routing');
self::$url = $url;
if (self::$url === '/' || trim(self::$url) === '') {
self::$url = '';
self::defaultRout();
} else {
self::findCurrentValue();
}
return self::$router;
}