up
This commit is contained in:
+1
-4
@@ -21,10 +21,7 @@
|
|||||||
"WhatsApp\\": "classes/",
|
"WhatsApp\\": "classes/",
|
||||||
"WhatsApp\\Services\\": "services/",
|
"WhatsApp\\Services\\": "services/",
|
||||||
"WhatsApp\\Queue\\": "queue/"
|
"WhatsApp\\Queue\\": "queue/"
|
||||||
},
|
}
|
||||||
"files": [
|
|
||||||
"config/config.php"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"optimize-autoloader": true,
|
"optimize-autoloader": true,
|
||||||
|
|||||||
@@ -47,6 +47,15 @@ function loadEnvFile($path) {
|
|||||||
// Cargar .env si existe
|
// Cargar .env si existe
|
||||||
loadEnvFile(__DIR__ . '/../.env');
|
loadEnvFile(__DIR__ . '/../.env');
|
||||||
|
|
||||||
|
// Cargar autoloader de Composer si existe (solo una vez)
|
||||||
|
$composerAutoload = __DIR__ . '/../vendor/autoload.php';
|
||||||
|
if (file_exists($composerAutoload)) {
|
||||||
|
// Verificar que no se haya cargado ya usando una clase del autoloader
|
||||||
|
if (!class_exists('Predis\Client', false)) {
|
||||||
|
require_once $composerAutoload;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Función helper para obtener variables de entorno
|
// Función helper para obtener variables de entorno
|
||||||
if (!function_exists('env')) {
|
if (!function_exists('env')) {
|
||||||
function env($key, $default = null) {
|
function env($key, $default = null) {
|
||||||
@@ -65,6 +74,7 @@ function isInstallationCompleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Función para obtener configuración desde base de datos
|
// Función para obtener configuración desde base de datos
|
||||||
|
if (!function_exists('getConfigFromDB')) {
|
||||||
function getConfigFromDB($key, $default = null) {
|
function getConfigFromDB($key, $default = null) {
|
||||||
static $configs = null;
|
static $configs = null;
|
||||||
global $config_cache_cleared;
|
global $config_cache_cleared;
|
||||||
@@ -108,6 +118,7 @@ function getConfigFromDB($key, $default = null) {
|
|||||||
|
|
||||||
return $configs[$key] ?? $default;
|
return $configs[$key] ?? $default;
|
||||||
}
|
}
|
||||||
|
} // end if !function_exists('getConfigFromDB')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guarda una configuración en la base de datos
|
* Guarda una configuración en la base de datos
|
||||||
|
|||||||
Reference in New Issue
Block a user