Changeset 277

Show
Ignore:
Timestamp:
11/01/07 01:25:23 (1 year ago)
Author:
hans
Message:

#171 - Changing the DirectoryScanner to do a type-insensitive check on results of FileSelector->isSelected()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.3/classes/phing/types/selectors/ExtendSelector.php

    r123 r277  
    2626 * Selector that selects files by forwarding the request on to other classes. 
    2727 * 
    28  * TODO: 
    29  *        Consider adding Path (org.apache.tools.ant.types.Path) support to this class 
     28 * TODO - Consider adding Path (phing.types.Path) support to this class 
    3029 *         and to the Mappers class.  See Ant versions for implimentation details. 
    31  * 
    32  * @author <a href="mailto:bruce@callenish.com">Bruce Atherton</a> 
     30 *  
     31 * @author Hans Lellelid <hans@xmpl.org> (Phing) 
     32 * @author Bruce Atherton <bruce@callenish.com> (Ant) 
    3333 * @package phing.types.selectors 
    3434 */ 
     
    106106    /** 
    107107     * Allows the custom selector to choose whether to select a file. This 
    108      * is also where the Parameters are passed to the custom selector, 
    109      * since we know we must have them all by now. And since we must know 
    110      * both classpath and classname, creating the class is deferred to here 
    111      * as well. 
     108     * is also where the Parameters are passed to the custom selector. 
    112109     * 
    113110     * @throws BuildException 
  • branches/2.3/classes/phing/util/DirectoryScanner.php

    r123 r277  
    699699    protected function isSelected($name, $file) { 
    700700        if ($this->selectors !== null) { 
    701             for ($i=0,$size=count($this->selectors); $i < $size; $i++) { 
    702                 if (($this->selectors[$i]->isSelected(new PhingFile($this->basedir), $name, new PhingFile($file))) === false) { 
    703                     return false; 
    704                 } 
    705             } 
     701                $basedir = new PhingFile($this->basedir); 
     702                $file = new PhingFile($file); 
     703                foreach($this->selectors as $selector) { 
     704                        if (!$selector->isSelected($basedir, $name, $file)) { 
     705                                return false; 
     706                        } 
     707                } 
    706708        } 
    707709        return true;