Files
2026-09-01 10:46:29 -03:00

177 lines
6.8 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
use App\Console\Commands\DbSyncSisTablesCommand;
use App\Console\Commands\DbBackupCommand;
use App\Console\Commands\DbRelationshipsCommand;
use App\Console\Commands\DbExportCommand;
use App\Console\Commands\DbListCommand;
use App\Console\Commands\DbMonitorCommand;
use App\Console\Commands\DbQueryCommand;
use App\Console\Commands\DbImportCommand;
use App\Console\Commands\DbShowCommand;
use App\Console\Commands\DbTableCommand;
use App\Console\Commands\DbOptimizeCommand;
use App\Console\Commands\DbWipeCommand;
use App\Console\Commands\DownCommand;
use App\Console\Commands\UpCommand;
use App\Console\Commands\EnvListCommand;
use App\Console\Commands\LogsClearCommand;
use App\Console\Commands\ActivityLogsClearCommand;
use App\Console\Commands\MakeMiddlewareCommand;
use App\Console\Commands\MakeRepositoryCommand;
use App\Console\Commands\MakeServiceCommand;
use App\Console\Commands\MakeInterfaceCommand;
use App\Console\Commands\MakeTraitCommand;
use App\Console\Commands\MakeExceptionCommand;
use App\Console\Commands\MakeViewCommand;
use App\Console\Commands\MakeHelperCommand;
use App\Console\Commands\DebugContainerCommand;
use App\Console\Commands\DebugRouterCommand;
use App\Console\Commands\MigrateCommand;
use App\Console\Commands\MigrateFreshCommand;
use App\Console\Commands\MigrateRefreshCommand;
use App\Console\Commands\RollbackCommand;
use App\Console\Commands\MigrationStatusCommand;
use App\Console\Commands\MakeMigrationCommand;
use App\Console\Commands\MakeMigrationModuleCommand;
use App\Console\Commands\CacheClearCommand;
use App\Console\Commands\OpcacheClearCommand;
use App\Console\Commands\CreateUserCommand;
use App\Console\Commands\CreateSuperAdminCommand;
use App\Console\Commands\UserListCommand;
use App\Console\Commands\UserDeleteCommand;
use App\Console\Commands\UserPasswordCommand;
use App\Console\Commands\UserRoleCommand;
use App\Console\Commands\UserRegisterCommand;
use App\Console\Commands\AppInfoCommand;
use App\Console\Commands\AppAboutCommand;
use App\Console\Commands\AppOptimizeCommand;
use App\Console\Commands\AppRenameCommand;
use App\Console\Commands\ModuleListCommand;
use App\Console\Commands\ModuleEnableCommand;
use App\Console\Commands\ModuleDisableCommand;
use App\Console\Commands\ModuleDeleteCommand;
use App\Console\Commands\ModuleRegisterCommand;
use App\Console\Commands\ModulePublishCommand;
use App\Console\Commands\ModuleMakeProviderCommand;
use App\Console\Commands\RouteListCommand;
use App\Console\Commands\StorageLinkCommand;
use App\Console\Commands\MakeModuleCommand;
use App\Console\Commands\MakeControllerCommand;
use App\Console\Commands\MakeModelCommand;
use App\Console\Commands\MakeCommandCommand;
use App\Console\Commands\MakeSeedCommand;
use App\Console\Commands\DbSeedCommand;
use App\Console\Commands\PermissionListCommand;
use App\Console\Commands\KeyGenerateCommand;
use Symfony\Component\Console\Application;
use Illuminate\Database\Capsule\Manager as Capsule;
use Kernel\ModuleLoader;
// Load Composer autoloader
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/app/helpers.php';
// Load environment variables
load_env();
// Initialize Module Loader
$moduleLoader = new ModuleLoader(__DIR__ . '/modules');
$moduleLoader->registerAutoload();
// $moduleLoader->loadAll(); // Optional: load modules if necessary for commands
// Initialize database (Eloquent)
$capsule = new Capsule;
$capsule->addConnection([
'driver' => $_ENV['DB_CONNECTION'] ?? 'mysql',
'host' => $_ENV['DB_HOST'] ?? 'localhost',
'port' => $_ENV['DB_PORT'] ?? '3306',
'database' => $_ENV['DB_DATABASE'] ?? 'syscms',
'username' => $_ENV['DB_USERNAME'] ?? 'root',
'password' => $_ENV['DB_PASSWORD'] ?? '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
]);
// Make Capsule instance globally available
$capsule->setAsGlobal();
// Initialize Eloquent ORM
$capsule->bootEloquent();
// Create Symfony Console application
$application = new Application('SysCMS Console', '1.0.0');
// Register commands
$application->add(new DbSyncSisTablesCommand());
$application->add(new DbBackupCommand());
$application->add(new DbRelationshipsCommand());
$application->add(new DbExportCommand());
$application->add(new DbListCommand());
$application->add(new DbMonitorCommand());
$application->add(new DbQueryCommand());
$application->add(new DbImportCommand());
$application->add(new DbShowCommand());
$application->add(new DbTableCommand());
$application->add(new DbOptimizeCommand());
$application->add(new DbWipeCommand());
$application->add(new DownCommand());
$application->add(new UpCommand());
$application->add(new EnvListCommand());
$application->add(new LogsClearCommand());
$application->add(new ActivityLogsClearCommand());
$application->add(new MakeMiddlewareCommand());
$application->add(new MakeRepositoryCommand());
$application->add(new MakeServiceCommand());
$application->add(new MakeInterfaceCommand());
$application->add(new MakeTraitCommand());
$application->add(new MakeExceptionCommand());
$application->add(new MakeViewCommand());
$application->add(new MakeHelperCommand());
$application->add(new DebugContainerCommand());
$application->add(new DebugRouterCommand());
$application->add(new MigrateCommand());
$application->add(new MigrateFreshCommand());
$application->add(new MigrateRefreshCommand());
$application->add(new RollbackCommand());
$application->add(new MigrationStatusCommand());
$application->add(new MakeMigrationCommand());
$application->add(new MakeMigrationModuleCommand());
$application->add(new CacheClearCommand());
$application->add(new OpcacheClearCommand());
$application->add(new CreateUserCommand());
$application->add(new CreateSuperAdminCommand());
$application->add(new UserListCommand());
$application->add(new UserDeleteCommand());
$application->add(new UserPasswordCommand());
$application->add(new UserRoleCommand());
$application->add(new UserRegisterCommand());
$application->add(new AppInfoCommand());
$application->add(new AppAboutCommand());
$application->add(new AppOptimizeCommand());
$application->add(new AppRenameCommand());
$application->add(new ModuleListCommand());
$application->add(new ModuleEnableCommand());
$application->add(new ModuleDisableCommand());
$application->add(new ModuleDeleteCommand());
$application->add(new ModuleRegisterCommand());
$application->add(new ModulePublishCommand());
$application->add(new ModuleMakeProviderCommand());
$application->add(new RouteListCommand());
$application->add(new StorageLinkCommand());
$application->add(new MakeModuleCommand());
$application->add(new MakeControllerCommand());
$application->add(new MakeModelCommand());
$application->add(new MakeCommandCommand());
$application->add(new MakeSeedCommand());
$application->add(new DbSeedCommand());
$application->add(new PermissionListCommand());
$application->add(new KeyGenerateCommand());
// Run the application
$application->run();