Example #1
0
 /**
  * Searches the directory paths for a given file.
  *
  * @param   mixed   $paths  An path string or array of path strings to search in
  * @param   string  $file   The file name to look for.
  *
  * @return  mixed   The full path and file name for the target file, or boolean false if the file is not found in any of the paths.
  *
  * @since   2.0
  */
 public static function find($paths, $file)
 {
     /**
      * Files callback
      *
      * @param \SplFileInfo                $current  Current item's value
      * @param string                      $key      Current item's key
      * @param \RecursiveDirectoryIterator $iterator Iterator being filtered
      *
      * @return boolean   TRUE to accept the current item, FALSE otherwise
      */
     $filter = function ($current, $key, $iterator) use($file) {
         return $current->getBasename() == $file;
     };
     $collection = new PathCollection($paths);
     return $collection->findOne($filter);
 }