recursiveGlob($dir.DIRECTORY_SEPARATOR.basename($pattern), $flags)); } } } return $files; } /** * Performs a recursive glob search for files with the given pattern. * * @param string $pattern * The pattern passed to glob(). * @param int $flags * Flags to pass into glob(). * * @return mixed * An array of files that match the recursive pattern given. */ public function recursiveGlobFiles($pattern, $flags = 0) { $files = $this->recursiveGlob($pattern, $flags); return array_filter($files, 'is_file'); } }