PHPackages                             hguenot/yii2-gftp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hguenot/yii2-gftp

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

hguenot/yii2-gftp
=================

Ftp is a FTP extension for \[YII 2 Framework\](http://www.yiiframework.com).

3.0.3(4y ago)16131.8k↓15.9%14[3 issues](https://github.com/hguenot/yii2-gftp/issues)4GPL-3.0+PHPPHP &gt;=7.1

Since Jun 14Pushed 4y ago4 watchersCompare

[ Source](https://github.com/hguenot/yii2-gftp)[ Packagist](https://packagist.org/packages/hguenot/yii2-gftp)[ RSS](/packages/hguenot-yii2-gftp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (4)

[![Latest Stable Version](https://camo.githubusercontent.com/f5433cb7271944a548760a321d4a8316c1e90475603bf1f96314748fa554810a/68747470733a2f2f706f7365722e707567782e6f72672f686775656e6f742f796969322d676674702f762f737461626c65)](https://packagist.org/packages/hguenot/yii2-gftp)[![Total Downloads](https://camo.githubusercontent.com/94de4d71cfbe91f8e92ff011ed34907910cd1e26c783c43124541568749b8e1e/68747470733a2f2f706f7365722e707567782e6f72672f686775656e6f742f796969322d676674702f646f776e6c6f616473)](https://packagist.org/packages/hguenot/yii2-gftp)[![License](https://camo.githubusercontent.com/71a1198b95ca6386b00a015589a9a54a557a9a848ff2e60366d9ffce3dd2df9d/68747470733a2f2f706f7365722e707567782e6f72672f686775656e6f742f796969322d676674702f6c6963656e7365)](https://packagist.org/packages/hguenot/yii2-gftp)

GFtp
====

[](#gftp)

GFtp is a FTP extension for [YII 2 Framework](http://www.yiiframework.com).

It contains 2 main component :

- `\gftp\FtpComponent` : A Yii component used to manage FTP connection and navigation (encapsulates PHP ftp method).
- `\gftp\FtpWidget` : A widget which can be used to display FTP folder content and allow FTP server browsing.

It supports FTP protocol and FTP over SSL protocol. SFTP support is provider by [Yii2-gsftp](https://github.com/hguenot/yii2-gsftp) extension.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist hguenot/yii2-gftp "*"

```

or add

```
"hguenot/yii2-gftp": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Here is a basic usage of GFtp extension.

- Create an FTP application component (in your Web config file)

```
return [
	// [...]
	'components'=>[
		// [...]
		'ftp' => [
			'connectionString' => 'ftp://user:pass@host:21',
			'driverOptions' =>  [
				'timeout' => 120,
				'passive' => false
			]
		]
	],
	// [...]
];
```

- You can user either a connection string where protocol could be ftp or ftps or directly set `protocol`, `user`, `pass`, `host` and `port` properties :

```
return [
	// [...]
	'components'=>[
		// [...]
		'ftp' => [
			'class' => '\gftp\FtpComponent',
			'driverOptions' =>  [
				'class' => '\gftp\drivers\SftpProtocol',
				'user' => 'me@somewhere.otrb',
				'pass' => 'PassW0rd',
				'host' => 'ftp.somewhere.otrb',
				'port' => 2121,
				'timeout' => 120,
				'passive' => false
			]
		]
	],
	// [...]
];
```

- Use component

```
$files = $gftp->ls();
$gftp->chdir('images');
```

More complete example :

```
public function actionExample() {
    $remote_file = '/data/users.txt';
    $local_file = '/tmp/users.load';
    $mode = 'FTP_ASCII';
    $asynchronous = false;
    $file = Yii::$app->ftp->get($remote_file, $local_file, $mode, $asynchronous);
    // [...]
}
```

- Display ftp content in a Widget :

```
use gftp\FtpWidget;
echo FtpWidget::widget();
```

- If no FTP(S) connection is passed to the widget, it needs an application component named `'ftp'`. But you can pass an FtpComponent directly :

```
use \gftp\FtpWidget;
echo FtpWidget::widget([
	'ftp' => \Yii::$app->get('otrb')
]);
```

or

```
use \gftp\FtpWidget;
use \gftp\FtpComponent;

echo FtpWidget::widget([
	'ftp' => new FtpComponent([
			'driverOptions' =>  [
				'class' => '\gftp\drivers\SftpProtocol',
				'user' => 'me@somewhere.otrb',
				'pass' => 'PassW0rd',
				'host' => 'ftp.somewhere.otrb',
				'port' => 2121,
				'timeout' => 120,
				'passive' => false
			]
	]);
]);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 60.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~207 days

Recently: every ~325 days

Total

12

Last Release

1708d ago

Major Versions

1.0 → 2.02015-06-19

2.2.0 → 3.0.02020-04-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f980dc7f653be656d2725f6457567a666e792e4173ba57536de674b6f3e291e?d=identicon)[hguenot](/maintainers/hguenot)

---

Top Contributors

[![hguenot](https://avatars.githubusercontent.com/u/2578010?v=4)](https://github.com/hguenot "hguenot (17 commits)")[![fbens](https://avatars.githubusercontent.com/u/1414939?v=4)](https://github.com/fbens "fbens (4 commits)")[![armagedon007](https://avatars.githubusercontent.com/u/13165506?v=4)](https://github.com/armagedon007 "armagedon007 (3 commits)")[![ndobromirov](https://avatars.githubusercontent.com/u/1191506?v=4)](https://github.com/ndobromirov "ndobromirov (1 commits)")[![G9901](https://avatars.githubusercontent.com/u/153264214?v=4)](https://github.com/G9901 "G9901 (1 commits)")[![d4rkstar](https://avatars.githubusercontent.com/u/4957015?v=4)](https://github.com/d4rkstar "d4rkstar (1 commits)")[![grptx](https://avatars.githubusercontent.com/u/6595328?v=4)](https://github.com/grptx "grptx (1 commits)")

---

Tags

yii2extensiongftp

### Embed Badge

![Health badge](/badges/hguenot-yii2-gftp/health.svg)

```
[![Health](https://phpackages.com/badges/hguenot-yii2-gftp/health.svg)](https://phpackages.com/packages/hguenot-yii2-gftp)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
