/** * Instantiates the database connection * * @author Art <*****@*****.**> * * @param string $ip The IP address to use * @param int $port The port to use * @param string $user The username * @param string $pw The password * @param string $db The database to use * @param string $cache Which cache interface to use * @param array $options Connection options */ function __construct($ip = ALO_MYSQL_SERVER, $port = ALO_MYSQL_PORT, $user = ALO_MYSQL_USER, $pw = ALO_MYSQL_PW, $db = ALO_MYSQL_DATABASE, $cache = ALO_MYSQL_CACHE, array $options = null) { $this->pdo = new PDO('mysql:dbname=' . $db . ';host=' . $ip . ';charset=' . ALO_MYSQL_CHARSET . ';port=' . $port, $user, $pw, $options); $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $this->cachePrefix = ALO_MYSQL_CACHE_PREFIX; parent::__construct($cache); \Log::debug('Initialised MySQL database connection'); }