PHPackages                             j-rodrigueza-2018/php-hexadrive - 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. j-rodrigueza-2018/php-hexadrive

ActiveLibrary

j-rodrigueza-2018/php-hexadrive
===============================

PHP library for managing files and folders in Google Drive using Hexagonal Architecture.

v1.0.5(1mo ago)08MITPHPPHP &gt;=8.1CI failing

Since Apr 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/j-rodrigueza-2018/PHP-HexaDrive)[ Packagist](https://packagist.org/packages/j-rodrigueza-2018/php-hexadrive)[ Docs](https://github.com/j-rodrigueza-2018/PHP-HexaDrive)[ RSS](/packages/j-rodrigueza-2018-php-hexadrive/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

PHP-HexaDrive
=============

[](#php-hexadrive)

**PHP-HexaDrive** is a modern PHP library for managing files and folders in **Google Drive**, built with a clean and decoupled **Hexagonal Architecture**.

✨ Features
----------

[](#-features)

- 📁 Upload, download, list, rename and delete files
- 📂 Create, list, rename and delete folders
- 🔌 Hexagonal Architecture: decoupled, testable and clean
- ⚙️ PSR-4 autoloading and interface-based adapters
- 🌐 Ready to extend to other providers (e.g. AWS S3, Dropbox, etc.)
- ✅ Comes with integration tests using real Google Drive accounts

🛠 Installation
--------------

[](#-installation)

```
composer require j-rodrigueza-2018/php-hexadrive
```

⚙️ Configuration
----------------

[](#️-configuration)

1. Go to [Google Cloud Console](https://console.cloud.google.com/), enable the **Google Drive API** and create a **Service Account**.
2. Download the `credentials.json` file.
3. Share your target Google Drive folder with the service account email.
4. Add a custom key in the credentials file for the folder ID:

```
{
  "type": "service_account",
  "project_id": "...",
  "...": "...",
  "folder_id": "YOUR_FOLDER_ID"
}
```

5. Save the file as `google-credentials.json` in your project root
    (or pass a custom path to the factory).

---

🚀 Basic Usage
-------------

[](#-basic-usage)

### Upload and Download a File

[](#upload-and-download-a-file)

```
use JRA\HexaDrive\Infrastructure\Factories\GoogleDrive\GoogleDriveCloudServiceFactory;
use JRA\HexaDrive\Infrastructure\Adapters\GoogleDrive\GoogleDriveFileAdapter;

// Initialize service
$service = (new GoogleDriveCloudServiceFactory('/path/to/google-credentials.json'))->create();
$file_manager = new GoogleDriveFileAdapter($service);

// Upload
$file_id = $file_manager->uploadFile('example.txt', 'Hello world!');

// Download
$content = $file_manager->downloadFile($file_id);

// Delete
$file_manager->deleteFile($file_id);
```

---

### Folder Management

[](#folder-management)

```
use JRA\HexaDrive\Infrastructure\Adapters\GoogleDrive\GoogleDriveFolderAdapter;

$service = (new GoogleDriveCloudServiceFactory('/path/to/google-credentials.json'))->create();
$folder_manager = new GoogleDriveFolderAdapter($service);

// Create
$new_folder_id = $folder_manager->createFolder('MyFolder');

// Rename
$folder_manager->renameFolder($new_folder_id, 'RenamedFolder');

// Delete
$folder_manager->deleteFolder($new_folder_id);
```

---

📄 License
---------

[](#-license)

This project is licensed under the [MIT License](LICENSE).

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance97

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~68 days

Recently: every ~86 days

Total

6

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/845b0e31b1cb09004c5f04b6c002e774e550a32ef6828e9e1b56ff0c08bda1d5?d=identicon)[j-rodrigueza-2018](/maintainers/j-rodrigueza-2018)

---

Top Contributors

[![j-rodrigueza-2018](https://avatars.githubusercontent.com/u/85250489?v=4)](https://github.com/j-rodrigueza-2018 "j-rodrigueza-2018 (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/j-rodrigueza-2018-php-hexadrive/health.svg)

```
[![Health](https://phpackages.com/badges/j-rodrigueza-2018-php-hexadrive/health.svg)](https://phpackages.com/packages/j-rodrigueza-2018-php-hexadrive)
```

###  Alternatives

[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1225.0k10](/packages/fleetbase-core-api)[chameleon-system/chameleon-base

The Chameleon System core.

1026.5k3](/packages/chameleon-system-chameleon-base)[voidagency/vactory_starter_kit

Vactory is a custom Drupal profile which is developed and released by VOID Agency.

1019.7k](/packages/voidagency-vactory-starter-kit)

PHPackages © 2026

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