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


PHP loadConfig函数代码示例

本文整理汇总了PHP中loadConfig函数的典型用法代码示例。如果您正苦于以下问题:PHP loadConfig函数的具体用法?PHP loadConfig怎么用?PHP loadConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了loadConfig函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $this->db = loadModel('session_model');
     $this->lifetime = loadConfig('config', 'session_ttl');
     session_set_save_handler(array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc'));
     session_start();
 }
开发者ID:iquanxin,项目名称:march,代码行数:7,代码来源:session.cls.php

示例2: __construct

 public function __construct()
 {
     $this->db_config = loadConfig('dbconfig');
     $this->db_setting = 'default';
     $this->table_name = 'session';
     parent::__construct();
 }
开发者ID:iquanxin,项目名称:march,代码行数:7,代码来源:session_model.cls.php

示例3: prepare_items

 function prepare_items()
 {
     $iterator = new DirectoryIterator($this->skinsDir);
     $skins = array();
     foreach ($iterator as $item) {
         if (!$item->isDot() and $item->isDir()) {
             $skin = $item->getBasename();
             $neon = $item->getPathname() . "/{$skin}.neon";
             if (file_exists($neon)) {
                 $config = loadConfig($neon);
                 $skins[$skin]['name'] = $config['name'];
                 $skins[$skin]['url'] = "{$this->skinsUrl}/{$skin}";
                 $skins[$skin]['author'] = $config['author'];
                 $skins[$skin]['desc'] = $config['desc'];
                 $skins[$skin]['theme'] = isset($config['theme']) ? $config['theme'] : '';
                 if (file_exists("{$this->skinsDir}/{$skin}/{$skin}-screenshot.png")) {
                     $skins[$skin]['screenshot'] = "{$this->skinsUrl}/{$skin}/{$skin}-screenshot.png";
                 } else {
                     $skins[$skin]['screenshot'] = '';
                 }
             }
         }
     }
     uksort($skins, "strnatcasecmp");
     $per_page = 15;
     $page = $this->get_pagenum();
     $start = ($page - 1) * $per_page;
     $this->items = array_slice($skins, $start, $per_page);
     $this->set_pagination_args(array('total_items' => count($skins), 'per_page' => $per_page));
 }
开发者ID:simeont9,项目名称:stoneopen,代码行数:30,代码来源:AitSkinsListTable.php

示例4: __construct

 /**
  * @desc constructor for mysql class
  * @param string $sEnvType
  */
 private function __construct($sEnvType = 'release')
 {
     if ($sEnvType == 'test') {
         $this->_dbconfig = loadConfig('DBTest');
     } elseif ($sEnvType == 'release') {
         $this->_dbconfig = loadConfig('DB');
     } else {
         if (isTestEnv()) {
             $this->_dbconfig = loadConfig('DBTest');
         } else {
             $this->_dbconfig = loadConfig('DB');
         }
     }
     $sHost = $this->_dbconfig['host'];
     $sPort = $this->_dbconfig['port'];
     $sUser = $this->_dbconfig['user'];
     $sPassword = $this->_dbconfig['password'];
     $this->_link = mysql_connect("{$sHost}:{$sPort}", $sUser, $sPassword);
     if (!$this->_link) {
         recordSysLog('Unable to connect to Mysql');
     }
     $sDatabase = $this->_dbconfig['database'];
     $this->setDatabase($sDatabase);
     $sCharset = $this->_dbconfig['charset'];
     $this->setCharset($sCharset);
 }
开发者ID:shishihai,项目名称:PHPFramework,代码行数:30,代码来源:mysql.inc.php

示例5: createSitemap

 function createSitemap($type, $showMessage = 1)
 {
     $sitemapConfig = loadConfig('sitemap');
     $articleCount = $sitemapConfig['articleCount'] ? $sitemapConfig['articleCount'] : 500;
     $ucarCount = $sitemapConfig['ucarCount'] ? $sitemapConfig['ucarCount'] : 500;
     $datas = array();
     switch ($type) {
         default:
         case 'news':
             $article_db = bpBase::loadModel('article_model');
             $articles = $article_db->select(array('ex' => 0), 'link,time,title,keywords', '0,' . $articleCount, 'time DESC');
             if ($articles) {
                 foreach ($articles as $a) {
                     if (!strExists($a['link'], 'http://')) {
                         $a['link'] = MAIN_URL_ROOT . $a['link'];
                     }
                     if ($a['keywords'] == ',') {
                         $a['keywords'] = '';
                     }
                     array_push($datas, array('url' => $a['link'], 'time' => $a['time'], 'keywords' => $a['keywords']));
                 }
             }
             break;
     }
     $this->_createSitemap($type, $datas, $showMessage);
 }
开发者ID:ailingsen,项目名称:pigcms,代码行数:26,代码来源:seoObj.class.php

示例6: config

function config(string $key, $default = null)
{
    static $config;
    if (!$config) {
        $config = loadConfig();
    }
    return $config[$key] ?? $default;
}
开发者ID:kelunik,项目名称:chat-main,代码行数:8,代码来源:functions.php

示例7: __construct

 function __construct()
 {
     $this->watermarkConfig = loadConfig('watermark');
     $this->watermarkConfig['leftTopWaterMarkText'] = $this->watermarkConfig['leftTopWaterMarkText'] ? $this->watermarkConfig['leftTopWaterMarkText'] : $this->watermarkConfig['waterMarkText'];
     $this->watermarkConfig['leftDistance'] = isset($this->watermarkConfig['leftDistance']) ? intval($this->watermarkConfig['leftDistance']) : 9;
     $this->watermarkConfig['topDistance'] = isset($this->watermarkConfig['topDistance']) ? intval($this->watermarkConfig['topDistance']) : 16;
     $this->watermarkConfig['rightDistance'] = isset($this->watermarkConfig['rightDistance']) ? intval($this->watermarkConfig['rightDistance']) : 5;
     $this->watermarkConfig['bottomDistance'] = isset($this->watermarkConfig['bottomDistance']) ? intval($this->watermarkConfig['bottomDistance']) : 10;
 }
开发者ID:ailingsen,项目名称:pigcms,代码行数:9,代码来源:watermark.class.php

示例8: dbInit

 protected function dbInit()
 {
     $config = loadConfig('confDb', 'config');
     $this->_dbname = $config['dbname'];
     $this->_host = $config['host'];
     $this->_user = $config['user'];
     $this->_password = $config['password'];
     $dsn = 'mysql:dbname=' . $this->_dbname . ';host=' . $this->_host . '';
     $this->db = new Database($dsn, $this->_user, $this->_password);
 }
开发者ID:emrecete,项目名称:fmr,代码行数:10,代码来源:Model.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     /***********uid*******************/
     $uid = isset($_GET['uid']) && intval($_GET['uid']) > 0 ? intval($_GET['uid']) : 0;
     //设置uid为request的数值
     $uid = $uid > 0 ? $uid : $this->uid;
     $this->assign('uid', $uid);
     if (!$uid) {
         header('Location:/');
         exit;
     }
     $thisUser = $this->user;
     $this->assign('user', $thisUser);
     /**********************************************************/
     if ($this->uid == $uid) {
         $sub = '我';
         $my = 1;
     } else {
         $sub = '他(她)';
         $my = 0;
     }
     $this->uid = $uid;
     $this->assign('sub', $sub);
     $this->assign('my', $my);
     /*********************判断是不是各种经销商***************************/
     $storeUserIndependent = 0;
     //经销商用户是否单独建表存储
     if (intval(loadConfig('store', 'storeUserIndependent'))) {
         $storeUserIndependent = 1;
         //经销商用户是否单独建表存储
     }
     if ($uid == $this->uid) {
         $this->assign('canManage', 1);
     }
     if ($uid == $this->uid && !$storeUserIndependent) {
         $store_db = bpBase::loadModel('store_model');
         $is4sStore = 0;
         if ($store_db->select(array('storetype' => 1, 'uid' => $this->uid))) {
             $is4sStore = 1;
         }
         $this->assign('is4sStore', $is4sStore);
         //carRental
         $isRentalStore = 0;
         if ($store_db->select(array('storetype' => 3, 'uid' => $this->uid))) {
             $isRentalStore = 1;
         }
         $this->assign('isRentalStore', $isRentalStore);
         //ucar
         $ucar_store_db = bpBase::loadModel('usedcar_store_model');
         $thisUcarStore = $ucar_store_db->select(array('uid' => $this->uid));
         $this->assign('isUcarStore', $thisUcarStore ? 1 : 0);
     }
 }
开发者ID:ailingsen,项目名称:pigcms,代码行数:54,代码来源:userPageInfo.class.php

示例10: init

 public function init()
 {
     // Initialize logger and translate actions
     $this->_logger = Zend_Registry::get("logger");
     $this->_translate = Zend_Registry::get("translate");
     // set the redirector to ignore the baseurl for redirections
     $this->_helper->redirector->setPrependBase(false);
     $this->_eventdispatcher = initializeSFEventDispatcher();
     // load the application configuration
     loadConfig();
     $this->view->referer = $this->getRequest()->getHeader('referer');
     $this->view->viewurl = $_SERVER['REQUEST_URI'];
     // debugMessage($this->view->viewurl);
     // debugMessage($this->getRequest());
     $isvalid = false;
     $host = giveHost($this->view->serverUrl());
     // debugMessage($host);
     $this->view->domain = str_replace('http://', '', strtolower($host));
     $subdomain = getSubdomain($this->view->serverUrl());
     $this->view->subdomain = strtolower($subdomain);
     if ($subdomain == "www") {
         $this->_helper->redirector->gotoUrl('http://' . $host);
         exit;
     }
     // debugMessage('subdomain '.$subdomain);
     if (!isEmptyString($subdomain) && strtolower($host) == "hrmagic.ug") {
         $session = SessionWrapper::getInstance();
         $session->setVar('companyid', '');
         $company = new Company();
         if ($company->isRenderable($subdomain)) {
             $isvalid = true;
             // debugMessage('valid');
         } else {
             // debugMessage('invalid');
         }
         if ($isvalid) {
             // if valid subdomain, set id to session
             $companyid = $company->findByUsername($subdomain);
             $session->setVar('cid', $companyid);
         } else {
             // subdomain not found. redirect to 404 page.
             $domain = str_replace($subdomain . '.', '', $this->view->serverUrl());
             // debugMessage('d is '.$domain);
             $this->_helper->redirector->gotoUrl(stripUrl($domain) . '/index/error');
         }
     }
     $url = array('http://www.domain.com', 'http://domain.com', 'https://domain.com', 'www.domain.com', 'domain.com', 'www.domain.com/some/path', 'http://sub.domain.com/domain.com', 'http://sub-domain.domain.net/domain.net', 'sub-domain.third-Level_DomaIN.domain.uk.co/domain.net');
     /* foreach ($url as $u) {
     		    debugMessage(getSubdomain($u));
     		} */
     // exit();
     # set default timezone based on company in session
     # date_default_timezone_set(getTimeZine());
 }
开发者ID:7thZoneTechnology,项目名称:hrms-1,代码行数:54,代码来源:IndexController.php

示例11: verifyUserPass

function verifyUserPass($username, $password, $redirect)
{
    $config = getConfig();
    if (checkUsername($username, $config->username) && checkPassword($password, $config->password)) {
        if (loadConfig($config)) {
            $_SESSION["loggedIn"] = true;
        }
        header("Location: " . $redirect);
    } else {
        return false;
    }
}
开发者ID:curlytailedbuffalo,项目名称:DashMaxPi,代码行数:12,代码来源:func.php

示例12: getInstance

 public static function getInstance($config = '')
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     if ($config == '') {
         $config = loadConfig('dbconfig');
     }
     if ($config != '' && $config != self::$_instance->_config) {
         self::$_instance->_config = array_merge($config, self::$_instance->_config);
     }
     return self::$_instance;
 }
开发者ID:iquanxin,项目名称:march,代码行数:13,代码来源:db.cls.php

示例13: _errorLog

function _errorLog($errno, $errstr, $errfile, $errline)
{
    if ($errno == 8) {
        return '';
    }
    $errfile = str_replace(ROOT_PATH, '', $errfile);
    if (loadConfig('config', 'errorlog')) {
        error_log('<?php exit;?>' . date('Y-m-d H:i:s', SYS_TIME) . ' | ' . $errno . ' | ' . str_pad($errstr, 30) . ' | ' . $errfile . ' | ' . $errline . "\r\n", 3, CACHE_PATH . 'errorlog.php');
    } else {
        $str = '<div style="border:1px solid #ccc;color:#666">errorno:' . $errno . ',str:' . $errstr . ',file:<span style="color:#f00">' . $errfile . '</span>,line:' . $errline . '</div>';
        echo $str;
    }
}
开发者ID:iquanxin,项目名称:march,代码行数:13,代码来源:global.func.php

示例14: main

function main()
{
    $pp = new Prefork(array('max_workers' => 5, 'trap_signals' => array(SIGHUP => SIGTERM, SIGTERM => SIGTERM)));
    while ($pp->signalReceived() !== SIGTERM) {
        loadConfig();
        if ($pp->start()) {
            continue;
        }
        workChildren();
        $pp->finish();
    }
    $pp->waitAllChildren();
}
开发者ID:ngyuki,项目名称:php-Parallel-Prefork,代码行数:13,代码来源:01-sleep.php

示例15: __construct

 public function __construct()
 {
     if (!get_magic_quotes_gpc()) {
         $_GET = new_addslashes($_GET);
         $_POST = new_addslashes($_POST);
         $_REQUEST = new_addslashes($_REQUEST);
         $_COOKIE = new_addslashes($_COOKIE);
     }
     $this->route = loadConfig('route', 'default');
     if (isset($_GET['page'])) {
         $_GET['page'] = max(intval($_GET['page']), 1);
         $_GET['page'] = min($_GET['page'], 1000000);
     }
 }
开发者ID:iquanxin,项目名称:march,代码行数:14,代码来源:param.cls.php


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