protected function changeOwner($path, $newOwner)
    {
        $ownerUid = fileowner($path);
        $ownerData = posix_getpwuid($ownerUid);
        $oldOwner = $ownerData['name'];
        if ($oldOwner !== $this->user) {
            if(!@chown($path, $newOwner)) {
                throw new CException(sprintf('Unable to change owner for %s, permission denied', $path));
            }
            echo sprintf("Changing owner for %s (%s => %s)... ", $path, $oldOwner, $newOwner);
            echo "done\n";
        }
    }
protected function changeOwner($path, $newOwner)
    {
        $ownerUid = fileowner($path);
        $ownerData = posix_getpwuid($ownerUid);
        $oldOwner = $ownerData['name'];
        if ($oldOwner !== $this->user) {
            if(!@chown($path, $newOwner)) {
                throw new CException(sprintf('Unable to change owner for %s, permission denied', $path));
            }
            echo sprintf("Changing owner for %s (%s => %s)... ", $path, $oldOwner, $newOwner);
            echo "done\n";
        }
    }
protected function changeOwner ( $ path , $ newOwner ) { $ ownerUid = fileowner ( $ path ) ; $ ownerData = posix_getpwuid ( $ ownerUid ) ; $ oldOwner = $ ownerData [ 'name' ] ; if ( $ oldOwner !== $ this -> user ) { if ( ! @ chown ( $ path , $ newOwner ) ) { throw new CException ( sprintf ( 'Unable to change owner for %s, permission denied' , $ path ) ) ; } echo sprintf ( "Changing owner for %s (%s => %s)... " , $ path , $ oldOwner , $ newOwner ) ; echo "done\n" ; } }
Changes the owner for a directory.
@param string $path the directory path.
@param string $newOwner the name of the new owner.
Changes the owner for a directory .