Development

Changeset 8702

You must first sign up to be able to contribute.

Changeset 8702

Show
Ignore:
Timestamp:
04/30/08 21:22:51 (4 months ago)
Author:
fabien
Message:

fixed sfAutoload::autoloadAgain() to only flush the autoload cache once per request

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/autoload/sfAutoload.class.php

    r7614 r8702  
    2323{ 
    2424  static protected 
    25     $instance = null; 
     25    $freshCache = false, 
     26    $instance   = null; 
    2627 
    2728  protected 
    2829    $overriden = array(), 
    29     $classes = array(); 
     30    $classes   = array(); 
    3031 
    3132  protected function __construct() 
     
    8788  public function reloadClasses($force = false) 
    8889  { 
     90    // only (re)load the autoloading cache once per request 
     91    if (self::$freshCache) 
     92    { 
     93      return; 
     94    } 
     95 
    8996    $configuration = sfProjectConfiguration::getActive(); 
    9097    if (!$configuration || !$configuration instanceof sfApplicationConfiguration) 
     
    106113      $this->classes[$class] = $path; 
    107114    } 
     115 
     116    self::$freshCache = true; 
    108117  } 
    109118 
     
    123132    } 
    124133 
    125     if (self::loadClass($class)) 
    126     { 
    127       return true; 
    128     } 
    129  
    130     return false; 
     134    return self::loadClass($class); 
    131135  } 
    132136