Changeset 6

Show
Ignore:
Timestamp:
02/09/06 08:39:54 (3 years ago)
Author:
hans
Message:

Added smarter handling of 'dir' attribute of <resolvepath> task; it will only be used if 'file' attribute is not an absolute path.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/classes/phing/tasks/system/ResolvePathTask.php

    r1 r6  
    104104        } 
    105105         
     106                $fs = FileSystem::getFileSystem(); 
     107                 
    106108        // if dir attribute was specified then we should 
    107109        // use that as basedir to which file was relative. 
    108         if ($this->dir !== null) { 
     110                // -- unless the file specified is an absolute path 
     111        if ($this->dir !== null && !$fs->isAbsolute(new PhingFile($this->file))) { 
    109112            $resolved = new PhingFile($this->dir->getPath(), $this->file); 
    110113        } else { 
     
    117120    } 
    118121 
    119      
    120      
    121122} 
  • trunk/classes/phing/tasks/system/ResolvePathTask.php

    r1 r6  
    104104        } 
    105105         
     106                $fs = FileSystem::getFileSystem(); 
     107                 
    106108        // if dir attribute was specified then we should 
    107109        // use that as basedir to which file was relative. 
    108         if ($this->dir !== null) { 
     110                // -- unless the file specified is an absolute path 
     111        if ($this->dir !== null && !$fs->isAbsolute(new PhingFile($this->file))) { 
    109112            $resolved = new PhingFile($this->dir->getPath(), $this->file); 
    110113        } else { 
     
    117120    } 
    118121 
    119      
    120      
    121122}