Changeset 353
- Timestamp:
- 02/06/08 19:43:18 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.3/classes/phing/system/io/FileSystem.php
r258 r353 409 409 } 410 410 411 /** 412 * Change the ownership on a file or directory. 413 * 414 * @param string $pathname Path and name of file or directory. 415 * @param string $user The user name or number of the file or directory. See http://us.php.net/chown 416 * 417 * @return void 418 * @throws Exception if operation failed. 419 */ 420 function chown($pathname, $user) { 421 if (false === @chown($pathname, $user)) {// FAILED. 422 $msg = "FileSystem::chown() FAILED. Cannot chown $pathname. User $user." . (isset($php_errormsg) ? ' ' . $php_errormsg : ""); 423 throw new Exception($msg); 424 } 425 } 426 411 427 /** 412 428 * Change the permissions on a file or directory. branches/2.3/classes/phing/system/io/PhingFile.php
r325 r353 714 714 } 715 715 716 /** 717 * Sets the owner of the file. 718 * @param mixed $user User name or number. 719 */ 720 public function setUser($user) { 721 $fs = FileSystem::getFileSystem(); 722 return $fs->chown($this->getPath(), $user); 723 } 724 725 /** 726 * Retrieve the owner of this file. 727 * @return int User ID of the owner of this file. 728 */ 729 function getUser() { 730 return @fileowner($this->getPath()); 731 } 732 716 733 /** 717 734 * Sets the mode of the file branches/2.3/classes/phing/tasks/defaults.properties
r340 r353 11 11 available=phing.tasks.system.AvailableTask 12 12 chmod=phing.tasks.system.ChmodTask 13 chown=phing.tasks.system.ChownTask 13 14 concat=phing.tasks.system.AppendTask 14 15 condition=phing.tasks.system.ConditionTask
