From 7f41eb831cd55d9003648a25b4c6f0ab97bbeec0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 22 Apr 2018 18:45:30 +0200 Subject: [PATCH] Remove class FramaDB and unused call Signed-off-by: Thomas Citharel --- app/classes/Framadate/FramaDB.php | 99 ------------------- .../Framadate/Repositories/VoteRepository.php | 1 - 2 files changed, 100 deletions(-) delete mode 100644 app/classes/Framadate/FramaDB.php diff --git a/app/classes/Framadate/FramaDB.php b/app/classes/Framadate/FramaDB.php deleted file mode 100644 index 9d477d9..0000000 --- a/app/classes/Framadate/FramaDB.php +++ /dev/null @@ -1,99 +0,0 @@ -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 d7a362b..0c2aa02 100644 --- a/app/classes/Framadate/Repositories/VoteRepository.php +++ b/app/classes/Framadate/Repositories/VoteRepository.php @@ -1,7 +1,6 @@