Deploy on 2026-06-05 12:22:27

This commit is contained in:
Hamza-Ayed
2026-06-05 12:22:27 +03:00
parent d5871be373
commit c911518189
2 changed files with 905 additions and 0 deletions

14
cli.php
View File

@@ -27,6 +27,7 @@ use App\Services\Crawler\RssParser;
use App\Services\Crawler\AiAnalyzer;
use App\Services\Crawler\Collector;
use Database\Seeds\DatabaseSeeder;
use Database\Seeds\SourceSeeder;
$container = new Container();
@@ -34,6 +35,7 @@ $container = new Container();
$container->singleton(Connection::class, Connection::class);
$container->singleton(MigrationRunner::class, MigrationRunner::class);
$container->singleton(DatabaseSeeder::class, DatabaseSeeder::class);
$container->singleton(SourceSeeder::class, SourceSeeder::class);
// Crawler service (needed for CLI collect command)
$container->singleton(RssParser::class, RssParser::class);
@@ -55,6 +57,17 @@ switch ($command) {
}
break;
case 'seed-sources':
echo "=== Seeding 100+ Data Sources ===\n";
try {
$seeder = $container->get(SourceSeeder::class);
$seeder->seed();
} catch (\Throwable $e) {
echo "Seeding sources failed: " . $e->getMessage() . "\n";
exit(1);
}
break;
case 'seed':
echo "=== Running Database Seeder ===\n";
try {
@@ -99,6 +112,7 @@ switch ($command) {
echo "Commands:\n";
echo " migrate Run SQL database migrations\n";
echo " seed Seed the database with default data\n";
echo " seed-sources Seed 100+ data sources (RSS feeds)\n";
echo " collect Run data collector (RSS feeds)\n";
echo " help Show this help menu\n";
break;