]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/db.php
création d'une classe store() pour gérer tout type de stockage : sqlite, file, mysql...
[github/wallabag/wallabag.git] / inc / db.php
CommitLineData
e46efced 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
10
11class db {
12 var $handle;
d178419c 13 function __construct($path) {
e46efced 14 $this->handle = new PDO($path);
1c182b6c 15 $this->handle->exec('CREATE TABLE IF NOT EXISTS "entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , "title" VARCHAR, "url" VARCHAR UNIQUE , "is_read" INTEGER DEFAULT 0, "is_fav" INTEGER DEFAULT 0, "content" BLOB)');
e46efced 16 $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
17 }
18
d178419c 19 public function getHandle() {
e46efced 20 return $this->handle;
21 }
22}