ftp_mkdir example


    public function mkdir( $path$chmod = false, $chown = false, $chgrp = false ) {
        $path = untrailingslashit( $path );

        if ( empty( $path ) ) {
            return false;
        }

        if ( ! ftp_mkdir( $this->link, $path ) ) {
            return false;
        }

        $this->chmod( $path$chmod );

        return true;
    }

    /** * Deletes a directory. * * @since 2.5.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */

  protected function copyFileJailed($source$destination) {
    if (!@ftp_put($this->connection, $destination$source, FTP_BINARY)) {
      throw new FileTransferException("Cannot move @source to @destination", 0, ["@source" => $source, "@destination" => $destination]);
    }
  }

  /** * {@inheritdoc} */
  protected function createDirectoryJailed($directory) {
    if (!ftp_mkdir($this->connection, $directory)) {
      throw new FileTransferException("Cannot create directory @directory", 0, ["@directory" => $directory]);
    }
  }

  /** * {@inheritdoc} */
  protected function removeDirectoryJailed($directory) {
    $pwd = ftp_pwd($this->connection);
    if (!ftp_chdir($this->connection, $directory)) {
      throw new FileTransferException("Unable to change the current directory to @directory", 0, ['@directory' => $directory]);
    }
Home | Imprint | This part of the site doesn't use cookies.