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


PHP load_config函数代码示例

本文整理汇总了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;
}
开发者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


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