本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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();
}
示例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']);
示例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);
}
示例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();
示例8: __construct
public function __construct()
{
$this->route = new Route();
self::$config = new ConfigManager();
}