generated from mirzaev/pot
completely moved from codepen
This commit is contained in:
parent
294cedf35a
commit
97c8c58ce0
|
@ -23,7 +23,7 @@
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.4",
|
"php": "^8.4",
|
||||||
"triagens/arangodb": "^3.8",
|
"triagens/arangodb": "^3.8",
|
||||||
"mirzaev/minimal": "^3.2.0",
|
"mirzaev/minimal": "^3.3.0",
|
||||||
"mirzaev/arangodb": "^1.3",
|
"mirzaev/arangodb": "^1.3",
|
||||||
"twig/twig": "^3.10",
|
"twig/twig": "^3.10",
|
||||||
"twig/extra-bundle": "^3.7",
|
"twig/extra-bundle": "^3.7",
|
||||||
|
|
|
@ -5,9 +5,10 @@ declare(strict_types=1);
|
||||||
namespace svoboda\works\controllers;
|
namespace svoboda\works\controllers;
|
||||||
|
|
||||||
// Files of the project
|
// Files of the project
|
||||||
use svoboda\works\views\manager,
|
use svoboda\works\views\templater,
|
||||||
svoboda\works\models\core as models,
|
svoboda\works\models\core as models,
|
||||||
svoboda\works\models\session;
|
svoboda\works\models\session,
|
||||||
|
svoboda\works\models\enumerations\language;
|
||||||
|
|
||||||
// Framework for PHP
|
// Framework for PHP
|
||||||
use mirzaev\minimal\core as minimal,
|
use mirzaev\minimal\core as minimal,
|
||||||
|
@ -71,18 +72,18 @@ class core extends controller
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param minimal $minimal Instance of the MINIMAL
|
* @param minimal $core Instance of the MINIMAL
|
||||||
* @param bool $initialize Initialize a controller?
|
* @param bool $initialize Initialize a controller?
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(minimal $minimal, bool $initialize = true)
|
public function __construct(minimal $core, bool $initialize = true)
|
||||||
{
|
{
|
||||||
// Blocking requests from CloudFlare (better to write this blocking into nginx config file)
|
// Blocking requests from CloudFlare (better to write this blocking into nginx config file)
|
||||||
if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label;
|
if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label;
|
||||||
|
|
||||||
// For the extends system
|
// For the extends system
|
||||||
parent::__construct(core: $minimal);
|
parent::__construct(core: $core);
|
||||||
|
|
||||||
if ($initialize) {
|
if ($initialize) {
|
||||||
// Requestet initializing
|
// Requestet initializing
|
||||||
|
@ -90,7 +91,7 @@ class core extends controller
|
||||||
// Initializing core of the models
|
// Initializing core of the models
|
||||||
new models();
|
new models();
|
||||||
|
|
||||||
// Initializing of the date until which the session will be active
|
/* // Initializing of the date until which the session will be active
|
||||||
$expires = strtotime('+1 week');
|
$expires = strtotime('+1 week');
|
||||||
|
|
||||||
// Initializing of default value of hash of the session
|
// Initializing of default value of hash of the session
|
||||||
|
@ -116,10 +117,11 @@ class core extends controller
|
||||||
'samesite' => 'strict'
|
'samesite' => 'strict'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
} */
|
||||||
|
|
||||||
// Initializing of preprocessor of views
|
// Initializing of preprocessor of views
|
||||||
$this->view = new templater($this->session);
|
/* $this->view = new templater($this->session); */
|
||||||
|
$this->view = new templater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ namespace svoboda\works\controllers;
|
||||||
use svoboda\works\controllers\core;
|
use svoboda\works\controllers\core;
|
||||||
|
|
||||||
// Framework for PHP
|
// Framework for PHP
|
||||||
use mirzaev\minimal\http\enumerations\status;
|
use mirzaev\minimal\http\enumerations\content,
|
||||||
|
mirzaev\minimal\http\enumerations\status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index
|
* Index
|
||||||
|
@ -44,7 +45,7 @@ final class index extends core
|
||||||
// Request for any response
|
// Request for any response
|
||||||
|
|
||||||
// Render page
|
// Render page
|
||||||
$page = $this->view->render('index.html');
|
$page = $this->view->render('/pages/statistics/total.html');
|
||||||
|
|
||||||
// Sending response
|
// Sending response
|
||||||
$this->response
|
$this->response
|
||||||
|
|
|
@ -8,15 +8,6 @@ namespace svoboda\works\models;
|
||||||
use mirzaev\minimal\model,
|
use mirzaev\minimal\model,
|
||||||
mirzaev\minimal\http\enumerations\status;
|
mirzaev\minimal\http\enumerations\status;
|
||||||
|
|
||||||
// Framework for ArangoDB
|
|
||||||
use mirzaev\arangodb\connection as arangodb,
|
|
||||||
mirzaev\arangodb\collection,
|
|
||||||
mirzaev\arangodb\document;
|
|
||||||
|
|
||||||
// Library for ArangoDB
|
|
||||||
use ArangoDBClient\Document as _document,
|
|
||||||
ArangoDBClient\DocumentHandler as _document_handler;
|
|
||||||
|
|
||||||
// Built-in libraries
|
// Built-in libraries
|
||||||
use exception;
|
use exception;
|
||||||
|
|
||||||
|
@ -29,27 +20,12 @@ use exception;
|
||||||
* @param arangodb $arangodb Instance of the ArangoDB session
|
* @param arangodb $arangodb Instance of the ArangoDB session
|
||||||
*
|
*
|
||||||
* @method void __construct(bool $initialize, ?arangodb $arangodb) Constructor
|
* @method void __construct(bool $initialize, ?arangodb $arangodb) Constructor
|
||||||
* @method _document|static|array|null read(string $filter, string $sort, int $amount, int $page, string $return, array $parameters, array &$errors) Read document from ArangoDB
|
|
||||||
*
|
*
|
||||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
||||||
* @author svoboda <mail@domain.zone>
|
* @author svoboda <mail@domain.zone>
|
||||||
*/
|
*/
|
||||||
class core extends model
|
class core extends model
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* ArangoDB connection daa
|
|
||||||
*
|
|
||||||
* @var string ARANGODB Path to the file with ArangoDB session connection data
|
|
||||||
*/
|
|
||||||
final public const string ARANGODB = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'settings' . DIRECTORY_SEPARATOR . 'arangodb.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ArangoDB
|
|
||||||
*
|
|
||||||
* @var arangodb $arangodb Instance of the ArangoDB session
|
|
||||||
*/
|
|
||||||
protected static arangodb $arangodb;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
@ -58,173 +34,10 @@ class core extends model
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(bool $initialize = true, ?arangodb $arangodb = null)
|
public function __construct(bool $initialize = true)
|
||||||
{
|
{
|
||||||
// For the extends system
|
// For the extends system
|
||||||
parent::__construct($initialize);
|
parent::__construct($initialize);
|
||||||
|
|
||||||
if ($initialize) {
|
|
||||||
// Initializing is requested
|
|
||||||
|
|
||||||
// Writing an instance of a session of ArangoDB to the property
|
|
||||||
self::$arangodb = $arangodb ?? new arangodb(require static::ARANGODB);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read document from ArangoDB
|
|
||||||
*
|
|
||||||
* @param string $filter Expression for filtering (AQL)
|
|
||||||
* @param string $sort Expression for sorting (AQL)
|
|
||||||
* @param int $amount Amount of documents for collect
|
|
||||||
* @param int $page Page
|
|
||||||
* @param string $return Expression describing the parameters to return (AQL)
|
|
||||||
* @param array $parameters Binded parameters for placeholders ['placeholder' => parameter]
|
|
||||||
* @param array &$errors Registry of errors
|
|
||||||
*
|
|
||||||
* @return mixed An array of instances of documents from ArangoDB, if they are found
|
|
||||||
*/
|
|
||||||
public static function _read(
|
|
||||||
string $filter = '',
|
|
||||||
string $sort = 'd.created DESC, d._key DESC',
|
|
||||||
int $amount = 1,
|
|
||||||
int $page = 1,
|
|
||||||
string $return = 'd',
|
|
||||||
array $parameters = [],
|
|
||||||
array &$errors = []
|
|
||||||
): _document|static|array|null {
|
|
||||||
try {
|
|
||||||
if (collection::initialize(static::COLLECTION, static::TYPE)) {
|
|
||||||
// Initialized the collection
|
|
||||||
|
|
||||||
// Read from ArangoDB
|
|
||||||
$result = collection::execute(
|
|
||||||
sprintf(
|
|
||||||
<<<'AQL'
|
|
||||||
FOR d IN @@collection
|
|
||||||
%s
|
|
||||||
%s
|
|
||||||
LIMIT @offset, @amount
|
|
||||||
RETURN %s
|
|
||||||
AQL,
|
|
||||||
empty($filter) ? '' : "FILTER $filter",
|
|
||||||
empty($sort) ? '' : "SORT $sort",
|
|
||||||
empty($return) ? 'd' : $return
|
|
||||||
),
|
|
||||||
[
|
|
||||||
'@collection' => static::COLLECTION,
|
|
||||||
'offset' => --$page <= 0 ? 0 : $page * $amount,
|
|
||||||
'amount' => $amount
|
|
||||||
] + $parameters,
|
|
||||||
errors: $errors
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($amount === 1 && $result instanceof _document) {
|
|
||||||
// Received only 1 document and @todo rebuild
|
|
||||||
|
|
||||||
// Initializing the object
|
|
||||||
$object = new static;
|
|
||||||
|
|
||||||
if (method_exists($object, '__document')) {
|
|
||||||
// Object can implement a document from ArangoDB
|
|
||||||
|
|
||||||
// Writing the instance of document from ArangoDB to the implement object
|
|
||||||
$object->__document($result);
|
|
||||||
|
|
||||||
// Exit (success)
|
|
||||||
return $object;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit (success)
|
|
||||||
return $result;
|
|
||||||
} else throw new exception('Failed to initialize ' . static::TYPE . ' collection: ' . static::COLLECTION);
|
|
||||||
} catch (exception $e) {
|
|
||||||
// Writing to registry of errors
|
|
||||||
$errors[] = [
|
|
||||||
'text' => $e->getMessage(),
|
|
||||||
'file' => $e->getFile(),
|
|
||||||
'line' => $e->getLine(),
|
|
||||||
'stack' => $e->getTrace()
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit (fail)
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
* @param mixed $value Value of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __set(string $name, mixed $value = null): void
|
|
||||||
{
|
|
||||||
match ($name) {
|
|
||||||
'arangodb' => (function () use ($value) {
|
|
||||||
if (isset(static::$arangodb)) throw new exception('Forbidden to reinitialize the ArangoDB session($this::$arangodb)', status::internal_server_error->value);
|
|
||||||
else if ($value instanceof arangodb) self::$arangodb = $value;
|
|
||||||
else throw new exception('Session of connection to ArangoDB ($this::$arangodb) is need to be mirzaev\arangodb\connection', status::internal_server_error->value);
|
|
||||||
})(),
|
|
||||||
default => parent::__set($name, $value)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return mixed Content of the property, if they are found
|
|
||||||
*/
|
|
||||||
public function __get(string $name): mixed
|
|
||||||
{
|
|
||||||
return match ($name) {
|
|
||||||
default => parent::__get($name)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __unset(string $name): void
|
|
||||||
{
|
|
||||||
// Deleting a property and exit (success)
|
|
||||||
parent::__unset($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check of initialization
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return bool The property is initialized?
|
|
||||||
*/
|
|
||||||
public function __isset(string $name): bool
|
|
||||||
{
|
|
||||||
// Check of initialization of the property and exit (success)
|
|
||||||
return parent::__isset($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Call a static property or method
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property or the method
|
|
||||||
* @param array $arguments Arguments for the method
|
|
||||||
*/
|
|
||||||
public static function __callStatic(string $name, array $arguments): mixed
|
|
||||||
{
|
|
||||||
return match ($name) {
|
|
||||||
'arangodb' => (new static)->__get('arangodb'),
|
|
||||||
default => throw new exception("Not found: $name", 500)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace svoboda\works\models\interfaces;
|
|
||||||
|
|
||||||
// Framework for ArangoDB
|
|
||||||
use mirzaev\arangodb\enumerations\collection\type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Collection
|
|
||||||
*
|
|
||||||
* Interface for implementing a collection from ArangoDB
|
|
||||||
*
|
|
||||||
* @package svoboda\works\models\interfaces
|
|
||||||
*
|
|
||||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
|
||||||
* @author svoboda <mail@domain.zone>
|
|
||||||
*/
|
|
||||||
interface collection
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Name of the collection in ArangoDB
|
|
||||||
*/
|
|
||||||
public const string COLLECTION = 'THIS_COLLECTION_SHOULD_NOT_EXIST';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type of the collection in ArangoDB
|
|
||||||
*/
|
|
||||||
public const type TYPE = type::document;
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace svoboda\works\models\interfaces;
|
|
||||||
|
|
||||||
// Library для ArangoDB
|
|
||||||
use ArangoDBClient\Document as _document;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Document
|
|
||||||
*
|
|
||||||
* Interface for implementing a document instance from ArangoDB
|
|
||||||
*
|
|
||||||
* @param _document $document An instance of the ArangoDB document from ArangoDB (protected readonly)
|
|
||||||
*
|
|
||||||
* @package svoboda\works\models\interfaces
|
|
||||||
*
|
|
||||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
|
||||||
* @author svoboda <mail@domain.zone>
|
|
||||||
*/
|
|
||||||
interface document
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Write
|
|
||||||
*
|
|
||||||
* Write a property into an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
* @param mixed $value Content of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __set(string $name, mixed $value = null): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read
|
|
||||||
*
|
|
||||||
* Read a property from an instance of the ArangoDB docuemnt
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return mixed Content of the property
|
|
||||||
*/
|
|
||||||
public function __get(string $name): mixed;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete
|
|
||||||
*
|
|
||||||
* Deinitialize the property in an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __unset(string $name): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check of initialization
|
|
||||||
*
|
|
||||||
* Check of initialization of the property into an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return bool The property is initialized?
|
|
||||||
*/
|
|
||||||
public function __isset(string $name): bool;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute a method
|
|
||||||
*
|
|
||||||
* Execute a method from an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the method
|
|
||||||
* @param array $arguments Arguments for the method
|
|
||||||
*
|
|
||||||
* @return mixed Result of execution of the method
|
|
||||||
*/
|
|
||||||
public function __call(string $name, array $arguments = []): mixed;
|
|
||||||
}
|
|
|
@ -1,206 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace svoboda\works\models\traits;
|
|
||||||
|
|
||||||
// Files of the project
|
|
||||||
use svoboda\works\models\interfaces\document as document_interface,
|
|
||||||
svoboda\works\models\interfaces\collection as collection_interface,
|
|
||||||
svoboda\works\models\connect;
|
|
||||||
|
|
||||||
// Library для ArangoDB
|
|
||||||
use ArangoDBClient\Document as _document;
|
|
||||||
|
|
||||||
// Framework for ArangoDB
|
|
||||||
use mirzaev\arangodb\connection as arangodb,
|
|
||||||
mirzaev\arangodb\document as framework_document,
|
|
||||||
mirzaev\arangodb\collection;
|
|
||||||
|
|
||||||
// Built-in libraries
|
|
||||||
use exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trait for implementing a document instance from ArangoDB
|
|
||||||
*
|
|
||||||
* @uses document_interface
|
|
||||||
*
|
|
||||||
* @var protected readonly _document|null $document An instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @package svoboda\works\models\traits
|
|
||||||
*
|
|
||||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
|
||||||
* @author svoboda <mail@domain.zone>
|
|
||||||
*/
|
|
||||||
trait document
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Document
|
|
||||||
*
|
|
||||||
* @var _document $document An instance of the document from ArangoDB
|
|
||||||
*/
|
|
||||||
protected readonly _document $document;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param bool $initialize Initialize a model?
|
|
||||||
* @param ?arangodb $arangodb Instance of a session of ArangoDB
|
|
||||||
* @param _document|null|false $document An instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(
|
|
||||||
bool $initialize = true,
|
|
||||||
?arangodb $arangodb = null,
|
|
||||||
_document|null|false $document = false
|
|
||||||
) {
|
|
||||||
// For the extends system
|
|
||||||
parent::__construct($initialize, $arangodb);
|
|
||||||
|
|
||||||
// Writing to the property
|
|
||||||
if ($document instanceof _document) $this->__document($document);
|
|
||||||
else if ($document === null) throw new exception('Failed to initialize an instance of the document from ArangoDB');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write or read document
|
|
||||||
*
|
|
||||||
* @param _document|null $document Instance of document from ArangoDB
|
|
||||||
*
|
|
||||||
* @return _document|null Instance of document from ArangoDB
|
|
||||||
*/
|
|
||||||
public function __document(?_document $document = null): ?_document
|
|
||||||
{
|
|
||||||
// Writing a property storing a document instance to ArangoDB
|
|
||||||
if ($document) $this->document ??= $document;
|
|
||||||
|
|
||||||
// Read a property storing a document instance to ArangoDB and exit (success)
|
|
||||||
return $this->document ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Connect
|
|
||||||
*
|
|
||||||
* @param collecton_interface $document Document
|
|
||||||
* @param array &$errors Registry of errors
|
|
||||||
*
|
|
||||||
* @return string|null The identifier of the created edge of the "connect" collection, if created
|
|
||||||
*/
|
|
||||||
public function connect(collection_interface $document, array &$errors = []): ?string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (collection::initialize(static::COLLECTION, static::TYPE, errors: $errors)) {
|
|
||||||
if (collection::initialize(connect::COLLECTION, connect::TYPE, errors: $errors)) {
|
|
||||||
if (collection::initialize($document::COLLECTION, $document::TYPE, errors: $errors)) {
|
|
||||||
// Initialized collections
|
|
||||||
|
|
||||||
if ($this->document instanceof _document) {
|
|
||||||
// Initialized instance of the document from ArangoDB
|
|
||||||
|
|
||||||
// Writing document and exit (success)
|
|
||||||
return framework_document::write(
|
|
||||||
connect::COLLECTION,
|
|
||||||
[
|
|
||||||
'_from' => $document->getId(),
|
|
||||||
'_to' => $this->document->getId()
|
|
||||||
],
|
|
||||||
errors: $errors
|
|
||||||
);
|
|
||||||
} else throw new exception('The instance of the document from ArangoDB is not initialized');
|
|
||||||
} else throw new exception('Failed to initialize ' . $document::TYPE . ' collection: ' . $document::COLLECTION);
|
|
||||||
} else throw new exception('Failed to initialize ' . connect::TYPE . ' collection: ' . connect::COLLECTION);
|
|
||||||
} else throw new exception('Failed to initialize ' . static::TYPE . ' collection: ' . static::COLLECTION);
|
|
||||||
} catch (exception $e) {
|
|
||||||
// Writing to the registry of errors
|
|
||||||
$errors[] = [
|
|
||||||
'text' => $e->getMessage(),
|
|
||||||
'file' => $e->getFile(),
|
|
||||||
'line' => $e->getLine(),
|
|
||||||
'stack' => $e->getTrace()
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit (fail)
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write
|
|
||||||
*
|
|
||||||
* Write a property into an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
* @param mixed $value Content of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __set(string $name, mixed $value = null): void
|
|
||||||
{
|
|
||||||
// Writing to the property into an instance of the ArangoDB document and exit (success)
|
|
||||||
$this->document->{$name} = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read
|
|
||||||
*
|
|
||||||
* Read a property from an instance of the ArangoDB docuemnt
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return mixed Content of the property
|
|
||||||
*/
|
|
||||||
public function __get(string $name): mixed
|
|
||||||
{
|
|
||||||
// Read a property from an instance of the ArangoDB document and exit (success)
|
|
||||||
return match ($name) {
|
|
||||||
default => $this->document->{$name}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete
|
|
||||||
*
|
|
||||||
* Deinitialize the property in an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __unset(string $name): void
|
|
||||||
{
|
|
||||||
// Delete the property in an instance of the ArangoDB document and exit (success)
|
|
||||||
unset($this->document->{$name});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check of initialization
|
|
||||||
*
|
|
||||||
* Check of initialization of the property into an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the property
|
|
||||||
*
|
|
||||||
* @return bool The property is initialized?
|
|
||||||
*/
|
|
||||||
public function __isset(string $name): bool
|
|
||||||
{
|
|
||||||
// Check of initializatio nof the property and exit (success)
|
|
||||||
return isset($this->document->{$name});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute a method
|
|
||||||
*
|
|
||||||
* Execute a method from an instance of the ArangoDB document
|
|
||||||
*
|
|
||||||
* @param string $name Name of the method
|
|
||||||
* @param array $arguments Arguments for the method
|
|
||||||
*
|
|
||||||
* @return mixed Result of execution of the method
|
|
||||||
*/
|
|
||||||
public function __call(string $name, array $arguments = []): mixed
|
|
||||||
{
|
|
||||||
// Execute the method and exit (success)
|
|
||||||
return method_exists($this->document, $name) ? $this->document->{$name}($arguments) ?? null : null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: 'DejaVu';
|
||||||
|
src: url("/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf");
|
||||||
|
font-weight: 200;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'DejaVu';
|
||||||
|
src: url("/fonts/dejavu/DejaVuLGCSans.ttf");
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'DejaVu';
|
||||||
|
src: url("/fonts/dejavu/DejaVuLGCSans-Oblique.ttf");
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'DejaVu';
|
||||||
|
src: url("/fonts/dejavu/DejaVuLGCSans-Bold.ttf");
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'DejaVu';
|
||||||
|
src: url("/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf");
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
|
@ -0,0 +1,139 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Hair.woff2') format('woff2'), url('/fonts/fira/FiraSans-Hair.woff') format('woff');
|
||||||
|
font-weight: 100;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-HairItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-HairItalic.woff') format('woff');
|
||||||
|
font-weight: 100;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-UltraLight.woff2') format('woff2'), url('/fonts/fira/FiraSans-UltraLight.woff') format('woff');
|
||||||
|
font-weight: 200;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-UltraLightItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-UltraLightItalic.woff') format('woff');
|
||||||
|
font-weight: 200;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Light.woff2') format('woff2'), url('/fonts/fira/FiraSans-Light.woff') format('woff');
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-LightItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-LightItalic.woff') format('woff');
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Regular.woff2') format('woff2'), url('/fonts/fira/FiraSans-Regular.woff') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Italic.woff2') format('woff2'), url('/fonts/fira/FiraSans-Italic.woff') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraMono-Medium.woff2') format('woff2'), url('/fonts/fira/FiraMono-Medium.woff') format('woff');
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-MediumItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-MediumItalic.woff') format('woff');
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-SemiBold.woff2') format('woff2'), url('/fonts/fira/FiraSans-SemiBold.woff') format('woff');
|
||||||
|
font-weight: 600;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-SemiBoldItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-SemiBoldItalic.woff') format('woff');
|
||||||
|
font-weight: 600;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Bold.woff2') format('woff2'), url('/fonts/fira/FiraSans-Bold.woff') format('woff');
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-BoldItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-BoldItalic.woff') format('woff');
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-ExtraBold.woff2') format('woff2'), url('/fonts/fira/FiraSans-ExtraBold.woff') format('woff');
|
||||||
|
font-weight: 800;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-ExtraBoldItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-ExtraBoldItalic.woff') format('woff');
|
||||||
|
font-weight: 800;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-Heavy.woff2') format('woff2'), url('/fonts/fira/FiraSans-Heavy.woff') format('woff');
|
||||||
|
font-weight: 900;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira';
|
||||||
|
src: url('/fonts/fira/FiraSans-HeavyItalic.woff2') format('woff2'), url('/fonts/fira/FiraSans-HeavyItalic.woff') format('woff');
|
||||||
|
font-weight: 900;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira' Mono;
|
||||||
|
src: url('/fonts/fira/FiraMono-Regular.woff2') format('woff2'), url('/fonts/fira/FiraMono-Regular.woff') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira' Mono;
|
||||||
|
src: url('/fonts/fira/FiraMono-Bold.woff2') format('woff2'), url('/fonts/fira/FiraMono-Bold.woff') format('woff');
|
||||||
|
font-weight: 600;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Hack';
|
||||||
|
src: url('/fonts/hack/hack-regular.woff2?sha=3114f1256') format('woff2'), url('/fonts/hack/hack-regular.woff?sha=3114f1256') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Hack';
|
||||||
|
src: url('/fonts/hack/hack-bold.woff2?sha=3114f1256') format('woff2'), url('/fonts/hack/hack-bold.woff?sha=3114f1256') format('woff');
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Hack';
|
||||||
|
src: url('/fonts/hack/hack-italic.woff2?sha=3114f1256') format('woff2'), url('/fonts/hack/hack-italic.woff?sha=3114f1256') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: italic;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Hack';
|
||||||
|
src: url('/fonts/hack/hack-bolditalic.woff2?sha=3114f1256') format('woff2'), url('/fonts/hack/hack-bolditalic.woff?sha=3114f1256') format('woff');
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: italic;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue