FTP extension for YII Framework
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
converter
views
GFtpApplicationComponent.php
GFtpComponent.php
GFtpException.php
GFtpFile.php
GFtpParser.php
GFtpUtils.php
GFtpWidget.php
README.md

README.md

GFtp

GFtp is a FTP extension for YII Framework.

It contains :

  • GFtpComponent : A component used to manage FTP connection and navigation (encapsulates PHP ftp method).
  • GFtpApplicationComponent : An application component that wraps FTP component.
  • GFtpWidget : A widget which can be used to display FTP folder content and allow FTP server browsing.

Installation

As many YII extension, you have to unzip archive under a subfolder of your extensions folder.

Subfolder must be named GFtp.

Usage

Here is a basic usage of GFtp extension. More samples could be found on GFtp extension website.

  • Create an FTP application component
return array(
	// [...]
	'components'=>array(
		// [...]
		'ftp' => array(
			'class' => 'ext.GFtp.GFtpApplicationComponent',
			'connectionString' => 'ftp://user:pass@host:21',
			'timeout' => 120,
			'passive' => false
		)
	),
	// [...]
);
  • Create a local FTP component
Yii::import('ext.GFtp.GFtpComponent')

$gftp = Yii::createComponent('ext.GFtp.GFtpComponent', array(
	'connectionString' => 'ftp://user:pass@host:21', 
	'timeout' => 120, 
	'passive' => false)
);
  • Use component
$files = $gftp->ls();
$gftp->chdir('images');