Skip to content

Commit

Permalink
Extension manager: Fix cache extension to be .repo
Browse files Browse the repository at this point in the history
The dot was missing i.e. the cache files had no real extension at all.
  • Loading branch information
michitux committed Mar 8, 2014
1 parent cc0082d commit 59ac7be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/plugins/extension/helper/repository.php
Expand Up @@ -31,7 +31,7 @@ public function init() {
$request_data = array('fmt' => 'php');
$request_needed = false;
foreach ($list as $name) {
$cache = new cache('##extension_manager##'.$name, 'repo');
$cache = new cache('##extension_manager##'.$name, '.repo');
$result = null;
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
$this->loaded_extensions[$name] = true;
Expand All @@ -46,7 +46,7 @@ public function init() {
if ($data !== false) {
$extensions = unserialize($data);
foreach ($extensions as $extension) {
$cache = new cache('##extension_manager##'.$extension['plugin'], 'repo');
$cache = new cache('##extension_manager##'.$extension['plugin'], '.repo');
$cache->storeCache(serialize($extension));
}
} else {
Expand All @@ -63,7 +63,7 @@ public function init() {
*/
public function hasAccess() {
if ($this->has_access === null) {
$cache = new cache('##extension_manager###hasAccess', 'repo');
$cache = new cache('##extension_manager###hasAccess', '.repo');
$result = null;
if (!$cache->useCache(array('age' => 3600 * 24, 'purge'=>1))) {
$httpclient = new DokuHTTPClient();
Expand All @@ -90,7 +90,7 @@ public function hasAccess() {
* @return array The data or null if nothing was found (possibly no repository access)
*/
public function getData($name) {
$cache = new cache('##extension_manager##'.$name, 'repo');
$cache = new cache('##extension_manager##'.$name, '.repo');
$result = null;
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
$this->loaded_extensions[$name] = true;
Expand Down Expand Up @@ -130,7 +130,7 @@ public function search($q){
// store cache info for each extension
foreach($result as $ext){
$name = $ext['plugin'];
$cache = new cache('##extension_manager##'.$name, 'repo');
$cache = new cache('##extension_manager##'.$name, '.repo');
$cache->storeCache(serialize($ext));
$ids[] = $name;
}
Expand Down

0 comments on commit 59ac7be

Please sign in to comment.