PHP Class FileNamingResolver\FileInfo

Author: Victor Bocharsky ([email protected])
Inheritance: extends SplFileInfo
Show file Open project: bocharsky-bw/FileNamingResolver Class Usage Examples

Public Methods

Method Description
changeBasename ( string $basename ) : FileInfo Changes base name of file without extension (or base name of directory).
changeExtension ( string $extension ) : FileInfo Changes file extension.
changePath ( string $path ) : FileInfo Changes directory path to the file / directory.
createPathname ( string $path, string $basename, string $extension = '' ) : string Creates full pathname to the file / directory based on its path, basename and extension
getBasename ( string $suffix = null ) : string Returns base name of file without extension (or base name of directory).
getPathRelativeTo ( string $basePath ) : string
getPathnameRelativeTo ( string $basePathname ) : string
isExists ( ) : boolean Checks whether a file / directory exists.
purifyBasename ( string $basename ) : string
purifyExtension ( string $extension ) : string
purifyPath ( string $path ) : string
toString ( ) : string Converts object to a string representation.

Method Details

changeBasename() public method

Changes base name of file without extension (or base name of directory).
public changeBasename ( string $basename ) : FileInfo
$basename string
return FileInfo

changeExtension() public method

Changes file extension.
public changeExtension ( string $extension ) : FileInfo
$extension string
return FileInfo

changePath() public method

Changes directory path to the file / directory.
public changePath ( string $path ) : FileInfo
$path string
return FileInfo

createPathname() public static method

Creates full pathname to the file / directory based on its path, basename and extension
public static createPathname ( string $path, string $basename, string $extension = '' ) : string
$path string Directory path to the file (or directory)
$basename string Base name of file without extension (or base name of directory)
$extension string [OPTIONAL] File extension (empty for directory)
return string

getBasename() public method

Returns base name of file without extension (or base name of directory).
public getBasename ( string $suffix = null ) : string
$suffix string
return string

getPathRelativeTo() public method

public getPathRelativeTo ( string $basePath ) : string
$basePath string
return string

getPathnameRelativeTo() public method

public getPathnameRelativeTo ( string $basePathname ) : string
$basePathname string
return string

isExists() public method

Checks whether a file / directory exists.
public isExists ( ) : boolean
return boolean

purifyBasename() public static method

public static purifyBasename ( string $basename ) : string
$basename string
return string

purifyExtension() public static method

public static purifyExtension ( string $extension ) : string
$extension string
return string

purifyPath() public static method

public static purifyPath ( string $path ) : string
$path string
return string

toString() public method

Converts object to a string representation.
public toString ( ) : string
return string