Changeset View
Changeset View
Standalone View
Standalone View
src/Tasks/WithMySQL.php
- This file was added.
<?php | |||||
namespace Nasqueron\SAAS\PhpBB\Tasks; | |||||
use Nasqueron\SAAS\PhpBB\Config\DefaultConfiguration; | |||||
use PDO; | |||||
trait WithMySQL { | |||||
public function getMySQLDatabase() : PDO { | |||||
$info = DefaultConfiguration::getMySQLConnectionInformation(); | |||||
return new PDO( | |||||
DefaultConfiguration::getMySQLDatasourceName(), | |||||
$info['user'], | |||||
$info['pass'], | |||||
[ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ] | |||||
); | |||||
} | |||||
} |
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator