X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FDatabase.class.php;fp=inc%2Fpoche%2FDatabase.class.php;h=9c1c0286b4fd2feafebea8e04b94c83c2bc2be3f;hb=3602405ec0dbc576fce09ff9e865ba2404622080;hp=11cccb7238d9d6a6e16695386152a25fc6789fa8;hpb=6400371ff93782d25cdbd50aa224c70145b3890a;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 11cccb72..9c1c0286 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -5,7 +5,7 @@ * @category wallabag * @author Nicolas Lœuillet * @copyright 2013 - * @license http://www.wtfpl.net/ see COPYING file + * @license http://opensource.org/licenses/MIT see COPYING file */ class Database { @@ -38,6 +38,7 @@ class Database { } $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $this->_checkTags(); Tools::logm('storage type ' . STORAGE); } @@ -45,21 +46,7 @@ class Database { return $this->handle; } - public function isInstalled() { - $sql = "SELECT username FROM users"; - $query = $this->executeQuery($sql, array()); - if ($query == false) { - die(STORAGE . ' database looks empty. You have to create it (you can find database structure in install folder).'); - } - $hasAdmin = count($query->fetchAll()); - - if ($hasAdmin == 0) - return false; - - return true; - } - - public function checkTags() { + private function _checkTags() { if (STORAGE == 'sqlite') { $sql = '