Esempio n. 1
0
 /**
  * Get all module basenames.
  *
  * @return array
  */
 protected function getAllBasenames()
 {
     $path = $this->getPath();
     try {
         $collection = collect($this->files->directories($path));
         $basenames = $collection->map(function ($item, $key) {
             return basename($item);
         });
         return $basenames;
     } catch (\InvalidArgumentException $e) {
         return collect(array());
     }
 }
Esempio n. 2
0
 /**
  * Remove all items from the cache.
  *
  * @return void
  */
 public function flush()
 {
     if ($this->files->isDirectory($this->directory)) {
         foreach ($this->files->directories($this->directory) as $directory) {
             $this->files->deleteDirectory($directory);
         }
     }
 }