/** * Append the character set specifications to a command. * * @param string $sql * @param \Illuminate\Database\Connection $connection * @return string */ protected function compileCreateEncoding($sql, Connection $connection) { if (!is_null($charset = $connection->getConfig('charset'))) { $sql .= ' default character set ' . $charset; } if (!is_null($collation = $connection->getConfig('collation'))) { $sql .= ' collate ' . $collation; } return $sql; }
protected function _setUp() { $config = \XenForo_Application::getConfig()->toArray(); $config = $config['db']; // XenForo only supports MySQL I think... $config['driver'] = 'mysql'; $config['database'] = $config['dbname']; $config['collation'] = 'utf8_general_ci'; $config['charset'] = 'utf8'; $pdo = Connector::create($config, true); $this->_connection = Connection::create($config['driver'], $pdo, $config['database']); $this->_schema = $this->_connection->getSchemaBuilder(); $this->_db = \XenForo_Application::getDb(); }
/** * Create a new database Schema manager. * * @param \Illuminate\Database\Connection $connection * @return void */ public function __construct(Connection $connection) { $this->connection = $connection; $this->grammar = $connection->getSchemaGrammar(); }