diff --git a/app/classes/Framadate/FramaDB.php b/app/classes/Framadate/FramaDB.php deleted file mode 100644 index 9d477d9fe948a579a177f1636ea9157ae30afdf0..0000000000000000000000000000000000000000 --- a/app/classes/Framadate/FramaDB.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -/** - * This software is governed by the CeCILL-B license. If a copy of this license - * is not distributed with this file, you can obtain one at - * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt - * - * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ - * Authors of Framadate/OpenSondage: Framasoft (https://github.com/framasoft) - * - * ============================= - * - * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence - * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur - * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt - * - * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ - * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) - */ -namespace Framadate; - -use PDO; - -class FramaDB { - /** - * PDO Object, connection to database. - */ - private $pdo = null; - - function __construct($connection_string, $user, $password) { - $this->pdo = new \PDO($connection_string, $user, $password); - $this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_OBJ); - $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - } - - /** - * @return \PDO Connection to database - */ - function getPDO() { - return $this->pdo; - } - - /** - * Find all tables in database. - * - * @return array|false The array of table names - */ - public function allTables() - { - $driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); - switch ($driver) { - case 'mysql': - $result = $this->pdo->query('SHOW TABLES'); - $schemas = $result->fetchAll(\PDO::FETCH_COLUMN); - break; - case 'pgsql': - $result = $this->pdo->query( - "SELECT table_name FROM information_schema.tables WHERE table_schema='public'" - ); - $schemas = $result->fetchAll(\PDO::FETCH_COLUMN); - break; - default: - return false; - } - - return $schemas; - } - - function prepare($sql) { - return $this->pdo->prepare($sql); - } - - function beginTransaction() { - $this->pdo->beginTransaction(); - } - - function commit() { - $this->pdo->commit(); - } - - function rollback() { - $this->pdo->rollback(); - } - - function errorCode() { - return $this->pdo->errorCode(); - } - - function errorInfo() { - return $this->pdo->errorInfo(); - } - - function query($sql) { - return $this->pdo->query($sql); - } - - public function lastInsertId() { - return $this->pdo->lastInsertId(); - } -} diff --git a/app/classes/Framadate/Repositories/VoteRepository.php b/app/classes/Framadate/Repositories/VoteRepository.php index d7a362b8db0103357341b15260a64f41f6f7f413..0c2aa0286c518ff116e24eb273549954bbe52800 100644 --- a/app/classes/Framadate/Repositories/VoteRepository.php +++ b/app/classes/Framadate/Repositories/VoteRepository.php @@ -1,7 +1,6 @@ <?php namespace Framadate\Repositories; -use Framadate\FramaDB; use Framadate\Utils; class VoteRepository extends AbstractRepository {