Home / Blog / Post
Php Class Datastore
Added on 09th July 2018 in Project

Why would you use DataStore

DataStore in its current version works only with the filesystem, which although not scalable for larger datasets, can be of use for simpler systems.

  • Low overhead compared to a database
  • Capable of Creating, Reading, Updating, Deleting and Searching through data
  • Can be easily extended to add additional functionality
  • Simple to Backup and Restore Data

Some Example Uses

  • User Login System
  • Blog / Guesbook
  • System Logging

History Timeline for DataStore

DataStore is the evolution of a class called Entity from (https://webpi.chris-shaw.com) Entity was a raw class to standardise how the WebPi software would interact with data stored within the filesystem

  • Started Life as Entity.php in WebPi ()
  • Became a general way for WebPi to access data and becoming basis for an authentication class.
  • Was moved to its own repository with unit tests to be shared between progects
  • Renamed to DataStore and Added to packagest for composer install



$payload = [
       'id_entity' => 'testId',
       'test' => 'case'

$dataStore = new DataStore('exampleID');


$dataStore = new DataStore('exampleID');


$dataStore = new DataStore('exampleID');
$dataStore>getValue('field', 'value');


$dataStore = new DataStore('exampleID');


$filters = [

$search = new DataStore();
$results = $search->search();

How to Install

1. Composer

The preferred method is using composer (https://getcomposer.org/) and can be insalled using the following command

composer require christopher-paul-shaw/datastore 

2. Cloning

You can also clone the repository from github

git clone [email protected]:christopher-paul-shaw/DataStore.git

Url: https://github.com/christopher-paul-shaw/DataStore/

Hi there, I am christopher shaw, a software developer form South Yorkshire, England.

I love tinkering with all things tech, and opened this website as a web presence for myself and a place to keep my notes and snippets. Hopefully you will find something here to help

Christopher Shaw