mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Merging fixes and enhancements into trunk.
Revision: [2265] Corrected error when cached file was found with partial matching name. git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2266 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c439ed8742
commit
61730a94c5
2 changed files with 22 additions and 17 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
1.0.0.2264
|
||||
1.0.0.2266
|
|
@ -114,32 +114,37 @@ if(defined('CACHE_CHECK') && CACHE_CHECK === true)
|
|||
$uri = setUri();
|
||||
}
|
||||
|
||||
$filename = CACHE.'views'.DS.'*'.str_replace('/', '_', $uri).'*';
|
||||
$pattern = str_replace('/', '_', $uri);
|
||||
$filename = CACHE.'views'.DS.'*'.$pattern .'*';
|
||||
$files = glob($filename);
|
||||
|
||||
if(isset($files[0]))
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if (file_exists($files[0]))
|
||||
if (preg_match('/('.$pattern.')(_{0,2}\\d+)/', $file))
|
||||
{
|
||||
if (preg_match('/(\\d+).php/', $files[0], $match))
|
||||
if (file_exists($file))
|
||||
{
|
||||
if(time() >= $match['1'])
|
||||
if (preg_match('/(\\d+).php/', $file, $match))
|
||||
{
|
||||
@unlink($files[0]);
|
||||
unset($out);
|
||||
}
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
include($files[0]);
|
||||
if (DEBUG)
|
||||
if(time() >= $match['1'])
|
||||
{
|
||||
echo "<!-- Cached Render Time: ". round(getMicrotime() - $TIME_START, 4) ."s -->";
|
||||
@unlink($file);
|
||||
unset($out);
|
||||
}
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
include($file);
|
||||
if (DEBUG)
|
||||
{
|
||||
echo "<!-- Cached Render Time: ". round(getMicrotime() - $TIME_START, 4) ."s -->";
|
||||
}
|
||||
$out = ob_get_clean();
|
||||
die(e($out));
|
||||
}
|
||||
$out = ob_get_clean();
|
||||
die(e($out));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue