Files
ventas_php/diagnose_docroot.php

48 lines
1.2 KiB
PHP
Executable File

<?php
/**
* Script para detectar y arreglar el problema de DOC_ROOT
*/
echo "🔧 Diagnosticando y arreglando DOC_ROOT...\n";
// Verificar si config.php define DOC_ROOT correctamente
$configContent = file_get_contents('config.php');
if (strpos($configContent, 'defineLegacyConstants') !== false) {
echo "✅ config.php está usando defineLegacyConstants\n";
} else {
echo "❌ config.php necesita actualización manual\n";
}
// Probar carga de sistema
echo "\n🧪 Probando carga del sistema...\n";
try {
// Iniciar sesión
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Cargar sistema de configuración
require_once 'classes/system-config.class.php';
defineLegacyConstants();
echo "✅ SystemConfig cargado\n";
echo " - DOC_ROOT: " . DOC_ROOT . "\n";
echo " - WEB_ROOT: " . WEB_ROOT . "\n";
// Probar libraries.php
ob_start();
include 'libraries.php';
ob_end_clean();
echo "✅ libraries.php cargado sin errores\n";
} catch (Exception $e) {
echo "❌ Error: " . $e->getMessage() . "\n";
} catch (Error $e) {
echo "❌ Error fatal: " . $e->getMessage() . "\n";
}
echo "\n🎯 Diagnóstico completado\n";
?>