File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change 3030/**
3131 * Class Driver
3232 * @package phpFastCache\Drivers
33+ * @property MongodbClient $instance Instance of driver service
3334 */
3435class 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+ }
You can’t perform that action at this time.
0 commit comments