summaryrefslogtreecommitdiff
path: root/plugins/session/session.module
blob: c979a8a83bc17f9c50b8989a0a761b7120983230 (plain)
1
2
3
4
5
6
7
8
9
10
11
<?php

function session_db($mysql) {
  $options = [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'];
  return new PDO($mysql['dsn'], $mysql['username'], $mysql['password'], $options);
}

function session_init($config) {
  require_once __DIR__ . '/BridgeSession.php';
  return new BridgeSession(session_db($config['mysql']), $config);
}