Symfony\Component\HttpKernel\Kernel::getEnvParameters PHP Method

getEnvParameters() protected method

protected getEnvParameters ( )
    protected function getEnvParameters()
    {
        $parameters = array();
        foreach ($_SERVER as $key => $value) {
            if ('SYMFONY__' === substr($key, 0, 9)) {
                $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
            }
        }

        return $parameters;
    }

Same methods

Kernel::getEnvParameters ( ) : array

Usage Example

Ejemplo n.º 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;
 }
All Usage Examples Of Symfony\Component\HttpKernel\Kernel::getEnvParameters