• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP loadConfig函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: resolveImports

function resolveImports($doc, $prefix, $i, $configFolder)
{
    $xpath = new DOMXPath($doc);
    $xquery = "//import";
    $nodelist = $xpath->query($xquery);
    if ($nodelist->length == 0) {
        return;
    }
    /**
     * Import all linked documents
     */
    echo str_repeat(" ", $i * 2);
    echo "<import>\n";
    foreach ($nodelist as $node) {
        $toImport = $filename = $node->nodeValue;
        $parent = $node->parentNode;
        if (strpos($toImport, "/") !== 0) {
            $toImport = $configFolder . $toImport;
        }
        // Prefixed file
        $prefixedFile = str_replace($filename, $prefix . "." . $filename, $toImport);
        // If prefixed file exists, use it
        if (file_exists($prefixedFile)) {
            $toImport = $prefixedFile;
        } elseif ($prefix == 'test' and !file_exists($toImport)) {
            $toImport = str_replace($filename, 'prod.' . $filename, $toImport);
        }
        echo str_repeat(" ", $i * 2 + 2) . $toImport . "\n";
        // Read in import file
        $import = loadConfig($toImport);
        resolveImports($import, $prefix, $i + 1, $configFolder);
        // Add provides-prefix if import-tag provides-prefix attribute is set
        $providesPrefix = $node->getAttribute('prefix-provides');
        if ($providesPrefix) {
            $modules = $import->documentElement->getElementsByTagName('module');
            foreach ($modules as $m) {
                $provides = $m->getAttribute('provides');
                if ($provides) {
                    $m->setAttribute('provides', $providesPrefix . ucfirst($provides));
                }
            }
        }
        foreach ($import->documentElement->childNodes as $child) {
            $import = $doc->importNode($child, true);
            $parent->insertBefore($import, $node);
        }
        $node->parentNode->removeChild($node);
    }
}
开发者ID:M4R7iNP,项目名称:aether,代码行数:49,代码来源:generateConfig.php


示例17: __construct

 /**
  * 构造函数
  */
 public function __construct()
 {
     $route = bpBase::loadSysClass('route');
     if (!defined('ROUTE_MODEL')) {
         define('ROUTE_MODEL', $route->routeModel());
         define('ROUTE_CONTROL', $route->routeControl());
         define('ROUTE_ACTION', $route->routeAction());
     }
     $this->init();
     //执行计划任务
     if (loadConfig('system', 'cron')) {
         //$classRunObj=bpBase::loadAppClass('cronRun','cron',1);
         //$classRunObj->init();
     }
 }
开发者ID:liuguogen,项目名称:weixin,代码行数:18,代码来源:application.class.php


示例18: __construct

 /**
  * 构造函数
  * 
  */
 public function __construct($dbObj = null)
 {
     if (!$dbObj) {
         $this->db = bpBase::loadModel('session_model');
     } else {
         //autoDB;
         $this->db = $dbObj;
         $this->oldSys = 1;
         $this->table = TABLE_PREFIX . 'session';
     }
     $this->lifetime = loadConfig('site', 'session_ttl');
     $this->lifetime = $this->lifetime == '' ? 3600 : $this->lifetime;
     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:ailingsen,项目名称:pigcms,代码行数:19,代码来源:session_mysql.class.php


示例19: MCache_connect

function MCache_connect($name)
{
    // use link for adding connection into global $Config
    $settings =& loadConfig('memcache')['memcache'][$name];
    // get connect if it already exists
    if (!is_null($settings['connect'])) {
        return $settings['connect'];
    }
    $mcConnect = memcache_pconnect($settings['hostname'], $settings['port']);
    if (!$mcConnect) {
        exit("Memcache connect error.");
    }
    // remember connection
    $settings['connect'] = $mcConnect;
    return $mcConnect;
}
开发者ID:Archerol,项目名称:booking,代码行数:16,代码来源:memcache.php


示例20: Database_connect

/**
 * Create database connect.
 * Settings gets from config/db.php, from array with key = $name
 * Function creates connect only first time and remembers it.
 * In next time function returns connection which already created.
 */
function Database_connect($name)
{
    // use link for adding connection into global $Config
    $settings =& loadConfig('db')['db'][$name];
    // get connect if it already exists
    if (!is_null($settings['connect'])) {
        return $settings['connect'];
    }
    $dbConnect = mysqli_connect($settings['hostname'], $settings['username'], $settings['password'], $settings['database']);
    if (!$dbConnect) {
        exit("Database connect error: " . mysqli_connect_error());
    }
    Database_setCharset($dbConnect, $settings['encoding']);
    // remember connection
    $settings['connect'] = $dbConnect;
    return $dbConnect;
}
开发者ID:Archerol,项目名称:booking,代码行数:23,代码来源:database.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP loadController函数代码示例发布时间:2022-05-15
下一篇:
PHP loadComboListFromArray函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap