getEnvParameters() protected method

protected getEnvParameters ( )
Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * 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;
 }