Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ public function addScriptToHead($context)
// Get the correct caching time:
$content = file_get_contents(DATASOURCES.'/data.'.$callback['context'][1].'.php');
preg_match('/public \$dsParamCACHE = (.*);/', $content, $match);
$js = 'var cacheMinutes = '.$match[1].', cacheEnabled = true;';
if(!empty($match[1]))
{
$js = 'var cacheMinutes = '.$match[1].', cacheEnabled = true;';
} else {
// No cache time found. The datasource was probably cached first, and then un-cached afterwards:
$js = 'var cacheMinutes = 60, cacheEnabled = false;';
}
} else {
$js = 'var cacheMinutes = 60, cacheEnabled = false;';
}
Expand Down