Download the PHP package meyersm/simple-datastore without Composer

On this page you can find all versions of the php package meyersm/simple-datastore. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simple-datastore

simpleDatastore

Build Status

A PHP library to store objects between sessions using only the local file system.

Objects can be stored in json or serialized formats and be opened in read only mode or a read/write mode that locks the datastore to prevent overwriting or race conditions.

Good uses for simpleDatastore

This library should NOT be used as a replacement for a database in any application that has high traffic and many concurrent writes, while the files are locked while writing, every other thread/script that wants to write will have to wait for the lock causing slowdowns.

Installation

To install with composer, add this to your composer.json

Then run composer update and add this to your code,

Alternativly you can just download the simpleDatastore.php file and add this to your code,

Usage

Creating a new Datastore:

Then you can start adding data, and save to the new datastore

The datastore still has a write lock on the file until the file is closed, at that point another script can open and read the data

If you want to delete a datastore file, use the destroy function

When you try to open a datastore that already has a lock on it, the library will re-try for a configurable amount of time then error out. If you want to access a datastore while its locked, you can open it in read only mode

Working with php classes that would be better stored as serialized objects instead of json? Set the serialize flag to true when opening a datastore

By default the library will store all datastores and thier lock files in a sub directory called "datastore". It also throws exceptions in case of an error, if you would like to change either of those defaults you can.

To change the way the library handles a locked datastore file, use the setLockConfig function. Again if doing this, delay opening the datastore file like in the example above

For more examples on how to use this library, check out the unit tests

Unit tests


All versions of simple-datastore with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package meyersm/simple-datastore contains the following files

Loading the files please wait ....