diff options
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-x | inc/poche/Database.class.php | 19 |
1 files changed, 3 insertions, 16 deletions
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 @@ | |||
5 | * @category wallabag | 5 | * @category wallabag |
6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> | 6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> |
7 | * @copyright 2013 | 7 | * @copyright 2013 |
8 | * @license http://www.wtfpl.net/ see COPYING file | 8 | * @license http://opensource.org/licenses/MIT see COPYING file |
9 | */ | 9 | */ |
10 | 10 | ||
11 | class Database { | 11 | class Database { |
@@ -38,6 +38,7 @@ class Database { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | 40 | $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
41 | $this->_checkTags(); | ||
41 | Tools::logm('storage type ' . STORAGE); | 42 | Tools::logm('storage type ' . STORAGE); |
42 | } | 43 | } |
43 | 44 | ||
@@ -45,21 +46,7 @@ class Database { | |||
45 | return $this->handle; | 46 | return $this->handle; |
46 | } | 47 | } |
47 | 48 | ||
48 | public function isInstalled() { | 49 | private function _checkTags() { |
49 | $sql = "SELECT username FROM users"; | ||
50 | $query = $this->executeQuery($sql, array()); | ||
51 | if ($query == false) { | ||
52 | die(STORAGE . ' database looks empty. You have to create it (you can find database structure in install folder).'); | ||
53 | } | ||
54 | $hasAdmin = count($query->fetchAll()); | ||
55 | |||
56 | if ($hasAdmin == 0) | ||
57 | return false; | ||
58 | |||
59 | return true; | ||
60 | } | ||
61 | |||
62 | public function checkTags() { | ||
63 | 50 | ||
64 | if (STORAGE == 'sqlite') { | 51 | if (STORAGE == 'sqlite') { |
65 | $sql = ' | 52 | $sql = ' |