PHP Class TheSeer\Autoload\AutoloadRenderer

Author: Arne Blankerts ([email protected])
Show file Open project: theseer/autoload Class Usage Examples

Protected Properties

Property Type Description
$baseDir string An optional base dir to strip for the realpath of the filename
$classes array Associative array of classes (key) and the files (value) they are in
$compat boolean Flag to toggle PHP 5.2 compat mode
$dateformat string Format string supplied to date() for use with ___CREATED___
$indent string Indenting char(s)
$linebreak string Char(s) used as linebreak
$timestamp integer Timestamp of production start
$variables array Variables for templates

Public Methods

Method Description
__construct ( array $classlist ) Constructor of AutoloadRenderer class
enableExceptions ( )
getLineBreak ( ) : string Accessor for current linebreak setting
prependAutoloader ( )
render ( string $template ) : string Render autoload code into a string
setBaseDir ( string $dir ) : void Setter for the Basedir
setCompat ( boolean $mode ) Toggle PHP 5.2 compat mode
setDateTimeFormat ( string $frmt ) Setter to adjust the date/time format output of ___CREATED___
setIndent ( string $indent ) : void Overwrite default or previously set indenting option
setLineBreak ( string $lbs ) : void Overwrite default or previously set linebreak chars
setTimestamp ( integer $time ) Setter to use allow usage of fixed date/time for ___CREATED___
setVariable ( string $name, string $value ) Set a variable for use with template code

Private Methods

Method Description
resolvePath ( string $fname ) : string Resolve relative location of file path to basedir if one is set and fix potential broken windows pathnames when run on windows.

Method Details

__construct() public method

Constructor of AutoloadRenderer class
public __construct ( array $classlist )
$classlist array Array of classes

enableExceptions() public method

public enableExceptions ( )

getLineBreak() public method

Accessor for current linebreak setting
public getLineBreak ( ) : string
return string

prependAutoloader() public method

public prependAutoloader ( )

render() public method

Render autoload code into a string
public render ( string $template ) : string
$template string
return string

setBaseDir() public method

Setter for the Basedir
public setBaseDir ( string $dir ) : void
$dir string Path to strip from beginning of filenames
return void

setCompat() public method

Toggle PHP 5.2 compat mode
public setCompat ( boolean $mode )
$mode boolean Mode to set compat to

setDateTimeFormat() public method

Setter to adjust the date/time format output of ___CREATED___
public setDateTimeFormat ( string $frmt )
$frmt string Date/Time format string

setIndent() public method

Overwrite default or previously set indenting option
public setIndent ( string $indent ) : void
$indent string Char(s) to use for indenting
return void

setLineBreak() public method

Overwrite default or previously set linebreak chars
public setLineBreak ( string $lbs ) : void
$lbs string Code to set linebreak
return void

setTimestamp() public method

Setter to use allow usage of fixed date/time for ___CREATED___
public setTimestamp ( integer $time )
$time integer unix timestamp

setVariable() public method

Set a variable for use with template code
public setVariable ( string $name, string $value )
$name string Key name (use as ___key___ in template)
$value string Value to use

Property Details

$baseDir protected property

An optional base dir to strip for the realpath of the filename
protected string $baseDir
return string

$classes protected property

Associative array of classes (key) and the files (value) they are in
protected array $classes
return array

$compat protected property

Flag to toggle PHP 5.2 compat mode
protected bool $compat
return boolean

$dateformat protected property

Format string supplied to date() for use with ___CREATED___
protected string $dateformat
return string

$indent protected property

Indenting char(s)
protected string $indent
return string

$linebreak protected property

Char(s) used as linebreak
protected string $linebreak
return string

$timestamp protected property

Timestamp of production start
protected int $timestamp
return integer

$variables protected property

Variables for templates
protected array $variables
return array