Update of /cvsroot/phpcvsview/phpcvsview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6090
Modified Files:
func_FileView.php
Log Message:
Fixed the code writing to the file view cache so that it doesn't create it when caching disabled.
Index: func_FileView.php
===================================================================
RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileView.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** func_FileView.php 18 Feb 2005 10:38:29 -0000 1.17
--- func_FileView.php 18 Feb 2005 23:30:29 -0000 1.18
***************
*** 38,43 ****
mkdir($CachedFileName, 0750);
}
}
- $CachedFileName .= "/".str_replace("/", "_", $File).",$Revision";
if (file_exists($CachedFileName) && $config['Cache']['Enable']) {
$fd = fopen($CachedFileName, "r");
--- 38,43 ----
mkdir($CachedFileName, 0750);
}
+ $CachedFileName .= "/".str_replace("/", "_", $File).",$Revision";
}
if (file_exists($CachedFileName) && $config['Cache']['Enable']) {
$fd = fopen($CachedFileName, "r");
***************
*** 82,91 ****
$hlcontent = $geshi->parse_code();
! // Store in the current cache.
! $fd = fopen($CachedFileName, "w");
! if ($fd !== false) {
! fwrite($fd, '<table class="source"><tr><td>'.$hlcontent.'</td></tr></table>');
! fclose($fd);
! }
// Display the file contents.
--- 82,93 ----
$hlcontent = $geshi->parse_code();
! // Store in the current cache.
! if ($config['Cache']['Enable']) {
! $fd = fopen($CachedFileName, "w");
! if ($fd !== false) {
! fwrite($fd, '<table class="source"><tr><td>'.$hlcontent.'</td></tr></table>');
! fclose($fd);
! }
! }
// Display the file contents.
***************
*** 102,108 ****
$soure_size = sizeof($source);
! $fd = fopen($CachedFileName, "w");
! if ($fd !== false) {
! fwrite($fd, "<pre>\n");
}
echo "<pre>\n";
--- 104,116 ----
$soure_size = sizeof($source);
! if ($config['Cache']['Enable']) {
! $fd = fopen($CachedFileName, "w");
! if ($fd !== false) {
! fwrite($fd, "<pre>\n");
! }
! }
! else
! {
! $fd = false;
}
echo "<pre>\n";
|