+ }
+ $this->messages->add('s', _('import from Readability completed. ' . $count . ' new links.'));
+ Tools::logm('import from Readability completed');
+ Tools::redirect();
+ }
+
+ /**
+ * import from Poche exported file
+ * @param string $targetFile the file used for importing
+ * @return boolean
+ */
+ private function importFromPoche($targetFile)
+ {
+ $str_data = file_get_contents($targetFile);
+ $data = json_decode($str_data,true);
+ Tools::logm('starting import from Poche');
+
+
+ $sequence = '';
+ if (STORAGE == 'postgres') {
+ $sequence = 'entries_id_seq';
+ }
+
+ $count = 0;
+ foreach ($data as $value) {
+
+ $url = new Url(base64_encode($value['url']));
+ $favorite = ($value['is_fav'] == -1);
+ $archive = ($value['is_read'] == -1);
+