Download the PHP package arc/store without Composer

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

arc\store: fast schema-free JSON store

Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

arc\store is part of ARC - a component library.

ARC is a spinoff from the Ariadne Web Application Platform and Content Management System http://www.ariadne-cms.org/.

Installation

You can install the full set of ARC components using composer:

composer require arc/arc

Or you can start a new project with arc/arc like this:

composer create-project arc/arc {$path}

Or just use this package:

composer require arc/store

Usage

Example DSN for PostgreSQL:

Example DSN for MySQL:

This will show an array with one object, with parent '/', name 'foo', and a single property 'foo' => 'bar'.

What is ARC\Store?

ARC\Store is a minimal implementation of the structured object store implemented in Ariadne-CMS. It stores free form object data in a tree structure, similar to a filesystem. It provides seperate query and save and delete methods. The query has its own format and parser. The data is stored in PostgreSQL using JSONB data blobs, which are fully indexed.

This solution gives you flexible and fast storage of any kind of data, while keeping many advantages of using a proven technology like PostgreSQL. Although this implementation doesn't have it, it would be easy to add transactions with commit/rollback to gain atomic updates, even for batch operations.

Because of its tree structure, ARC\Store integrates well with other ARC Components, like ARC\Grants and ARC\Config.

methods

\arc\store::connect

(\arc\store\Store) \arc\store::connect( (string) $dsn, (callable) $resultHandler=null)

This method creates a new PSQLStore instance and connects it to a PostgreSQL database. Optionally you can pass your own resultHandler function. The PSQLStore class contains two static functions predefined for this:

\arc\store::disconnect

(void) \arc\store::disconnect()

Removes the last store connection from the context stack (\arc\context).

\arc\store::cd

(\arc\store\PSQLStore) \arc\store::cd($path)

Returns a new store istance, with its default path set to $path. This call will always succeed, even if $path doesn't exist in the object store. It does not update the path of the store instance in the context stack (\arc\context). To do that, you must push the new store onto the context stack:

\arc\store::find

(mixed) \arc\store::find((string) $query, (string) $path)

Compiles the query to SQL, calls the resultHandler with it and returs the results. The query syntax is read only, it can only read data, never update or delete it. You can also call this method on a store istance, like this:

The query format supports the following operators:

You can combine multiple query parts using and and or. You can use parenthesis to group them. And you can negate a part by prefixing it with not. Strings must be enclosed in single quotes. A single quote inside the string should be escaped with a \.

You can query any part of the object, but there are a few meta data properties you can search for:

Example queries:

\arc\store::parents

(mixed) \arc\store::parents((string) $path)

Returns a list of parent objects, starting with the root and ending with the direct parent.

\arc\store::ls

(mixed) \arc\store::ls((string) $path)

Returns a list of direct children of the given path.

\arc\store::get

(object) \arc\store::get((string) $path)

Returns the object with the give path, or null.

\arc\store::exists

(bool) \arc\store::exists((string) $path)

Returns true if an object with the given path exists.

\arc\store\Store->save

(bool) $store->save( (object) $data, (string) $path = '')

Saves the object data at the given path. Returns true on success or false on failure.

\arc\store\Store->delete

(bool) $store->delete((string) $path = '')

Deletes the object with the given path and all its children. It will never remove the root object. If you don't pass an argument, it will use the current path set in the store instance. Returns true on success or false on failure.


All versions of store with dependencies

PHP Build Version
Package Version
Requires php Version >=7
arc/base Version >=3.0.3
arc/prototype Version >=3.0.1
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 arc/store contains the following files

Loading the files please wait ....