diff --git a/author/project/system/controllers/core.php b/author/project/system/controllers/core.php deleted file mode 100755 index b06ad61..0000000 --- a/author/project/system/controllers/core.php +++ /dev/null @@ -1,126 +0,0 @@ - - */ -class core extends controller -{ - /** - * Session - * - * @var session|null $session Instance of the session - */ - protected readonly session $session; - - /** - * Language - * - * @var language $language Language - */ - protected language $language = language::en; - - /** - * Response - * - * @see https://wiki.php.net/rfc/property-hooks (find a table about backed and virtual hooks) - * - * @var response $response Response - */ - protected response $response { - // Read - get => $this->response ??= $this->request->response(); - } - - /** - * Errors - * - * @var array $errors Registry of errors - */ - protected array $errors = [ - 'session' => [], - 'account' => [] - ]; - - /** - * Constructor - * - * @param minimal $core Instance of the MINIMAL - * @param bool $initialize Initialize a controller? - * - * @return void - */ - public function __construct(minimal $core, bool $initialize = true) - { - // 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; - - // For the extends system - parent::__construct(core: $core); - - if ($initialize) { - // Requestet initializing - - // Initializing core of the models - new models(); - - // Initializing of the date until which the session will be active - $expires = strtotime('+1 week'); - - // Initializing of default value of hash of the session - $_COOKIE["session"] ??= null; - - // Initializing of session - $this->session = new session($_COOKIE["session"], $expires, $this->errors['session']); - - // Handle a problems with initializing a session - if (!empty($this->errors['session'])) die; - else if ($_COOKIE["session"] !== $this->session->hash) { - // Hash of the session is changed (implies that the session has expired and recreated) - - // Write a new hash of the session to cookies - setcookie( - 'session', - $this->session->hash, - [ - 'expires' => $expires, - 'path' => '/', - 'secure' => true, - 'httponly' => true, - 'samesite' => 'strict' - ] - ); - } - - // Initializing of preprocessor of views - $this->view = new templater($this->session); - } - } -} diff --git a/author/project/system/controllers/index.php b/author/project/system/controllers/index.php deleted file mode 100755 index 9be9e3d..0000000 --- a/author/project/system/controllers/index.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ -final class index extends core -{ - /** - * Errors - * - * @var array $errors Registry of errors - */ - protected array $errors = [ - 'session' => [] - ]; - - /** - * Main page - * - * @return null - */ - public function index(): null - { - if (str_contains($this->request->headers['accept'], content::any->value)) { - // Request for any response - - // Render page - $page = $this->view->render('index.html'); - - // Sending response - $this->response - ->start() - ->clean() - ->sse() - ->write($page) - ->validate($this->request) - ?->body() - ->end(); - - // Deinitializing rendered page - unset($page); - - // Exit (success) - return null; - } - - // Exit (fail) - return null; - } -} diff --git a/author/project/system/models/core.php b/author/project/system/models/core.php deleted file mode 100755 index 93ec1c7..0000000 --- a/author/project/system/models/core.php +++ /dev/null @@ -1,230 +0,0 @@ - - */ -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 - * - * @param bool $initialize Initialize a model? - * @param ?arangodb $arangodb Instance of the ArangoDB session - * - * @return void - */ - public function __construct(bool $initialize = true, ?arangodb $arangodb = null) - { - // For the extends system - 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) - }; - } -} - diff --git a/author/project/system/models/enumerations/language.php b/author/project/system/models/enumerations/language.php deleted file mode 100755 index 528e592..0000000 --- a/author/project/system/models/enumerations/language.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @author mirzaev - */ -enum language -{ - case en; - case ru; - - /** - * Label - * - * Initialize label of the language - * - * @param language|null $language Language into which to translate - * - * @return string Translated label of the language - * - * @todo - * 1. More languages - * 2. Cases??? - */ - public function label(?language $language = language::en): string - { - // Exit (success) - return match ($this) { - language::en => match ($language) { - language::en => 'English', - language::ru => 'Английский' - }, - language::ru => match ($language) { - language::en => 'Russian', - language::ru => 'Русский' - } - }; - } -} diff --git a/author/project/system/models/enumerations/session.php b/author/project/system/models/enumerations/session.php deleted file mode 100755 index 2d023ae..0000000 --- a/author/project/system/models/enumerations/session.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -enum session -{ - case hash_only; - case hash_else_address; -} diff --git a/author/project/system/models/interfaces/collection.php b/author/project/system/models/interfaces/collection.php deleted file mode 100755 index 2d2169f..0000000 --- a/author/project/system/models/interfaces/collection.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -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; -} diff --git a/author/project/system/models/interfaces/document.php b/author/project/system/models/interfaces/document.php deleted file mode 100755 index 7fe7925..0000000 --- a/author/project/system/models/interfaces/document.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ -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; -} diff --git a/author/project/system/models/session.php b/author/project/system/models/session.php deleted file mode 100755 index 48737ed..0000000 --- a/author/project/system/models/session.php +++ /dev/null @@ -1,233 +0,0 @@ - - */ -final class session extends core implements document_interface, collection_interface -{ - use status, document_trait, buffer, cart { - buffer::write as write; - cart::initialize as cart; - } - - /** - * Collection name - * - * @var string COLLECTION Name of the collection in ArangoDB - */ - final public const string COLLECTION = 'session'; - - /** - * Session verification type - * - * @var verification VERIFICATION Type of session verification - */ - final public const verification VERIFICATION = verification::hash_else_address; - - /** - * Constructor - * - * Initialize session and write into the $this->document property - * - * @param ?string $hash Hash of the session in ArangoDB - * @param ?int $expires Date of expiring of the session (used for creating a new session) - * @param array &$errors Registry of errors - * - * @return void - */ - public function __construct(?string $hash = null, ?int $expires = null, array &$errors = []) - { - try { - if (collection::initialize(static::COLLECTION, static::TYPE, errors: $errors)) { - // Initialized the collection - - if (isset($hash) && $document = $this->hash($hash, errors: $errors)) { - // Found the instance of the ArangoDB document of session and received a session hash - - // Writing document instance of the session from ArangoDB to the property of the implementing object - $this->__document($document); - } else if (static::VERIFICATION === verification::hash_else_address && $document = $this->address($_SERVER['REMOTE_ADDR'], errors: $errors)) { - // Found the instance of the ArangoDB document of session and received a session hash - - // Writing document instance of the session from ArangoDB to the property of the implementing object - $this->__document($document); - } else { - // Not found the instance of the ArangoDB document of session - - // Initializing a new session and write they into ArangoDB - $_id = document::write( - static::COLLECTION, - [ - 'active' => true, - 'expires' => $expires ?? time() + 604800, - 'address' => $_SERVER['REMOTE_ADDR'], - 'x-forwarded-for' => $_SERVER['HTTP_X_FORWARDED_FOR'] ?? null, - 'referer' => $_SERVER['HTTP_REFERER'] ?? null, - 'useragent' => $_SERVER['HTTP_USER_AGENT'] ?? null - ] - ); - - if ($session = collection::execute( - <<<'AQL' - FOR d IN @@collection - FILTER d._id == @_id && d.expires > @time && d.active == true - RETURN d - AQL, - [ - '@collection' => static::COLLECTION, - '_id' => $_id, - 'time' => time() - ], - errors: $errors - )) { - // Found the instance of just created new session - - // Generating a hash and write into the instance of the ArangoDB document of session property - $session->hash = sodium_bin2hex(sodium_crypto_generichash($_id)); - - if (document::update($session, errors: $errors)) { - // Writed to ArangoDB - - // Writing instance of the session document from ArangoDB to the property of the implementing object - $this->__document($session); - } else throw new exception('Failed to write the session data'); - } else throw new exception('Failed to create or find just created session'); - } - } 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() - ]; - } - } - - /** - * Search by hash - * - * Search for the session in ArangoDB by hash - * - * @param string $hash Hash of the session in ArangoDB - * @param array &$errors Registry of errors - * - * @return _document|null instance of document of the session in ArangoDB - */ - public static function hash(string $hash, array &$errors = []): ?_document - { - try { - if (collection::initialize(static::COLLECTION, static::TYPE, errors: $errors)) { - // Collection initialized - - // Search the session data in ArangoDB - return collection::execute( - <<<'AQL' - FOR d IN @@collection - FILTER d.hash == @hash && d.expires > @time && d.active == true - RETURN d - AQL, - [ - '@collection' => static::COLLECTION, - 'hash' => $hash, - 'time' => time() - ], - errors: $errors - ); - } 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; - } - - /** - * Search by IP-address - * - * Search for the session in ArangoDB by IP-address - * - * @param string $address IP-address writed to the session in ArangoDB - * @param array &$errors Registry of errors - * - * @return _document|null instance of document of the session in ArangoDB - */ - public static function address(string $address, array &$errors = []): ?_document - { - try { - if (collection::initialize(static::COLLECTION, static::TYPE, errors: $errors)) { - // Collection initialized - - // Search the session data in ArangoDB - return collection::execute( - <<<'AQL' - FOR d IN @@collection - FILTER d.address == @address && d.expires > @time && d.active == true - SORT d.updated DESC - LIMIT 1 - RETURN d - AQL, - [ - '@collection' => static::COLLECTION, - 'address' => $address, - 'time' => time() - ], - errors: $errors - ); - } 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; - }} diff --git a/author/project/system/models/traits/buffer.php b/author/project/system/models/traits/buffer.php deleted file mode 100755 index a3fc694..0000000 --- a/author/project/system/models/traits/buffer.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -trait buffer -{ - /** - * Write to buffer of the document - * - * @param array $data Data for writing (merge) - * @param array &$errors Registry of errors - * - * @return bool Is data has written into the document from ArangoDB? - */ - public function write(array $data, array &$errors = []): bool - { - try { - if (collection::initialize(static::COLLECTION, static::TYPE, errors: $errors)) { - // Initialized the collection - - // Is the instance of the document from ArangoDB are initialized? - if (!isset($this->document)) throw new exception('The instance of the sessoin document from ArangoDB is not initialized'); - - // Writing data into buffer of the instance of the document from ArangoDB - $this->document->buffer = array_replace_recursive($this->document->buffer ?? [], $data); - - // Is the buffer of the instance of the document from ArangoDB exceed 10 megabytes? - if (mb_strlen(json_encode($this->document->buffer)) > 10485760) throw new exception('The buffer size exceeds 10 megabytes'); - - // Serializing parameters - if ($this->document->language instanceof language) $this->document->language = $this->document->language->name; - - // Writing to ArangoDB and exit (success) - return document::update($this->document, errors: $errors); - } 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 false; - } -} diff --git a/author/project/system/models/traits/document.php b/author/project/system/models/traits/document.php deleted file mode 100755 index 8c61149..0000000 --- a/author/project/system/models/traits/document.php +++ /dev/null @@ -1,206 +0,0 @@ - - */ -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; - } -} diff --git a/author/project/system/models/traits/files.php b/author/project/system/models/traits/files.php deleted file mode 100755 index 07ea485..0000000 --- a/author/project/system/models/traits/files.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -trait files -{ - /** - * Delete - * - * Delete files recursively - * - * @param string $directory Directory - * @param array &$errors Registry of errors - * - * @return void - */ - private static function delete(string $directory, array &$errors = []): void - { - try { - if (file_exists($directory)) { - // Directory exists - - // Deleting descendant files and directories (enter to the recursion) - foreach (scandir($directory) as $file) { - if ($file === '.' || $file === '..') continue; - else if (is_dir("$directory/$file")) static::delete("$directory/$file", $errors); - else unlink("$directory/$file"); - } - - // Deleting the directory - rmdir($directory); - - // Exit (success) - return; - } else throw new exception('Directory does not exist'); - } 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; - } -} diff --git a/author/project/system/models/traits/status.php b/author/project/system/models/traits/status.php deleted file mode 100755 index 28e3cae..0000000 --- a/author/project/system/models/traits/status.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -trait status -{ - /** - * Status - * - * Check document by its status - * - * @param array &$errors Registry of errors - * - * @return ?bool Status, if found - */ - public function status(array &$errors = []): ?bool - { - try { - // Read from ArangoDB and exit (success) - return $this->document->active ?? false; - } 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; - } -} - diff --git a/author/project/system/public/css/fonts/dejavu.css b/author/project/system/public/css/fonts/dejavu.css deleted file mode 100755 index 5012ff4..0000000 --- a/author/project/system/public/css/fonts/dejavu.css +++ /dev/null @@ -1,34 +0,0 @@ -@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; -} diff --git a/author/project/system/public/css/fonts/fira.css b/author/project/system/public/css/fonts/fira.css deleted file mode 100755 index 074cfc0..0000000 --- a/author/project/system/public/css/fonts/fira.css +++ /dev/null @@ -1,139 +0,0 @@ -@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; -} diff --git a/author/project/system/public/css/fonts/hack.css b/author/project/system/public/css/fonts/hack.css deleted file mode 100755 index ea1ca63..0000000 --- a/author/project/system/public/css/fonts/hack.css +++ /dev/null @@ -1,31 +0,0 @@ -@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; -} diff --git a/author/project/system/public/fonts/commissioner.ttf b/author/project/system/public/fonts/commissioner.ttf deleted file mode 100755 index 5072c39..0000000 Binary files a/author/project/system/public/fonts/commissioner.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf deleted file mode 100755 index 78584c4..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf deleted file mode 100755 index a013892..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf deleted file mode 100755 index 60dd47e..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf deleted file mode 100755 index 37e6daf..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSans.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSans.ttf deleted file mode 100755 index 6060dfb..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSans.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf deleted file mode 100755 index 68908d7..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf deleted file mode 100755 index 1a2d58d..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf deleted file mode 100755 index 6d25e67..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf deleted file mode 100755 index 95aaba6..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf deleted file mode 100755 index c2465b3..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf deleted file mode 100755 index 303202f..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf deleted file mode 100755 index 1df5133..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf deleted file mode 100755 index 3206a82..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf deleted file mode 100755 index 2be31a1..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf deleted file mode 100755 index 2c6daba..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf deleted file mode 100755 index c52d49f..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerif.ttf deleted file mode 100755 index 046c102..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerif.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf deleted file mode 100755 index fc164c7..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf deleted file mode 100755 index f01089d..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf deleted file mode 100755 index 6254c8b..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf b/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf deleted file mode 100755 index 6e42557..0000000 Binary files a/author/project/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Bold.woff b/author/project/system/public/fonts/fira/FiraMono-Bold.woff deleted file mode 100755 index e7da594..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Bold.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Bold.woff2 b/author/project/system/public/fonts/fira/FiraMono-Bold.woff2 deleted file mode 100755 index 7a3a102..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Bold.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Medium.woff b/author/project/system/public/fonts/fira/FiraMono-Medium.woff deleted file mode 100755 index f08fde9..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Medium.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Medium.woff2 b/author/project/system/public/fonts/fira/FiraMono-Medium.woff2 deleted file mode 100755 index 3c9553d..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Medium.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Regular.woff b/author/project/system/public/fonts/fira/FiraMono-Regular.woff deleted file mode 100755 index 64e33d3..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Regular.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraMono-Regular.woff2 b/author/project/system/public/fonts/fira/FiraMono-Regular.woff2 deleted file mode 100755 index bb452d4..0000000 Binary files a/author/project/system/public/fonts/fira/FiraMono-Regular.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Bold.woff b/author/project/system/public/fonts/fira/FiraSans-Bold.woff deleted file mode 100755 index 8001b79..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Bold.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Bold.woff2 b/author/project/system/public/fonts/fira/FiraSans-Bold.woff2 deleted file mode 100755 index ce8013e..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Bold.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff b/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff deleted file mode 100755 index 9c1da3a..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff2 deleted file mode 100755 index cf90d9a..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-BoldItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Book.woff b/author/project/system/public/fonts/fira/FiraSans-Book.woff deleted file mode 100755 index 299c884..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Book.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Book.woff2 b/author/project/system/public/fonts/fira/FiraSans-Book.woff2 deleted file mode 100755 index 6f9e54d..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Book.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff b/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff deleted file mode 100755 index cc29ba7..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff2 deleted file mode 100755 index 1275913..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-BookItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Eight.woff b/author/project/system/public/fonts/fira/FiraSans-Eight.woff deleted file mode 100755 index 9261a69..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Eight.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Eight.woff2 b/author/project/system/public/fonts/fira/FiraSans-Eight.woff2 deleted file mode 100755 index 729ba54..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Eight.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff b/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff deleted file mode 100755 index 000003c..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff2 deleted file mode 100755 index e651af6..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-EightItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff b/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff deleted file mode 100755 index 8289f9f..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff2 b/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff2 deleted file mode 100755 index a14dbce..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraBold.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff b/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff deleted file mode 100755 index 5dfa8da..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 deleted file mode 100755 index 828a57d..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff b/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff deleted file mode 100755 index 16ec788..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff2 b/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff2 deleted file mode 100755 index 8e98c42..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraLight.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff b/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff deleted file mode 100755 index 99ce8e5..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 deleted file mode 100755 index 2ea8212..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Four.woff b/author/project/system/public/fonts/fira/FiraSans-Four.woff deleted file mode 100755 index 518fd5f..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Four.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Four.woff2 b/author/project/system/public/fonts/fira/FiraSans-Four.woff2 deleted file mode 100755 index 33473a6..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Four.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff b/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff deleted file mode 100755 index b407c43..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff2 deleted file mode 100755 index 0e64a9c..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-FourItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Hair.woff b/author/project/system/public/fonts/fira/FiraSans-Hair.woff deleted file mode 100755 index ce65bcc..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Hair.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Hair.woff2 b/author/project/system/public/fonts/fira/FiraSans-Hair.woff2 deleted file mode 100755 index 64cef84..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Hair.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff b/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff deleted file mode 100755 index 08abd3a..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff2 deleted file mode 100755 index b063e87..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-HairItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Heavy.woff b/author/project/system/public/fonts/fira/FiraSans-Heavy.woff deleted file mode 100755 index ff18652..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Heavy.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Heavy.woff2 b/author/project/system/public/fonts/fira/FiraSans-Heavy.woff2 deleted file mode 100755 index 0cafdba..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Heavy.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff b/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff deleted file mode 100755 index 77c1d55..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 deleted file mode 100755 index 8d48a7f..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Italic.woff b/author/project/system/public/fonts/fira/FiraSans-Italic.woff deleted file mode 100755 index d200976..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Italic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Italic.woff2 b/author/project/system/public/fonts/fira/FiraSans-Italic.woff2 deleted file mode 100755 index f7857e9..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Italic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Light.woff b/author/project/system/public/fonts/fira/FiraSans-Light.woff deleted file mode 100755 index 309ecf2..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Light.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Light.woff2 b/author/project/system/public/fonts/fira/FiraSans-Light.woff2 deleted file mode 100755 index 24e6444..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Light.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff b/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff deleted file mode 100755 index 9f3c250..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff2 deleted file mode 100755 index f456ca5..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-LightItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Medium.woff b/author/project/system/public/fonts/fira/FiraSans-Medium.woff deleted file mode 100755 index 1701b41..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Medium.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Medium.woff2 b/author/project/system/public/fonts/fira/FiraSans-Medium.woff2 deleted file mode 100755 index 71d8ed5..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Medium.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff b/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff deleted file mode 100755 index 029099b..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff2 deleted file mode 100755 index 97b96c6..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-MediumItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Regular.woff b/author/project/system/public/fonts/fira/FiraSans-Regular.woff deleted file mode 100755 index 10c41a7..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Regular.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Regular.woff2 b/author/project/system/public/fonts/fira/FiraSans-Regular.woff2 deleted file mode 100755 index f77c427..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Regular.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff b/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff deleted file mode 100755 index 3ccdeb4..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff2 b/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff2 deleted file mode 100755 index 29ef538..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-SemiBold.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff b/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff deleted file mode 100755 index 378fde9..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 deleted file mode 100755 index 91182a7..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Thin.woff b/author/project/system/public/fonts/fira/FiraSans-Thin.woff deleted file mode 100755 index 21e509d..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Thin.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Thin.woff2 b/author/project/system/public/fonts/fira/FiraSans-Thin.woff2 deleted file mode 100755 index c494caa..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Thin.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff b/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff deleted file mode 100755 index a75b761..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff2 deleted file mode 100755 index 4f432d6..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-ThinItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Two.woff b/author/project/system/public/fonts/fira/FiraSans-Two.woff deleted file mode 100755 index 3b77a84..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Two.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Two.woff2 b/author/project/system/public/fonts/fira/FiraSans-Two.woff2 deleted file mode 100755 index 6842f0c..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Two.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff b/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff deleted file mode 100755 index c2a549d..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff2 deleted file mode 100755 index 6b176c7..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-TwoItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Ultra.woff b/author/project/system/public/fonts/fira/FiraSans-Ultra.woff deleted file mode 100755 index 705346e..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Ultra.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-Ultra.woff2 b/author/project/system/public/fonts/fira/FiraSans-Ultra.woff2 deleted file mode 100755 index 25e5e6a..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-Ultra.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff b/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff deleted file mode 100755 index 1790a76..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff2 deleted file mode 100755 index 7b9b43b..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff b/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff deleted file mode 100755 index cbc1f31..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff2 b/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff2 deleted file mode 100755 index 82046b1..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraLight.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff b/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff deleted file mode 100755 index 5f0ef24..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 b/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 deleted file mode 100755 index a50a5df..0000000 Binary files a/author/project/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bold-subset.woff b/author/project/system/public/fonts/hack/hack-bold-subset.woff deleted file mode 100755 index 99e9e7b..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bold-subset.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bold-subset.woff2 b/author/project/system/public/fonts/hack/hack-bold-subset.woff2 deleted file mode 100755 index ae3694f..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bold-subset.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bold.woff b/author/project/system/public/fonts/hack/hack-bold.woff deleted file mode 100755 index 7a64513..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bold.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bold.woff2 b/author/project/system/public/fonts/hack/hack-bold.woff2 deleted file mode 100755 index a25b27d..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bold.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff b/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff deleted file mode 100755 index 91399f9..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff2 b/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff2 deleted file mode 100755 index 55d67b8..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bolditalic-subset.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bolditalic.woff b/author/project/system/public/fonts/hack/hack-bolditalic.woff deleted file mode 100755 index 993d05a..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bolditalic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-bolditalic.woff2 b/author/project/system/public/fonts/hack/hack-bolditalic.woff2 deleted file mode 100755 index 5415871..0000000 Binary files a/author/project/system/public/fonts/hack/hack-bolditalic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-italic-subset.woff b/author/project/system/public/fonts/hack/hack-italic-subset.woff deleted file mode 100755 index 4d747c7..0000000 Binary files a/author/project/system/public/fonts/hack/hack-italic-subset.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-italic-subset.woff2 b/author/project/system/public/fonts/hack/hack-italic-subset.woff2 deleted file mode 100755 index bbb6240..0000000 Binary files a/author/project/system/public/fonts/hack/hack-italic-subset.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-italic.woff b/author/project/system/public/fonts/hack/hack-italic.woff deleted file mode 100755 index b79f9e4..0000000 Binary files a/author/project/system/public/fonts/hack/hack-italic.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-italic.woff2 b/author/project/system/public/fonts/hack/hack-italic.woff2 deleted file mode 100755 index 40522cc..0000000 Binary files a/author/project/system/public/fonts/hack/hack-italic.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-regular-subset.woff b/author/project/system/public/fonts/hack/hack-regular-subset.woff deleted file mode 100755 index 65a07e4..0000000 Binary files a/author/project/system/public/fonts/hack/hack-regular-subset.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-regular-subset.woff2 b/author/project/system/public/fonts/hack/hack-regular-subset.woff2 deleted file mode 100755 index ae9eca7..0000000 Binary files a/author/project/system/public/fonts/hack/hack-regular-subset.woff2 and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-regular.woff b/author/project/system/public/fonts/hack/hack-regular.woff deleted file mode 100755 index 07d1b32..0000000 Binary files a/author/project/system/public/fonts/hack/hack-regular.woff and /dev/null differ diff --git a/author/project/system/public/fonts/hack/hack-regular.woff2 b/author/project/system/public/fonts/hack/hack-regular.woff2 deleted file mode 100755 index cc862c7..0000000 Binary files a/author/project/system/public/fonts/hack/hack-regular.woff2 and /dev/null differ diff --git a/author/project/system/public/index.php b/author/project/system/public/index.php deleted file mode 100755 index 24c60a7..0000000 --- a/author/project/system/public/index.php +++ /dev/null @@ -1,46 +0,0 @@ -router - ->write('/', new route('index', 'index'), 'GET') -; - -// Handling request -$core->start(); diff --git a/author/project/system/public/themes/default/css/aside.css b/author/project/system/public/themes/default/css/aside.css deleted file mode 100644 index faf9c91..0000000 --- a/author/project/system/public/themes/default/css/aside.css +++ /dev/null @@ -1,4 +0,0 @@ -@charset "UTF-8"; - -aside { -} diff --git a/author/project/system/public/themes/default/css/colors.css b/author/project/system/public/themes/default/css/colors.css deleted file mode 100644 index 9eaf50b..0000000 --- a/author/project/system/public/themes/default/css/colors.css +++ /dev/null @@ -1,37 +0,0 @@ -@charset "UTF-8"; - -@media (prefers-color-scheme: dark) { - :root { - --text-color: initial; - --text-color-hover: initial; - --text-color-active: initial; - --text-notice-color: initial; - --text-warning-color: initial; - --text-selected-color: initial; - --text-selected-background-color: initial; - - --link-color: initial; - --link-color-hover: initial; - --link-color-active: initial; - - color: var(--text-color); - } -} - -@media (prefers-color-scheme: light) { - :root { - --text-color: initial; - --text-color-hover: initial; - --text-color-active: initial; - --text-notice-color: initial; - --text-warning-color: initial; - --text-selected-color: initial; - --text-selected-background-color: initial; - - --link-color: initial; - --link-color-hover: initial; - --link-color-active: initial; - - color: var(--text-color); - } -} diff --git a/author/project/system/public/themes/default/css/fonts.css b/author/project/system/public/themes/default/css/fonts.css deleted file mode 100755 index 84f16b4..0000000 --- a/author/project/system/public/themes/default/css/fonts.css +++ /dev/null @@ -1,9 +0,0 @@ -@import url('/css/fonts/fira.css'); -@import url('/css/fonts/hack.css'); -@import url('/css/fonts/dejavu.css'); - -@font-face { - font-family: 'Commissioner'; - src: url('/fonts/commissioner.ttf'); - font-weight: 400; -} diff --git a/author/project/system/public/themes/default/css/footer.css b/author/project/system/public/themes/default/css/footer.css deleted file mode 100644 index 605243b..0000000 --- a/author/project/system/public/themes/default/css/footer.css +++ /dev/null @@ -1,4 +0,0 @@ -@charset "UTF-8"; - -footer { -} \ No newline at end of file diff --git a/author/project/system/public/themes/default/css/header.css b/author/project/system/public/themes/default/css/header.css deleted file mode 100644 index b440dd5..0000000 --- a/author/project/system/public/themes/default/css/header.css +++ /dev/null @@ -1,4 +0,0 @@ -@charset "UTF-8"; - -header { -} diff --git a/author/project/system/public/themes/default/css/main.css b/author/project/system/public/themes/default/css/main.css deleted file mode 100755 index ac799a9..0000000 --- a/author/project/system/public/themes/default/css/main.css +++ /dev/null @@ -1,9 +0,0 @@ -@charset "UTF-8"; - -main { - display: flex; - flex-direction: column; - align-items: center; - gap: var(--gap); - transition: 0s; -} \ No newline at end of file diff --git a/author/project/system/public/themes/default/css/system.css b/author/project/system/public/themes/default/css/system.css deleted file mode 100644 index 1137f56..0000000 --- a/author/project/system/public/themes/default/css/system.css +++ /dev/null @@ -1,34 +0,0 @@ -@charset "UTF-8"; - -:root { - --gap: min(12px, 1rem); - - /* font-family: , system-ui, sans-serif; */ - font-family: "dejavu"; - text-decoration: none; - outline: none; - border: none; - transition: 0.1s ease-out; -} - -/* Selection */ -::selection { - color: var(--text-selected-color); - background: var(--text-selected-background-color); -} - -::-moz-selection { - color: var(--text-selected-color); - background: var(--text-selected-background-color); -} - - -.unselectable { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - diff --git a/author/project/system/settings/arangodb.php.sample b/author/project/system/settings/arangodb.php.sample deleted file mode 100755 index 887d4a3..0000000 --- a/author/project/system/settings/arangodb.php.sample +++ /dev/null @@ -1,8 +0,0 @@ - 'unix:///var/run/arangodb3/arango.sock', - 'database' => 'parser_from_interneturok', - 'name' => 'parser_from_interneturok', - 'password' => '' -]; diff --git a/author/project/system/views/templater.php b/author/project/system/views/templater.php deleted file mode 100755 index 3831acf..0000000 --- a/author/project/system/views/templater.php +++ /dev/null @@ -1,214 +0,0 @@ - - */ -final class templater extends controller implements array_access -{ - /** - * Twig - * - * @var twig $twig Instance of the twig templater - */ - readonly public twig $twig; - - /** - * Variables - * - * @var array $variables Registry of view global variables - */ - public array $variables = []; - - /** - * Constructor of an instance - * - * @param ?session $session Instance of the session in ArangoDB - * - * @return void - */ - public function __construct(?session &$session = null) - { - // Initializing the Twig instance - $this->twig = new twig(new FilesystemLoader(VIEWS)); - - // Initializing global variables - $this->twig->addGlobal('theme', 'default'); - $this->twig->addGlobal('server', $_SERVER); - $this->twig->addGlobal('cookies', $_COOKIE); - if (!empty($session->status())) $this->twig->addGlobal('session', $session); - $this->twig->addGlobal('language', $language = $session?->buffer['language'] ?? language::en); - } - - /** - * Render - * - * Render the HTML-document - * - * @param string $file Related path to a HTML-document - * @param array $variables Registry of variables to push into registry of global variables - * - * @return ?string HTML-document - */ - public function render(string $file, array $variables = []): ?string - { - // Generation and exit (success) - return $this->twig->render('themes' . DIRECTORY_SEPARATOR . $this->twig->getGlobals()['theme'] . DIRECTORY_SEPARATOR . $file, $variables + $this->variables); - - } - - /** - * Write - * - * Write the variable into the registry of the view global variables - * - * @param string $name Name of the variable - * @param mixed $value Value of the variable - * - * @return void - */ - public function __set(string $name, mixed $value = null): void - { - // Write the variable and exit (success) - $this->variables[$name] = $value; - } - - /** - * Read - * - * Read the variable from the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return mixed Content of the variable, if they are found - */ - public function __get(string $name): mixed - { - // Read the variable and exit (success) - return $this->variables[$name]; - } - - /** - * Delete - * - * Delete the variable from the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return void - */ - public function __unset(string $name): void - { - // Delete the variable and exit (success) - unset($this->variables[$name]); - } - - /** - * Check of initialization - * - * Check of initialization in the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return bool The variable is initialized? - */ - public function __isset(string $name): bool - { - // Check of initialization of the variable and exit (success) - return isset($this->variables[$name]); - } - - /** - * Write - * - * Write the variable into the registry of the view global variables - * - * @param mixed $name Name of an offset of the variable - * @param mixed $value Value of the variable - * - * @return void - */ - public function offsetSet(mixed $name, mixed $value): void - { - // Write the variable and exit (success) - $this->variables[$name] = $value; - } - - /** - * Read - * - * Read the variable from the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return mixed Content of the variable, if they are found - */ - public function offsetGet(mixed $name): mixed - { - // Read the variable and exit (success) - return $this->variables[$name]; - } - - /** - * Delete - * - * Delete the variable from the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return void - */ - public function offsetUnset(mixed $name): void - { - // Delete the variable and exit (success) - unset($this->variables[$name]); - } - - /** - * Check of initialization - * - * Check of initialization in the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return bool The variable is initialized? - */ - public function offsetExists(mixed $name): bool - { - // Check of initialization of the variable and exit (success) - return isset($this->variables[$name]); - } -} - diff --git a/author/project/system/views/themes/default/aside.html b/author/project/system/views/themes/default/aside.html deleted file mode 100644 index afb2aa1..0000000 --- a/author/project/system/views/themes/default/aside.html +++ /dev/null @@ -1,10 +0,0 @@ -{% block css %} -{% endblock %} - -{% block body %} - -{% endblock %} - -{% block js %} -{% endblock %} \ No newline at end of file diff --git a/author/project/system/views/themes/default/core.html b/author/project/system/views/themes/default/core.html deleted file mode 100755 index 1bb43a7..0000000 --- a/author/project/system/views/themes/default/core.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {% use '/themes/default/head.html' with title as head_title, meta as head_meta, css as head_css %} - - {% block title %} - {{ block('head_title') }} - {% endblock %} - - {% block meta %} - {{ block('head_meta') }} - {% endblock %} - - {{ block('head_css') }} - {% block css %} - {% endblock %} - - - - {% block body %} - {% endblock %} - - {% include '/themes/default/js.html' %} - {% block js %} - {% endblock %} - - - - diff --git a/author/project/system/views/themes/default/footer.html b/author/project/system/views/themes/default/footer.html deleted file mode 100755 index 8322f33..0000000 --- a/author/project/system/views/themes/default/footer.html +++ /dev/null @@ -1,10 +0,0 @@ -{% block css %} -{% endblock %} - -{% block body %} - -{% endblock %} - -{% block js %} -{% endblock %} diff --git a/author/project/system/views/themes/default/head.html b/author/project/system/views/themes/default/head.html deleted file mode 100755 index 3eecb75..0000000 --- a/author/project/system/views/themes/default/head.html +++ /dev/null @@ -1,24 +0,0 @@ -{% block title %} -{% if head.title != empty %}{{ head.title }}{% else %}parser_from_interneturok by mirzaev{% endif %} -{% endblock %} - -{% block meta %} - - -{% for meta in head.metas %} - -{% endfor %} -{% endblock %} - -{% block css %} -{% for element in css %} - -{% endfor %} - - - - - - - -{% endblock %} diff --git a/author/project/system/views/themes/default/header.html b/author/project/system/views/themes/default/header.html deleted file mode 100755 index 430650a..0000000 --- a/author/project/system/views/themes/default/header.html +++ /dev/null @@ -1,10 +0,0 @@ -{% block css %} -{% endblock %} - -{% block body %} -
-
-{% endblock %} - -{% block js %} -{% endblock %} diff --git a/author/project/system/views/themes/default/index.html b/author/project/system/views/themes/default/index.html deleted file mode 100755 index 474fd75..0000000 --- a/author/project/system/views/themes/default/index.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "/themes/default/core.html" %} - -{% use "/themes/default/header.html" with css as header_css, body as header, js as header_js %} -{% use "/themes/default/aside.html" with css as aside_css, body as aside, js as aside_js %} -{% use "/themes/default/footer.html" with css as footer_css, body as footer, js as footer_js %} - -{% block css %} -{{ block('header_css') }} -{{ block('aside_css') }} -{{ block('footer_css') }} -{% endblock %} - -{% block body %} -{{ block('header') }} -{{ block('aside') }} -
- {% block main %} - {{ main|raw }} - {% endblock %} -
-{{ block('footer') }} -{% endblock %} - -{% block js %} -{{ block('footer_js') }} -{{ block('header_js') }} -{{ block('aside_js') }} -{% endblock %} diff --git a/author/project/system/views/themes/default/js.html b/author/project/system/views/themes/default/js.html deleted file mode 100755 index 784e58d..0000000 --- a/author/project/system/views/themes/default/js.html +++ /dev/null @@ -1,5 +0,0 @@ -{% block js %} -{% for element in js %} - -{% endfor %} -{% endblock %} diff --git a/composer.json b/composer.json index 2ae289d..491d817 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "homepage": "https://git.mirzaev.sexy/mirzaev/parser_from_interneturok", "type": "site", "keywords": [ - "minimal" + "minimal", + "baza" ], "readme": "README.md", "license": "WTFPL", @@ -12,7 +13,7 @@ { "name": "mirzaev", "email": "mirzaev@gmail.com", - "homepage": "https://mirzaev.page", + "homepage": "https://mirzaev.sexy", "role": "Programmer" } ], @@ -22,15 +23,18 @@ }, "require": { "php": "^8.4", - "triagens/arangodb": "^3.8", "mirzaev/minimal": "^3.4", - "mirzaev/arangodb": "^1.3", + "mirzaev/baza": "^3.3", "twig/twig": "^3.10", "twig/extra-bundle": "^3.7", - "twig/intl-extra": "^3.10" - }, - "require-dev": { - "phpunit/phpunit": "~9.5" + "twig/intl-extra": "^3.10", + "badfarm/zanzara": "^0.9.1", + "nyholm/psr7": "^1.8", + "react/filesystem": "^0.1.2", + "guzzlehttp/guzzle": "^7.9", + "svoboda/time": "^1.0", + "avadim/fast-excel-writer": "^6.4", + "react/async": "^4.3" }, "autoload": { "psr-4": { @@ -44,5 +48,11 @@ }, "scripts": { "pre-update-cmd": "./install.sh" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true, + "wyrihaximus/composer-update-bin-autoload-path": true + } } } diff --git a/examples/systemd/parser_from_interneturok-telegram.service b/examples/systemd/parser_from_interneturok-telegram.service new file mode 100755 index 0000000..a42beb1 --- /dev/null +++ b/examples/systemd/parser_from_interneturok-telegram.service @@ -0,0 +1,17 @@ +[Unit] +Description=Telegram chat-robot: @domain_of_your_robot_here + +Wants=network.target +After=syslog.target network-online.target + +[Service] +ExecStart=sudo -u www-data /usr/bin/php /var/www/project/mirzaev/parser_from_interneturok/system/public/telegram.php +PIDFile=/var/run/php/parser_from_interneturok-telegram.pid +RemainAfterExit=no +RuntimeMaxSec=3600s +Restart=always +RestartSec=5s + +[Install] +WantedBy=multi-user.target + diff --git a/mirzaev/parser_from_interneturok/system/controllers/core.php b/mirzaev/parser_from_interneturok/system/controllers/core.php new file mode 100755 index 0000000..e06f21c --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/controllers/core.php @@ -0,0 +1,53 @@ + + */ +class core extends controller +{ + + /** + * Response + * + * @see https://wiki.php.net/rfc/property-hooks (find a table about backed and virtual hooks) + * + * @var response $response Response + */ + protected response $response { + // Read + get => $this->response ??= $this->request->response(); + } + + /** + * Errors + * + * @var array $errors Registry of errors + */ + protected array $errors = []; + +} diff --git a/mirzaev/parser_from_interneturok/system/databases/.gitignore b/mirzaev/parser_from_interneturok/system/databases/.gitignore new file mode 100644 index 0000000..c936709 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/databases/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +*.baza +*.php diff --git a/mirzaev/parser_from_interneturok/system/models/core.php b/mirzaev/parser_from_interneturok/system/models/core.php new file mode 100755 index 0000000..6d92067 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/core.php @@ -0,0 +1,90 @@ + + */ +class core extends model +{ + /** + * 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) { + 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) { + default => throw new exception("Not found: $name", 500) + }; + } +} diff --git a/mirzaev/parser_from_interneturok/system/models/enumerations/subject.php b/mirzaev/parser_from_interneturok/system/models/enumerations/subject.php new file mode 100644 index 0000000..62b1546 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/enumerations/subject.php @@ -0,0 +1,43 @@ + + */ +enum subject: string +{ + case mathematics = 'Математика'; + case algebra = 'Алгебра'; + case geometry = 'Геометрия'; + case biology = 'Биология'; + case physics = 'Физика'; + case chemistry = 'Химия'; + case probability = 'Вероятность и статистика'; + case informatics = 'Информатика'; + case geography = 'География'; + case history = 'История'; + case social = 'Обществознание'; + case literature = 'Литература'; + case art = 'ИЗО'; + case music = 'Музыка'; + case safety = 'ОБЖ'; + case labor = 'Труд'; + case project = 'Индивидуальный проект'; + case english = 'Английский язык'; + case russian = 'Русский язык'; + case german = 'Германский язык'; + case china = 'Китайский язык'; + case odnknr = 'ОДНКНР'; + case obzr = 'ОБЗР'; + case sport = 'Физическая культура'; +} diff --git a/mirzaev/parser_from_interneturok/system/models/homework.php b/mirzaev/parser_from_interneturok/system/models/homework.php new file mode 100644 index 0000000..bcaace5 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/homework.php @@ -0,0 +1,90 @@ + + */ +final class homework extends core +{ + /** + * File + * + * @var string $database Path to the database file + */ + protected string $file = DATABASES . DIRECTORY_SEPARATOR . 'homeworks.baza'; + + /** + * Database + * + * @var database $database The database + */ + public protected(set) database $database; + + /** + * Constructor + * + * @return void + */ + public function __construct() + { + // Initializing the database + $this->database = new database() + ->encoding(encoding::ascii) + ->columns( + new column('identifier', type::integer_unsigned), + new column('created', type::integer_unsigned) + ) + ->connect($this->file); + } + + /** + * Create + * + * Creates the homework record in the database + * + * @param int $identifier Identifier of the homework from the APE response (homeworks->item_id) + * + * @return int|false The record identifier, if created + */ + public function create(int $identifier): int|false + { // Initializing the record + $record = $this->database->record( + $identifier, + svoboda::timestamp() + ); + + // Creating the record in the database + $created = $this->database->write($record); + + // Exit (success) + return $created ? $identifier : false; + } +} diff --git a/mirzaev/parser_from_interneturok/system/models/interneturok.php b/mirzaev/parser_from_interneturok/system/models/interneturok.php new file mode 100644 index 0000000..bc488ee --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/interneturok.php @@ -0,0 +1,913 @@ + + */ +final class interneturok extends core +{ + /** + * ROOT + * + * Method: GET + * + * @var string ROOT The root URN + */ + public const string ROOT = 'https://interneturok.ru'; + + /** + * AUTHENTICATION + * + * Method: GET + * + * @var const string AUTHENTICATION The authentication API URL + */ + public const string AUTHENTICATION = 'https://api-gw.interneturok.ru/api/v2/psp/tokens'; + + /** + * USER + * + * Method: GET + * + * @var const string USER The user data API URL + */ + public const string USER = 'https://api-gw.interneturok.ru/api/v2/homeschool/current_user'; + + /** + * SCHEDULES + * + * Method: GET + * Authrorization: Bearer + * + * @var const string SCHEDULES The user schedules API URL + */ + public const string SCHEDULES = 'https://api-gw.interneturok.ru/api/v2/schedules/study-years?filter[status][eq]=current'; + + /** + * JOURNAL + * + * Method: GET + * Format: "https://api-ege.interneturok.ru/api/v2/journal/student?grade=$grade&quarter=$quarter&year_id=$year&user_id=$identifier&token=$this->token" + * Authrorization: Bearer + * + * @var const string JOURNAL The user journal API URL + */ + public const string JOURNAL = 'https://api-ege.interneturok.ru/api/v2/journal/student'; + + /** + * TIME + * + * Method: GET + * + * @var const string TIME The moscow time API URL + */ + public const string TIME = 'https://api-gw.interneturok.ru/api/v2/settings/moscow-time'; + + /** + * LESSONS + * + * Method: GET + * Format: "https://api-gw.interneturok.ru/api/v2/homeschool/lessons/$lesson?items=true" + * Authrorization: Bearer + * + * @var const string LESSONS The lesson data API URL + */ + public const string LESSONS = 'https://api-gw.interneturok.ru/api/v2/homeschool/lessons'; + + /** + * TESTS + * + * Method: GET + * Format: "https://api-gw.interneturok.ru/api/v2/tests/users/current/tests/$test/result" + * Authrorization: Bearer + * + * @var const string TESTS The lesson data API URL + */ + public const string TESTS = 'https://api-gw.interneturok.ru/api/v2/tests/users/current/tests'; + + /** + * ATTACHMENTS + * + * Method: GET + * Format: "https://api-gw.interneturok.ru/api/v2/homeschool/attachments?attachable_id=$attachment&attachable_type=Result::Homework" + * Authrorization: Bearer + * + * @var const string ATTACHMENTS The attachments data API URL + */ + public const string ATTACHMENTS = 'https://api-gw.interneturok.ru/api/v2/homeschool/attachments'; + + /** + * Browser + * + * @var client $browser The guzzle client + */ + private client $browser; + + /** + * Token + * + * The account authorization bearer token + * + * @var string $token The account authorization bearer token + */ + private string $token; + + /** + * Constructor + */ + public function __construct() + { + // Initializint the guzzle client + $this->browser = new client(['cookies' => true]); + } + + /** + * Parse + * + * @param subject $subject The subject + * @param int $grade The grade + * @param int $waiting Interval for processing requests (seconds) + * + * @return array|false Downloaded homework files + */ + public function parse(subject $subject, int $grade, int $waiting = 3): array|false + { + // Initializing accounts + $accounts = static::accounts(); + + if (!empty($accounts)) { + // Initialized accounts + + /* if (shuffle($accounts)) { */ + // Shuffled accounts + + foreach ($accounts as $account) { + // Iterating over accounts + + // Waiting for processing the request + sleep($waiting); + + if ($this->authentication($account)->wait()) { + // Authenticated the account + + // Writing into the output buffer + echo 'Аутентифицирован: ' . $account['mail'] . "\n"; + + // Waiting for processing the request + sleep($waiting); + + // Initializing the user journal + $journal = $this->journal(grade: $grade)->wait(); + + if (!empty($journal)) { + // Initialized the user journal + + // Writing into the output buffer + echo "Инициализирован журнал\n"; + + // Initializing the actual date + $date = new datetime(); + + // Initializing the homeworks database + $model = new homework(); + + // Initializing the schedule subject events + $schedule = $journal?->schedule_events; + + foreach ($schedule as $_subject) { + // Iterating over scheduled subject events + + if ($_subject->subject?->name === $subject->value) { + // Found the target suject + + foreach ($_subject->events as $event) { + // Iterating over the target subject events + + // Normalizing the event variable (events can be more than one) + $event = $event[0] ?? null; + + if (!empty($event)) { + // Initialized the target subject event (the homework exists) + + if (new datetime($event->date) <= $date && new datetime($event->date)->modify('+6 days') >= $date) { + // Found the current event + + if ($event->subject?->name === $subject->value && $event->subject->grade === $grade) { + // Found the target subject + + // Writing into the output buffer + echo "Найден школьный предмет: $subject->value для $grade класса (с " . new datetime($event->date)->format('d.m') . ' по ' . new datetime($event->date)->modify('+6 days')->format('d.m') . ")\n"; + + // Initializing the unblock time + $unblock = svoboda::timestamp() - 31536000; + + foreach ($event->homeworks as $homework) { + // Iterating over scheduled event homeworks + + if ($homework->status === 'checked' && $homework->mark === 5) { + // Homework checked and completed for a grade of 5 + + // Checking for the block record + $blocked = $model->database->read( + filter: fn(record $record) => $record->identifier === $homework->item_id && $record->created > $unblock, + amount: 1 + )[0] ?? null; + + if ($blocked instanceof record) { + // The account homework has been downloaded for 1 year + + continue 3; + } else { + // The account homework has not been downloaded for 1 year + + // Writing into the output buffer + echo "Найдено домашнее задание: $homework->item_id с оценкой $homework->mark\n"; + + // Waiting for processing the request + sleep($waiting); + + // Initializing the homework files + $files = $this->homework(lesson: $event->lesson->id, homework: $homework->item_id)->wait(); + + if (!empty($files)) { + // Initialized the homework files + + // Writing into the output buffer + echo "Получено домашнее задание\n"; + + // Blocking the homework downloading for 1 year + $blocked = $model->create(identifier: $homework->item_id); + + if ($blocked !== false) { + // The homework was blocked for 1 year + + // Writing into the output buffer + echo "Заблокировано на 1 год домашнее задание\n"; + + // Exit (success) + return $files; + } + } + } + } + } + } + + // Stopping processing events and starting processing the next account + break 2; + } + } + } + + // Stopping processing events and starting processing the next account + break; + } + } + } else { + // Not initialized the user journal + + // Writing into the output buffer + echo "Аккаунт не подходит под требования\n"; + + // Proceed to processing the next account + continue; + } + } else { + // Not authenticated the account + + // Writing into the output buffer + echo "Не аутентифицирован\n"; + + // Proceed to processing the next account + continue; + } + } + /* } */ + } + + // Exit (fail) + return false; + } + + /** + * Authentication + * + * Authenticate on the InternetUrok site and save cookies in guzzle http client + * + * @param array $account The account ['mail' => '', 'password' => ''] + * + * @return promise Is the account authenticated? + */ + private function authentication(array $account): promise + { + // Initializing the request to the root page + $request = new request('GET', static::ROOT); + + // Authenticating and exit + return $this->browser->sendAsync($request) + ->then(function ($response) use ($account) { + // Sended the request and received the response + + // Initializing the DOM implementator + $dom = new dom; + + // Parsing the HTML-document + @$dom->loadHTML((string) $response->getBody()); + + // Initializing the XPATH implementator + $xpath = new xpath($dom); + + // Searching for the profile button + $entries = $xpath->query('//div[@class="header-userbox show"]/div[@class="header-profile btn btn-header-profile btn-white-border"]'); + + if (!empty($entries[0])) { + // Authenticated (found the profile button) + + // Initializing the profile button + $profile = $entries[0]; + + // Searching for the account mail + $entries = $xpath->query('//div[@class="header-profile-menu"]/a/div[@class="header-profile-userinfo-text"]/div[@class="header-profile-email js-userprofile-email"]'); + + if (!empty($entries[0])) { + // Found the account mail + + // Initializing the authenticated account mail + $mail = $entries[0]->textContent; + + if ($account['mail'] === $mail) { + // Authenticated the target account + + // Exit (success) + return true; + } else { + // Authenticated another account + + // Reinitializing the guzzle client + $this->browser = new client(['cookies' => true]); + + // Exit (success) + return false; + } + } else { + // Not found the account mail + + return false; + } + } else { + // Not authenticated (not found the profile button) + + // Exit (success) + return false; + } + }) + ->then( + function (bool $authenticated) use ($account) { + if ($authenticated) { + // Authenticated + + // Exit (success) + return true; + } else { + // Not authenticated + + // Initializing the request for authentication + $request = new request( + 'POST', + static::AUTHENTICATION, + [ + 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8' + ], + 'login=' . urlencode($account['mail']) . '&password=' . urlencode($account['password']) + ); + + // Sending the request + return $this->browser->sendAsync($request) + ->then(function ($response) use ($account) { + // Received the response + + if ($response->getStatusCode() === 200) { + // Success (received the "OK" status code) + + // Initializing the authentication response body + $authenticated = json_decode((string) $response->getBody()); + + // Initializing the account access token + $this->token = $authenticated?->data?->psp?->response?->data?->access_token; + + // Exit (success) + return true; + } else { + // Fail (received not the "OK" status code) + + // Exit (fail) + return false; + } + }) + ->wait(); + } + } + ); + } + + /** + * Journal + * + * Search for the user homeworks journal + * + * @param int $grade The grade + * + * @return promise|null The journal data (object) + */ + private function journal(int $grade): promise|null + { + if (!empty($this->token)) { + // Initialized the account authorization token + + // Initializing the request to the user data API + $request = new request( + 'GET', + static::USER, + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($grade) { + // Sended the request and received the response + + // Initializing the user data + $user = json_decode((string) $response->getBody())?->data?->homeschool?->response?->user; + + if ($user->grade + 1 === $grade) { + // Matched the account grade with the grade + + // Initialiint the user identifier + $identifier = $user?->id; + + if (!empty($identifier)) { + // Initialized the user identifier + + // Initializing the request to the user schedules API + $request = new request( + 'GET', + static::SCHEDULES, + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($grade, $identifier) { + // Sended the request and received the response + + // Initializing the user schedules + $schedules = json_decode((string) $response->getBody())?->data?->schedules?->response?->data; + + // Initializing the study years registry + $years = $schedules?->study_years; + + if (!empty($years)) { + // Initialized the study years registry + + foreach ($years as $year) { + // Iterating over study years + + if ($year->status === 'current') { + // The current study year + + // Initializing the request to the moscow time API + $request = new request( + 'GET', + static::TIME, + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($grade, $identifier, $year) { + // Sended the request and received the response + + // Initializing the moscow time + $time = json_decode((string) $response->getBody())?->data?->time?->response; + + if (!empty($time)) { + // Initialized the moscow time + + // Implementing the moscow time + $now = new datetime($time); + + // Declaring the quarter buffer + $quarter = null; + + foreach ($year->quarters as $value) { + // Iterating over study year quarters + + // Implementing the quarter start time and end time + $start = new datetime($value->starts_at); + $end = new datetime($value->ends_at); + + if ($now > $start && $now < $end) { + // Found the current quarter + + // Writing the current quarter identifier into the quarter buffer + $quarter = $value->quarter; + + // Stopping iterating over study year quarters + break; + } + } + + // Initializing the request to the user journal API + $request = new request( + 'GET', + static::JOURNAL . "?grade=$grade&quarter=$quarter&year_id=$year->id&user_id=$identifier&token=$this->token" + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) { + // Sended the request and received the response + + // Initializing the user journal + $journal = json_decode((string) $response->getBody()); + + if (!empty($journal)) { + // Initialized the user journal + + // Exit (success) + return $journal; + } else { + // Not initialized the user journal + + // Exit (fail) + return false; + } + })->wait(); + } else { + // Not initialized the moscow time + + // Exit (fail) + return false; + } + })->wait(); + } + } + } else { + // Not initialized the study years registry + + // Exit (fail) + return false; + } + })->wait(); + } else { + // Not initialized the user identifier + + // Exit (fail) + return false; + } + } else { + // Not matched the account grade with the grade + + // Exit (fail) + return false; + } + }); + } + + // Exit (fail) + return null; + } + + /** + * Homework + * + * Search for lesson and homework tetst or attachments, then download and generate excel documents + * + * @param int $lesson The lesson identifier + * @param int $homework The homework identifier + * + * @return promise|null The homework files (array) + */ + private function homework(int $lesson, int $homework): promise|null + { + if (!empty($this->token)) { + // Initialized the account authorization token + + // Initializing the request to the lesson data API + $request = new request( + 'GET', + static::LESSONS . "/$lesson?items=true", + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($homework) { + // Sended the request and received the response + + // Initializing the lesson + $lesson = json_decode((string) $response->getBody())?->data?->homeschool?->response; + + foreach ($lesson->items as $section) { + // Iterating over the lesson sections + + if ($section->id === $homework && $section->item_type === 'homework' && $section->homework_kind === 'homework_base') { + // Found the base homework section + + // Initializng the test identifier (string) + $test = $section->homework_attributes?->parsed_content?->evo_test_id ?? null; + + if (!empty($test)) { + // Initialized the test identifier + + // Initializing the request to the test data API + $request = new request( + 'GET', + static::TESTS . "/$test/result", + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($homework) { + // Sended the request and received the response + + // Initializing the test result + $result = json_decode((string) $response->getBody())?->data?->tests?->response?->data; + + if (!empty($result)) { + // Initialized the test result + + // Initializing paths to the homework storage folder + $storage = STORAGE . DIRECTORY_SEPARATOR . 'homeworks' . DIRECTORY_SEPARATOR . $homework; + + // Initializing the homework storage folder + if (!file_exists($storage)) mkdir($storage, 0775, true); + + // Initializing the excel document + $excel = excel::create(['Домашнее задание']); + + // Initializing the excel document sheet + $sheet = $excel->sheet(); + + // Writing settings of the excel document sheet + $sheet->setColWidths(['A' => 10, 'B' => 80, 'C' => 50]); + + // Writing title + $sheet->writeRow( + ['Номер', 'Задание', 'Ответ'], + [ + 'font' => [ + 'style' => 'bold' + ], + 'text-align' => 'center', + 'vertical-align' => 'center', + 'border' => 'thin', + 'height' => 24, + ] + ); + + foreach ($result->test?->questions as $question) { + // Iterating over questions + + foreach ($question->answer_results as $answer) { + // Iterating over question answers + + if ($answer->is_correct) { + // The answer is correct + + if (!empty($answer->section)) { + // Several sections for answers (expected) + + // Writing questions and answers + $sheet->writeRow([$question->test_question_position, $question->name, $answer->section->name . ' - ' . $answer->value]); + } else { + // One single answer (expected) + + // Writing questions and answers + $sheet->writeRow([$question->test_question_position, $question->name, $answer->value]); + } + } + } + } + + // Initializing path to the excel document file + $path = $storage . DIRECTORY_SEPARATOR . 'homework.xlsx'; + + // Writing the excel document file to the storage + $excel->save($path); + + // Exit (success) + return [$path]; + } else { + // Not initialized the test result + + // Exit (fail) + return false; + } + })->wait(); + } else { + // Not initialized the test identifier + + // Initializing the attachment identifier + $attachment = $section->result?->id; + + if (!empty($attachment)) { + // Initialized the attachment identifier + + // Initializing the request to the test data API + $request = new request( + 'GET', + static::ATTACHMENTS . "?attachable_id=$attachment&attachable_type=Result::Homework", + [ + 'Authorization' => "Bearer $this->token" + ] + ); + + return $this->browser->sendAsync($request) + ->then(function ($response) use ($homework) { + // Sended the request and received the response + + // Initializing attachments + $attachments = json_decode((string) $response->getBody())?->data?->homeschool?->response?->attachments; + + if (!empty($attachments)) { + // Initialized attachmetns + + // Initializing paths to the homework attachments storage folder + $storage = STORAGE . DIRECTORY_SEPARATOR . 'homeworks' . DIRECTORY_SEPARATOR . $homework . DIRECTORY_SEPARATOR . 'attachments'; + + // Initializing the homework attachments storage folder + if (!file_exists($storage)) mkdir($storage, 0775, true); + + // Declaring the buffer of files + $files = []; + + foreach ($attachments as $attachment) { + // Iteration over attachments + + if ($attachment->uploader_role === 'student' && $attachment->attachable_type === 'Result::Homework') { + // Found the homework attachment + + // Initializing path to the downloaded file + $path = $storage . DIRECTORY_SEPARATOR . $attachment->attach_path; + + // Downloading the file + $this->browser->request('GET', $attachment->attach, ['sink' => $path]); + + // Writing path to the downloaded file into the buffer of files + $files[] = $path; + } + } + + // Exit (success) + return $files; + } else { + // Not initialized attachments + + // Exit (fail) + return false; + } + })->wait(); + } else { + // Not initialized the attachment identifier + + // Exit (fail) + return false; + } + } + } + } + + // Exit (fail) + return false; + }, + function ($response) use ($homework) { + if ($response->getStatusCode() === 402) { + // Fail (received the "Payment Required" status code) + + // Writing into the output buffer + echo "Не удалось скачать домашнее задание $homework потому, что не оплачен тариф\n"; + + // Exit (fail) + return false; + } + }); + } + + // Exit (fail) + return null; + } + + + /** + * Accounts + * + * Read CSV rows and generate account registry + * + * @return array|false The accounts registry ['mail' => '', 'password' => ''] + */ + public static function accounts(): array|false + { + // Opening the InternetUrok accounts file + $file = fopen(INTERNETUROK_ACCOUNTS_FILE, "r"); + + if (is_resource($file)) { + // Opened the InternetUrok accounts file + + if (flock($file, LOCK_SH)) { + // Locked the InternetUrok accounts file + + // Initializing the InternetUrok accounts registry + $accounts = []; + + while (!empty($row = fgetcsv($file, 5000, " "))) { + // Readed the CSV row + + // Initializing the account data + $mail = $row[0]; + $password = $row[1]; + + // Writing into the InternetUrok accounts registry + $accounts[] = ['mail' => $mail, 'password' => $password]; + } + + // Unlocking the InternetUrok accounts file + flock($file, LOCK_UN); + + // Closing the InternetUrok accounts file + fclose($file); + + // Exit (success) + return $accounts; + } + } + + // Exit (fail) + return false; + } + + + /** + * Amount + * + * Calculate the number of rows in the accounts file (the number of accounts is expected) + * + * @return int Amount of accounts + */ + public static function amount(): int + { + // Opening the interneturok accounts file + $file = new spl(INTERNETUROK_ACCOUNTS_FILE, 'r'); + + // Move the cursor to the last row + $file->seek(PHP_INT_MAX); + + // Initializing number of the last row + $rows = $file->key(); + + // Exit (success) + return $rows; + } +} diff --git a/mirzaev/parser_from_interneturok/system/models/telegram/commands.php b/mirzaev/parser_from_interneturok/system/models/telegram/commands.php new file mode 100644 index 0000000..5158b23 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/telegram/commands.php @@ -0,0 +1,171 @@ + + */ +final class commands extends core +{ + /** + * Menu + * + * Responce for the commands: "/start", '/menu' + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function menu(context $context): void + { + // Initializing amount of accounts + $rows = interneturok::amount(); + + // Sending the message + $context->sendMessage( + << [ + 'inline_keyboard' => [ + [ + [ + 'text' => subject::mathematics->value, + 'callback_data' => subject::mathematics->name + ], + [ + 'text' => subject::algebra->value, + 'callback_data' => subject::algebra->name + ], + [ + 'text' => subject::geometry->value, + 'callback_data' => subject::geometry->name + ] + ], + [ + [ + 'text' => subject::probability->value, + 'callback_data' => subject::probability->name + ], + [ + 'text' => subject::informatics->value, + 'callback_data' => subject::informatics->name + ] + ], + [ + [ + 'text' => subject::physics->value, + 'callback_data' => subject::physics->name + ], + [ + 'text' => subject::chemistry->value, + 'callback_data' => subject::chemistry->name + ], + [ + 'text' => subject::biology->value, + 'callback_data' => subject::biology->name + ] + ], + [ + [ + 'text' => subject::geography->value, + 'callback_data' => subject::geography->name + ], + [ + 'text' => subject::history->value, + 'callback_data' => subject::history->name + ], + [ + 'text' => subject::social->value, + 'callback_data' => subject::social->name + ], + [ + 'text' => subject::literature->value, + 'callback_data' => subject::literature->name + ] + ], + [ + [ + 'text' => subject::art->value, + 'callback_data' => subject::art->name + ], + [ + 'text' => subject::music->value, + 'callback_data' => subject::music->name + ], + [ + 'text' => subject::safety->value, + 'callback_data' => subject::safety->name + ], + [ + 'text' => subject::labor->value, + 'callback_data' => subject::labor->name + ], + ], + [ + [ + 'text' => subject::project->value, + 'callback_data' => subject::project->name + ] + ], + [ + [ + 'text' => subject::english->value, + 'callback_data' => subject::english->name + ], + [ + 'text' => subject::russian->value, + 'callback_data' => subject::russian->name + ], + [ + 'text' => subject::german->value, + 'callback_data' => subject::german->name + ], + [ + 'text' => subject::china->value, + 'callback_data' => subject::china->name + ] + ], + [ + [ + 'text' => subject::odnknr->value, + 'callback_data' => subject::odnknr->name + ], + [ + 'text' => subject::obzr->value, + 'callback_data' => subject::obzr->name + ], + [ + 'text' => subject::sport->value, + 'callback_data' => subject::sport->name + ] + ], + ], + 'disable_notification' => true, + 'remove_keyboard' => true + ], + ] + )->then(function (message $message) use ($context) { + // Sended the message + }); + } +} diff --git a/mirzaev/parser_from_interneturok/system/models/telegram/middlewares.php b/mirzaev/parser_from_interneturok/system/models/telegram/middlewares.php new file mode 100644 index 0000000..e40278a --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/telegram/middlewares.php @@ -0,0 +1,59 @@ + + */ +final class middlewares extends core +{ + /** + * Authorization (middleware) + * + * Checks account permissions against the registry + * + * @param context $context + * @param node $next + * + * @return void + */ + public static function authorization(context $context, node $next): void + { + // Is the process stopped? + if ($context->get('stop')) return; + + // Initializing the telegram account + $telegram = $context->getEffectiveUser(); + + if (array_search($telegram->getId(), ACCOUNTS) !== false) { + // Authorized the account + + // Continuation of the process + $next($context); + } else { + // Not authorized the account + + // Sending the message + $context->sendMessage('⛔️ У тебя нет доступа к чат\-роботу')->then(function () use ($context) { + // Sended the message + + // Ending the conversation + $context->endConversation(); + }); + } + } +} diff --git a/mirzaev/parser_from_interneturok/system/models/telegram/parser.php b/mirzaev/parser_from_interneturok/system/models/telegram/parser.php new file mode 100644 index 0000000..bea9f44 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/models/telegram/parser.php @@ -0,0 +1,249 @@ + + */ +final class parser extends core +{ + /** + * Process + * + * @var const string PROCESS Name of the process in the telegram user buffer + */ + public const string PROCESS = 'parse_subject'; + + /** + * Subject + * + * Create the process, write subject to the buffer and request grade + * + * @param context $context Request data from Telegram + * @param subject $subject The schrool subject + * + * @return void + */ + public static function subject(context $context, subject $subject): void + { + // Initializing the parsing target buffer + $target = [ + 'subject' => $subject, + 'grade' => null + ]; + + // Writing to the telegram user buffer + $context->setUserDataItem(static::PROCESS, $target) + ->then(function () use ($context) { + // Writed to the telegram user buffer + + // Sending the message + $context->sendMessage( + '🎒 *Выбери номер класса*', + [ + 'reply_markup' => [ + 'inline_keyboard' => [ + [ + [ + 'text' => '4', + 'callback_data' => 'grade_4' + ], + [ + 'text' => '5', + 'callback_data' => 'grade_5' + ], + [ + 'text' => '6', + 'callback_data' => 'grade_6' + ], + [ + 'text' => '7', + 'callback_data' => 'grade_7' + ] + ], + [ + [ + 'text' => '8', + 'callback_data' => 'grade_8' + ], + [ + 'text' => '9', + 'callback_data' => 'grade_9' + ], + [ + 'text' => '10', + 'callback_data' => 'grade_10' + ], + [ + 'text' => '11', + 'callback_data' => 'grade_11' + ] + ] + ], + 'disable_notification' => true, + 'remove_keyboard' => true + ] + ] + ); + }); + } + + /** + * Grade + * + * Write grade to the buffer and request confirmation for starting the parsing process + * + * @param context $context Request data from Telegram + * @param int $grade The grade + * + * @return void + */ + public static function grade(context $context, int $grade): void + { + // Reading from the telegram user buffer + $context->getUserDataItem(static::PROCESS) + ->then(function (?array $target) use ($context, $grade) { + // Readed from the telegram user buffer + + if ($target) { + // Initialized the parsing process + + // Initializing the grade + $target['grade'] = $grade; + + // Writing to the telegram user buffer + $context->setUserDataItem(static::PROCESS, $target) + ->then(function () use ($context, $target) { + // Writed to the telegram user buffer + + // Initializing the subject + $subject = $target['subject']?->value; + + // Initializing the grade + $grade = $target['grade']; + + // Sending the message + $context->sendMessage( + << [ + 'inline_keyboard' => [ + [ + [ + 'text' => '✅ Отправить запрос', + 'callback_data' => 'parse' + ] + ] + ], + 'disable_notification' => true, + 'remove_keyboard' => true + ] + ] + ); + }); + } else { + // Not initialized the parsing process + + // Sending the message + $context->sendMessage('⚠️ *Не запущен процесс генерации парсинга*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Sending the menu with subjects + commands::menu($context); + }); + } + }); + } + + /** + * Parse + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function parse(context $context): void + { + // Reading from the telegram user buffer + $context->getUserDataItem(static::PROCESS) + ->then(function (?array $target) use ($context) { + // Readed from the telegram user buffer + + if ($target) { + // Initialized the parsing process + + // Initializing variables for the parsing process + $subject = $target['subject']; + $grade = $target['grade']; + + // Initializing the parser + $parser = new interneturok(); + + // Parsing homework files + $files = $parser->parse(subject: $subject, grade: $grade, waiting: 0); + + if (!empty($files)) { + // Initialized homework files + + foreach ($files as $file) { + // Iterating over files in the storage + + // Sending the file + await($context->sendDocument(new file_input($file))); + } + + // Deleting in the telegram user buffer + $context->deleteUserDataItem(static::PROCESS); + } else { + // Not initialized homework files + + // Sending the message + $context->sendMessage('❌ *Не найдены домашние задания') + ->then(function (message $message) use ($context) { + // Sended the message + + // Sending the menu with subjects + commands::menu($context); + }); + } + } else { + // Not initialized the parsing process + + // Sending the message + $context->sendMessage('⚠️ *Не запущен процесс генерации парсинга*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Sending the menu with subjects + commands::menu($context); + }); + } + }); + } +} diff --git a/mirzaev/parser_from_interneturok/system/public/telegram.php b/mirzaev/parser_from_interneturok/system/public/telegram.php new file mode 100755 index 0000000..7e2af01 --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/public/telegram.php @@ -0,0 +1,95 @@ +setParseMode(config::PARSE_MODE_MARKDOWN); +$config->useReactFileSystem(true); + +// Initializing the robot +$robot = new Zanzara(TELEGRAM_KEY, $config); + +// Initializing the robot middlewares +$robot->middleware([middlewares::class, 'authorization']); + +// Initializing the robot commands handlers +$robot->onCommand('start', [commands::class, 'menu']); +$robot->onCommand('menu', [commands::class, 'menu']); + +// Initializing the robot subjects buttons handlers +foreach (subject::cases() as $subject) { + // Iterating over subjects + + // Initializing subjects buttons + $robot->onCbQueryData([$subject->name], fn(context $context) => parser::subject(context: $context, subject: $subject)); +}; + +for ($i = 4; $i <= 11; ++$i) { + // Generating buttons from 4 to 11 grades + + // Initializing grades buttons + $robot->onCbQueryData(["grade_$i"], fn(context $context) => parser::grade(context: $context, grade: $i)); +} + +// Initializing the parse button +$robot->onCbQueryData(['parse'], [parser::class, 'parse']); + +// Initializing the exceptions handler +$robot->onException(function (context $context, $exception) { + var_dump($exception); +}); + +// Starting chat-robot +$robot->run(); diff --git a/author/project/system/settings/.gitignore b/mirzaev/parser_from_interneturok/system/settings/.gitignore similarity index 100% rename from author/project/system/settings/.gitignore rename to mirzaev/parser_from_interneturok/system/settings/.gitignore diff --git a/mirzaev/parser_from_interneturok/system/settings/accounts.php.sample b/mirzaev/parser_from_interneturok/system/settings/accounts.php.sample new file mode 100644 index 0000000..17a7e9a --- /dev/null +++ b/mirzaev/parser_from_interneturok/system/settings/accounts.php.sample @@ -0,0 +1,9 @@ +