Changeset 196ff59
- Timestamp:
- 11/11/11 23:04:16 (6 months ago)
- Branches:
- master
- Children:
- 2baac48
- Parents:
- 85f3723
- git-author:
- Michiel Rook <mrook@…> (11/11/11 23:04:16)
- git-committer:
- Michiel Rook <mrook@…> (11/11/11 23:04:16)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/phing/tasks/ext/SymlinkTask.php
r1c858ce r196ff59 83 83 84 84 /** 85 * Whether to override the symlink if it exists but points 86 * to a different location 87 * 88 * (default value: false) 89 * 90 * @var boolean 91 * @access private 92 */ 93 private $_overwrite = false; 94 95 /** 85 96 * setter for _target 86 97 * … … 117 128 return $this->_filesets[$num-1]; 118 129 } 119 130 131 /** 132 * setter for _overwrite 133 * 134 * @access public 135 * @param boolean $overwrite 136 * @return void 137 */ 138 public function setOverwrite($overwrite) 139 { 140 $this->_overwrite = $overwrite; 141 } 142 120 143 /** 121 144 * getter for _target … … 158 181 return $this->_filesets; 159 182 } 160 183 184 /** 185 * getter for _overwrite 186 * 187 * @access public 188 * @return boolean 189 */ 190 public function getOverwrite() 191 { 192 return $this->_overwrite; 193 } 194 161 195 /** 162 196 * Generates an array of directories / files to be linked … … 249 283 protected function symlink($target, $link) 250 284 { 251 if(file_exists($link)) { 252 $this->log('Link exists: ' . $link, Project::MSG_ERR); 253 return false; 285 if (file_exists($link)) { 286 if (!is_link($link)) { 287 $this->log('File exists: ' . $link, Project::MSG_ERR); 288 return false; 289 } 290 291 if (readlink($link) == $target || !$this->getOverwrite()) { 292 $this->log('Link exists: ' . $link, Project::MSG_ERR); 293 return false; 294 } 295 296 unlink($link); 254 297 } 255 298 -
docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html
r62794c5 r196ff59 7203 7203 <td>Yes</td> 7204 7204 </tr> 7205 <tr> 7206 <td>overwrite</td> 7207 <td>Boolean</td> 7208 <td>Whether to override the symlink if it exists but points 7209 to a different location</td> 7210 <td>false</td> 7211 <td>No</td> 7212 </tr> 7205 7213 </tbody> 7206 7214 </table>
Note: See TracChangeset
for help on using the changeset viewer.
