- 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.
100 lines
2.7 KiB
Plaintext
Executable File
100 lines
2.7 KiB
Plaintext
Executable File
# Ejemplo de archivo .env para sistema multi-empresa
|
|
# COPIAR ESTE CONTENIDO A UN ARCHIVO .env EN LA RAÍZ DEL PROYECTO
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN DE BASES DE DATOS MULTI-EMPRESA
|
|
# =============================================================================
|
|
# NOTA: No incluir información sensible en el código
|
|
# Todas las credenciales deben estar en este archivo .env
|
|
|
|
# Base de datos Master (para autenticación y catálogos globales)
|
|
# Basado en estructura real: avantikads_nmgen
|
|
DB_MASTER_HOST=localhost
|
|
DB_MASTER_DATABASE=avantikads_nmgen
|
|
DB_MASTER_USER=root
|
|
DB_MASTER_PASSWORD=venomp
|
|
|
|
# Configuración general de conexión
|
|
DB_HOST=localhost
|
|
DB_PORT=3306
|
|
DB_CHARSET=utf8mb4
|
|
|
|
# Prefijo para bases de datos de empresas
|
|
# Patón real: avantikads_nm{empresaId}
|
|
DB_EMPRESA_PREFIX=avantikads_nm
|
|
DB_EMPRESA_USER=root
|
|
DB_EMPRESA_PASSWORD=venomp
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN DEL SISTEMA
|
|
# =============================================================================
|
|
|
|
# Rutas del sistema
|
|
DOC_ROOT=/var/www/html/ventas
|
|
WEB_ROOT=http://localhost
|
|
|
|
# Configuración SMTP (correos)
|
|
SMTP_HOST=smtp.gmail.com
|
|
SMTP_USER=tu_correo@gmail.com
|
|
SMTP_PASS=tu_password_app
|
|
SMTP_PORT=587
|
|
|
|
# Configuración PAC (Facturación electrónica)
|
|
USER_PAC=tu_usuario_pac
|
|
PW_PAC=tu_password_pac
|
|
|
|
# Configuración de paginación
|
|
ITEMS_PER_PAGE=20
|
|
|
|
# Rango de años válidos
|
|
MIN_YEAR=2025
|
|
MAX_YEAR=2030
|
|
|
|
# Modo de depuración (true/false)
|
|
DEBUG_MODE=false
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN ADICIONAL
|
|
# =============================================================================
|
|
|
|
# Configuración de sesión
|
|
SESSION_LIFETIME=3600
|
|
SESSION_PATH=/
|
|
SESSION_DOMAIN=
|
|
|
|
# Configuración de seguridad
|
|
ENCRYPTION_KEY=tu_clave_encriptacion_32_chars
|
|
JWT_SECRET=tu_jwt_secret_key_aqui
|
|
|
|
# Configuración de archivos
|
|
MAX_FILE_SIZE=10485760
|
|
ALLOWED_FILE_TYPES=pdf,xml,csv,xlsx
|
|
|
|
# Configuración de respaldos
|
|
BACKUP_PATH=/var/backups/ventas
|
|
AUTO_BACKUP=true
|
|
BACKUP_RETENTION_DAYS=30
|
|
|
|
# =============================================================================
|
|
# VARIABLES ESPECÍFICAS DEL NEGOCIO
|
|
# =============================================================================
|
|
|
|
# Tasas de impuestos (pueden venir de BD pero tener valores por defecto)
|
|
IVA_RATE=0.16
|
|
ISR_RATE=0.10
|
|
|
|
# Configuración de facturación
|
|
SERIE_FACTURA=A
|
|
SERIE_NOTA_CREDITO=B
|
|
FOLIO_INICIAL=1
|
|
|
|
# Información bancaria por defecto (actualizar según empresa)
|
|
BANK_NAME=Banamex
|
|
BANK_ACCOUNT=224996
|
|
BANK_CLABE=002100017902249960
|
|
BANK_BRANCH=0179
|
|
|
|
# Contacto por defecto
|
|
CONTACT_PHONE=(961) 10 5 58 20
|
|
CONTACT_EMAIL=contacto@empresa.com
|
|
CONTACT_WEB=www.empresa.com |