Этап 1 рефакторинга: единая автозагрузка классов
- 42 файла ядра переименованы из *.class.php в *.php - самописный spl_autoload_register удалён из core/bootstrap.php - исправлен маппинг PSR-4: "Core\" теперь указывает на core/lib/Core/, а не на core/lib/. Прежнее значение было ошибочным: PSR-4 отбрасывает префикс Core\, поэтому composer искал классы в core/lib/Helpers/... вместо core/lib/Core/Helpers/... Автозагрузка composer для ядра не работала вовсе, из-за чего и появился второй автозагрузчик. Попутно: - устранены три deprecation PHP 8.4 (неявно nullable параметры) в FakeUserAgent::getMobileOS, Log::logToFile и Mail::__construct - Psalm удалён из проекта: зависимость, workflow и упоминания в доках - зафиксирована целевая платформа composer 8.4.0 - CLAUDE.md приведён в соответствие: пути файлов, автозагрузка, хранение секретов, отсутствие .htaccess на nginx Проверено: линт всей кодовой базы интерпретатором 8.4, phpunit, сверка ответов всех маршрутов и POST-сценария авторизации с состоянием до изменений.
This commit is contained in:
1 parent
9933803f36
commit
dfb1c4bd14
48 files changed
+104
-1322
No files matched your search
@@ -88,25 +88,6 @@
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Реализация механизма автозагрузки классов
|
||||
*/
|
||||
spl_autoload_register(static function ($class) {
|
||||
if (str_starts_with($class, 'Core')) {
|
||||
$class = str_replace('\\', '/', $class);
|
||||
$classPath = ROOT_PATH . '/core/lib/' . $class . '.class.php';
|
||||
$classPathTwo = ROOT_PATH . '/core/lib/' . $class . '.php';
|
||||
|
||||
if (file_exists($classPath)) {
|
||||
require_once $classPath;
|
||||
}
|
||||
|
||||
if (file_exists($classPathTwo)) {
|
||||
require_once $classPathTwo;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Инициализация кеша
|
||||
Cache::init(CACHE_DIR, USE_CACHE);
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -220,7 +220,7 @@
|
||||
* @return string Строка ОС
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getMobileOS(string $os = null): string
|
||||
private function getMobileOS(?string $os = null): string
|
||||
{
|
||||
$os = strtolower($os);
|
||||
$_os = [];
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -58,7 +58,7 @@
|
||||
string $filename = 'core.log',
|
||||
$content = null,
|
||||
int $priority = LOG_DEBUG,
|
||||
string $system = null,
|
||||
?string $system = null,
|
||||
bool $addEnv = true
|
||||
): int {
|
||||
if (!USE_LOG) {
|
||||
@@ -82,7 +82,7 @@
|
||||
/**
|
||||
* Конструктор
|
||||
*/
|
||||
public function __construct(User $user = null) {
|
||||
public function __construct(?User $user = null) {
|
||||
if($user !== null) {
|
||||
$this->user = $user;
|
||||
$this->setFrom(SERVER_EMAIL, SERVER_EMAIL_NAME)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user