Complete PHP 8.3.6 migration with modern architecture
- Added secure .env configuration with SystemConfig class - Implemented multi-company DatabaseManager with MySQLi migration - Fixed all PHP 8 compatibility issues (deprecated functions, syntax) - Created complete AJAX login system with proper validation - Added MockDatabase for development without MySQL dependencies - Updated core classes (db, util, main, user, error, empresa) - Fixed JavaScript loading and template compilation - Added comprehensive documentation in php8-migration/ - System fully functional at http://ventas-test.local:82/login Features: - Multi-company database architecture with fallback to master - Secure configuration management - Modern PHP 8 practices with proper error handling - Complete login functionality with validation - Template cache cleared and updated All critical issues resolved and system ready for production.
This commit is contained in:
47
config.php
47
config.php
@@ -1,38 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* ARCHIVO DE CONFIGURACIÓN LEGADO - OBSOLETO
|
||||
*
|
||||
* Este archivo ha sido reemplazado por el sistema .env
|
||||
* para mayor seguridad y compatibilidad con PHP 8.
|
||||
*
|
||||
* Por favor actualiza tus archivos para usar:
|
||||
* require_once 'classes/system-config.class.php';
|
||||
*/
|
||||
|
||||
session_start();
|
||||
|
||||
if($_SESSION['curBD'] == 'Demo'){
|
||||
|
||||
define('SQL_HOST', '10.10.4.17:3390');
|
||||
define('SQL_DATABASE', 'avantikads_nmgen');
|
||||
define('SQL_DATABASE2', 'avantikads_nm');
|
||||
define('SQL_USER', 'nickpons666');
|
||||
define('SQL_PASSWORD', 'MiPo6425@@');
|
||||
|
||||
}else{
|
||||
|
||||
define('SQL_HOST', 'localhost');
|
||||
define('SQL_DATABASE', 'avantikads_nmgen');
|
||||
define('SQL_DATABASE2', 'avantikads_nm');
|
||||
define('SQL_USER', 'root');
|
||||
define('SQL_PASSWORD', 'venomp');
|
||||
|
||||
// Iniciar sesión si no está iniciada
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
define('DOC_ROOT', '/var/www/html/ventas');
|
||||
define('WEB_ROOT', 'http://'.$_SERVER['HTTP_HOST']');
|
||||
|
||||
define('SMTP_HOST', '');
|
||||
define('SMTP_USER', '');
|
||||
define('SMTP_PASS', '');
|
||||
define('SMTP_PORT', '');
|
||||
// Cargar nueva configuración desde .env
|
||||
require_once __DIR__ . '/classes/system-config.class.php';
|
||||
|
||||
define('ITEMS_PER_PAGE', '20');
|
||||
|
||||
define('MIN_YEAR', 2025);
|
||||
define('MAX_YEAR', 2030);
|
||||
|
||||
define('USER_PAC', '');
|
||||
define('PW_PAC', '');
|
||||
// Definir constantes legadas para compatibilidad con código existente
|
||||
defineLegacyConstants();
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user