2017 © Pedro Peláez
 

library flatfiledb

PHP Flat File DB API

image

badpenguin/flatfiledb

PHP Flat File DB API

  • Wednesday, October 22, 2014
  • by badpenguin
  • Repository
  • 3 Watchers
  • 17 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

FlatFileDB

PHP Flat File DB library with cache for CMS, (*1)

More informations are available at http://www.badpenguin.org/php-flatfiledb, (*2)

Why?

On my VPS i uses Wordpress that is a fatty slow MySQL app., (*3)

Faster websites performs better also in SEO ranking., (*4)

Technology

  • Don't reinvent the wheel., (*5)

  • Uses "dba" with "qdbm" format., (*6)

  • "dba" format can be accessed from Perl and from Bash., (*7)

Features

  • DBA is a module so its faster then any self-made implementation., (*8)

  • Table Locking., (*9)

  • Library has a little "cache" system on top of DBA., (*10)

  • Can store anything: strings, arrays, objects., (*11)

Road Map

  • [ ] Database Locking., (*12)

  • [ ] Disable Locking., (*13)

  • [ ] Implement "composer", (*14)

Examples

Opening the DB

$cms = FlatFile::open('db/cms.qdbm');

Write Post

/* Create an Object */
$post = new stdClass;
$post->id=5;
$post->title='my title';
$post->body='

my content, (*15)

'; $post->last_modified_time = time(); $post->tags = array('featured','gallery'); $cms->set($post->id,$post); if (!$post) die('Save failed');

Get Post

$post = $cms->get($post_id);
if (!$post) die('Post not found');

Check if Key exists

if ($cms->is_valid('manteinance_mode')) die('Website is under manteinance');

Delete a key

$cms->delete('manteinance_mode');

Get all data

print_r($cms->get_all());

The Versions

22/10 2014

dev-master

9999999-dev https://github.com/badpenguin/flatfiledb

PHP Flat File DB API

  Sources   Download

LGPL 2.1

The Requires

  • php >=5.2

 

The Development Requires

db flatfile