- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
74 lines
2.8 KiB
PHP
74 lines
2.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Bootstrap Discovery System
|
|
*
|
|
* This script runs the discovery scanners and stores results
|
|
* Run this ONCE to initialize the new discovery system
|
|
*/
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\BuildTime\Discovery\Scanners\AttributeScanner;
|
|
use App\Framework\BuildTime\Discovery\Scanners\InterfaceScanner;
|
|
use App\Framework\BuildTime\Discovery\Scanners\TemplateScanner;
|
|
use App\Framework\Core\PathProvider;
|
|
use App\Framework\Discovery\Storage\DiscoveryStorageService;
|
|
use App\Framework\Filesystem\FileScanner;
|
|
use App\Framework\Filesystem\FileSystemService;
|
|
use App\Framework\Logging\NullLogger;
|
|
use App\Framework\Reflection\CachedReflectionProvider;
|
|
|
|
echo "🚀 Bootstrapping Discovery System...\n\n";
|
|
$totalStart = microtime(true);
|
|
|
|
// Create dependencies
|
|
$basePath = __DIR__ . '/../..';
|
|
$pathProvider = new PathProvider($basePath);
|
|
$storage = new DiscoveryStorageService($pathProvider);
|
|
$fileSystemService = new FileSystemService();
|
|
$logger = null;
|
|
$fileScanner = new FileScanner($logger, null, $fileSystemService);
|
|
$reflectionProvider = new CachedReflectionProvider();
|
|
|
|
// 1. Discover Attributes
|
|
echo "📦 Discovering attributes...\n";
|
|
$attrStart = microtime(true);
|
|
$attributeScanner = new AttributeScanner($fileScanner, $reflectionProvider);
|
|
$paths = [$pathProvider->getSourcePath()];
|
|
$attributeRegistry = $attributeScanner->scan($paths);
|
|
$storage->storeAttributes($attributeRegistry);
|
|
$attrDuration = round((microtime(true) - $attrStart) * 1000, 2);
|
|
echo " ✅ {$attributeRegistry->count()} attributes in {$attrDuration}ms\n\n";
|
|
|
|
// 2. Discover Templates
|
|
echo "📄 Discovering templates...\n";
|
|
$tplStart = microtime(true);
|
|
$templateScanner = new TemplateScanner($fileScanner);
|
|
$templatePaths = [
|
|
$pathProvider->getSourcePath(),
|
|
$pathProvider->getBasePath() . '/resources'
|
|
];
|
|
$templateRegistry = $templateScanner->scan($templatePaths);
|
|
$storage->storeTemplates($templateRegistry);
|
|
$tplDuration = round((microtime(true) - $tplStart) * 1000, 2);
|
|
echo " ✅ " . count($templateRegistry->getAll()) . " templates in {$tplDuration}ms\n\n";
|
|
|
|
// 3. Discover Interfaces
|
|
echo "🔌 Discovering interface implementations...\n";
|
|
$intStart = microtime(true);
|
|
$interfaceScanner = new InterfaceScanner($fileScanner, $reflectionProvider, []);
|
|
$interfaceRegistry = $interfaceScanner->scan($paths);
|
|
$storage->storeInterfaces($interfaceRegistry);
|
|
$intDuration = round((microtime(true) - $intStart) * 1000, 2);
|
|
echo " ✅ {$interfaceRegistry->count()} implementations in {$intDuration}ms\n\n";
|
|
|
|
// Summary
|
|
$totalDuration = round((microtime(true) - $totalStart) * 1000, 2);
|
|
echo str_repeat("=", 60) . "\n";
|
|
echo "🎉 Discovery bootstrap complete in {$totalDuration}ms\n";
|
|
echo " 📁 Stored in: storage/discovery/\n";
|
|
echo str_repeat("=", 60) . "\n";
|