{"id":13912658,"url":"https://github.com/fire015/flintstone","last_synced_at":"2026-04-06T00:05:33.412Z","repository":{"id":54939554,"uuid":"1905132","full_name":"fire015/flintstone","owner":"fire015","description":"A key/value database store using flat files for PHP.","archived":false,"fork":false,"pushed_at":"2023-07-09T09:13:02.000Z","size":147,"stargazers_count":285,"open_issues_count":2,"forks_count":35,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-05-18T17:04:28.197Z","etag":null,"topics":["database-store","flat-files","flintstone","key-value","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fire015.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fire015"}},"created_at":"2011-06-16T10:57:23.000Z","updated_at":"2024-06-13T06:57:08.448Z","dependencies_parsed_at":"2024-06-13T07:07:41.104Z","dependency_job_id":null,"html_url":"https://github.com/fire015/flintstone","commit_stats":{"total_commits":107,"total_committers":10,"mean_commits":10.7,"dds":0.514018691588785,"last_synced_commit":"19586058d455a9deaa27e741744b2f140bae6e72"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire015%2Fflintstone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire015%2Fflintstone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire015%2Fflintstone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire015%2Fflintstone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fire015","download_url":"https://codeload.github.com/fire015/flintstone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226409839,"owners_count":17620717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-store","flat-files","flintstone","key-value","php"],"created_at":"2024-08-07T01:01:38.603Z","updated_at":"2025-12-18T09:13:05.482Z","avatar_url":"https://github.com/fire015.png","language":"PHP","funding_links":["https://github.com/sponsors/fire015"],"categories":["php"],"sub_categories":[],"readme":"Flintstone\n==========\n\n[![Total Downloads](https://img.shields.io/packagist/dm/fire015/flintstone.svg)](https://packagist.org/packages/fire015/flintstone)\n[![Build Status](https://travis-ci.com/fire015/flintstone.svg?branch=master)](https://travis-ci.com/github/fire015/flintstone)\n\nA key/value database store using flat files for PHP.\n\nFeatures include:\n\n* Memory efficient\n* File locking\n* Caching\n* Gzip compression\n* Easy to use\n\n### Installation\n\nThe easiest way to install Flintstone is via [composer](http://getcomposer.org/). Run the following command to install it.\n\n```\ncomposer require fire015/flintstone\n```\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse Flintstone\\Flintstone;\n\n$users = new Flintstone('users', ['dir' =\u003e '/path/to/database/dir/']);\n```\n\n### Requirements\n\n- PHP 7.3+\n\n### Data types\n\nFlintstone can store any data type that can be formatted into a string. By default this uses `serialize()`. See [Changing the formatter](#changing-the-formatter) for more details.\n\n### Options\n\n|Name\t\t\t\t|Type\t\t|Default Value\t|Description\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n|---\t\t\t\t|---\t\t|---\t\t\t\t|---\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n|dir\t\t\t\t|string\t\t\t\t|the current working directory\t\t\t|The directory where the database files are stored (this should be somewhere that is not web accessible) e.g. /path/to/database/\t\t\t|\n|ext\t\t\t\t|string\t\t\t\t|.dat\t\t|The database file extension to use\t\t\t\t\t\t\t|\n|gzip\t\t\t\t|boolean\t\t\t|false\t\t|Use gzip to compress the database\t\t\t\t\t\t\t|\n|cache\t\t\t\t|boolean or object\t|true\t\t|Whether to cache `get()` results for faster data retrieval\t\t\t\t\t\t\t\t|\n|formatter\t\t\t|null or object\t\t|null\t\t|The formatter class used to encode/decode data\t\t\t\t|\n|swap_memory_limit\t|integer\t\t\t|2097152\t|The amount of memory to use before writing to a temporary file\t|\n\n\n### Usage examples\n\n```php\n\u003c?php\n\n// Load a database\n$users = new Flintstone('users', ['dir' =\u003e '/path/to/database/dir/']);\n\n// Set a key\n$users-\u003eset('bob', ['email' =\u003e 'bob@site.com', 'password' =\u003e '123456']);\n\n// Get a key\n$user = $users-\u003eget('bob');\necho 'Bob, your email is ' . $user['email'];\n\n// Retrieve all key names\n$keys = $users-\u003egetKeys(); // returns array('bob')\n\n// Retrieve all data\n$data = $users-\u003egetAll(); // returns array('bob' =\u003e array('email' =\u003e 'bob@site.com', 'password' =\u003e '123456'));\n\n// Delete a key\n$users-\u003edelete('bob');\n\n// Flush the database\n$users-\u003eflush();\n```\n\n### Changing the formatter\nBy default Flintstone will encode/decode data using PHP's serialize functions, however you can override this with your own class if you prefer.\n\nJust make sure it implements `Flintstone\\Formatter\\FormatterInterface` and then you can provide it as the `formatter` option.\n\nIf you wish to use JSON as the formatter, Flintstone already ships with this as per the example below:\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse Flintstone\\Flintstone;\nuse Flintstone\\Formatter\\JsonFormatter;\n\n$users = new Flintstone('users', [\n    'dir' =\u003e __DIR__,\n    'formatter' =\u003e new JsonFormatter()\n]);\n```\n\n### Changing the cache\nTo speed up data retrieval Flintstone can store the results of `get()` in a cache store. By default this uses a simple array that only persist's for as long as the `Flintstone` object exists.\n\nIf you want to use your own cache store (such as Memcached) you can pass a class as the `cache` option. Just make sure it implements `Flintstone\\Cache\\CacheInterface`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire015%2Fflintstone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffire015%2Fflintstone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire015%2Fflintstone/lists"}