Page MenuHomePhabricator

final class FileFinder
Arcanist Technical Documentation ()

Find files on disk matching criteria, like the 'find' system utility. Use of this class is straightforward:

// Find PHP files in /tmp
$files = id(new FileFinder('/tmp'))
  ->withType('f')
  ->withSuffix('php')
  ->find();

Tasks

Creating a File Query

  • public function __construct($root) — Create a new FileFinder.

Configuring File Queries

Executing the File Query

  • public function find()

Internal

Other Methods

Methods

public function __construct($root)

Create a new FileFinder.

Parameters
string$rootRoot directory to find files beneath.
Return
this//Implicit.//

public function excludePath($path)

This method is not documented.
Parameters
$path
Return
wild

public function withName($name)

This method is not documented.
Parameters
$name
Return
wild

public function withSuffix($suffix)

This method is not documented.
Parameters
$suffix
Return
wild

public function withPath($path)

This method is not documented.
Parameters
$path
Return
wild

public function withType($type)

This method is not documented.
Parameters
$type
Return
wild

public function withFollowSymlinks($follow)

This method is not documented.
Parameters
$follow
Return
wild

public function setGenerateChecksums($generate)

This method is not documented.
Parameters
$generate
Return
wild

public function getGenerateChecksums()

This method is not documented.
Return
wild

public function withNameGlob($pattern)

This method is not documented.
Parameters
$pattern
Return
wild

public function setForceMode($mode)

This method is not documented.
Parameters
string$modeEither "php", "shell", or the empty string.
Return
wild

public function validateFile($file)

This method is not documented.
Parameters
$file
Return
wild

private function getFiles($dir)

This method is not documented.
Parameters
$dir
Return
wild

public function find()

This method is not documented.
Return
wild

private function generateList($flag, $items, $mode)

This method is not documented.
Parameters
$flag
array$items
$mode
Return
wild