Fix attempt of traversing bool in FileLockRegion
This commit is contained in:
parent
1d4b96eed0
commit
58cd520e32
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user