PHP Class MiniAsset\AssetScanner

ファイルを表示 Open project: markstory/mini-asset Class Usage Examples

Protected Properties

Property Type Description
$_paths array Paths this scanner should scan.

Public Methods

Method 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.

Protected Methods

Method 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 method

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

_expandPaths() protected method

Expands constants and glob() patterns in the searchPaths.
protected _expandPaths ( ) : void
return void

_expandPrefix() protected method

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

_generateTree() protected method

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

_normalizePath() protected method

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
return string Normalized path

_normalizePaths() protected method

Normalizes the Directory Separator as well.
protected _normalizePaths ( ) : void
return void

find() public method

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.
return mixed Either false on a miss, or the full path of the file.

paths() public method

Accessor for paths.
public paths ( ) : array
return array an array of paths.

Property Details

$_paths protected_oe property

Paths this scanner should scan.
protected array $_paths
return array