return $updatesRan;
}
- if ($this->methods == null) {
+ if ($this->methods === null) {
throw new UpdaterException('Couldn\'t retrieve Updater class methods.');
}
return true;
}
- /**
- * Rename tags starting with a '-' to work with tag exclusion search.
- */
- public function updateMethodRenameDashTags()
- {
- $linklist = $this->linkDB->filterSearch();
- foreach ($linklist as $key => $link) {
- $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']);
- $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true)));
- $this->linkDB[$key] = $link;
- }
- $this->linkDB->save($this->conf->get('resource.page_cache'));
- return true;
- }
-
/**
* Move old configuration in PHP to the new config system in JSON format.
*
return true;
}
+ /**
+ * Rename tags starting with a '-' to work with tag exclusion search.
+ */
+ public function updateMethodRenameDashTags()
+ {
+ $linklist = $this->linkDB->filterSearch();
+ foreach ($linklist as $key => $link) {
+ $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']);
+ $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true)));
+ $this->linkDB[$key] = $link;
+ }
+ $this->linkDB->save($this->conf->get('resource.page_cache'));
+ return true;
+ }
+
/**
* Initialize API settings:
* - api.enabled: true
return true;
}
+
+ /**
+ * Move the file to inc/user.css to data/user.css.
+ *
+ * Note: Due to hardcoded paths, it's not unit testable. But one line of code should be fine.
+ *
+ * @return bool true if the update is successful, false otherwise.
+ */
+ public function updateMethodMoveUserCss()
+ {
+ if (! is_file('inc/user.css')) {
+ return true;
+ }
+
+ return rename('inc/user.css', 'data/user.css');
+ }
}
/**