Download the PHP package mindplay/jsondoc without Composer

On this page you can find all versions of the php package mindplay/jsondoc. 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 jsondoc

mindplay/jsondoc

Simple, file-based object/document-database using JSON-files for persistence.

Build Status

Scrutinizer Code Quality

Code Coverage

Overview

Object-graphs are serialized and stored as JSON-documents, in individual files - the JSON representations are (optionally, by default) indented and formatted in a human-readable and CVS-friendly way.

Object-keys map directly to folders and file-names - for example, an object stored as foo/bar is saved as {database name}/foo/bar.json.

Write and delete-operations are committed using basic transaction semantics, with simple database-level locking to prevent simultaneous writes, using early error-detection and automatic roll-back on failure.

Please see "Limitations" below for additional technical details.

API

The API consists of two classes:

DocumentStore represents the "connection" to a data-store: a root-folder containing one or more databases.

DocumentSession represents a session with one specific database inside a data-store - it manages the loading and saving of objects, and attempts to do so in a transactional and safe manner, e.g. committing all save/delete operations atomically.

Usage

Create a DocumentStore with FilePersistence and point it to an existing folder:

Ask the DocumentStore to create a DocumentSession:

This will lock the store in shared mode, until you close() the session. (it will also automatically close if it falls out of scope.)

Now create objects of any class, and store them:

Note that the state of the object has been captured in-memory, but the serialized object does not get written to underlying storage until changes are committed.

Alternatively, you can store an object with a generated UUID under a parent ID:

Load objects from the database into the current session:

Delete unwanted objects:

Call commit() to persist all the pending store/delete-operations:

Finally, you should close() to explicitly release the lock:

The DocumentSession API also provides a few other operations:

Limitations

Using individual, flat files for data-storage is not fast - this library (by design) is optimized for consistent storage, quick and easy implementation, human-readable and VCS-compatible file-based storage, in applications where speed is not a critical factor.

The JsonSerializer itself has an important limitation: it is designed to store self-contained object-graphs only - it does not support shared or circular object-references. This is by design, and in-tune with good DDD design practices: an object-graph with shared or circular references does not have clear transaction boundaries and cannot be stored in a predictable and consistent way.

This library does not synthesize object keys - which means you must assign a key when you store a new object. Again, this is by design.

More detailed background on limitations and technical decisions here.


All versions of jsondoc with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
mindplay/jsonfreeze Version >= 1.2
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 mindplay/jsondoc contains the following files

Loading the files please wait ....