Beispiel #1
0
 /**
  * List all paths.
  *
  * @param string $directory
  * @param bool $recursive
  * @param null $is
  * @return  array  paths
  */
 public function listPaths($directory = '', $recursive = false, $is = null)
 {
     if (!empty($directory)) {
         if (StringHelper::isRegexp($directory)) {
             return ArrayHelper::getColumn($this->searchDirByPattern($directory, $recursive, $is), 'path');
         }
     }
     if (!isset($is)) {
         return parent::listPaths($directory, $recursive);
     }
     $result = [];
     foreach (parent::listContents($directory, $recursive) as $value) {
         if ($value['type'] !== $is) {
             continue;
         }
         $result[] = $value['path'];
     }
     return $result;
 }