Changeset 582f22d


Ignore:
Timestamp:
12/27/11 15:33:17 (5 months ago)
Author:
mrook
Branches:
master
Children:
ffa0760
Parents:
8601090
git-author:
Michiel Rook <mrook@…> (12/27/11 15:33:17)
git-committer:
Michiel Rook <mrook@…> (12/27/11 15:33:17)
Message:

Fixes #795 - add 'forceExtract' attribute to unzip and untar tasks

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • classes/phing/tasks/ext/ExtractBaseTask.php

    r237cb3e r582f22d  
    4040    protected $removepath; 
    4141    protected $filesets = array(); // all fileset objects assigned to this task 
     42     
     43    /** 
     44     * Set to true to always extract (and possibly overwrite) 
     45     * all files from the archive  
     46     * @var boolean 
     47     */ 
     48    protected $forceExtract = false; 
    4249 
    4350    /** 
     
    7178        $this->removepath = $removepath; 
    7279    } 
     80     
     81    /** 
     82     * Sets the forceExtract attribute 
     83     * @param boolean $forceExtract 
     84     */ 
     85    public function setForceExtract($forceExtract) 
     86    { 
     87        $this->forceExtract = (bool) $forceExtract; 
     88    } 
    7389 
    7490    /** 
     
    101117                } 
    102118                 
    103                 if(!$this->isDestinationUpToDate($compressedArchiveFile)) { 
     119                if ($this->forceExtract || !$this->isDestinationUpToDate($compressedArchiveFile)) { 
    104120                   $filesToExtract[] = $compressedArchiveFile; 
    105121                } else { 
  • docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html

    r8601090 r582f22d  
    74087408                <td>No</td> 
    74097409            </tr> 
     7410            <tr> 
     7411                <td>forceExtract</td> 
     7412                <td>Boolean</td> 
     7413                <td>When set to false, only extract files if the destination does not exist yet or is older than the archive. 
     7414                When set to true, always extract files.</td> 
     7415                <td>false</td> 
     7416                <td>No</td> 
     7417            </tr> 
    74107418                </tbody> 
    74117419        </table> 
     
    74537461                                <td>Yes</td> 
    74547462                        </tr> 
     7463            <tr> 
     7464                <td>forceExtract</td> 
     7465                <td>Boolean</td> 
     7466                <td>When set to false, only extract files if the destination does not exist yet or is older than the archive. 
     7467                When set to true, always extract files.</td> 
     7468                <td>false</td> 
     7469                <td>No</td> 
     7470            </tr> 
    74557471                </tbody> 
    74567472        </table> 
Note: See TracChangeset for help on using the changeset viewer.