PHP code example of arc / store

1. Go to this page and download the library: Download arc/store library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arc / store example snippets


	$dsn = 'pgsql:host=localhost;dbname=arcstore;user=arcstore;password=arcstore';

	$dsn = 'mysql:host=localhost;dbname=arcstore;user=arcstore;password=arcstore';

    $store = \arc\store::connect($dsn);
    $store->initialize();
    if ($store->save(\arc\prototype::create(["foo" => "bar"]), "/foo/")) {
        $objects = $store->ls('/');
        var_dump($objects);
    }

	\arc\context::push([
		'arcStore' => \arc\store::cd('/foo/')
	]);

	$store = \arc\context::cd('/');
	$objects = $store->find("foo='bar'");

    $results = $store->find("nodes.path ~= '/foo/%'"); 
    $results = $store->find("foo.bar>3"); 
    $results = $store->find("foo.bar>3 and foo.bar<6");
    $results = $store->find("foo.bar<2 or foo.bar>8");
    $results = $store->find("type='order' and ( total<10 or total>1000 )");