diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-20 23:16:46 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-20 23:16:46 +0000 |
commit | 32394a4b178c9e580a2d0ab9f7a3bcc35defb40c (patch) | |
tree | e68e093c9e2a80dffbb263d5f1e32bb4d6792bec /simplecache/view.php | |
parent | aba238f57753f391bb15cf43bc5ff23cb943e470 (diff) | |
download | elgg-32394a4b178c9e580a2d0ab9f7a3bcc35defb40c.tar.gz elgg-32394a4b178c9e580a2d0ab9f7a3bcc35defb40c.tar.bz2 |
Refs #2410 - merged [7024] into trunk from 1.7 branch
git-svn-id: http://code.elgg.org/elgg/trunk@7109 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'simplecache/view.php')
-rw-r--r-- | simplecache/view.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/simplecache/view.php b/simplecache/view.php index f04ca0118..67c310d87 100644 --- a/simplecache/view.php +++ b/simplecache/view.php @@ -14,10 +14,11 @@ require_once(dirname(dirname(__FILE__)). '/engine/settings.php'); global $CONFIG, $viewinput, $override; if (!isset($override)) { - $override = false; + $override = FALSE; } $contents = ''; + if (!isset($viewinput)) { $viewinput = $_GET; } @@ -51,21 +52,22 @@ if ($mysql_dblink = @mysql_connect($CONFIG->dbhost,$CONFIG->dbuser,$CONFIG->dbpa $filename = $dataroot . 'views_simplecache/' . md5($viewtype . $view_name); if (file_exists($filename)) { $contents = file_get_contents($filename); - header("Content-Length: " . strlen($contents)); } else { mysql_query("INSERT into {$CONFIG->dbprefix}datalists set name = 'simplecache_lastupdate_$viewtype', value = '0' ON DUPLICATE KEY UPDATE value='0'"); - - echo ''; exit; } - } else { - mysql_close($mysql_dblink); - require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); - $contents = elgg_view($view_name); - header("Content-Length: " . strlen($contents)); } } } +// load full engine if simplecache is disabled, overriden, or invalid +if (!$contents) { + mysql_close($mysql_dblink); + require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); + $contents = elgg_view($view); +} + +header("Content-Length: " . strlen($contents)); + $split_output = str_split($contents, 1024); foreach($split_output as $chunk) { |