Download the PHP package yii2mod/yii2-ftp without Composer

On this page you can find all versions of the php package yii2mod/yii2-ftp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-ftp

FTP Client for Yii 2


Latest Stable Version Total Downloads License

yii2-ftp is a fork of Nicolab/php-ftp-client v1.2.0

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json.

Getting Started

Connect to a server FTP :

OR

Connect to a server FTP via SSL (on port 22 or other port) :

Note: The connection is implicitly closed at the end of script execution (when the object is destroyed). Therefore it is unnecessary to call $ftp->close(), except for an explicit re-connection.

Usage

Upload all files and all directories is easy :

Note : FTP_ASCII and FTP_BINARY are predefined PHP internal constants.

Get a directory size :

Count the items in a directory :

Detailed list of all files and directories :

Result:

'directory#www' =>
    array (size=10)
      'permissions' => string 'drwx---r-x' (length=10)
      'number'      => string '3' (length=1)
      'owner'       => string '32385' (length=5)
      'group'       => string 'users' (length=5)
      'size'        => string '5' (length=1)
      'month'       => string 'Nov' (length=3)
      'day'         => string '24' (length=2)
      'time'        => string '17:25' (length=5)
      'name'        => string 'www' (length=3)
      'type'        => string 'directory' (length=9)

  'link#www/index.html' =>
    array (size=11)
      'permissions' => string 'lrwxrwxrwx' (length=10)
      'number'      => string '1' (length=1)
      'owner'       => string '0' (length=1)
      'group'       => string 'users' (length=5)
      'size'        => string '38' (length=2)
      'month'       => string 'Nov' (length=3)
      'day'         => string '16' (length=2)
      'time'        => string '14:57' (length=5)
      'name'        => string 'index.html' (length=10)
      'type'        => string 'link' (length=4)
      'target'      => string '/var/www/shared/index.html' (length=26)

'file#www/README' =>
    array (size=10)
      'permissions' => string '-rw----r--' (length=10)
      'number'      => string '1' (length=1)
      'owner'       => string '32385' (length=5)
      'group'       => string 'users' (length=5)
      'size'        => string '0' (length=1)
      'month'       => string 'Nov' (length=3)
      'day'         => string '24' (length=2)
      'time'        => string '17:25' (length=5)
      'name'        => string 'README' (length=6)
      'type'        => string 'file' (length=4)

All FTP PHP functions are supported and some improved :

Get the help information of remote FTP server :

Result :

array (size=6)
  0 => string '214-The following SITE commands are recognized' (length=46)
  1 => string ' ALIAS' (length=6)
  2 => string ' CHMOD' (length=6)
  3 => string ' IDLE' (length=5)
  4 => string ' UTIME' (length=6)
  5 => string '214 Pure-FTPd - http://pureftpd.org/' (length=36)

Note : The result depend of FTP server.

Support us

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.


All versions of yii2-ftp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-ftp Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yii2mod/yii2-ftp contains the following files

Loading the files please wait ....