chmodJailed example

public function chmodJailed($path$mode$recursive) {
    if (!ftp_chmod($this->connection, $mode$path)) {
      throw new FileTransferException("Unable to set permissions on %file", 0, ['%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);
      }
    }
  }

}

  final public function chmod($path$mode$recursive = FALSE) {
    if (!($this instanceof ChmodInterface)) {
      throw new FileTransferException('Unable to change file permissions');
    }
    $path = $this->sanitizePath($path);
    $path = $this->fixRemotePath($path);
    $this->checkPath($path);
    $this->chmodJailed($path$mode$recursive);
  }

  /** * Creates a directory. * * @param string $directory * The directory to be created. */
  final public function createDirectory($directory) {
    $directory = $this->fixRemotePath($directory);
    $this->checkPath($directory);
    
Home | Imprint | This part of the site doesn't use cookies.