PHP Class Gregwar\RST\Builder

Show file Open project: gregwar/rst Class Usage Examples

Protected Properties

Property Type Description
$beforeHooks Hooks before the parsing on the environment
$directory Source and target directory
$documents Parsed documents waiting to be rendered
$errorManager Error manager
$hooks Hooks after the parsing
$indexName Tree index name
$kernel Kernel
$metas Metas for documents
$parseQueue Queue of documents to be parsed
$states States (decision) of the scanned documents
$targetDirectory
$toCopy Files to copy at the end of the build
$toMkdir
$verbose Verbose build ?

Public Methods

Method Description
__construct ( $kernel = null )
addBeforeHook ( $function ) Adds an hook which will be called on each environment during building
addHook ( $function ) Adds an hook which will be called on each document after parsing
build ( $directory, $targetDirectory = 'output', $verbose = true )
copy ( $source, $destination = null ) Add a file to copy
doCopy ( ) Run the copy
doMkdir ( ) Run the directories creation
getErrorManager ( )
getIndexName ( )
getRST ( $file ) Gets the .rst of a source file
getSourceFile ( $filename ) Gets the name of a source file
getTargetFile ( $filename ) Gets the name of a target file
getTargetOf ( $file ) Gets the name of a target for a file, for instance /introduction/part1 could be resolved into /path/to/introduction/part1.html
getUrl ( $document ) Gets the URL of a target file
mkdir ( $directory ) Creates a directory in the target
scan ( $file ) Scans a file, this will check the status of the file and tell if it needs to be parsed or not
scanMetas ( ) Scans all the metas
setIndexName ( $name )

Protected Methods

Method Description
addToParseQueue ( $file ) Adding a file to the parse queue
display ( $text )
getFileToParse ( ) Returns the next file to parse
getMetaFile ( ) Get the meta file name
loadMetas ( ) Try to inport the metas from the meta files
parseAll ( ) Parses all the document that need to be parsed
render ( ) Renders all the pending documents
saveMetas ( ) Saving the meta files

Method Details

__construct() public method

public __construct ( $kernel = null )

addBeforeHook() public method

Adds an hook which will be called on each environment during building
public addBeforeHook ( $function )

addHook() public method

Adds an hook which will be called on each document after parsing
public addHook ( $function )

addToParseQueue() protected method

Adding a file to the parse queue
protected addToParseQueue ( $file )

build() public method

public build ( $directory, $targetDirectory = 'output', $verbose = true )

copy() public method

Add a file to copy
public copy ( $source, $destination = null )

display() protected method

protected display ( $text )

doCopy() public method

Run the copy
public doCopy ( )

doMkdir() public method

Run the directories creation
public doMkdir ( )

getErrorManager() public method

public getErrorManager ( )

getFileToParse() protected method

Returns the next file to parse
protected getFileToParse ( )

getIndexName() public method

public getIndexName ( )

getMetaFile() protected method

Get the meta file name
protected getMetaFile ( )

getRST() public method

Gets the .rst of a source file
public getRST ( $file )

getSourceFile() public method

Gets the name of a source file
public getSourceFile ( $filename )

getTargetFile() public method

Gets the name of a target file
public getTargetFile ( $filename )

getTargetOf() public method

Gets the name of a target for a file, for instance /introduction/part1 could be resolved into /path/to/introduction/part1.html
public getTargetOf ( $file )

getUrl() public method

Gets the URL of a target file
public getUrl ( $document )

loadMetas() protected method

Try to inport the metas from the meta files
protected loadMetas ( )

mkdir() public method

Creates a directory in the target
public mkdir ( $directory )
$directory the directory name to create

parseAll() protected method

Parses all the document that need to be parsed
protected parseAll ( )

render() protected method

Renders all the pending documents
protected render ( )

saveMetas() protected method

Saving the meta files
protected saveMetas ( )

scan() public method

Scans a file, this will check the status of the file and tell if it needs to be parsed or not
public scan ( $file )

scanMetas() public method

Scans all the metas
public scanMetas ( )

setIndexName() public method

public setIndexName ( $name )

Property Details

$beforeHooks protected property

Hooks before the parsing on the environment
protected $beforeHooks

$directory protected property

Source and target directory
protected $directory

$documents protected property

Parsed documents waiting to be rendered
protected $documents

$errorManager protected property

Error manager
protected $errorManager

$hooks protected property

Hooks after the parsing
protected $hooks

$indexName protected property

Tree index name
protected $indexName

$kernel protected property

Kernel
protected $kernel

$metas protected property

Metas for documents
protected $metas

$parseQueue protected property

Queue of documents to be parsed
protected $parseQueue

$states protected property

States (decision) of the scanned documents
protected $states

$targetDirectory protected property

protected $targetDirectory

$toCopy protected property

Files to copy at the end of the build
protected $toCopy

$toMkdir protected property

protected $toMkdir

$verbose protected property

Verbose build ?
protected $verbose