mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/11618] Replace glob() with scandir() and string matching Conflicts: tests/template/template_test.php
This commit is contained in:
commit
f2b174c8b5
1 changed files with 15 additions and 4 deletions
|
@ -83,9 +83,14 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||
$this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable.");
|
||||
}
|
||||
|
||||
foreach (glob($this->template->cachepath . '*') as $file)
|
||||
$file_array = scandir($template_cache_dir);
|
||||
$file_prefix = basename($this->template->cachepath);
|
||||
foreach ($file_array as $file)
|
||||
{
|
||||
unlink($file);
|
||||
if (strpos($file, $file_prefix) === 0)
|
||||
{
|
||||
unlink($template_cache_dir . '/' . $file);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setup_engine();
|
||||
|
@ -95,9 +100,15 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||
{
|
||||
if (is_object($this->template))
|
||||
{
|
||||
foreach (glob($this->template->cachepath . '*') as $file)
|
||||
$template_cache_dir = dirname($this->template->cachepath);
|
||||
$file_array = scandir($template_cache_dir);
|
||||
$file_prefix = basename($this->template->cachepath);
|
||||
foreach ($file_array as $file)
|
||||
{
|
||||
unlink($file);
|
||||
if (strpos($file, $file_prefix) === 0)
|
||||
{
|
||||
unlink($template_cache_dir . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue