Development

Changeset 15726 for branches/1.1/lib

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
02/23/09 16:56:12 (4 years ago)
Author:
fabien
Message:

[1.1, 1.2, 1.3] fixed sf_culture being set automatically when testing, but not when using the site (closes #5852)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/util/sfBrowser.class.php

    r12215 r15726  
    410410    if (is_null($this->context) || $forceReload) 
    411411    { 
    412       if (!is_null($this->context)) 
    413       { 
    414         $currentConfiguration = $this->context->getConfiguration(); 
    415         $configuration = ProjectConfiguration::getApplicationConfiguration($currentConfiguration->getApplication(), $currentConfiguration->getEnvironment(), $currentConfiguration->isDebug()); 
    416         $this->context = sfContext::createInstance($configuration); 
    417         unset($currentConfiguration); 
    418  
     412      $isContextEmpty = is_null($this->context); 
     413      $context = $isContextEmpty ? sfContext::getInstance() : $this->context; 
     414 
     415      $currentConfiguration = $context->getConfiguration(); 
     416      $configuration = ProjectConfiguration::getApplicationConfiguration($currentConfiguration->getApplication(), $currentConfiguration->getEnvironment(), $currentConfiguration->isDebug()); 
     417      $this->context = sfContext::createInstance($configuration); 
     418      unset($currentConfiguration); 
     419 
     420      if (!$isContextEmpty) 
     421      { 
    419422        sfConfig::clear(); 
    420423        sfConfig::add($this->rawConfiguration); 
     
    422425      else 
    423426      { 
    424         $this->context = sfContext::getInstance(); 
    425         $this->context->initialize($this->context->getConfiguration()); 
    426  
    427427        $this->rawConfiguration = sfConfig::getAll(); 
    428428      }