public function __construct($slave = false, $domain = false, $server = false)
 {
     $parametro = new Parametros();
     if ($domain == false) {
         if (defined('URL_BASE_FULL')) {
             $urlBase = explode('/', URL_BASE_FULL);
             $urlBase = $urlBase[0];
         } else {
             $urlBase = 'none';
         }
     } else {
         $urlBase = $domain;
     }
     $lang = false;
     if (file_exists(ETC . 'company.inc.php')) {
         require ETC . 'company.inc.php';
         if (isset($company[$urlBase])) {
             if (is_array($company[$urlBase])) {
                 if (isset($company[$urlBase]['LANGUAGE'])) {
                     $lang = $company[$urlBase]['LANGUAGE'];
                 }
                 if (isset($company[$urlBase]['CONFIGFILE'])) {
                     if (file_exists(ETC . $company[$urlBase]['CONFIGFILE'])) {
                         require ETC . $company[$urlBase]['CONFIGFILE'];
                     } else {
                         header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
                         //header('HTTP/1.0 500 Error company file');
                         echo "Error company file";
                         exit;
                     }
                 } else {
                     header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
                     //header('HTTP/1.0 500 Error company param');
                     echo "Error company param";
                     exit;
                 }
                 if (isset($company[$urlBase]['TIMEZONE'])) {
                     date_default_timezone_set($company[$urlBase]['TIMEZONE']);
                     ini_set('date.timezone', $company[$urlBase]['TIMEZONE']);
                 }
                 if (isset($company[$urlBase]['DEC_POINT'])) {
                     $DEC_POINT = $company[$urlBase]['DEC_POINT'];
                 }
                 if (isset($company[$urlBase]['THOUSANDS_SEP'])) {
                     $THOUSANDS_SEP = $company[$urlBase]['THOUSANDS_SEP'];
                 }
             } else {
                 if (file_exists(ETC . $company[$urlBase])) {
                     require ETC . $company[$urlBase];
                 } else {
                     header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
                     //header('HTTP/1.0 500 Error company param');
                     echo "Error company file";
                     exit;
                 }
             }
         } else {
             header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
             //header('HTTP/1.0 500 Error company param');
             echo "Error company not found";
             exit;
         }
     } else {
         require ETC . 'config.inc.php';
     }
     if (!defined('DEC_POINT')) {
         if (isset($DEC_POINT)) {
             define('DEC_POINT', $DEC_POINT);
         } else {
             define('DEC_POINT', ',');
         }
     }
     if (!defined('THOUSANDS_SEP')) {
         if (isset($THOUSANDS_SEP)) {
             define('THOUSANDS_SEP', $THOUSANDS_SEP);
         } else {
             define('THOUSANDS_SEP', '.');
         }
     }
     $conn = $parametro->get("ConnectBD", true);
     $this->logs = new Logs($parametro);
     if ($conn) {
         $conexion = new Connect($parametro, $this->logs, $slave);
         $parametro = new Parametrosdb($parametro, $conexion);
         $this->conexion = $conexion;
     }
     if ($server == true) {
         $this->parametro = $parametro;
         $this->basic = new Basic($parametro, $conexion, $this->logs, false);
         $this->curl = new curl($parametro, $this->logs);
         $this->language = Language::getInstance();
     } else {
         $this->parametro = $parametro;
         $this->plantilla = new plantilla($lang);
         $this->protect = new Protect($parametro, $conexion, $this->logs, $lang);
         $this->language = Language::getInstance();
         $this->basic = new Basic($parametro, $conexion, $this->logs, $this->language);
         $this->bmonitor = new bmonitor($parametro, $conexion, $this->logs, $this->language, $this->protect, $this->basic, $this->plantilla);
         $this->generate = new generate($parametro, $conexion, $this->logs, $this->language, $this->protect, $this->basic, $this->plantilla);
         $this->graph = new Graph($parametro, $conexion, $this->logs);
         $this->charts = new Charts($parametro, $conexion, $this->logs);
         $this->curl = new curl($parametro, $this->logs);
     }
 }