PHP Class MiniAsset\AssetScanner

Afficher le fichier Open project: markstory/mini-asset Class Usage Examples

Protected Properties

Свойство Type Description
$_paths array Paths this scanner should scan.

Méthodes publiques

Méthode Description
__construct ( array $paths ) Constructor.
find ( string $file ) : mixed Find a file in the connected paths, and check for its existance.
paths ( ) : array Accessor for paths.

Méthodes protégées

Méthode Description
_expandPaths ( ) : void Expands constants and glob() patterns in the searchPaths.
_expandPrefix ( string $path ) : string Path resolution hook. Used by framework integrations to add in framework module paths.
_generateTree ( string $path ) : array Discover all the sub directories for a given path.
_normalizePath ( string $name, type $ds ) : string Normalize a file path to the specified Directory Separator ($ds)
_normalizePaths ( ) : void Ensure all paths end in a directory separator and expand any APP/WEBROOT constants.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $paths )
$paths array The paths to scan.

_expandPaths() protected méthode

Expands constants and glob() patterns in the searchPaths.
protected _expandPaths ( ) : void
Résultat void

_expandPrefix() protected méthode

Path resolution hook. Used by framework integrations to add in framework module paths.
protected _expandPrefix ( string $path ) : string
$path string Path to resolve
Résultat string resolved path

_generateTree() protected méthode

Discover all the sub directories for a given path.
protected _generateTree ( string $path ) : array
$path string The path to search
Résultat array Array of subdirectories.

_normalizePath() protected méthode

Normalize a file path to the specified Directory Separator ($ds)
protected _normalizePath ( string $name, type $ds ) : string
$name string Path to normalize
$ds type Directory Separator to be used
Résultat string Normalized path

_normalizePaths() protected méthode

Normalizes the Directory Separator as well.
protected _normalizePaths ( ) : void
Résultat void

find() public méthode

Find a file in the connected paths, and check for its existance.
public find ( string $file ) : mixed
$file string The file you want to find.
Résultat mixed Either false on a miss, or the full path of the file.

paths() public méthode

Accessor for paths.
public paths ( ) : array
Résultat array an array of paths.

Property Details

$_paths protected_oe property

Paths this scanner should scan.
protected array $_paths
Résultat array