Fix systematic errors in pagination, sucursal warnings, and fatal count() errors across multiple modules
This commit is contained in:
48
diagnose_docroot.php
Executable file
48
diagnose_docroot.php
Executable file
@@ -0,0 +1,48 @@
|
||||
<?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";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user