mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 12:02:41 +00:00
Merging fixes and enhancements into trunk.
Revision: [2270] Refactored clearCache() Revision: [2269] Removed timestamp in file name. Removed debug code in model_php5.php git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2271 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
54df7c300f
commit
2862d11796
5 changed files with 44 additions and 36 deletions
|
@ -916,7 +916,8 @@ function clearCache($params = null, $type = 'views', $ext = '.php')
|
|||
$cache = CACHE.$type.DS.$params;
|
||||
if(is_file($cache.$ext))
|
||||
{
|
||||
return unlink($cache);
|
||||
@unlink($cache.$ext);
|
||||
return true;
|
||||
}
|
||||
else if(is_dir($cache))
|
||||
{
|
||||
|
@ -925,7 +926,14 @@ function clearCache($params = null, $type = 'views', $ext = '.php')
|
|||
{
|
||||
return false;
|
||||
}
|
||||
array_map('unlink', $files);
|
||||
|
||||
foreach($files as $file)
|
||||
{
|
||||
if(is_file($file))
|
||||
{
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -936,7 +944,13 @@ function clearCache($params = null, $type = 'views', $ext = '.php')
|
|||
{
|
||||
return false;
|
||||
}
|
||||
array_map('unlink', $files);
|
||||
foreach($files as $file)
|
||||
{
|
||||
if(is_file($file))
|
||||
{
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -953,7 +967,13 @@ function clearCache($params = null, $type = 'views', $ext = '.php')
|
|||
{
|
||||
if(is_array($delete))
|
||||
{
|
||||
array_map('unlink', $delete);
|
||||
foreach($delete as $file)
|
||||
{
|
||||
if(is_file($file))
|
||||
{
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue