aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r--inc/poche/Poche.class.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 56910bc0..2af49acd 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -18,6 +18,11 @@ class Poche
18 18
19 function __construct() 19 function __construct()
20 { 20 {
21 if (file_exists('./install') && !DEBUG_POCHE) {
22 Tools::logm('folder /install exists');
23 die('To install your poche with sqlite, copy /install/poche.sqlite in /db and delete the folder /install. you have to delete the /install folder before using poche.');
24 }
25
21 $this->store = new Database(); 26 $this->store = new Database();
22 $this->init(); 27 $this->init();
23 $this->messages = new Messages(); 28 $this->messages = new Messages();
@@ -31,11 +36,6 @@ class Poche
31 36
32 private function init() 37 private function init()
33 { 38 {
34 if (file_exists('./install') && !DEBUG_POCHE) {
35 Tools::logm('folder /install exists');
36 die('the folder /install exists, you have to delete it before using poche.');
37 }
38
39 Tools::initPhp(); 39 Tools::initPhp();
40 Session::init(); 40 Session::init();
41 41
@@ -69,6 +69,10 @@ class Poche
69 $filter = new Twig_SimpleFilter('getDomain', 'Tools::getDomain'); 69 $filter = new Twig_SimpleFilter('getDomain', 'Tools::getDomain');
70 $this->tpl->addFilter($filter); 70 $this->tpl->addFilter($filter);
71 71
72 # filter for reading time
73 $filter = new Twig_SimpleFilter('getReadingTime', 'Tools::getReadingTime');
74 $this->tpl->addFilter($filter);
75
72 # Pagination 76 # Pagination
73 $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p'); 77 $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p');
74 } 78 }
@@ -122,6 +126,8 @@ class Poche
122 $last_id = $this->store->getLastId($sequence); 126 $last_id = $this->store->getLastId($sequence);
123 if (DOWNLOAD_PICTURES) { 127 if (DOWNLOAD_PICTURES) {
124 $content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id); 128 $content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id);
129 Tools::logm('updating content article');
130 $this->store->updateContent($last_id, $content, $this->user->getId());
125 } 131 }
126 if (!$import) { 132 if (!$import) {
127 $this->messages->add('s', _('the link has been added successfully')); 133 $this->messages->add('s', _('the link has been added successfully'));
@@ -213,7 +219,7 @@ class Poche
213 ); 219 );
214 } 220 }
215 else { 221 else {
216 Tools::logm('error in view call : entry is NULL'); 222 Tools::logm('error in view call : entry is null');
217 } 223 }
218 break; 224 break;
219 default: # home view 225 default: # home view