DEV: Upgrade to HLEB v1.6.53

This commit is contained in:
Evg 2022-04-18 23:15:13 +03:00
parent 4aafd676ac
commit 56fdb9bca4
5 changed files with 24 additions and 7 deletions

View file

@ -219,6 +219,7 @@ class AddPostController extends MainController
'item_is_soft' => 0,
'item_is_github' => 0,
'item_votes' => 0,
'item_close_replies'=> 0,
'item_count' => 1,
]
);

View file

@ -143,6 +143,7 @@ if ($arguments) {
" --list or -l (forms a list of commands)" . PHP_EOL .
" --list <command> [--help] (command info)" . PHP_EOL .
" --logs or -lg (prints multiple trailing lines from a log file)" . PHP_EOL .
" --find-route <url> [method] [domain] (route search by url)" . PHP_EOL .
" --new-task (сreates a new command)" . PHP_EOL .
" --new-task example-task \"Short description\"" . PHP_EOL .
(HL_TWIG_CONNECTED ? " --clear-cache--twig or -cc-twig" . PHP_EOL . " --forced-cc-twig" . PHP_EOL : '');
@ -171,6 +172,21 @@ if ($arguments) {
include_once HLEB_PROJECT_DIRECTORY . '/Main/Console/CreateTask.php';
new \Hleb\Main\Console\CreateTask(strval($argv[2] ?? ''), strval($argv[3] ?? ''));
break;
case '--find-route':
case '-fr':
hlUploadAll();
if (class_exists('Phphleb\Rfinder\RouteFinder', true)) {
$address = $argv[2] ?? '';
if (!empty($address)) {
$finder = (new \Phphleb\Rfinder\RouteFinder(strval($address), $argv[3] ?? 'GET', $argv[4] ?? null));
echo $finder->getInfo() . PHP_EOL;
} else {
echo 'Required URL not specified! php console --find-route <url> [method] [domain]' . PHP_EOL;
}
} else {
echo 'You need to install the phphleb/rfinder library.' . PHP_EOL;
}
break;
default:
$file = $fn->convertCommandToTask($arguments);
if (file_exists(HLEB_GLOBAL_DIRECTORY . "/app/Commands/$file.php")) {

View file

@ -1,6 +1,6 @@
<?php
define('HLEB_PROJECT_FULL_VERSION', '1.6.52');
define('HLEB_PROJECT_FULL_VERSION', '1.6.53');
require HLEB_PROJECT_DIRECTORY . '/Scheme/App/Controllers/MainController.php';

View file

@ -22,7 +22,7 @@ class Add
{
// Access rights by the trust level of the participant
// Права доступа по уровню доверия участника
(new \Modules\Catalog\App\Сhecks())->limit();
(new \Modules\Catalog\App\Checks())->limit();
// Plugin for selecting facets
Request::getResources()->addBottomStyles('/assets/js/tag/tagify.css');
@ -51,21 +51,21 @@ class Add
// Access rights by the trust level of the participant
// Права доступа по уровню доверия участника
(new \Modules\Catalog\App\Сhecks())->limit();
(new \Modules\Catalog\App\Checks())->limit();
// Check if the domain exists in the system
// Проверим наличие домена в системе
if ($domain = (new \Modules\Catalog\App\Сhecks())->getDomain(Request::getPost('url'))) {
if ($domain = (new \Modules\Catalog\App\Checks())->getDomain(Request::getPost('url'))) {
return json_encode(['error' => 'error', 'text' => Translate::get('site.replay')]);
}
// Get a first level domain
// Получим данные домена первого уровня
$basic_host = (new \Modules\Catalog\App\Сhecks())->domain(Request::getPost('url'));
$basic_host = (new \Modules\Catalog\App\Checks())->domain(Request::getPost('url'));
// Check the length of the site name
// Проверим длину названия сайта
if (!$title = (new \Modules\Catalog\App\Сhecks())->length(Request::getPost('title'), 14, 250)) {
if (!$title = (new \Modules\Catalog\App\Checks())->length(Request::getPost('title'), 14, 250)) {
$msg = sprintf(Translate::get('string.length'), '«' . Translate::get('title') . '»', 14, 250);
return json_encode(['error' => 'error', 'text' => $msg]);
}

View file

@ -6,7 +6,7 @@
// All calls are sent to this file.
// Все вызовы направляются в этот файл.
define('HLEB_START', microtime(true));
define('HLEB_FRAME_VERSION', "1.6.52");
define('HLEB_FRAME_VERSION', "1.6.53");
define('HLEB_PUBLIC_DIR', __DIR__);
// General headers.