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


PHP Application::config方法代码示例

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


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

示例1: unregisterCollector

 /**
  * Unregister a collector
  * 
  * @param   string  $name
  */
 public function unregisterCollector($name)
 {
     $name = strtolower($name);
     $collectors = $this->app->config()->read('collectors');
     $collectors += $this->getCollectors();
     unset($collectors[$name]);
     $this->app->config()->write('collectors', $collectors);
 }
开发者ID:opis-colibri,项目名称:core,代码行数:13,代码来源:CollectorManager.php

示例2: initLanguage

 public function initLanguage(Application $currentApp, $type)
 {
     if ($type === "default") {
         return $currentApp->config()->get(Enums\AppSettingKeys::DefaultLanguage);
     }
     if ($type === "browser") {
         return substr(strtok($_SERVER['HTTP_ACCEPT_LANGUAGE'], '?'), 0, 2);
     }
 }
开发者ID:tymiles003,项目名称:FieldWorkManager,代码行数:9,代码来源:HttpRequest.php

示例3: setConfig

 public static function setConfig()
 {
     $config = array();
     // first defaults are loaded, then the custom configs
     require APP_DIR . DIRECTORY_SEPARATOR . 'config.default.php';
     if (file_exists(APP_DIR . DIRECTORY_SEPARATOR . 'config.php')) {
         require APP_DIR . DIRECTORY_SEPARATOR . 'config.php';
     }
     self::$config = new Zend_Config($config, array('allowModifications' => true));
     Zend_Registry::set('config', self::$config);
 }
开发者ID:sdgdsffdsfff,项目名称:auth-center,代码行数:11,代码来源:Application.php

示例4: run

 public static function run($configFile, $applicationEnv)
 {
     Loader::registerAutoload();
     self::$request = new Request();
     self::$response = new Response();
     include $configFile;
     self::$config = $config[$applicationEnv];
     StringHelper::setCryptKey(self::$config['crypt_key']);
     self::$db = new Db(self::$config['db']['params']);
     self::initView();
     self::startDispatch();
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:12,代码来源:Application.php

示例5: getenv

add_include_path($directoryPath . "constraints", false);
add_include_path($directoryPath . "login", false);
add_include_path($directoryPath . "logout", false);
add_include_path($directoryPath . "password_history", false);
add_include_path($directoryPath . "role_validity", false);
add_include_path($directoryPath . "roles", false);
add_include_path($directoryPath . "users", false);
add_include_path($directoryPath . "users_roles", false);
//Add lib for auth
add_include_path(__DIR__ . "/lib", false);
// Load the applications configuration file and define the home
require "app/config.php";
define("SOFTWARE_HOME", $config['home']);
// Add the script which contains the third party libraries
require "app/includes.php";
// Setup the global variables needed by the redirected packages
global $redirectedPackage;
global $packageSchema;
$selected = getenv('CFX_SELECTED_DATABASE') !== false ? getenv('CFX_SELECTED_DATABASE') : $selected;
// Setup the database driver and other boilerplate stuff
$dbDriver = $config['db'][$selected]['driver'];
$dbDriverClass = Application::camelize($dbDriver);
add_include_path(Application::getWyfHome("models/datastores/databases/{$dbDriver}"));
Db::$defaultDatabase = $selected;
SQLDBDataStore::$activeDriverClass = $dbDriverClass;
Application::$config = $config;
Application::$prefix = $config['prefix'];
Cache::init($config['cache']['method']);
define('CACHE_MODELS', $config['cache']['models']);
define('CACHE_PREFIX', "");
define('ENABLE_AUDIT_TRAILS', $config['audit_trails']);
开发者ID:nthc,项目名称:cfx,代码行数:31,代码来源:wyf_bootstrap.php

示例6: write

 /**
  * Write the file.
  * @param $path string | The path where the file is located.
  * @param $file string | The filename.
  * @param $content string | The file content.
  * @return string
  */
 public function write($path = '', $file = '', $content = '')
 {
     $the_path = Application::config()->public_folder() . '/' . $path;
     @mkdir($the_path, 0755, true);
     $this->write_to($the_path . '/' . $file, $content);
 }
开发者ID:diasbruno,项目名称:stc,代码行数:13,代码来源:DataWriter.php

示例7: dirname

<?php

ob_start();
// -----
// Error displaying (comment the following to turn on error displaying)
error_reporting(0);
// Constants
define('ROOT_DIR', dirname(__FILE__));
// Imports
require_once 'lib/magic_quotes_fix.php';
require_once 'lib/autoload.php';
// Run the application
$application = new Application();
$application->config();
$response = $application->run(new Request());
$response->send();
// -----
ob_end_flush();
开发者ID:migumuno,项目名称:obesity,代码行数:18,代码来源:app.php

示例8: __construct

 public function __construct()
 {
     $this->route = new Route();
     self::$config = new ConfigManager();
 }
开发者ID:RomsonApp,项目名称:blog,代码行数:5,代码来源:Application.php


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