本文整理汇总了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();
}