Fetch files from a directory
Summary:
Mirror the File class into a Directory class,
with similar methods.
Allow to glob files in a directory and gets the result
as a collection of File instances.
Use cases
Nasqueron Notifications, Auth Grove and Zed can benefit from
autodiscovery mechanism where all files in a directory are
loaded as events, services or, for Zed, health checks.
Sites also use glob to find files like images in a directory.
With those new Directory and glob components, result will use
the File class, offering an unified interface to query file
and path information.
Test Plan:
- Unit tests provided
- Zed uses Directory::glob method for SiteHealth engine (see T1678).
Reviewers: dereckson
Reviewed By: dereckson
Maniphest Tasks: T1678
Differential Revision: https://devcentral.nasqueron.org/D2500