PHP Класс Neos\Fusion\Core\Parser

Наследование: implements Neos\Fusion\Core\ParserInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$reservedParseTreeKeys array Reserved parse tree keys for internal usage.

Защищенные свойства (Protected)

Свойство Тип Описание
$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