Development

Changeset 12952

You must first sign up to be able to contribute.

Changeset 12952

Show
Ignore:
Timestamp:
11/12/08 15:34:57 (8 months ago)
Author:
Kris.Wallsmith
Message:

[1.2] fixed assumption plugin name can be determined using basename()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/config/sfProjectConfiguration.class.php

    r12672 r12952  
    8282    foreach ($this->getPluginPaths() as $path) 
    8383    { 
    84       $name  = basename($path); 
    85       $class = $name.'Configuration'; 
    86  
    87       if (is_readable($file = sprintf('%s/config/%sConfiguration.class.php', $path, $name))) 
     84      if (false === $plugin = array_search($path, $this->overriddenPluginPaths)) 
     85      { 
     86        $plugin = basename($path); 
     87      } 
     88      $class = $plugin.'Configuration'; 
     89 
     90      if (is_readable($file = sprintf('%s/config/%s.class.php', $path, $class))) 
    8891      { 
    8992        require_once $file; 
     
    9598      } 
    9699 
    97       $this->pluginConfigurations[$name] = $configuration; 
     100      $this->pluginConfigurations[$plugin] = $configuration; 
    98101    } 
    99102 
     
    372375 
    373376    $this->plugins = array(); 
    374     foreach ($this->getAllPluginPaths() as $plugin
    375     { 
    376       $this->plugins[] = basename($plugin)
     377    foreach ($this->getAllPluginPaths() as $plugin => $path
     378    { 
     379      $this->plugins[] = $plugin
    377380    } 
    378381 
     
    480483   * This method can be used to ease functional testing of plugins. It is not 
    481484   * intended to support sharing plugins between projects, as many plugins 
    482    * save project specific code (to /lib/form, for example). 
     485   * save project specific code (to /lib/form/base, for example). 
    483486   *  
    484487   * @param string $plugin 
     
    487490  public function setPluginPath($plugin, $path) 
    488491  { 
    489     $this->overriddenPluginPaths[$plugin] = $path
     492    $this->overriddenPluginPaths[$plugin] = realpath($path)
    490493  } 
    491494 

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.