- Refactored AuthService to use UserRepository for user authentication. - Added .env file for environment configuration. - Created migration system with Migrator and ConnectionFactory classes. - Added database migration files for creating users table. - Implemented settings controller for managing database migrations. - Developed user repository for user data handling. - Created users controller for user management interface. - Added frontend standards and migration documentation. - Introduced reusable UI components and jQuery alerts module.
38 lines
877 B
PHP
38 lines
877 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use App\Core\Application;
|
|
use App\Core\Support\Env;
|
|
|
|
$basePath = dirname(__DIR__);
|
|
$vendorAutoload = $basePath . '/vendor/autoload.php';
|
|
|
|
if (is_file($vendorAutoload)) {
|
|
require $vendorAutoload;
|
|
} else {
|
|
spl_autoload_register(static function (string $class) use ($basePath): void {
|
|
$prefix = 'App\\';
|
|
if (!str_starts_with($class, $prefix)) {
|
|
return;
|
|
}
|
|
|
|
$relative = substr($class, strlen($prefix));
|
|
$file = $basePath . '/src/' . str_replace('\\', '/', $relative) . '.php';
|
|
if (is_file($file)) {
|
|
require $file;
|
|
}
|
|
});
|
|
}
|
|
|
|
Env::load($basePath . '/.env');
|
|
|
|
$config = [
|
|
'app' => require $basePath . '/config/app.php',
|
|
'database' => require $basePath . '/config/database.php',
|
|
];
|
|
|
|
$app = new Application($basePath, $config);
|
|
$app->boot();
|
|
|
|
return $app;
|