Skip to content

Commit

Permalink
[mod] improving method what resolves selection of the resource what s…
Browse files Browse the repository at this point in the history
…hould be shown

[add] put post output processing configuration to the example file for the user configuration
  • Loading branch information
haschek committed Jun 23, 2011
1 parent 156c275 commit c80c3aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
9 changes: 8 additions & 1 deletion foafpressapp/core/Foafpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ protected function ResolveResourceRequest()
{
return $this->arc2_resource->index[$checkTopicOfUri]['http://xmlns.com/foaf/0.1/primaryTopic'][0]['value'];
}
elseif (($index_resource_uris = array_keys($this->arc2_resource->index)) &&
is_array($index_resource_uris) &&
isset($index_resource_uris[0]))
{
// fallback: return uri of the resource what is found first
return $index_resource_uris[0];
}
else
{
// last fallback, use url of requested rdf document
Expand Down Expand Up @@ -666,7 +673,7 @@ public function dieWithException($message = null)
{
if (!$message)
{
throw new Exception('Need error message! Message: '.$message);
throw new Exception('Need error message!');
}

throw new Exception($message); // TODO insert line where the exception was triggered
Expand Down
15 changes: 15 additions & 0 deletions fp-config.php-example
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,21 @@
# $c['Foafpress']['LinkedData']['cachetime'] = -1; // one time cache, no invalidation, default: 7 days
# $c['Foafpress']['Activity']['cachetime'] = 2 * 60 * 60; // 2 hours, default: 6 hours

/* -- Enable post output processing --------------------------------------------
*
* If you enable this, Faofpress will use old output caches to serve the request
* instantly, but keeps running to do all the time-consuming data aggregations
* after this output, and creating a new cache what can served to the next user.
* This is done for performance issues because without post output processing
* the user must wait until Foafpress updated all data caches.
*
* Be aware that this process experimental, usually it should work in most
* browsers but it could have problems with some other (older) browser clients.
* That is the reason why it is turned off by default.
*/

# $c['Foafpress']['enableOutputPostprocessing'] = true; // default: false

/* -- Ignore resources ---------------------------------------------------------
*
* You may want Foafpress to ignore some resources because you want to use them
Expand Down

0 comments on commit c80c3aa

Please sign in to comment.