mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-23 15:39:38 +01:00
Also change glob to readdir which performs better
This commit is contained in:
parent
e91887e463
commit
de0ae1af61
10
tcpdf.php
10
tcpdf.php
@ -7756,9 +7756,13 @@ class TCPDF {
|
||||
if ($destroyall AND !$preserve_objcopy) {
|
||||
self::$cleaned_ids[$this->file_id] = true;
|
||||
// remove all temporary files
|
||||
$tmpfiles = glob(K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_*');
|
||||
if (!empty($tmpfiles)) {
|
||||
array_map('unlink', $tmpfiles);
|
||||
if ($handle = opendir(K_PATH_CACHE)) {
|
||||
while ( false !== ( $file_name = readdir( $handle ) ) ) {
|
||||
if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0) {
|
||||
unlink(K_PATH_CACHE.$file_name);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
$preserve = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user