forked from localzet-archive/WebKit-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster
More file actions
57 lines (48 loc) · 2.49 KB
/
master
File metadata and controls
57 lines (48 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env php
<?php declare(strict_types=1);
/**
* @package Triangle Engine (FrameX Project)
* @link https://github.com/localzet/FrameX FrameX Project v1-2
* @link https://github.com/Triangle-org/Engine Triangle Engine v2+
*
* @author Ivan Zorin <creator@localzet.com>
* @copyright Copyright (c) 2018-2024 Localzet Group
* @license https://www.gnu.org/licenses/agpl AGPL-3.0 license
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Triangle\Console;
use Triangle\Engine\Autoload;
use Triangle\Engine\Environment;
use Triangle\Engine\Path;
if (!Phar::running()) chdir(__DIR__);
require_once __DIR__ . '/vendor/autoload.php';
// Основная директория проекта
Path::$basePath = BASE_PATH;
// Конфигурация и контроллеры
Path::$configPath = Path::basePath('config');
Path::$appPath = Path::basePath('app');
// Статика, логи и временные
// ВАЖНО! Используется runPath() для определения рабочей директории!
// Это позволяет при работе из бинарника писать логи в директорию рядом с ним
Path::$publicPath = Path::runPath('public');
Path::$runtimePath = Path::runPath('runtime');
// Загрузка переменных окружения
// Путь и имя файла могут быть массивом путей и файлов
Environment::load(Path::runPath(), '.env');
// Автозагрузка конфигурации и файлов
// + Bootstrap, Middleware, Database, Session, Router, Events, Cron
Autoload::start($argv[1] ?? '');
// Запуск консоли и выполнение запрошенной команды
Console::runAll();