PHPackages                             quangtam/flysystem-google-drive - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. quangtam/flysystem-google-drive

ActiveLibrary[File &amp; Storage](/categories/file-storage)

quangtam/flysystem-google-drive
===============================

Flysystem adapter for Google Drive

1.1.6(8y ago)014MITPHPPHP &gt;=5.4.0

Since Feb 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/quangtam/flysystem-google-drive)[ Packagist](https://packagist.org/packages/quangtam/flysystem-google-drive)[ RSS](/packages/quangtam-flysystem-google-drive/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (13)Used By (0)

Flysystem Adapter for Google Drive
==================================

[](#flysystem-adapter-for-google-drive)

[![Author](https://camo.githubusercontent.com/204e32c8ec40a28cd778a206d8f90cb3bf783a9c40c1872bf5f97ff06df7b90e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d6e616f2d2d706f6e2532306879707765622d626c75652e7376673f7374796c653d666c6174)](http://xoops.hypweb.net/)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

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

[](#installation)

- For Google Drive API V3

```
composer require nao-pon/flysystem-google-drive:~1.1
```

- For Google Drive API V2 "**Deprecated**"

```
composer require nao-pon/flysystem-google-drive:~1.0.0
```

Usage
-----

[](#usage)

#### follow [Google Docs](https://developers.google.com/drive/v3/web/enable-sdk) to obtain your `ClientId, ClientSecret & refreshToken`

[](#follow-google-docs-to-obtain-your-clientid-clientsecret--refreshtoken)

- you can also check [This Example](https://github.com/nao-pon/flysystem-google-drive/blob/master/example/GoogleUpload.php) for a better understanding.

```
$client = new \Google_Client();
$client->setClientId('[app client id].apps.googleusercontent.com');
$client->setClientSecret('[app client secret]');
$client->refreshToken('[your refresh token]');

$service = new \Google_Service_Drive($client);

$adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]');
/* Recommended cached adapter use */
// $adapter = new \League\Flysystem\Cached\CachedAdapter(
//     new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]'),
//     new \League\Flysystem\Cached\Storage\Memory()
// );

$filesystem = new \League\Flysystem\Filesystem($adapter);
```

### Usage to with [elFinder](https://github.com/Studio-42/elFinder)

[](#usage-to-with-elfinder)

```
composer require nao-pon/elfinder-flysystem-driver-ext
composer require nao-pon/flysystem-google-drive:~1.1
```

```
// Load composer autoloader
require 'vender/autoload.php';

// Google API Client
$client = new \Google_Client();
$client->setClientId('xxxxx CLIENTID xxxxx');
$client->setClientSecret('xxxxx CLIENTSECRET xxxxx');
$client->refreshToken('xxxxx REFRESH TOKEN xxxxx');

// Google Drive Adapter
$googleDrive = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter(
	new \Google_Service_Drive($client), // Client service
	'root',                             // Holder ID as root ('root' or Holder ID)
	[ 'useHasDir' => true ]             // options (elFinder need hasDir method)
);

// Extended cached strage adapter class for cache enabled of hasDir() method
class myCachedStrageAdapter extends \League\Flysystem\Cached\Storage\Adapter
{
    use \Hypweb\Flysystem\Cached\Extra\Hasdir;
    use \Hypweb\Flysystem\Cached\Extra\DisableEnsureParentDirectories;
}

// Make Flysystem adapter and cache object
$useCache = true;
if ($useCache) {
	// Example to Flysystem cacheing
	$cache = new myCachedStrageAdapter(
		new \League\Flysystem\Adapter\Local('flycache'),
		'gdcache',
		300
	);

	// Flysystem cached adapter
	$adapter = new \League\Flysystem\Cached\CachedAdapter(
		$googleDrive,
		$cache
	);
} else {
	// Not use cached adapter
	$cache = null;
	$adapter = $googleDrive;
}

// Google Drive elFinder Volume driver
$gdrive = [
    // require
    'driver'       => 'FlysystemExt',
    'filesystem'   =>  new \League\Flysystem\Filesystem($adapter),
    'fscache'      => $cache,
    'separator'    => '/',
    // optional
    'alias'        => 'GoogleDrive',
    'rootCssClass' => 'elfinder-navbar-root-googledrive'
];

// elFinder volume roots options
$elFinderOpts = [
	'roots' => []
];

$elFinderOpts['roots'][] = $gdrive;

// run elFinder
$connector = new elFinderConnector(new elFinder($elFinderOpts));
$connector->run();
```

Tips
----

[](#tips)

- [Setup a Laravel Storage driver with Google Drive API](https://gist.github.com/ivanvermeyen/cc7c59c185daad9d4e7cb8c661d7b89b)
- [Issue list with "HowTo" tag](https://github.com/nao-pon/flysystem-google-drive/issues?utf8=%E2%9C%93&q=label%3AHowTo%20)

TODO
----

[](#todo)

- Unit tests to be written

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% 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 ~55 days

Recently: every ~82 days

Total

11

Last Release

3139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a101ea900abe8470ad7a7450bcd2d873956a42b9f1f6b0aefdff185e35bc702?d=identicon)[quangtam](/maintainers/quangtam)

---

Top Contributors

[![nao-pon](https://avatars.githubusercontent.com/u/1412630?v=4)](https://github.com/nao-pon "nao-pon (81 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (1 commits)")[![quangtam](https://avatars.githubusercontent.com/u/6047178?v=4)](https://github.com/quangtam "quangtam (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/quangtam-flysystem-google-drive/health.svg)

```
[![Health](https://phpackages.com/badges/quangtam-flysystem-google-drive/health.svg)](https://phpackages.com/packages/quangtam-flysystem-google-drive)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k257.1M691](/packages/league-flysystem-aws-s3-v3)[nao-pon/flysystem-google-drive

Flysystem adapter for Google Drive

3672.0M19](/packages/nao-pon-flysystem-google-drive)[league/flysystem-local

Local filesystem adapter for Flysystem.

226221.1M24](/packages/league-flysystem-local)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40028.5M67](/packages/league-flysystem-bundle)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2611.6M13](/packages/masbug-flysystem-google-drive-ext)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8532.5M167](/packages/league-flysystem-memory)

PHPackages © 2026

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