2017 © Pedro Peláez
 

library php-ftp

PHP FTP Utilities

image

hugsbrugs/php-ftp

PHP FTP Utilities

  • Thursday, March 23, 2017
  • by hugsbrugs
  • Repository
  • 1 Watchers
  • 1 Stars
  • 168 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

php-ftp

PHP FTP Utilities, (*1)

If you also need SFTP : php-sftp, (*2)

Install

Install package with composer, (*3)

composer require hugsbrugs/php-ftp

In your PHP code, load librairy, (*4)

require_once __DIR__ . '/vendor/autoload.php';
use Hug\Ftp\Ftp as Ftp;

Usage

Test FTP connection, (*5)

Ftp::test($server, $user, $password, $port = 21);

Check if a file exists on Ftp Server, (*6)

Ftp::is_file($server, $user, $password, $remote_file, $port = 21);

Delete a file on remote FTP server, (*7)

Ftp::delete($server, $user, $password, $remote_file, $port = 21);

Recursively deletes files and folder in given directory (If remote_path ends with a slash delete folder content otherwise delete folder itself), (*8)

Ftp::rmdir($server, $user, $password, $remote_path, $port = 21);

Recursively copy files and folders on remote FTP server (If local_path ends with a slash upload folder content otherwise upload folder itself), (*9)

Ftp::upload_dir($server, $user, $password, $local_path, $remote_path, $port = 21);

Download a file from remote Ftp server, (*10)

Ftp::download($server, $user, $password, $remote_file, $local_file, $port = 21);

Download a directory from remote FTP server (If remote_dir ends with a slash download folder content otherwise download folder itself), (*11)

Ftp::download_dir($server, $user, $password, $remote_dir, $local_dir, 
$port = 21);

Rename a file on remote FTP server, (*12)

Ftp::rename($server, $user, $password, $old_file, $new_file, $port = 21);

Create a directory on remote FTP server, (*13)

Ftp::mkdir($server, $user, $password, $directory, $port = 21);

Create a file on remote FTP server, (*14)

Ftp::touch($server, $user, $password, $remote_file, $content, $port = 21);

Upload a file on FTP server, (*15)

Ftp::upload($server, $user, $password, $local_file, $remote_file = '', $port = 21);

List files on FTP server, (*16)

Ftp::scandir($server, $user, $password, $path, $port = 21);

Get default login FTP directory aka pwd, (*17)

Ftp::pwd($server, $user, $password, $port = 21);

Tests

Edit example/test.php with your FTP parameters then run, (*18)

php example/test.php

To Do

PHPUnit Tests, (*19)

Author

Hugo Maugey visit my website ;), (*20)

The Versions

23/03 2017

dev-master

9999999-dev

PHP FTP Utilities

  Sources   Download

The Requires

 

20/03 2017

0.1

0.1.0.0

PHP FTP Utilities

  Sources   Download

The Requires

 

20/03 2017

1.0

1.0.0.0

PHP FTP Utilities

  Sources   Download

The Requires