Skip to content

Commit 51d8cfb

Browse files
committed
Cache certain search results
1 parent 0c99ac4 commit 51d8cfb

File tree

4 files changed

+321
-217
lines changed

4 files changed

+321
-217
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ public/database/oc_media/**/*
88
public/cache/**/*
99
public/comp_cache/**/*
1010
public/time_cache/**/*
11+
public/search_cache/**/*
12+
public/search_cache/*
13+
public/search_cache/
1114

1215
public/exports/*
1316
public/cache/*

application/controllers/ExportController.php

+16-6
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public function dbDumpAction() {
9393
$this->_helper->viewRenderer->setNoRender();
9494

9595
$projects = array('64013C33-4039-46C9-609A-A758CE51CA49',
96-
'81204AF8-127C-4686-E9B0-1202C3A47959'
96+
'81204AF8-127C-4686-E9B0-1202C3A47959',
97+
'3F6DCD13-A476-488E-ED10-47D25513FCB2',
98+
'8F947319-3C69-4847-B7A2-09E00ED90B32'
9799
);
98100
/*
99101
$projects = array('99BDB878-6411-44F8-2D7B-A99384A6CA21',
@@ -122,13 +124,21 @@ public function subjectJsonAction(){
122124
$jsonLDObj = new XMLjsonLD_Item;
123125
$xpathsObj = new XMLjsonLD_XpathBasics;
124126
$uri = "http://opencontext/subjects/9E474B89-E36B-4B9D-2D38-7C7CCBDBB030";
125-
//$uri = "http://opencontext/subjects/830DA747-2681-45ED-F768-EE0F350D56E7";
127+
$uri = "http://opencontext/subjects/FC96A49E-FE12-488B-4EFF-02D4E147B885";
126128
$jsonLDObj = $xpathsObj->URIconvert($uri , $jsonLDObj);
127129
$jsonLDObj->uri = $uri;
128-
$output = $jsonLDObj->makeJSON_LD();
129-
header('Content-Type: application/json; charset=utf8');
130-
//echo Zend_Json::encode($output, JSON_PRETTY_PRINT);
131-
echo json_encode($output, JSON_PRETTY_PRINT);
130+
$JSONld = $jsonLDObj->makeJSON_LD();
131+
if(!isset($_GET["xml"])){
132+
header('Content-Type: application/json; charset=utf8');
133+
//echo Zend_Json::encode($output, JSON_PRETTY_PRINT);
134+
echo json_encode($JSONld, JSON_PRETTY_PRINT);
135+
}
136+
else{
137+
$compactObj = new XMLjsonLD_CompactXML;
138+
$doc = $compactObj->makeCompactXML($JSONld);
139+
header('Content-Type: application/xml; charset=utf8');
140+
echo $doc->saveXML();
141+
}
132142
}
133143

134144

0 commit comments

Comments
 (0)