diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-28 16:16:44 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-12 03:03:12 +0100 |
commit | 01878a75b93b9966f7366ea2937c118bbc3e459e (patch) | |
tree | 92286b70b4dd67a1bbd8d030fac6c0a70f64ded0 /application/Updater.php | |
parent | 1dc37f9cf8397e6050c4d5d981da263e6333a849 (diff) | |
download | Shaarli-01878a75b93b9966f7366ea2937c118bbc3e459e.tar.gz Shaarli-01878a75b93b9966f7366ea2937c118bbc3e459e.tar.zst Shaarli-01878a75b93b9966f7366ea2937c118bbc3e459e.zip |
Apply the new ID system accros the whole codebase
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/application/Updater.php b/application/Updater.php index 94b63990..16c8c376 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -218,7 +218,7 @@ class Updater | |||
218 | 218 | ||
219 | /** | 219 | /** |
220 | * Update the database to use the new ID system, which replaces linkdate primary keys. | 220 | * Update the database to use the new ID system, which replaces linkdate primary keys. |
221 | * Also, creation and update dates are now DateTime objects. | 221 | * Also, creation and update dates are now DateTime objects (done by LinkDB). |
222 | * | 222 | * |
223 | * Since this update is very sensitve (changing the whole database), the datastore will be | 223 | * Since this update is very sensitve (changing the whole database), the datastore will be |
224 | * automatically backed up into the file datastore.<datetime>.php. | 224 | * automatically backed up into the file datastore.<datetime>.php. |
@@ -243,10 +243,6 @@ class Updater | |||
243 | $links = array_reverse($links); | 243 | $links = array_reverse($links); |
244 | $cpt = 0; | 244 | $cpt = 0; |
245 | foreach ($links as $l) { | 245 | foreach ($links as $l) { |
246 | $l['created'] = DateTime::createFromFormat('Ymd_His', $l['linkdate']); | ||
247 | if (! empty($l['updated'])) { | ||
248 | $l['updated'] = DateTime::createFromFormat('Ymd_His', $l['updated']); | ||
249 | } | ||
250 | unset($l['linkdate']); | 246 | unset($l['linkdate']); |
251 | $l['id'] = $cpt; | 247 | $l['id'] = $cpt; |
252 | $this->linkDB[$cpt++] = $l; | 248 | $this->linkDB[$cpt++] = $l; |