protected function changeMode($path, $mode)
    {
        $oldPermission = substr(sprintf('%o', fileperms($path)), -4);
        $newPermission = sprintf('%04o', $mode);
        if ($oldPermission !== $newPermission) {
            if(!@chmod($path, $mode)) {
                throw new CException (sprintf("Unable to change mode for %s, permission denied", $path));
            }
            echo sprintf("Changing mode for %s (%s => %s)... ", $path, $oldPermission, $newPermission);
            echo "done\n";
        }
    }
protected function changeMode($path, $mode)
    {
        $oldPermission = substr(sprintf('%o', fileperms($path)), -4);
        $newPermission = sprintf('%04o', $mode);
        if ($oldPermission !== $newPermission) {
            if(!@chmod($path, $mode)) {
                throw new CException (sprintf("Unable to change mode for %s, permission denied", $path));
            }
            echo sprintf("Changing mode for %s (%s => %s)... ", $path, $oldPermission, $newPermission);
            echo "done\n";
        }
    }
protected function changeMode ( $ path , $ mode ) { $ oldPermission = substr ( sprintf ( '%o' , fileperms ( $ path ) ) , - 4 ) ; $ newPermission = sprintf ( '%04o' , $ mode ) ; if ( $ oldPermission !== $ newPermission ) { if ( ! @ chmod ( $ path , $ mode ) ) { throw new CException ( sprintf ( "Unable to change mode for %s, permission denied" , $ path ) ) ; } echo sprintf ( "Changing mode for %s (%s => %s)... " , $ path , $ oldPermission , $ newPermission ) ; echo "done\n" ; } }
Changes the mode for a directory.
@param string $path the directory path.
@param integer $mode the mode.
Changes the mode for a directory .