PHP Class Sprockets\Locator

Datei anzeigen Open project: nami-doc/sprockets-php

Public Methods

Method Description
__construct ( $pipeline, $paths, $prefix )
getDirectoriesFor ( $ext )
getDirectory ( $name, $ext ) first-depth find. only returns 1 result
getFile ( $name, $type )
getFileListName ( )
getFilesUnder ( $name, $ext, $depth ) vomit
getNameAndExtension ( $name ) reads name and extension for a file name
getPathsHash ( )
getTypeForExt ( $ext ) : string returns the named type of an extension ie png, gif, jpg and jpeg are images, no need to have separate folders same applies to otf and ttf, they're fonts
hasDirectory ( $name )
hasFile ( $name, $type )
hasProcessedFile ( $file )
resolveFile ( $name )
save ( ) Calling file_put_contents within a destructor will cause the file to be written in SERVER_ROOT.
setDefaultExtension ( $ext ) # }
skipFile ( $file )

Private Methods

Method Description
findFile ( string $name, string $ext ) finds a file, whether it has many extensions or not findFile('xe', 'css') will find 'xs.css.less'

Method Details

__construct() public method

public __construct ( $pipeline, $paths, $prefix )

getDirectoriesFor() public method

public getDirectoriesFor ( $ext )

getDirectory() public method

first-depth find. only returns 1 result
public getDirectory ( $name, $ext )

getFile() public method

public getFile ( $name, $type )

getFileListName() public method

public getFileListName ( )

getFilesUnder() public method

vomit
public getFilesUnder ( $name, $ext, $depth )

getNameAndExtension() public method

reads name and extension for a file name
public getNameAndExtension ( $name )

getPathsHash() public method

public getPathsHash ( )

getTypeForExt() public method

returns the named type of an extension ie png, gif, jpg and jpeg are images, no need to have separate folders same applies to otf and ttf, they're fonts
public getTypeForExt ( $ext ) : string
return string ext's named type, or extension itself

hasDirectory() public method

public hasDirectory ( $name )

hasFile() public method

public hasFile ( $name, $type )

hasProcessedFile() public method

public hasProcessedFile ( $file )

resolveFile() public method

public resolveFile ( $name )

save() public method

..
public save ( )

setDefaultExtension() public method

# }
public setDefaultExtension ( $ext )

skipFile() public method

public skipFile ( $file )