PHP Class Gregwar\RST\Environment

ファイルを表示 Open project: gregwar/rst Class Usage Examples

Public Properties

Property Type Description
$errorManager Error manager
$letters Letters used as separators for titles and horizontal line
$prettyTableHeader
$prettyTableJoint
$prettyTableLetter
$tableLetter Table letters

Protected Properties

Property Type Description
$anonymous Anonymous links stack
$counters
$currentDirectory
$currentFileName Current file name
$currentTitleLevel Title letter for each levels
$dependencies Dependencies of this document
$levels Level counters
$links Links
$metas Metas
$references References that can be resolved
$targetDirectory
$titleLetters
$url
$variables Variables of the document

Public Methods

Method Description
__construct ( )
absoluteRelativePath ( $url ) Returns an absolute path for a relative given URL
addDependency ( $dependency ) Adds a dependency to the document
canonicalUrl ( $url ) Gets a canonical URL from the given one
createTitle ( $level ) Title level
found ( $section, $data )
getDependencies ( ) Getting all the dependencies for this environment
getDepth ( ) Get the depth of the current file name (the number of parent directories)
getDirName ( ) Returns the directory name
getErrorManager ( )
getLevel ( $letter )
getLink ( $name, $relative = true ) Get a link value
getMetas ( )
getMyToc ( ) Get the docs involving this document
getNumber ( $level ) Get a level number
getParent ( ) Get my parent metas
getTargetDirectory ( )
getTitleLetters ( )
getUrl ( )
getVariable ( $variable, $default = null ) Gets the variable value
pushAnonymous ( $name ) Set the current anonymous links name
registerReference ( Gregwar\RST\Reference $reference ) Registers a new reference
relativeUrl ( $url ) Resolves a relative URL using directories, for instance, if the current directory is "path/to/something", and you want to get the relative URL to "path/to/something/else.html", the result will be else.html. Else, ".
reset ( ) Puts the environment in a clean state for a new parse, like title level order.
resetAnonymousStack ( ) Resets the anonymous stack
resolve ( $section, $data ) Resolves a reference
setCurrentDirectory ( $directory ) Sets the directory of the current parsing
setCurrentFileName ( $filename ) Sets the current file name
setErrorManager ( Gregwar\RST\ErrorManager $errorManager )
setLink ( $name, $url ) Set the link url
setMetas ( $metas )
setTargetDirectory ( $directory )
setUrl ( $url )
setVariable ( $variable, $value ) Sets the giving variable to a value

Protected Methods

Method Description
canonicalize ( $url ) Canonicalize a path, a/b/c/.
samePrefix ( $url ) Returns true if the given url have the same prefix as the current document

Method Details

__construct() public method

public __construct ( )

absoluteRelativePath() public method

Returns an absolute path for a relative given URL
public absoluteRelativePath ( $url )

addDependency() public method

Adds a dependency to the document
public addDependency ( $dependency )

canonicalUrl() public method

Gets a canonical URL from the given one
public canonicalUrl ( $url )

canonicalize() protected method

./d/e will become a/b/d/e
protected canonicalize ( $url )

createTitle() public method

Title level
public createTitle ( $level )

found() public method

public found ( $section, $data )

getDependencies() public method

Getting all the dependencies for this environment
public getDependencies ( )

getDepth() public method

Get the depth of the current file name (the number of parent directories)
public getDepth ( )

getDirName() public method

Returns the directory name
public getDirName ( )

getErrorManager() public method

public getErrorManager ( )

getLevel() public method

public getLevel ( $letter )

getMetas() public method

public getMetas ( )

getMyToc() public method

Get the docs involving this document
public getMyToc ( )

getNumber() public method

Get a level number
public getNumber ( $level )

getParent() public method

Get my parent metas
public getParent ( )

getTargetDirectory() public method

public getTargetDirectory ( )

getTitleLetters() public method

public getTitleLetters ( )

getUrl() public method

public getUrl ( )

getVariable() public method

Gets the variable value
public getVariable ( $variable, $default = null )

pushAnonymous() public method

Set the current anonymous links name
public pushAnonymous ( $name )

registerReference() public method

Registers a new reference
public registerReference ( Gregwar\RST\Reference $reference )
$reference Gregwar\RST\Reference

relativeUrl() public method

./" will be added to go to the upper directory
public relativeUrl ( $url )

reset() public method

Puts the environment in a clean state for a new parse, like title level order.
public reset ( )

resetAnonymousStack() public method

Resets the anonymous stack
public resetAnonymousStack ( )

resolve() public method

Resolves a reference
public resolve ( $section, $data )

samePrefix() protected method

Returns true if the given url have the same prefix as the current document
protected samePrefix ( $url )

setCurrentDirectory() public method

Sets the directory of the current parsing
public setCurrentDirectory ( $directory )

setCurrentFileName() public method

Sets the current file name
public setCurrentFileName ( $filename )

setErrorManager() public method

public setErrorManager ( Gregwar\RST\ErrorManager $errorManager )
$errorManager Gregwar\RST\ErrorManager

setMetas() public method

public setMetas ( $metas )

setTargetDirectory() public method

public setTargetDirectory ( $directory )

setUrl() public method

public setUrl ( $url )

setVariable() public method

Sets the giving variable to a value
public setVariable ( $variable, $value )
$variable the variable name
$value the variable value

Property Details

$anonymous protected_oe property

Anonymous links stack
protected $anonymous

$counters protected_oe property

protected $counters

$currentDirectory protected_oe property

protected $currentDirectory

$currentFileName protected_oe property

Current file name
protected $currentFileName

$currentTitleLevel protected_oe property

Title letter for each levels
protected $currentTitleLevel

$dependencies protected_oe property

Dependencies of this document
protected $dependencies

$errorManager public_oe property

Error manager
public $errorManager

$letters public_oe static_oe property

Letters used as separators for titles and horizontal line
public static $letters

$levels protected_oe property

Level counters
protected $levels

$metas protected_oe property

Metas
protected $metas

$prettyTableHeader public_oe static_oe property

public static $prettyTableHeader

$prettyTableJoint public_oe static_oe property

public static $prettyTableJoint

$prettyTableLetter public_oe static_oe property

public static $prettyTableLetter

$references protected_oe property

References that can be resolved
protected $references

$tableLetter public_oe static_oe property

Table letters
public static $tableLetter

$targetDirectory protected_oe property

protected $targetDirectory

$titleLetters protected_oe property

protected $titleLetters

$url protected_oe property

protected $url

$variables protected_oe property

Variables of the document
protected $variables