Development

Changeset 10702

You must first sign up to be able to contribute.

Changeset 10702

Show
Ignore:
Timestamp:
08/06/08 13:11:16 (1 year ago)
Author:
hartym
Message:

[1.1] Bug: when tasks are nested, newly registered autoloading path does not take precedence over older ones if it was already registered before.

Bug example: registering /a/, then /b/, then /a/ again will give autoloading precedence to /b/, so if a task needs /a/ then /b/ and another needs /b/ then /a/, the first to do it will forbid the other one to bahve correct.

This allows tasks to override their parent task autoloading settings and thus showing correct behavior when an application overrides a plugin's model task (otherwise, the load-data part in build-all-load doesnot behave the same way on its own and within the combo task)

Files:

Legend:

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

    r10009 r10702  
    175175 
    176176  /** 
    177    * Adds a directory to the autoloading system
     177   * Adds a directory to the autoloading system if not yet present and give it the highest possible precedence
    178178   * 
    179179   * @param string The directory to look for classes 
     
    183183  { 
    184184    $finder = sfFinder::type('file')->follow_link()->name('*'.$ext); 
     185 
    185186    if($dirs = glob($dir)) 
    186187    { 
    187188      foreach ($dirs as $dir) 
    188189      { 
    189         if (in_array($dir, $this->dirs)) 
     190        if (false !== ($key = array_search($dir, $this->dirs))) 
    190191        { 
     192          unset($this->dirs[$key]); 
     193          $this->dirs[] = $dir; 
     194 
    191195          if ($this->cacheLoaded) 
    192196          { 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.