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


PHP Config::init方法代码示例

本文整理汇总了PHP中Config::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::init方法的具体用法?PHP Config::init怎么用?PHP Config::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


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

示例1: __construct

 /**
  * Main constructor.
  *
  * @param string $moduleName
  */
 function __construct($moduleName = '')
 {
     // Инициализация конфига
     Config::init($moduleName);
     // БД
     $this->db = DbClass::init(['host' => DBHOST, 'user' => DBUSER, 'pass' => DBPASS, 'db' => DBNAME, 'charset' => COLLATE]);
 }
开发者ID:dle-modules,项目名称:DLE-Components,代码行数:12,代码来源:Main.php

示例2: __construct

 /**
  * @param String $config_file
  */
 public function __construct($config = array())
 {
     // make sure global statics are set up
     Config::init($config);
     Template::init();
     $this->ingester = new Ingester();
 }
开发者ID:helloandre,项目名称:pressing,代码行数:10,代码来源:Pressing.php

示例3: init

 public function init()
 {
     parent::init();
     $currency = new \Zend_Form_Element_Hidden('currency', array('decorators' => array('ViewHelper'), 'required' => true, 'value' => 'USD'));
     $amount = new \Tillikum_Form_Element_Number('amount', array('attribs' => array('min' => '-9999.99', 'max' => '9999.99', 'step' => '0.01', 'title' => 'Value must be precise to no more than 2' . ' decimal places'), 'label' => 'Amount', 'required' => true, 'validators' => array('Float', new \Zend_Validate_Between(-9999.99, 9999.99))));
     $this->addElements(array($currency, $amount));
 }
开发者ID:tillikum,项目名称:tillikum-core-module,代码行数:7,代码来源:FacilityBooking.php

示例4: router

 public static function router()
 {
     // System Classes
     Config::init();
     Autoloder::load();
     Request::setRequest();
     // Router Data
     Config::$controller = Request::$request['post']['controller'];
     Config::$action = Request::$request['post']['action'];
     Config::$route = self::$controller . '/' . self::$action;
     Config::$session = [];
     Config::$is_ajax = false;
     if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
         Config::$is_ajax = true;
     }
     // Current User Session
     Config::locateUserSession();
     // API Mode
     if (!Request::$request['post']) {
         //Default API Mode
         Config::$mobile_mode = 'default';
     } else {
         Config::$mobile_mode = Request::$request['post']['mobile'];
     }
     return true;
 }
开发者ID:astar3086,项目名称:studio_logistic,代码行数:26,代码来源:Config.php

示例5: plugin

function plugin(&$url_parts)
{
    $CFG = Config::init();
    if (isset($url_parts[0]) && isset($url_parts[1])) {
        $file_path = $url_parts[0] . DS . $url_parts[1] . '.php';
        if (is_file($file = TPL_PATH . 'application/controllers' . DS . $file_path)) {
            $url_parts = array_slice($url_parts, 2);
            return $file;
        }
        if (is_file($file = APPPATH . 'controllers/' . $file_path)) {
            $url_parts = array_slice($url_parts, 2);
            return $file;
        }
    }
    if (isset($url_parts[0])) {
        $file_path = $url_parts[0] . '.php';
        if (is_file($file = TPL_PATH . 'application/controllers' . DS . $file_path)) {
            $url_parts = array_slice($url_parts, 1);
            return $file;
        }
        if (is_file($file = APPPATH . 'controllers/' . $file_path)) {
            $url_parts = array_slice($url_parts, 1);
            return $file;
        }
    }
    $file_path = ($CFG->get('default_controller') == '' ? '' : $CFG->get('default_controller') . DS) . $CFG->get('default_action') . '.php';
    if (is_file($file = TPL_PATH . 'application/controllers' . DS . $file_path)) {
        return $file;
    }
    return APPPATH . 'controllers/' . $file_path;
}
开发者ID:ionutmilica,项目名称:my-archive,代码行数:31,代码来源:functions.php

示例6: __construct

 /**
  * Constructor.
  *
  * @access protected
  */
 protected function __construct()
 {
     // Init Config
     Config::init();
     // Turn on output buffering
     ob_start();
     // Display Errors
     Config::get('system.errors.display') and error_reporting(-1);
     // Set internal encoding
     function_exists('mb_language') and mb_language('uni');
     function_exists('mb_regex_encoding') and mb_regex_encoding(Config::get('system.charset'));
     function_exists('mb_internal_encoding') and mb_internal_encoding(Config::get('system.charset'));
     // Set default timezone
     date_default_timezone_set(Config::get('system.timezone'));
     // Start the session
     Session::start();
     // Init Cache
     Cache::init();
     // Init Plugins
     Plugins::init();
     // Init Blocks
     Blocks::init();
     // Init Pages
     Pages::init();
     // Flush (send) the output buffer and turn off output buffering
     ob_end_flush();
 }
开发者ID:zorca,项目名称:morfy,代码行数:32,代码来源:Morfy.php

示例7: testInvalidXml

 /**
  * @throws Exception
  * @return void
  */
 public function testInvalidXml()
 {
     $this->setExpectedException('Migration\\Exception', 'XML file is invalid');
     $validationState = $this->getMockBuilder('Magento\\Framework\\App\\Arguments\\ValidationState')->disableOriginalConstructor()->setMethods(['isValidationRequired'])->getMock();
     $validationState->expects($this->any())->method('isValidationRequired')->willReturn(true);
     $config = new Config($validationState);
     $config->init(__DIR__ . '/_files/invalid-config.xml');
 }
开发者ID:Mohitsahu123,项目名称:data-migration-tool-ce,代码行数:12,代码来源:ConfigTest.php

示例8: init

 private static function init()
 {
     if (self::$init == true) {
         return;
     }
     $string = file_get_contents(self::$config_path);
     self::$properties = json_decode($string, TRUE);
     self::$init = true;
 }
开发者ID:vladkanash,项目名称:PHP-Blog,代码行数:9,代码来源:Config.php

示例9: __construct

 private function __construct()
 {
     Config::init();
     $this->include_library();
     $this->db = $this->init_db();
     $this->session = $this->init_session();
     $this->flash = $this->init_flash();
     $this->log = $this->init_log();
     $this->init_cache();
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:10,代码来源:context.class.php

示例10: init

 private static function init()
 {
     global $db;
     $res = $db->query("SELECT * FROM " . TABLE_CONFIG . "");
     while ($row = $db->fetchObject($res)) {
         self::$values[$row->key] = $row->value;
     }
     ksort(self::$values);
     self::$init = true;
 }
开发者ID:GIDIX,项目名称:quicktalk,代码行数:10,代码来源:Config.php

示例11: __construct

 public function __construct($formatclass, $opts, $extra = array())
 {
     foreach ($opts as $k => $v) {
         $method = "set_{$k}";
         Config::$method($v);
     }
     if (count($extra) != 0) {
         Config::init($extra);
     }
     $classname = __NAMESPACE__ . "\\" . $formatclass;
     $this->format = new $classname();
 }
开发者ID:marczych,项目名称:hack-hhvm-docs,代码行数:12,代码来源:TestRender.php

示例12: __construct

 public function __construct($apikey = null, $api_secret = null)
 {
     $this->yunpian_config = Config::init();
     if ($api_secret == null) {
         $this->api_secret = $this->yunpian_config['API_SECRET'];
     } else {
         $this->api_secret = $apikey;
     }
     if ($apikey == null) {
         $this->apikey = $this->yunpian_config['APIKEY'];
     } else {
         $this->apikey = $api_secret;
     }
 }
开发者ID:oyoy8629,项目名称:yii-core,代码行数:14,代码来源:SmsOperator.php

示例13: init

 /**
  * 初始化配置
  */
 protected static function init()
 {
     Config::init(BASE_PATH);
     Config::loadConfig(CONFIG_PATH . 'global.php');
     Config::loadConfig(CONFIG_PATH . Config::get('ENV') . '.php');
     date_default_timezone_set(Config::get('TIMEZONE'));
     //error display
     if (Config::get('DEBUG')) {
         ini_set("display_errors", 1);
         error_reporting(E_ALL ^ E_NOTICE);
     } else {
         ini_set("display_errors", 0);
         error_reporting(0);
     }
 }
开发者ID:lerre,项目名称:canphp,代码行数:18,代码来源:App.php

示例14: load

 public static function load()
 {
     // app is available
     static::available();
     // load the app configs
     Config::init();
     // initializing encryption
     Encryption::init();
     // initializing the request infos
     Request::init();
     // initializing sessions
     Session::init();
     Session::start();
     // handling the routes and response
     echo Route::response();
 }
开发者ID:ramee,项目名称:alien-framework,代码行数:16,代码来源:App.php

示例15: __construct

 public function __construct()
 {
     if (isset($_REQUEST['reportID'])) {
         $this->report = new Report($_REQUEST['reportID']);
     } else {
         $this->report = new Report(header('Location: index.php'));
     }
     if (isset($_REQUEST['outputType'])) {
         $this->outputType = $_REQUEST['outputType'];
     } else {
         $this->outputType = 'web';
     }
     if ($this->outputType != 'web') {
         $this->startPage = 1;
     } else {
         if (isset($_REQUEST['startPage'])) {
             $this->startPage = $_REQUEST['startPage'];
         } else {
             $this->startPage = 1;
         }
     }
     if (isset($_REQUEST['sortColumn'])) {
         $this->sortColumn = $_REQUEST['sortColumn'];
     }
     if (isset($_REQUEST['sortOrder'])) {
         $this->sortOrder = $_REQUEST['sortOrder'];
     }
     if (isset($_REQUEST['titleID'])) {
         $this->titleID = $_REQUEST['titleID'];
     }
     $this->hidden_inputs = new HiddenInputs();
     $this->loopThroughParams();
     $this->sumColsArray = $this->report->getReportSums();
     $this->groupColsArray = $this->report->getGroupingColumns();
     if (count($this->groupColsArray) > 0) {
         $this->perform_subtotal_flag = true;
     } else {
         $this->perform_subtotal_flag = false;
     }
     $this->outlier = $this->report->getOutliers();
     Config::init();
     if (Config::$settings->baseURL) {
         $hasQ = strpos(Config::$settings->baseURL, '?') > 0;
         $this->baseURL = Config::$settings->baseURL . ($hasQ ? '&' : '?');
     }
 }
开发者ID:mehulsbhatt,项目名称:reports,代码行数:46,代码来源:ReportHelper.php


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