PHP 클래스 Neos\Fusion\Core\Parser

상속: implements Neos\Fusion\Core\ParserInterface
파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$reservedParseTreeKeys array Reserved parse tree keys for internal usage.

보호된 프로퍼티들

프로퍼티 타입 설명
$contextPathAndFilename string An optional context path which is used as a prefix for inclusion of further TypoScript files
$currentBlockCommentState boolean Determines if a block comment is currently active or not.
$currentLineNumber integer The line number which is currently processed
$currentObjectPathStack array The current object path context as defined by confinements.
$currentSourceCodeLines array An array of strings of the source code which has
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$objectTree array The TypoScript object tree, created by this parser.
$objectTypeNamespaces array By convention, the namespace should be a package key, but other strings would be possible, too. Note that, in order to resolve an object type, a prototype with that namespace and name must be defined elsewhere. These namespaces are _not_ used for resolution of processor class names.

공개 메소드들

메소드 설명
parse ( string $sourceCode, string $contextPathAndFilename = null, array $objectTreeUntilNow = [], boolean $buildPrototypeHierarchy = true ) : array Parses the given TypoScript source code and returns an object tree as the result.
setObjectTypeNamespace ( string $alias, string $namespace ) : void Sets the given alias to the specified namespace.

보호된 메소드들

메소드 설명
buildPrototypeHierarchy ( ) : void Precalculate merged configuration for inherited prototypes.
getCurrentObjectPathPrefix ( ) : string Returns the first part of an object path from the current object path stack which can be used to prefix a relative object path.
getNextTypoScriptLine ( ) : string Get the next, unparsed line of TypoScript from this->currentSourceCodeLines and increase the pointer
getParsedObjectPath ( string $objectPath ) : array Parse an object path specified as a string and returns an array.
getProcessedValue ( string $unparsedValue ) : mixed Parses the given value (which may be a literal, variable or object type) and returns the evaluated result, including variables replaced by their actual value.
getValueFromObjectTree ( array $objectPathArray, array &$objectTree = null ) : mixed Retrieves a value from a node in the object tree, specified by the object path array.
initialize ( ) : void Initializes the TypoScript parser
parseComment ( string $typoScriptLine ) : void Parses a line with comments or a line while parsing is in block comment mode.
parseConfinementBlock ( string $typoScriptLine, boolean $isOpeningConfinement ) : void Parses a line which opens or closes a confinement
parseDeclaration ( string $typoScriptLine ) : void Parses a parser declaration of the form "declarationtype: declaration".
parseInclude ( string $include ) : void Parse an include file. Currently, we start a new parser object; but we could as well re-use the given one.
parseNamespaceDeclaration ( string $namespaceDeclaration ) : void Parses a namespace declaration and stores the result in the namespace registry.
parseObjectDefinition ( string $typoScriptLine ) : void Parses an object definition.
parseTypoScriptLine ( string $typoScriptLine ) : void Parses one line of TypoScript
parseValueAssignment ( string $objectPath, string $value ) : void Parses a value operation of the type "assignment".
parseValueCopy ( string $sourceObjectPath, string $targetObjectPath ) : void Copies the object or value specified by sourcObjectPath and assigns it to targetObjectPath.
parseValueUnAssignment ( string $objectPath ) : void Unsets the object, property or variable specified by the object path.
setValueInObjectTree ( array $objectPathArray, mixed $value, array &$objectTree = null ) : array Assigns a value to a node or a property in the object tree, specified by the object path array.
unquoteString ( string $quotedValue ) : string Removes escapings from a given argument string and trims the outermost quotes.

메소드 상세

buildPrototypeHierarchy() 보호된 메소드

Precalculate merged configuration for inherited prototypes.
protected buildPrototypeHierarchy ( ) : void
리턴 void

getCurrentObjectPathPrefix() 보호된 메소드

Returns the first part of an object path from the current object path stack which can be used to prefix a relative object path.
protected getCurrentObjectPathPrefix ( ) : string
리턴 string A part of an object path, ready to use as a prefix

getNextTypoScriptLine() 보호된 메소드

Get the next, unparsed line of TypoScript from this->currentSourceCodeLines and increase the pointer
protected getNextTypoScriptLine ( ) : string
리턴 string next line of typoscript to parse

getParsedObjectPath() 보호된 메소드

Parse an object path specified as a string and returns an array.
protected getParsedObjectPath ( string $objectPath ) : array
$objectPath string The object path to parse
리턴 array An object path array

getProcessedValue() 보호된 메소드

Parses the given value (which may be a literal, variable or object type) and returns the evaluated result, including variables replaced by their actual value.
protected getProcessedValue ( string $unparsedValue ) : mixed
$unparsedValue string The unparsed value
리턴 mixed The processed value

getValueFromObjectTree() 보호된 메소드

Retrieves a value from a node in the object tree, specified by the object path array.
protected getValueFromObjectTree ( array $objectPathArray, array &$objectTree = null ) : mixed
$objectPathArray array The object path, specifying the node to retrieve the value of
$objectTree array The current (sub-) tree, used internally - don't specify!
리턴 mixed The value

initialize() 보호된 메소드

Initializes the TypoScript parser
protected initialize ( ) : void
리턴 void

parse() 공개 메소드

Parses the given TypoScript source code and returns an object tree as the result.
public parse ( string $sourceCode, string $contextPathAndFilename = null, array $objectTreeUntilNow = [], boolean $buildPrototypeHierarchy = true ) : array
$sourceCode string The TypoScript source code to parse
$contextPathAndFilename string An optional path and filename to use as a prefix for inclusion of further TypoScript files
$objectTreeUntilNow array Used internally for keeping track of the built object tree
$buildPrototypeHierarchy boolean Merge prototype configurations or not. Will be FALSE for includes to only do that once at the end.
리턴 array A TypoScript object tree, generated from the source code

parseComment() 보호된 메소드

Parses a line with comments or a line while parsing is in block comment mode.
protected parseComment ( string $typoScriptLine ) : void
$typoScriptLine string One line of TypoScript code
리턴 void

parseConfinementBlock() 보호된 메소드

Parses a line which opens or closes a confinement
protected parseConfinementBlock ( string $typoScriptLine, boolean $isOpeningConfinement ) : void
$typoScriptLine string One line of TypoScript code
$isOpeningConfinement boolean Set to TRUE, if an opening confinement is to be parsed and FALSE if it's a closing confinement.
리턴 void

parseDeclaration() 보호된 메소드

Parses a parser declaration of the form "declarationtype: declaration".
protected parseDeclaration ( string $typoScriptLine ) : void
$typoScriptLine string One line of TypoScript code
리턴 void

parseInclude() 보호된 메소드

Parse an include file. Currently, we start a new parser object; but we could as well re-use the given one.
protected parseInclude ( string $include ) : void
$include string The include value, for example " FooBar" or " resource://....". Can also include wildcard mask for TypoScript globbing.
리턴 void

parseNamespaceDeclaration() 보호된 메소드

Parses a namespace declaration and stores the result in the namespace registry.
protected parseNamespaceDeclaration ( string $namespaceDeclaration ) : void
$namespaceDeclaration string The namespace declaration, for example "neos = Neos.Neos"
리턴 void

parseObjectDefinition() 보호된 메소드

Parses an object definition.
protected parseObjectDefinition ( string $typoScriptLine ) : void
$typoScriptLine string One line of TypoScript code
리턴 void

parseTypoScriptLine() 보호된 메소드

Parses one line of TypoScript
protected parseTypoScriptLine ( string $typoScriptLine ) : void
$typoScriptLine string One line of TypoScript code
리턴 void

parseValueAssignment() 보호된 메소드

Parses a value operation of the type "assignment".
protected parseValueAssignment ( string $objectPath, string $value ) : void
$objectPath string The object path as a string
$value string The unparsed value as a string
리턴 void

parseValueCopy() 보호된 메소드

Copies the object or value specified by sourcObjectPath and assigns it to targetObjectPath.
protected parseValueCopy ( string $sourceObjectPath, string $targetObjectPath ) : void
$sourceObjectPath string Specifies the location in the object tree from where the object or value will be taken
$targetObjectPath string Specifies the location in the object tree where the copy will be stored
리턴 void

parseValueUnAssignment() 보호된 메소드

Unsets the object, property or variable specified by the object path.
protected parseValueUnAssignment ( string $objectPath ) : void
$objectPath string The object path as a string
리턴 void

setObjectTypeNamespace() 공개 메소드

The namespaces defined through this setter or through a "namespace" declaration in one of the TypoScripts are used to resolve a fully qualified TypoScript object name while parsing TypoScript code. The alias is the handle by wich the namespace can be referred to. The namespace is, by convention, a package key which must correspond to a namespace used in the prototype definitions for TypoScript object types. The special alias "default" is used as a fallback for resolution of unqualified TypoScript object types.
public setObjectTypeNamespace ( string $alias, string $namespace ) : void
$alias string An alias for the given namespace, for example "neos"
$namespace string The namespace, for example "Neos.Neos"
리턴 void

setValueInObjectTree() 보호된 메소드

Assigns a value to a node or a property in the object tree, specified by the object path array.
protected setValueInObjectTree ( array $objectPathArray, mixed $value, array &$objectTree = null ) : array
$objectPathArray array The object path, specifying the node / property to set
$value mixed The value to assign, is a non-array type or an array with __eelExpression etc.
$objectTree array The current (sub-) tree, used internally - don't specify!
리턴 array The modified object tree

unquoteString() 보호된 메소드

This method is meant as a helper for regular expression results.
protected unquoteString ( string $quotedValue ) : string
$quotedValue string Value to unquote
리턴 string Unquoted value

프로퍼티 상세

$contextPathAndFilename 보호되어 있는 프로퍼티

An optional context path which is used as a prefix for inclusion of further TypoScript files
protected string $contextPathAndFilename
리턴 string

$currentBlockCommentState 보호되어 있는 프로퍼티

Determines if a block comment is currently active or not.
protected bool $currentBlockCommentState
리턴 boolean

$currentLineNumber 보호되어 있는 프로퍼티

The line number which is currently processed
protected int $currentLineNumber
리턴 integer

$currentObjectPathStack 보호되어 있는 프로퍼티

The current object path context as defined by confinements.
protected array $currentObjectPathStack
리턴 array

$currentSourceCodeLines 보호되어 있는 프로퍼티

An array of strings of the source code which has
protected array $currentSourceCodeLines
리턴 array

$objectManager 보호되어 있는 프로퍼티

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
리턴 Neos\Flow\ObjectManagement\ObjectManagerInterface

$objectTree 보호되어 있는 프로퍼티

The TypoScript object tree, created by this parser.
protected array $objectTree
리턴 array

$objectTypeNamespaces 보호되어 있는 프로퍼티

By convention, the namespace should be a package key, but other strings would be possible, too. Note that, in order to resolve an object type, a prototype with that namespace and name must be defined elsewhere. These namespaces are _not_ used for resolution of processor class names.
protected array $objectTypeNamespaces
리턴 array

$reservedParseTreeKeys 공개적으로 정적으로 프로퍼티

Reserved parse tree keys for internal usage.
public static array $reservedParseTreeKeys
리턴 array