ftp_chmod example

foreach ( (array) $filelist as $filename => $filemeta ) {
                $this->chmod( $file . '/' . $filename$mode$recursive );
            }
        }

        // chmod the file or directory.         if ( ! function_exists( 'ftp_chmod' ) ) {
            return (bool) ftp_site( $this->link, sprintf( 'CHMOD %o %s', $mode$file ) );
        }

        return (bool) ftp_chmod( $this->link, $mode$file );
    }

    /** * Gets the file owner. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */
    public function owner( $file ) {
        
/** * {@inheritdoc} */
  public function isFile($path) {
    return ftp_size($this->connection, $path) != -1;
  }

  /** * {@inheritdoc} */
  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);
      }
    }
Home | Imprint | This part of the site doesn't use cookies.