Fixing callback in DiskCacheSource
authorTim Düsterhus <timwolla@arcor.de>
Tue, 18 Oct 2011 16:40:20 +0000 (18:40 +0200)
committerTim Düsterhus <timwolla@arcor.de>
Tue, 18 Oct 2011 16:40:20 +0000 (18:40 +0200)
wcfsetup/install/files/lib/system/cache/source/DiskCacheSource.class.php

index 73a840bda4a88fa31c35ff2334e57316315558e1..04bcc94a186e9cb2dd2f43d32ccf98c35982edd6 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\cache\source;
 use wcf\system\exception\SystemException;
 use wcf\system\io\File;
+use wcf\system\Callback;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 use wcf\util\DirectoryUtil;
@@ -101,11 +102,11 @@ class DiskCacheSource implements ICacheSource {
                        $directory .= '/';      
                }
 
-               DirectoryUtil::getInstance($directory)->executeCallback(function ($filename) {
+               DirectoryUtil::getInstance($directory)->executeCallback(new Callback(function ($filename) {
                        if (!@touch($filename, 1)) {
                                @unlink($filename);
                        }
-               }, '%^'.$directory.$filepattern.'$%i');
+               }), '%^'.$directory.$filepattern.'$%i');
        }
        
        /**