method cleanStoragePath documentation in bbn\X

Deletes the for form the given path and date format if it's empty.

function(string $path, $format = 'Y/m/d', bbn\File\System $fs = NULL) { $format = 'Y/m/d', File\System $fs = null ): ?int { if (empty($format)) { $format = 'Y/m/d'; } if (!$fs) { $fs = new File\System(); } if (!$fs->isDir($path)) { return null; } $limit = count(self::split($format, '/')) + 1; $res = 0; while ($limit > 0) { if (!$fs->getNumFiles($path) && $fs->delete($path)) { $limit--; $res++; $path = self::dirname($path); } else{ break; } } return $res; }

Deletes the for form the given path and date format if it's empty. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.