本文整理匯總了PHP中Zend\Mvc\Application::getConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::getConfig方法的具體用法?PHP Application::getConfig怎麽用?PHP Application::getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\Mvc\Application
的用法示例。
在下文中一共展示了Application::getConfig方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: extractInitParameters
/**
* Collects init params configuration from multiple sources
*
* Each next step overwrites previous, whenever data is available, in the following order:
* 1: ZF application config
* 2: environment
* 3: CLI parameters (if the application is running in CLI mode)
*
* @param Application $application
* @return array
*/
private function extractInitParameters(Application $application)
{
$result = [];
$config = $application->getConfig();
if (isset($config[self::BOOTSTRAP_PARAM])) {
$result = $config[self::BOOTSTRAP_PARAM];
}
foreach ([State::PARAM_MODE, AppBootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] as $initKey) {
if (isset($_SERVER[$initKey])) {
$result[$initKey] = $_SERVER[$initKey];
}
}
$result = array_replace_recursive($result, $this->extractFromCli($application->getRequest()));
return $result;
}
示例2: getConfig
public static function getConfig()
{
return self::$applicationInstance->getConfig();
}
示例3: testConfigIsPopulated
public function testConfigIsPopulated()
{
$smConfig = $this->serviceManager->get('Config');
$appConfig = $this->application->getConfig();
$this->assertEquals($smConfig, $appConfig, sprintf('SM config: %s; App config: %s', var_export($smConfig, 1), var_export($appConfig, 1)));
}
示例4: getConfig
public function getConfig()
{
return $this->applicationInstance->getConfig();
}