2017 © Pedro Peláez
 

library innudb

Experimental library for manipulation with array-based "database".

image

czproject/innudb

Experimental library for manipulation with array-based "database".

  • Wednesday, December 27, 2017
  • by janpecha
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

InnuDb

Experimental PHP library for manipulation with array-based "database"., (*1)

``` php $pathToFile = DIR . '/data.php'; // see file content below $loader = new Cz\InnuDb\Loader; $innudb = new Cz\InnuDb\InnuDb($loader, $pathToFile);, (*2)

$persons = $innudb->createCollection('persons');, (*3)

foreach($persons as $id => $item) { var_dump($item); }, (*4)

// $persons->getCount(); // // $persons->limit(limit); // $persons->limit(limit, offset); // // $persons->sort('column'); // ASC is default // $persons->sort('column', 'ASC'); // or order('column') // $persons->sort('column', 'DESC'); // ASC is default // $persons->sort(array( // 'column' => 'ASC', // or 'DESC' // )); // $persons->sort('name')->sort('age', 'DESC'); // fluent interface // // $persons->where('column', 'value'); // column = value // $persons->where('column >', 'value'); // column > value // $persons->where('column <=', 'value'); // column <= value // $persons->where('column', 'value')->where('column2 >', 'value2'); // fluent interface: column = value AND column2 > value2 // $persons->where(array( // 'column' => 'value', // column = value // 'column2 <=' => 'value2', // AND column2 <= value2 // ));, (*5)


Supported data files: PHP file, [NEON](http://ne-on.org), JSON, INI PHP file -------- ``` php <?php return array( 'persons' => array( // 'persons' subset 'harry-potter' => array( 'name' => 'Harry Potter', 'story' => 'Harry Potter', 'age' => 20, ), 'gandalf' => array( 'name' => 'Gandalf The White', 'story' => 'Lord of the Rings', 'age' => 2000, ), ), );

NEON file

persons:
    harry-potter:
        name: Harry Potter
        story: Harry Potter
        age: 20

    gandalf:
        name: Gandalf The White
        story: Lord of the Rings
        age: 2000

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/, (*6)

The Versions

27/12 2017

dev-master

9999999-dev

Experimental library for manipulation with array-based "database".

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

18/08 2013

v0.9.0

0.9.0.0

  Sources   Download

The Requires

 

The Development Requires