You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Darksparrow\DeegraphInteractions\Core\DeegraphServer;
|
|
use Darksparrow\DeegraphInteractions\DataStructures\DataURL;
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
|
|
|
|
$db = new DeegraphServer(
|
|
token: "UFVUX1lPVVJfVE9LRU5fSEVSRQ==",
|
|
actor: "db36576b-cc5c-573a-8ae2-00258884d8c6",
|
|
allowSelfSignedCerts: true,
|
|
);
|
|
/*
|
|
$insertQuery = QueryBuilder::Put()
|
|
->Schema(schema: "https://schemas.auxiliumsoftware.co.uk/v1/collection.json")
|
|
->At(relativePath: "{970334ed-1f4f-465a-94d7-923a99698786}/todo");
|
|
$insertQuery = QueryBuilder::Put()
|
|
->URI(uri: DataURL::BuildBase64(unencodedString: "nya~"))
|
|
->At(relativePath: "{970334ed-1f4f-465a-94d7-923a99698786}/example");
|
|
$insertQuery = QueryBuilder::Insert()
|
|
->RelativePath(relativePath: "{970334ed-1f4f-465a-94d7-923a99698786}/example");
|
|
echo $insertQuery;
|
|
echo "\n";
|
|
$result = $db->RunQuery($insertQuery);
|
|
var_dump($result);
|
|
*/
|
|
|
|
$selectQueryBuilder = QueryBuilder::Select()
|
|
->RelativePath(relativePath: ".")
|
|
->From(target: "**");
|
|
|
|
$selectQuery = $selectQueryBuilder->Build();
|
|
|
|
$result = $selectQuery->RunQuery($db);
|
|
|
|
foreach($result->FlattenRows() as $row)
|
|
{
|
|
echo "$row\n";
|
|
}
|
|
|
|
|