Skip to content

Commit 54f71ea

Browse files
authored
Merge branch 'final' into final
2 parents ecb82a9 + 78cae99 commit 54f71ea

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/phpFastCache/Drivers/Files/Driver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ protected function driverDelete(CacheItemInterface $item)
138138
if ($item instanceof Item) {
139139
$file_path = $this->getFilePath($item->getKey(), true);
140140
if (file_exists($file_path) && @unlink($file_path)) {
141+
$dir = dirname($file_path);
142+
if (!(new \FilesystemIterator($dir))->valid()) {
143+
rmdir($dir);
144+
}
141145
return true;
142146
} else {
143147
return false;
@@ -236,4 +240,4 @@ public function getStats()
236240

237241
return $stat;
238242
}
239-
}
243+
}

src/phpFastCache/Drivers/Mongodb/Driver.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@
3030
/**
3131
* Class Driver
3232
* @package phpFastCache\Drivers
33+
* @property MongodbClient $instance Instance of driver service
3334
*/
3435
class Driver extends DriverAbstract
3536
{
36-
/**
37-
* @var MongodbClient
38-
*/
39-
public $instance;
40-
4137
/**
4238
* Driver constructor.
4339
* @param array $config
@@ -59,12 +55,7 @@ public function __construct(array $config = [])
5955
*/
6056
public function driverCheck()
6157
{
62-
if(class_exists('MongoDB\Driver\Manager')){
63-
trigger_error('PhpFastCache currently only support the pecl Mongo extension.<br />
64-
The Support for the MongoDB extension will be added coming soon.', E_USER_ERROR);
65-
}
66-
67-
return extension_loaded('Mongodb') && class_exists('MongoClient');
58+
return class_exists('MongoClient');
6859
}
6960

7061
/**
@@ -220,4 +211,4 @@ public function getStats()
220211

221212
return $stats;
222213
}
223-
}
214+
}

0 commit comments

Comments
 (0)