1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Fix attempt of traversing bool in FileLockRegion

This commit is contained in:
Alexander Kurilo 2014-06-26 19:46:45 +03:00 committed by Marco Pivetta
parent 1d4b96eed0
commit 58cd520e32
2 changed files with 11 additions and 4 deletions

View File

@ -201,8 +201,13 @@ class FileLockRegion implements ConcurrentRegion
*/
public function evictAll()
{
foreach (glob(sprintf("%s/*.%s" , $this->directory, self::LOCK_EXTENSION)) as $filename) {
@unlink($filename);
// The check below is necessary because on some platforms glob returns false
// when nothing matched (even though no errors occurred)
$filenames = glob(sprintf("%s/*.%s" , $this->directory, self::LOCK_EXTENSION));
if (is_array($filenames)) {
foreach ($filenames as $filename) {
@unlink($filename);
}
}
return $this->region->evictAll();

View File

@ -393,8 +393,10 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
return unlink($path);
} else if (is_dir($path)) {
$files = glob(rtrim($path,'/').'/*');
foreach ($files as $file){
$this->_deleteDirectory($file);
if (is_array($files)) {
foreach ($files as $file){
$this->_deleteDirectory($file);
}
}
return rmdir($path);
}