1
0

36 Commits

Author SHA1 Message Date
a76e11fb9f fixed settings installer 2026-01-07 12:54:54 +05:00
190ef8eabd exaples 2026-01-06 14:20:24 +05:00
41fcf9319b localizations 2026-01-06 14:17:36 +05:00
8b5a49747b why so shroomious 2026-01-06 14:04:51 +05:00
f2eb59336e created from kodorvan/neurobot 2026-01-06 14:02:18 +05:00
913dfb8a92 fixed $ 2025-11-04 16:19:18 +07:00
372d008545 added copying *.sample files script 2025-11-04 16:12:31 +07:00
e38a870e71 controller HTML response 2025-11-04 10:55:58 +07:00
36b48d14d1 suggest mirzaev/files and delete files trait 2025-11-04 02:41:27 +07:00
1261738c3d languages support + deleted @author tags 2025-10-26 18:06:27 +07:00
9718bec887 languages and currencies 2025-10-26 17:34:50 +07:00
7f8525789e update minimal 2025-10-11 16:35:55 +07:00
c6f7f65360 deleting when empty 2025-07-06 13:22:05 +07:00
c65f7d4055 deleting when empty 2025-07-06 13:21:53 +07:00
bdef194b68 deleting when empty 2025-07-06 13:21:38 +07:00
a3eeacc4b4 flex-grow: 1; 2025-07-06 13:20:42 +07:00
da69b20491 colorscheme 2025-07-06 13:19:30 +07:00
1d4d3e5f24 updated and renamed 2025-07-06 13:18:26 +07:00
2b417f1649 fixed paths 2025-07-06 13:16:42 +07:00
1ee4c9a7dd deleted session 2025-07-06 11:59:42 +07:00
ece40a8644 added tabs 2025-07-06 11:28:56 +07:00
6e5339a7d9 added russian 2025-07-06 10:41:28 +07:00
b989a89e2b fixed 2025-07-06 10:41:04 +07:00
fbcb72a47b deleted arangodb 2025-07-06 10:35:42 +07:00
485ac59c69 english localization 2025-07-06 10:28:46 +07:00
315f9bb7e3 added localizations 2025-07-06 10:27:23 +07:00
9baf88d93c updated dependencies 2025-07-05 22:37:42 +07:00
d3a47b04fb body margin unset 2025-04-10 22:47:34 +07:00
1a05a0413d returned templater 2025-04-10 22:33:05 +07:00
8c777e72c7 $ to $$ 2025-03-30 00:37:01 +07:00
a62b5ad3e5 resolved #13, resolved #14, resolved #15 2025-02-26 13:40:06 +07:00
4eecb4c5ed resolved #13, resolved #14 2025-02-26 13:27:59 +07:00
ff663e7bf7 resolved #12 2025-02-21 12:07:50 +07:00
32d92bcc7e resolved #11 2025-02-21 12:07:15 +07:00
5c06ec423a resolved #10 2025-02-21 11:57:23 +07:00
41c0e2717c "/css/themes/default" to "/themes/default/css" 2024-12-17 15:17:45 +07:00
41 changed files with 2061 additions and 1174 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,3 @@
!.gitignore !.gitignore
composer.phar composer.phar
composer.lock
vendor vendor

View File

@@ -6,9 +6,10 @@ namespace ${REPO_OWNER}\${REPO_NAME}\controllers;
// Files of the project // Files of the project
use ${REPO_OWNER}\${REPO_NAME}\views\templater, use ${REPO_OWNER}\${REPO_NAME}\views\templater,
${REPO_OWNER}\${REPO_NAME}\models\core as models, ${REPO_OWNER}\${REPO_NAME}\models\core as models;
${REPO_OWNER}\${REPO_NAME}\models\session,
${REPO_OWNER}\${REPO_NAME}\models\enumerations\language; // Library for languages support
use mirzaev\languages\language;
// Framework for PHP // Framework for PHP
use mirzaev\minimal\core as minimal, use mirzaev\minimal\core as minimal,
@@ -21,25 +22,17 @@ use mirzaev\minimal\core as minimal,
* *
* @package ${REPO_OWNER}\${REPO_NAME}\controllers * @package ${REPO_OWNER}\${REPO_NAME}\controllers
* *
* @param session $$session Instance of the session
* @param language $$language Language * @param language $$language Language
* @param response $$response Response * @param response $$response Response
* @param array $$errors Registry of errors * @param array $$errors Registry of errors
* *
* @method void __construct(minimal $$minimal, bool $$initialize) Constructor * @method void __construct(minimal $$minimal) Constructor
* *
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
* @author ${REPO_OWNER} <mail@domain.zone> * @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/ */
class core extends controller class core extends controller
{ {
/**
* Session
*
* @var session|null $$session Instance of the session
*/
protected readonly session $$session;
/** /**
* Language * Language
* *
@@ -65,8 +58,7 @@ class core extends controller
* @var array $$errors Registry of errors * @var array $$errors Registry of errors
*/ */
protected array $$errors = [ protected array $$errors = [
'session' => [], 'system' => []
'account' => []
]; ];
/** /**
@@ -77,50 +69,15 @@ class core extends controller
* *
* @return void * @return void
*/ */
public function __construct(minimal $$core, bool $$initialize = true) public function __construct(minimal $$core)
{ {
// Blocking requests from CloudFlare (better to write this blocking into nginx config file) // Blocking requests from CloudFlare (better to write this blocking into nginx config file)
if (isset($$_SERVER['HTTP_USER_AGENT']) && $$_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label; if (isset($$_SERVER['HTTP_USER_AGENT']) && $$_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label;
// Initializing the view template engine instance
$$this->view = new templater();
// For the extends system // For the extends system
parent::__construct(core: $$core); 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);
}
} }
} }

View File

@@ -21,7 +21,7 @@ use mirzaev\minimal\http\enumerations\content,
* @method null index() Main page * @method null index() Main page
* *
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
* @author ${REPO_OWNER} <mail@domain.zone> * @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/ */
final class index extends core final class index extends core
{ {
@@ -31,7 +31,7 @@ final class index extends core
* @var array $$errors Registry of errors * @var array $$errors Registry of errors
*/ */
protected array $$errors = [ protected array $$errors = [
'session' => [] 'system' => []
]; ];
/** /**
@@ -41,8 +41,8 @@ final class index extends core
*/ */
public function index(): null public function index(): null
{ {
if (str_contains($$this->request->headers['accept'], content::any->value)) { if (str_contains($$this->request->headers['accept'] ?? '', content::html->value)) {
// Request for any response // Request for HTML response
// Render page // Render page
$$page = $$this->view->render('index.html'); $$page = $$this->view->render('index.html');

View File

@@ -0,0 +1,3 @@
!.gitignore
!*.php
*.baza

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
namespace ${REPO_OWNER}\${REPO_NAME};
// Files of the project
use ${REPO_OWNER}\${REPO_NAME}\models\account,
${REPO_OWNER}\${REPO_NAME}\models\authorizations,
${REPO_OWNER}\${REPO_NAME}\models\chat,
${REPO_OWNER}\${REPO_NAME}\models\tariff;
// Svoboda time
use svoboda\time\statement as svoboda;
// Baza database
use mirzaev\baza\record;
// Enabling debugging
/* ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1); */
// Initializing path to the public directory
define('INDEX', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'public');
// Initializing path to the root directory
define('ROOT', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
// Initializing path to the settings directory
define('SETTINGS', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'settings');
// Initializing path to the storage directory
define('STORAGE', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'storage');
// Initializing path to the databases directory
define('DATABASES', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'databases');
// Initializing path to the localizations directory
define('LOCALIZATIONS', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'localizations');
// Initiailizing telegram data
require(SETTINGS . DIRECTORY_SEPARATOR . 'telegram.php');
// Initializing dependencies
require ROOT . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
// Initializing the account model
$$account_model = new account();
// Searching for the account
$$account = $$account_model->database->read(
filter: fn(record $$record) => $$record->domain === 'buddy_volkodav',
amount: 1,
offset: 0
)[0] ?? null;
var_dump($$account);
// Initializing the account authorizations model
$$authorizations_model = new authorizations();
// Searching for the account authorizations
$$authorizations = $$authorizations_model->database->read(
filter: fn(record $$record) => $$record->account === $$account->identifier,
amount: 1,
offset: 0