aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/History.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam+github@flibidi.net>2017-10-08 16:35:57 +0200
committerGitHub <noreply@github.com>2017-10-08 16:35:57 +0200
commit9f32160c323e77237e4051056c1f1061586cc12e (patch)
treec8203cd553fa770f2067ce04d30579ee1aa2f60f /application/History.php
parent0a496258af71ab77eacb9e7ccd27471a65b61fa0 (diff)
parent66e74d50d38a6fea8fc904a1746157633de7cc65 (diff)
downloadShaarli-9f32160c323e77237e4051056c1f1061586cc12e.tar.gz
Shaarli-9f32160c323e77237e4051056c1f1061586cc12e.tar.zst
Shaarli-9f32160c323e77237e4051056c1f1061586cc12e.zip
Merge pull request #992 from ArthurHoaro/feature/import-history
Don't write History for link import
Diffstat (limited to 'application/History.php')
-rw-r--r--application/History.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/application/History.php b/application/History.php
index 116b9264..5e3b1b72 100644
--- a/application/History.php
+++ b/application/History.php
@@ -16,6 +16,7 @@
16 * - UPDATED: link updated 16 * - UPDATED: link updated
17 * - DELETED: link deleted 17 * - DELETED: link deleted
18 * - SETTINGS: the settings have been updated through the UI. 18 * - SETTINGS: the settings have been updated through the UI.
19 * - IMPORT: bulk links import
19 * 20 *
20 * Note: new events are put at the beginning of the file and history array. 21 * Note: new events are put at the beginning of the file and history array.
21 */ 22 */
@@ -42,6 +43,11 @@ class History
42 const SETTINGS = 'SETTINGS'; 43 const SETTINGS = 'SETTINGS';
43 44
44 /** 45 /**
46 * @var string Action key: a bulk import has been processed.
47 */
48 const IMPORT = 'IMPORT';
49
50 /**
45 * @var string History file path. 51 * @var string History file path.
46 */ 52 */
47 protected $historyFilePath; 53 protected $historyFilePath;
@@ -122,6 +128,16 @@ class History
122 } 128 }
123 129
124 /** 130 /**
131 * Add Event: bulk import.
132 *
133 * Note: we don't store links add/update one by one since it can have a huge impact on performances.
134 */
135 public function importLinks()
136 {
137 $this->addEvent(self::IMPORT);
138 }
139
140 /**
125 * Save a new event and write it in the history file. 141 * Save a new event and write it in the history file.
126 * 142 *
127 * @param string $status Event key, should be defined as constant. 143 * @param string $status Event key, should be defined as constant.