WrapperTrait
Trait for the component file wrappers.
Tags
Table of Contents
- $_file : string
- Full path to the file.
- __toString() : mixed
- Returns the file contents.
- diff() : string
- Returns a diff between the saved and the current version of the file.
- exists() : bool
- Returns whether the file exists.
- getFileName() : string
- Returns the file name.
- getFullPath() : string
- Returns the full path to the file.
- getLocalPath() : string
- Returns the local path to the file inside the package.
- save() : mixed
- Saves this object to the file.
Properties
$_file
Full path to the file.
protected
string
$_file
Methods
__toString()
Returns the file contents.
public
abstract __toString() : mixed
Return values
mixed —diff()
Returns a diff between the saved and the current version of the file.
public
diff([Wrapper $wrapper = null ]) : string
Parameters
- $wrapper : Wrapper = null
Return values
string —File diff.
exists()
Returns whether the file exists.
public
exists() : bool
Return values
bool —True if the file exists.
getFileName()
Returns the file name.
public
getFileName() : string
Return values
string —The file name.
getFullPath()
Returns the full path to the file.
public
getFullPath() : string
Return values
string —Path to the file.
getLocalPath()
Returns the local path to the file inside the package.
public
getLocalPath(string $dir) : string
Parameters
- $dir : string
-
The package directory.
Return values
string —Path to the file.
save()
Saves this object to the file.
public
save() : mixed