WHAT. A. BIG. REFACTOR. + new license (we moved to MIT one)

This commit is contained in:
Nicolas Lœuillet
2014-07-11 16:03:59 +02:00
parent 6400371ff9
commit 3602405ec0
20 changed files with 930 additions and 771 deletions

View File

@ -5,7 +5,7 @@
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @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 = '