Exemple #1
0
 public function __construct(array $params)
 {
     $params['type'] = strtolower($params['type']);
     switch ($params['type']) {
         case 'mysql':
         case 'pgsql':
             break;
         case 'postgresql':
             $params['type'] = 'pgsql';
             break;
         default:
             throw OutOfBoundsException('想定外のDBです');
     }
     $class = 'AttoDbo_Connection' . ucfirst($params['type']);
     if (!class_exists($class, false)) {
         require Atto::dir_atto_classes() . 'atto-dao' . DS . 'connection-' . $params['type'] . '.php';
     }
     $this->_con = new $class($params);
 }