Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
DirSearch Class Reference

Public Member Functions

 __construct (ComponentRegistrarInterface $registrar, Filesystem\Directory\ReadFactory $readFactory)
 
 collectFiles ($componentType, $pattern)
 
 collectFilesWithContext ($componentType, $pattern)
 

Detailed Description

Class for searching files across all locations of certain component type

Definition at line 13 of file DirSearch.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ComponentRegistrarInterface  $registrar,
Filesystem\Directory\ReadFactory  $readFactory 
)

Constructor

Parameters
ComponentRegistrarInterface$registrar
Filesystem\Directory\ReadFactory$readFactory

Definition at line 35 of file DirSearch.php.

36  {
37  $this->registrar = $registrar;
38  $this->readFactory = $readFactory;
39  }

Member Function Documentation

◆ collectFiles()

collectFiles (   $componentType,
  $pattern 
)

Search for files in each component by pattern, returns absolute paths

Parameters
string$componentType
string$pattern
Returns
array

Definition at line 48 of file DirSearch.php.

49  {
50  return $this->collect($componentType, $pattern, false);
51  }
$pattern
Definition: website.php:22

◆ collectFilesWithContext()

collectFilesWithContext (   $componentType,
  $pattern 
)

Search for files in each component by pattern, returns file objects with absolute file paths

Parameters
string$componentType
string$pattern
Returns
ComponentFile[]

Definition at line 60 of file DirSearch.php.

61  {
62  return $this->collect($componentType, $pattern, true);
63  }
$pattern
Definition: website.php:22

The documentation for this class was generated from the following file: