<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require_once __DIR__ . '/../services/analytics/AnalyticsEngine.php';

header('Content-Type: text/plain; charset=utf-8');

try {
    $engine = new AnalyticsEngine();
    $engine->rebuild();

    echo "OK ANALYTICS" . PHP_EOL;
    echo "Analytics Engine reconstruido correctamente." . PHP_EOL;
} catch (Exception $e) {
    echo "ERROR ANALYTICS" . PHP_EOL;
    echo $e->getMessage() . PHP_EOL;
}