PHPackages                             basilicom/flysystem-pdo - 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. basilicom/flysystem-pdo

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

basilicom/flysystem-pdo
=======================

Flysystem v3 adapter for PDO

v1.1.1(3y ago)2643GPL-3.0-or-laterPHPPHP 8.0.\* || 8.1.\* || 8.2.\*

Since Feb 12Pushed 3y ago5 watchersCompare

[ Source](https://github.com/basilicom/flysystem-pdo)[ Packagist](https://packagist.org/packages/basilicom/flysystem-pdo)[ RSS](/packages/basilicom-flysystem-pdo/feed)WikiDiscussions main Synced 1mo ago

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

Flysystem v3 PDO adapter
========================

[](#flysystem-v3-pdo-adapter)

[![Psalm coverage](https://camo.githubusercontent.com/44fddffb163e08defb8a2963e46ef4b94ef5075e509c16963c7c3e2e8f4b9490/68747470733a2f2f73686570686572642e6465762f6769746875622f626173696c69636f6d2f666c7973797374656d2d70646f2f636f7665726167652e737667)](https://camo.githubusercontent.com/44fddffb163e08defb8a2963e46ef4b94ef5075e509c16963c7c3e2e8f4b9490/68747470733a2f2f73686570686572642e6465762f6769746875622f626173696c69636f6d2f666c7973797374656d2d70646f2f636f7665726167652e737667)[![Psalm level](https://camo.githubusercontent.com/0c9a60e4ab9b3712b1c76684d2436eda00012f37321fbda68ca09a9b5be9cb9c/68747470733a2f2f73686570686572642e6465762f6769746875622f626173696c69636f6d2f666c7973797374656d2d70646f2f6c6576656c2e737667)](https://camo.githubusercontent.com/0c9a60e4ab9b3712b1c76684d2436eda00012f37321fbda68ca09a9b5be9cb9c/68747470733a2f2f73686570686572642e6465762f6769746875622f626173696c69636f6d2f666c7973797374656d2d70646f2f6c6576656c2e737667)

A (very simple) [Flysystem](https://flysystem.thephpleague.com) v3 adapter for PDO/MySQL`. Based on the  implementation.

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

[](#installation)

```
$ composer require basilicom/flysystem-pdo`
```

Prepare a (MySQL) table:

```
create table files (
	bucket varchar(32) not null default 'default',
	path varchar(255) not null,
	isFile tinyint not null default 1,
	mimeType varchar(64) not null default '',
	contents longblob not null,
	size int unsigned not null default 0,
	checksum varchar(256) not null,
	lastModified datetime,
	visibility varchar(64),
	PRIMARY KEY(bucket, path)
);

```

Usage
-----

[](#usage)

```
use League\Flysystem\Filesystem;
use Basilicom\Flysystem\Pdo\PdoAdapter;

$pdo = new PDO('mysql:host=mysql;dbname=mydb', 'myuser', 'mypass');
$adapter = new \Basilicom\Flysystem\Pdo\PdoAdapter($pdo);

$flysystem = new Filesystem($adapter);
```

#### Example

[](#example)

```
$path = 'my/path/to/file.txt';
$contents = 'Lorem Ipsum';
$flysystem->write($path, $contents);
```

Tests
-----

[](#tests)

This library uses the `FilesystemAdapterTestCase` provided by [`league/flysystem-adapter-test-utilities`](https://github.com/thephpleague/flysystem-adapter-test-utilities), so it performs integration tests that need a real PDO connection.

To run tests, provide a MySQL database with the `files` table schema, duplicate the `phpunit.xml.dist` file into `phpunit.xml` and fill all the environment variables, then run:

```
$ composer test
```

This will run PHP-CS-Fixer,\[Psalm\]\[3\] and \[PHPUnit\]\[4\], but you can run them individually like this:

```
$ composer phpcsfixer
$ composer psalm
$ composer phpunit
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

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 ~0 days

Total

3

Last Release

1180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c0d06c93d4cfac61be4239ec123ca75a189a5275d4e1782755d85029e67b6bc?d=identicon)[christophluehr](/maintainers/christophluehr)

![](https://www.gravatar.com/avatar/a5082ec20fca835c8a833af5de2647529bad59c9423fbc58cc5625c9fbff230c?d=identicon)[IgorBenko](/maintainers/IgorBenko)

![](https://www.gravatar.com/avatar/afb6145ee5c0c6af7662a537e76ee9c679d30e7e6217636d72576ea5ccd8b002?d=identicon)[AlexanderHeidrich](/maintainers/AlexanderHeidrich)

---

Top Contributors

[![christophluehr](https://avatars.githubusercontent.com/u/1352356?v=4)](https://github.com/christophluehr "christophluehr (3 commits)")

---

Tags

flysystempdofilesystemFlysystempdoadapterstorage

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/basilicom-flysystem-pdo/health.svg)

```
[![Health](https://phpackages.com/badges/basilicom-flysystem-pdo/health.svg)](https://phpackages.com/packages/basilicom-flysystem-pdo)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M782](/packages/league-flysystem-aws-s3-v3)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

2610.5M30](/packages/league-flysystem-async-aws-s3)[nimbusoft/flysystem-openstack-swift

Flysystem adapter for OpenStack Swift

44774.4k6](/packages/nimbusoft-flysystem-openstack-swift)

PHPackages © 2026

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