本文整理汇总了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]);
}
示例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();
}
示例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));
}
示例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;
}
示例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;
}
示例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();
}
示例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');
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
}
示例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);
}
}
示例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();
}
示例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 ? '&' : '?');
}
}