本文整理汇总了PHP中load_config函数的典型用法代码示例。如果您正苦于以下问题:PHP load_config函数的具体用法?PHP load_config怎么用?PHP load_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_config函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:robhell,项目名称:friendica,代码行数:35,代码来源:gprobe.php
示例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;
}
开发者ID:rahmiyildiz,项目名称:friendica,代码行数:32,代码来源:directory.php
示例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;
}
开发者ID:nextgensh,项目名称:friendica,代码行数:26,代码来源:directory.php
示例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;
}
开发者ID:nphyx,项目名称:friendica,代码行数:30,代码来源:expire.php
示例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;
}
开发者ID:nextgensh,项目名称:friendica,代码行数:33,代码来源:expire.php
示例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));
}
}
}
开发者ID:xinyifuyun,项目名称:thinkphp,代码行数:35,代码来源:Think.class.php
示例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];
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:12,代码来源:forecasting.php
示例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));
}
}
开发者ID:varyan,项目名称:namecpaseSystem,代码行数:12,代码来源:Upload.php
示例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';
}
}
开发者ID:sunqinye,项目名称:SunPHP,代码行数:9,代码来源:Edcrypt.php
示例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;
}
开发者ID:nscreed,项目名称:rp,代码行数:10,代码来源:Auth_Base.php
示例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);
}
开发者ID:sunqinye,项目名称:SunPHP,代码行数:10,代码来源:Model.php
示例12: testModelConnection
function testModelConnection()
{
$model = new Model();
$config = load_config();
$model->config = $config["database"];
$model->load();
global $test;
echo "<br />";
$test->show();
}
开发者ID:hurrycane,项目名称:framework,代码行数:10,代码来源:model_tests.php
示例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;
}
}
开发者ID:qcind,项目名称:Frame1.1,代码行数:11,代码来源:PubAuth.php
示例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;
}
}
开发者ID:yunsite,项目名称:tp-coupon,代码行数:17,代码来源:LocalTime.class.php
示例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;
}
开发者ID:varyan,项目名称:namecpaseSystem,代码行数:17,代码来源:Routing.php
示例16: __construct
/**
* __construct method
* @param array $config
* */
public function __construct($config = null)
{
foreach (load_config('database') as $item => $value) {
$this->{$item} = $value;
}
if (!is_null($config)) {
foreach ($config as $item => $value) {
$this->{$item} = $value;
}
}
$this->makeConnection();
}
开发者ID:varyan,项目名称:namecpaseSystem,代码行数:16,代码来源:Database.php
示例17: emailServer
/**
* 由email取得邮件服务商的信息
* @param type $email 邮箱名
* @return array ['name'] && ['url']
*/
static function emailServer($email)
{
$emailServer = array("name" => "", "url" => "");
load_config('emailServer');
$emailDomain = substr($email, stripos($email, '@') + 1);
if (isset($GLOBALS['config']['emailServer'][$emailDomain])) {
$emailServer = $GLOBALS['config']['emailServer'][$emailDomain];
} else {
$emailServer['name'] = "邮箱";
$emailServer['url'] = "http://www." . $email_domain;
}
return $emailServer;
}
开发者ID:qcind,项目名称:Frame1.1,代码行数:18,代码来源:PubUtil.php
示例18: checkcookie
/**
* 检测Cookie是否存在
*/
public static function checkcookie($name)
{
$cookieconfig = load_config('config', 'cookie');
$prefix = $cookieconfig['prefix'];
$name = $prefix . $name;
$name = base64_encode($name);
$name = strtr($name, '=', 'S');
if (isset($_COOKIE[$name])) {
return true;
} else {
return false;
}
}
开发者ID:sunqinye,项目名称:SunPHP,代码行数:16,代码来源:CookieHelper.php
示例19: cronhooks_run
function cronhooks_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);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
require_once 'include/pidfile.php';
load_config('config');
load_config('system');
$maxsysload = intval(get_config('system', 'maxloadavg'));
if ($maxsysload < 1) {
$maxsysload = 50;
}
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if (intval($load[0]) > $maxsysload) {
logger('system: load ' . $load . ' too high. Poller deferred to next scheduled run.');
return;
}
}
$lockpath = get_lockpath();
if ($lockpath != '') {
$pidfile = new pidfile($lockpath, 'cronhooks');
if ($pidfile->is_already_running()) {
logger("cronhooks: Already running");
if ($pidfile->running_time() > 19 * 60) {
$pidfile->kill();
logger("cronhooks: killed stale process");
// Calling a new instance
proc_run('php', 'include/cronhooks.php');
}
exit;
}
}
$a->set_baseurl(get_config('system', 'url'));
load_hooks();
logger('cronhooks: start');
$d = datetime_convert();
call_hooks('cron', $d);
logger('cronhooks: end');
return;
}
开发者ID:jzacman,项目名称:friendica,代码行数:50,代码来源:cronhooks.php
示例20: get_config
/**
* @brief Get a particular config variable given the category name ($family)
* and a key.
*
* Get a particular config variable from the given category ($family) and the
* $key from a cached storage in $a->config[$family]. If a key is found in the
* DB but does not exist in local config cache, pull it into the cache so we
* do not have to hit the DB again for this item.
*
* Returns false if not set.
*
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to query
* @return mixed Return value or false on error or if not set
*/
function get_config($family, $key)
{
global $a;
if (!array_key_exists($family, $a->config) || !array_key_exists('config_loaded', $a->config[$family])) {
load_config($family);
}
if (array_key_exists('config_loaded', $a->config[$family])) {
if (!array_key_exists($key, $a->config[$family])) {
return false;
}
return !is_array($a->config[$family][$key]) && preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key]) ? unserialize($a->config[$family][$key]) : $a->config[$family][$key];
}
return false;
}
开发者ID:Pesmark,项目名称:hubzilla,代码行数:31,代码来源:config.php
注:本文中的load_config函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论