Download the PHP package ronolo/json-store without Composer
On this page you can find all versions of the php package ronolo/json-store. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package json-store
Json-Store
A document store which uses any type of filesystem to store documents as JSON. It uses https://flysystem.thephpleague.com/ to abstract the storage space.
As by definition a store acts like ONE table in a database. You can put everything into one store or have many stores for different JSON objects.
It uses a NoSQL like query system for the documents and aims to use very low memory footprint (aka not loading all documents into memory to process them).
Note: There is a ronolo/json-database package, which uses the json-store and extends it with document relations (foreign keys) and query result caching.
Usage
First create a Config object.
Then specify the adapter which shall be used to actually store the JSON files to a disc/cloud/memory/zip. See https://github.com/thephpleague/flysystem to find the one which fits your needs. You have to init the adapter with the correct parameters.
The store is now ready. We can now store, read, delete and update documents. As a very basic usage, we can read every document back by ID.
Note: Update is always an update of the whole object. It is not possible to update single fields via store command.
As a speed bonus the store keeps all document IDs in an index file, which will be loaded on store construct. Another speed bonus would be to use the caching and speedup adapters found on the https://flysystem.thephpleague.com/v1/docs/advanced/caching/ page.
It is also possible to query documents in a CouchDB like fashion from the store.
There are the following conditions implemented:
Examples can be found in the subdirectories of tests/src/query.
A few examples from there:
Goals
- No real database needed like SqlLite, Mysql, MongoDB, CouchDB ...)
- PHP 7.2+
- Document Store aka NoSQL
- JSON as format of storage
- (very) low memory usage even for huge results
- NoSQL like query syntax (CouchDB style)
- Abstract data location via https://flysystem.thephpleague.com/
Limitations
- Any limitation the underlying flysystem adapter has
- If the creation of an unique ID fails, there will be an exception
All versions of json-store with dependencies
ext-json Version *
league/flysystem Version ^1.1
ronolo/json-query Version ^1.2