PHP Class FOF30\Platform\Base\Filesystem

Inheritance: implements FOF30\Platform\FilesystemInterface
Show file Open project: akeeba/fof Class Usage Examples

Protected Properties

Property Type Description
$container The component container
$paths array The list of paths where platform class files will be looked for

Public Methods

Method Description
__construct ( Container $c ) Public constructor.
getExt ( string $file ) : string Gets the extension of a file name
stripExt ( string $file ) : string Strips the last extension off of a file name

Protected Methods

Method Description
getFiles ( string $path, array $ignoreFolders = [], array $ignoreFiles = [] ) : array This method will crawl a starting directory and get all the valid files that will be analyzed by getInstance.
scanDirectory ( string $path, array $ignoreFolders = [], array $ignoreFiles = [] ) : array Recursive function that will scan every directory unless it's in the ignore list. Files that aren't in the ignore list are returned.

Method Details

__construct() public method

Public constructor.
public __construct ( Container $c )
$c FOF30\Container\Container The component container

getExt() public method

Gets the extension of a file name
public getExt ( string $file ) : string
$file string The file name
return string The file extension

getFiles() protected static method

Then it organizes them into an associative array.
protected static getFiles ( string $path, array $ignoreFolders = [], array $ignoreFiles = [] ) : array
$path string Folder where we should start looking
$ignoreFolders array Folder ignore list
$ignoreFiles array File ignore list
return array Associative array, where the `fullpath` key contains the path to the file, and the `classname` key contains the name of the class

scanDirectory() protected static method

Recursive function that will scan every directory unless it's in the ignore list. Files that aren't in the ignore list are returned.
protected static scanDirectory ( string $path, array $ignoreFolders = [], array $ignoreFiles = [] ) : array
$path string Folder where we should start looking
$ignoreFolders array Folder ignore list
$ignoreFiles array File ignore list
return array List of all the files

stripExt() public method

Strips the last extension off of a file name
public stripExt ( string $file ) : string
$file string The file name
return string The file name without the extension

Property Details

$container protected property

The component container
protected $container

$paths protected static property

The list of paths where platform class files will be looked for
protected static array $paths
return array