aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/NetscapeBookmarkUtils.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-01-16 12:31:08 +0100
committerArthurHoaro <arthur@hoa.ro>2017-03-21 20:29:20 +0100
commit4306b184c4471825f916d895b047ed03fdf58985 (patch)
treeae4ffd760d74e58bf469f743076aecf838f634f2 /application/NetscapeBookmarkUtils.php
parentb2306b0c783365e3f8110ae25bc93f2630b8b2c8 (diff)
downloadShaarli-4306b184c4471825f916d895b047ed03fdf58985.tar.gz
Shaarli-4306b184c4471825f916d895b047ed03fdf58985.tar.zst
Shaarli-4306b184c4471825f916d895b047ed03fdf58985.zip
History mechanism
Use case: rest API service * saved by default in data/history * same format as datastore.php * traced events: * save/edit/delete link * change settings or plugins settings * rename tag
Diffstat (limited to 'application/NetscapeBookmarkUtils.php')
-rw-r--r--application/NetscapeBookmarkUtils.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php
index ab346f81..bbfde138 100644
--- a/application/NetscapeBookmarkUtils.php
+++ b/application/NetscapeBookmarkUtils.php
@@ -95,10 +95,11 @@ class NetscapeBookmarkUtils
95 * @param array $files Server $_FILES parameters 95 * @param array $files Server $_FILES parameters
96 * @param LinkDB $linkDb Loaded LinkDB instance 96 * @param LinkDB $linkDb Loaded LinkDB instance
97 * @param ConfigManager $conf instance 97 * @param ConfigManager $conf instance
98 * @param History $history History instance
98 * 99 *
99 * @return string Summary of the bookmark import status 100 * @return string Summary of the bookmark import status
100 */ 101 */
101 public static function import($post, $files, $linkDb, $conf) 102 public static function import($post, $files, $linkDb, $conf, $history)
102 { 103 {
103 $filename = $files['filetoupload']['name']; 104 $filename = $files['filetoupload']['name'];
104 $filesize = $files['filetoupload']['size']; 105 $filesize = $files['filetoupload']['size'];
@@ -182,6 +183,7 @@ class NetscapeBookmarkUtils
182 $linkDb[$existingLink['id']] = $newLink; 183 $linkDb[$existingLink['id']] = $newLink;
183 $importCount++; 184 $importCount++;
184 $overwriteCount++; 185 $overwriteCount++;
186 $history->updateLink($newLink);
185 continue; 187 continue;
186 } 188 }
187 189
@@ -193,6 +195,7 @@ class NetscapeBookmarkUtils
193 $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']); 195 $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']);
194 $linkDb[$newLink['id']] = $newLink; 196 $linkDb[$newLink['id']] = $newLink;
195 $importCount++; 197 $importCount++;
198 $history->addLink($newLink);
196 } 199 }
197 200
198 $linkDb->save($conf->get('resource.page_cache')); 201 $linkDb->save($conf->get('resource.page_cache'));