PHP Class PHPDaemon\Config\Parser

Author: Vasily Zorin ([email protected])
Inheritance: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Datei anzeigen Open project: kakserpom/phpdaemon Class Usage Examples

Protected Properties

Property Type Description
$col number Current column number
$data string Contents of config file
$erroneous boolean Erroneous?
$file string Config file path
$length integer File length
$line number Current line number
$p integer Pointer (current offset)
$revision integer Revision
$stack array Parse stack
$state array State stack
$target object Target object
$tokens array Callbacks

Public Methods

Method Description
getCurrentScope ( ) : object Returns current variable scope
isErroneous ( ) : boolean Erroneous?
parse ( $file, $target, $included = false ) : Parser Parse config file
raiseError ( string $msg, $level = 'emerg', $line = null, $col = null ) : void Raises error message.

Protected Methods

Method Description
__construct ( $file, $target, $included = false ) : void Constructor
getCurrentChar ( ) : string Current character.
getNextChar ( ) : string Returns next character.
purgeScope ( $scope ) : void Removes old config parts after updating.
rewind ( $n ) : void Rewinds the pointer back.
token ( $token, string $c ) : mixed | void Executes token server.

Method Details

__construct() protected method

Constructor
protected __construct ( $file, $target, $included = false ) : void
return void

getCurrentChar() protected method

Current character.
protected getCurrentChar ( ) : string
return string Character.

getCurrentScope() public method

Returns current variable scope
public getCurrentScope ( ) : object
return object Scope.

getNextChar() protected method

Returns next character.
protected getNextChar ( ) : string
return string Character.

isErroneous() public method

Erroneous?
public isErroneous ( ) : boolean
return boolean

parse() public static method

Parse config file
public static parse ( $file, $target, $included = false ) : Parser
return Parser

purgeScope() protected method

Removes old config parts after updating.
protected purgeScope ( $scope ) : void
return void

raiseError() public method

Raises error message.
public raiseError ( string $msg, $level = 'emerg', $line = null, $col = null ) : void
$msg string
return void

rewind() protected method

Rewinds the pointer back.
protected rewind ( $n ) : void
return void

token() protected method

Executes token server.
protected token ( $token, string $c ) : mixed | void
$c string
return mixed | void

Property Details

$col protected_oe property

Current column number
protected number $col
return number

$data protected_oe property

Contents of config file
protected string $data
return string

$erroneous protected_oe property

Erroneous?
protected bool $erroneous
return boolean

$file protected_oe property

Config file path
protected string $file
return string

$length protected_oe property

File length
protected int $length
return integer

$line protected_oe property

Current line number
protected number $line
return number

$p protected_oe property

Pointer (current offset)
protected int $p
return integer

$revision protected_oe property

Revision
protected int $revision
return integer

$stack protected_oe static_oe property

Parse stack
protected static array $stack
return array

$state protected_oe property

State stack
protected array $state
return array

$target protected_oe property

Target object
protected object $target
return object

$tokens protected_oe property

Callbacks
protected array $tokens
return array