PHPackages                             net\_bazzline/php\_component\_database\_file\_storage - 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. [Database &amp; ORM](/categories/database)
4. /
5. net\_bazzline/php\_component\_database\_file\_storage

ActiveLibrary[Database &amp; ORM](/categories/database)

net\_bazzline/php\_component\_database\_file\_storage
=====================================================

local file database

0.7.1(9y ago)0441LGPL-3.0PHPPHP &gt;=5.4.0

Since Jun 8Pushed 8y ago6 watchersCompare

[ Source](https://github.com/bazzline/php_component_database_file_storage)[ Packagist](https://packagist.org/packages/net_bazzline/php_component_database_file_storage)[ RSS](/packages/net-bazzline-php-component-database-file-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (20)Used By (1)

Database File Storage for PHP
=============================

[](#database-file-storage-for-php)

[crud](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) [storage interface](https://github.com/bazzline/php_component_database_file_storage/blob/master/source/Net/Bazzline/Database/FileStorage/StorageInterface.php)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#crud-storage-interface)

```
/**
 * @param $data
 * @return mixed - unique identifier
 */
public function create($data);

/**
 * @return array
 */
public function readMany();

/**
 * @return null|mixed - nothing or data
 */
public function readOne();

/**
 * @param mixed $data
 * @return boolean
 */
public function update($data);

/**
 * @return boolean
 */
public function delete();

/**
 * @param mixed $key
 * @param mixed $value
 * @return $this
 */
public function filterBy($key, $value);

/**
 * @param mixed $id
 * @return $this
 */
public function filterById($id);

/**
 * @param int $count
 * @param null|int $offset
 * @return $this
 */
public function limitBy($count, $offset = null);
```

Install
=======

[](#install)

By Hand
-------

[](#by-hand)

```
mkdir -p vendor/net_bazzline/php_component_database_file_storage
cd vendor/net_bazzline/php_component_database_file_storage
git clone https://github.com/bazzline/php_component_database_file_storage .

```

With [Packagist](https://packagist.org/packages/net_bazzline/php_component_database_file_storage)
-------------------------------------------------------------------------------------------------

[](#with-packagist)

```
composer require net_bazzline/php_component_database_file_storage:dev-master

```

Benefits
========

[](#benefits)

- implemented [locking](https://packagist.org/packages/net_bazzline/component_lock) to prevent multiple reads and writes

API
===

[](#api)

[API](http://www.bazzline.net/7ef9fafed9e60d5b861fe82e107b79e3f7adae0e/index.html) is available at [bazzline.net](http://www.bazzline.net).

Future Improvements
-------------------

[](#future-improvements)

- extend "filterBy"
    - $key and $value are optional to filter by key or by value
- take a look to [bigdump](https://github.com/wires/bigdump)
- take a look to [reactphp/filesystem](https://github.com/reactphp/filesystem)
- take a look to [file wrapper](https://php.net/manual/en/wrappers.file.php)
- implement "modifier" to easy up modifiying data before reading or writing
- if write (create/read) action is triggered, create a \*.lock file to prevent multiple writings
    - or usd [flock](https://php.net/manual/en/function.flock.php)
- implement caching via proxy
    - simple two files storages injected
    - if number of changed itemes reaches limit, cache is written into real storage
- use a uuid generator for unique keys
    - use a [temporary file](http://php.net/manual/en/function.tmpfile.php)
    - beeing even more pro, use [php://temp](http://php.net/manual/en/wrappers.php.php)
        - implement some kind of "intelligent" cache that counts the average size of an entry to determine the maximum number of entries before flushing the cache

History
=======

[](#history)

- upcomming
    - @todo
    - added support for php version above 7.0
    - dropped support for php version below 5.6
- [0.7.1](https://github.com/bazzline/php_component_database_file_storage/tree/0.7.1) - released at 11.08.2016
    - updated phpunit
- [0.7.0](https://github.com/bazzline/php_component_database_file_storage/tree/0.7.0) - released at 29.03.2016
    - added *API* section
    - bumped php version to 5.4
    - moved to psr-4 autoloading
    - updated dependencies
- [0.6.5](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.5) - released at 18.12.2015
    - updated dependencies
- [0.6.4](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.4) - released at 11.12.2015
    - updated dependencies
- [0.6.3](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.3) - released at 18.11.2015
    - updated dependencies
- [0.6.2](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.2) - released at 13.09.2015
    - stabalized dependencies
- [0.6.1](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.1) - released at 12.09.2015
    - added protected *getIdGenerator*, *getLockableWriterFactory*, *getReaderFactory* and *getStorage* methods to easy up creating your own storage by using the default factory
- [0.6.0](https://github.com/bazzline/php_component_database_file_storage/tree/0.6.0) - released at 12.09.2015
    - fixed issue in *readMany* if limit is used
- [0.5.0](https://github.com/bazzline/php_component_database_file_storage/tree/0.5.0) - released at 12.09.2015
    - added example *has*
    - added method *has($atLeast = 1, $atMost = null)*
    - added optional argument *resetRuntimeProperties* (*filters* and *limit* settings) to *create*, *readMany*, *readOne*, *update* and *delete*
- [0.4.1](https://github.com/bazzline/php_component_database_file_storage/tree/0.4.1) - released at 11.09.2015
    - adapted to new *Experiment* from toolbox
- [0.4.0](https://github.com/bazzline/php_component_database_file_storage/tree/0.4.0) - released at 11.09.2015
    - moved code into directories (*Storage* and *IdGenerator*)
    - renamed *Repository* to *Storage*
- [0.3.4](https://github.com/bazzline/php_component_database_file_storage/tree/0.3.4) - released at 10.09.2015
    - fixed issue in *LockableWriterForPhp5Dot3*
- [0.3.3](https://github.com/bazzline/php_component_database_file_storage/tree/0.3.3) - released at 10.09.2015
    - fixed issue in *LockableWriterForPhp5Dot3*
- [0.3.2](https://github.com/bazzline/php_component_database_file_storage/tree/0.3.2) - released at 10.09.2015
    - fixed issue when dealing with php 5.3
- [0.3.1](https://github.com/bazzline/php_component_database_file_storage/tree/0.3.1) - released at 10.09.2015
    - fixed broken unit test
- [0.3.0](https://github.com/bazzline/php_component_database_file_storage/tree/0.3.0) - released at 10.09.2015
    - created and used own `LockableWriter` to switch from "FileNameLock" to "FileHandlerLock"

Final Words
===========

[](#final-words)

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if use it. Make a [donation](https://gratipay.com/~stevleibelt) if you love it :-\].

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

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

Recently: every ~66 days

Total

19

Last Release

3567d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.3.3

0.7.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/58451b041f6f5a38c7e62762c96d01f5e2bcac30e322707fe4760a82bccb6856?d=identicon)[artodeto](/maintainers/artodeto)

---

Top Contributors

[![stevleibelt](https://avatars.githubusercontent.com/u/2287220?v=4)](https://github.com/stevleibelt "stevleibelt (85 commits)")

---

Tags

psrphpdatabasefileuuidlocalbazzlinerepositoryPSR-4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/net-bazzline-php-component-database-file-storage/health.svg)

```
[![Health](https://phpackages.com/badges/net-bazzline-php-component-database-file-storage/health.svg)](https://phpackages.com/packages/net-bazzline-php-component-database-file-storage)
```

###  Alternatives

[larachimp/mango-repo

Simple repository package for Laravel 5.

317.2k](/packages/larachimp-mango-repo)[weebly/laravel-mutate

Mutate Laravel attributes

1354.7k](/packages/weebly-laravel-mutate)[eftec/documentstoreone

A flat document store for PHP that allows multiples concurrencies.

124.5k4](/packages/eftec-documentstoreone)

PHPackages © 2026

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