aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/network.php b/include/network.php
index ec3474a41..13339eccd 100644
--- a/include/network.php
+++ b/include/network.php
@@ -2084,7 +2084,7 @@ function jsonld_document_loader($url) {
}
}
- $cachepath = 'store/[data]/ldcache';
+ $cachepath = 'store/[data]/[jsonld]';
if(!is_dir($cachepath)) {
os_mkdir($cachepath, STORAGE_DEFAULT_PERMISSIONS, true);
}
@@ -2093,9 +2093,7 @@ function jsonld_document_loader($url) {
if (file_exists($filename) && filemtime($filename) > time() - (12 * 60 * 60)) {
logger('loading ' . $filename . ' from recent cache');
-
- $doc->document = file_get_contents($filename);
- return $doc;
+ return json_decode(file_get_contents($filename));
}
$r = jsonld_default_document_loader($url);
@@ -2112,8 +2110,7 @@ function jsonld_document_loader($url) {
if (file_exists($filename)) {
logger('loading ' . $filename . ' from longterm cache');
- $doc->document = file_get_contents($filename);
- return $doc;
+ return json_decode(file_get_contents($filename));
}
else {
logger($filename . ' does not exist and cannot be loaded');