Changeset 2baac48


Ignore:
Timestamp:
11/12/11 00:35:51 (6 months ago)
Author:
mrook
Branches:
master
Children:
7195cc7, e1d3d66
Parents:
196ff59
git-author:
Michiel Rook <mrook@…> (11/12/11 00:35:51)
git-committer:
Michiel Rook <mrook@…> (11/12/11 00:35:51)
Message:

Fixes #653 - chown task now accepts group attribute

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • classes/phing/tasks/system/ChownTask.php

    rc7dadbf9 r2baac48  
    3535 
    3636    private $user; 
     37    private $group; 
    3738 
    3839    private $filesets = array(); 
     
    8788 
    8889    /** 
     90     * Sets the group 
     91     */ 
     92    function setGroup($group) { 
     93        $this->group = $group; 
     94    } 
     95 
     96    /** 
    8997     * Nested creator, adds a set of files (nested fileset attribute). 
    9098     */ 
     
    114122        } 
    115123 
    116         if ($this->user === null) { 
    117             throw new BuildException("You have to specify an owner for chown."); 
     124        if ($this->user === null && $this->group === null) { 
     125            throw new BuildException("You have to specify either an owner or a group for chown."); 
    118126        } 
    119127    } 
     
    131139            $group = $userElements[1]; 
    132140        } else { 
    133             $group = null; 
     141            $group = $this->group; 
    134142        } 
    135143 
     
    185193 
    186194        try { 
    187             $file->setUser($user); 
     195            if (!empty($user)) { 
     196                $file->setUser($user); 
     197            } 
    188198             
    189199            if (!empty($group)) { 
  • docs/phing_guide/book/chapters/appendixes/AppendixB-CoreTasks.html

    rb71d117 r2baac48  
    365365                                        groupname, separated by a dot.</td> 
    366366                                <td>n/a</td> 
    367                                 <td>Yes</td> 
     367                                <td>No</td> 
     368                        </tr> 
     369                        <tr> 
     370                                <td>group</td> 
     371                                <td>String</td> 
     372                                <td>The new group owner of the file.</td> 
     373                                <td>n/a</td> 
     374                                <td>No</td> 
    368375                        </tr> 
    369376                        <tr> 
Note: See TracChangeset for help on using the changeset viewer.