本文整理匯總了PHP中Symfony\Component\HttpKernel\Kernel::getEnvParameters方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel::getEnvParameters方法的具體用法?PHP Kernel::getEnvParameters怎麽用?PHP Kernel::getEnvParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpKernel\Kernel
的用法示例。
在下文中一共展示了Kernel::getEnvParameters方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEnvParameters
/**
* Injecting the owner's name of this Kernel file to add an "env parameter"
* Note : This mechanism is only avalaible in DEV because it is only intended
* in development environment. With this parameter, you can customize any
* parameter of config_dev.yml with the shortcut %developer.name%
*
* This is very convenient when you have many developers on one common
* development POSIX server. There is a fallback for Windows.
*
* @return array
*/
protected function getEnvParameters()
{
$base = parent::getEnvParameters();
// owner of source
if ('dev' == $this->getEnvironment()) {
$base['developer.name'] = 'dev';
if (function_exists('posix_getpwuid')) {
$owner = posix_getpwuid(fileowner(__FILE__));
if (array_key_exists('name', $owner)) {
$base['developer.name'] = $owner['name'];
}
}
}
return $base;
}
示例2: getEnvParameters
/**
* Gets the environment parameters.
*
* Only the parameters starting with "ZIKULA__" are considered.
*
* @return array An array of parameters
*/
protected function getEnvParameters()
{
$parameters = parent::getEnvParameters();
foreach ($_SERVER as $key => $value) {
if (0 === strpos($key, 'ZIKULA__')) {
$parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
}
}
return $parameters;
}