/** * @author Rolando Antonio Arriaza * @todo Constructor de la clase mysqlconection * @version 1.3 * @param Array $conect_dsn Conecta un dsn nuevo fuera del la conexion principal * @param string $directory directorio del config (Option en vez del $conect_dsn) * @since 1.1 */ public function __construct() { global $CONFIG_; $this->dsn = $CONFIG_["DB_MYSQL"]["driver"] . ':host=' . $CONFIG_["DB_MYSQL"]["host"] . ';dbname=' . $CONFIG_["DB_MYSQL"]["database"] . ';port=' . $CONFIG_["DB_MYSQL"]["port"]; try { parent::__construct($this->dsn, $CONFIG_["DB_MYSQL"]["user"], $CONFIG_["DB_MYSQL"]["password"]); parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $ex) { $header = new \Http\Header(); if ($ex->getMessage() == "could not find driver") { $header->redirect(\Url\Url::GetContentUrl("web/admin/error/database/index.php?err=0")); } else { $header->redirect(\Url\Url::GetContentUrl("web/admin/error/database/index.php?err=1")); } } }
public static function GetContentUrl($link = "") { return \Url\Url::GetContentUrl($link); }