diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-02-04 15:24:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-04 15:24:49 +0100 |
commit | 5f3f19f1c0f1a4feac20c40fe9ee8437469450f3 (patch) | |
tree | 4afdf4b58f17960d0e471a2ae378cda3e8cfae72 /application/Updater.php | |
parent | 6f566b69ba141c29fb3fa1e32a1760a1e8b09840 (diff) | |
parent | c03455af1161befa404ed8759ca55b63bbf593a2 (diff) | |
download | Shaarli-5f3f19f1c0f1a4feac20c40fe9ee8437469450f3.tar.gz Shaarli-5f3f19f1c0f1a4feac20c40fe9ee8437469450f3.tar.zst Shaarli-5f3f19f1c0f1a4feac20c40fe9ee8437469450f3.zip |
Merge pull request #776 from ArthurHoaro/hotfix/linkdb-update
Fixes #775: LinkDB do not access LinkDB before ID system migration
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/application/Updater.php b/application/Updater.php index eb03c6d3..90aba745 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -133,21 +133,6 @@ class Updater | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Rename tags starting with a '-' to work with tag exclusion search. | ||
137 | */ | ||
138 | public function updateMethodRenameDashTags() | ||
139 | { | ||
140 | $linklist = $this->linkDB->filterSearch(); | ||
141 | foreach ($linklist as $key => $link) { | ||
142 | $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); | ||
143 | $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); | ||
144 | $this->linkDB[$key] = $link; | ||
145 | } | ||
146 | $this->linkDB->save($this->conf->get('resource.page_cache')); | ||
147 | return true; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * Move old configuration in PHP to the new config system in JSON format. | 136 | * Move old configuration in PHP to the new config system in JSON format. |
152 | * | 137 | * |
153 | * Will rename 'config.php' into 'config.save.php' and create 'config.json.php'. | 138 | * Will rename 'config.php' into 'config.save.php' and create 'config.json.php'. |
@@ -258,6 +243,21 @@ class Updater | |||
258 | } | 243 | } |
259 | 244 | ||
260 | /** | 245 | /** |
246 | * Rename tags starting with a '-' to work with tag exclusion search. | ||
247 | */ | ||
248 | public function updateMethodRenameDashTags() | ||
249 | { | ||
250 | $linklist = $this->linkDB->filterSearch(); | ||
251 | foreach ($linklist as $key => $link) { | ||
252 | $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); | ||
253 | $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); | ||
254 | $this->linkDB[$key] = $link; | ||
255 | } | ||
256 | $this->linkDB->save($this->conf->get('resource.page_cache')); | ||
257 | return true; | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * Initialize API settings: | 261 | * Initialize API settings: |
262 | * - api.enabled: true | 262 | * - api.enabled: true |
263 | * - api.secret: generated secret | 263 | * - api.secret: generated secret |