created from kodorvan/neurobot
This commit is contained in:
2
author/project/system/databases/.gitignore
vendored
2
author/project/system/databases/.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
!.gitignore
|
||||
!*.php
|
||||
*.baza
|
||||
*.php
|
||||
|
||||
71
author/project/system/databases/scripts/account.php
Normal file
71
author/project/system/databases/scripts/account.php
Normal 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
|
||||
)[0] ?? null;
|
||||
|
||||
var_dump($$authorizations);
|
||||
|
||||
Reference in New Issue
Block a user