function FileTransferFTPExtension::chmodJailed

Overrides FileTransferChmodInterface::chmodJailed

File

includes/filetransfer/ftp.inc, line 123

Class

FileTransferFTPExtension

Code

function chmodJailed($path, $mode, $recursive) {
    if (!ftp_chmod($this->connection, $mode, $path)) {
        throw new FileTransferException("Unable to set permissions on %file", NULL, array(
            '%file' => $path,
        ));
    }
    if ($this->isDirectory($path) && $recursive) {
        $filelist = @ftp_nlist($this->connection, $path);
        if (!$filelist) {
            
            //empty directory - returns false
            return;
        }
        foreach ($filelist as $file) {
            $this->chmodJailed($file, $mode, $recursive);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.