Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

DefinitionBased.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\TransformationProcessor;
8
9 use eZ\Publish\Core\Persistence\TransformationProcessor;
10 use eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser;
11
15 class DefinitionBased extends TransformationProcessor
16 {
22 protected $parser = null;
23
38 public function __construct(Parser $parser, PcreCompiler $compiler, array $ruleFiles = [])
39 {
40 parent::__construct($compiler, $ruleFiles);
41 $this->parser = $parser;
42 }
43
49 protected function getRules()
50 {
51 if ($this->compiledRules === null) {
52 $rules = [];
53 foreach ($this->ruleFiles as $file) {
54 $rules = array_merge(
55 $rules,
56 $this->parser->parse($file)
57 );
58 }
59
60 $this->compiledRules = $this->compiler->compile($rules);
61 }
62
63 return $this->compiledRules;
64 }
65 }
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser
Parser for transformation specifications.
Definition: Persistence/TransformationProcessor/DefinitionBased/Parser.php:35
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased
Class for processing a set of transformations, loaded from .tr files, on a string.
Definition: DefinitionBased.php:16
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\__construct
__construct(Parser $parser, PcreCompiler $compiler, array $ruleFiles=[])
Construct instance of TransformationProcessor\DefinitionBased.
Definition: DefinitionBased.php:38
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\$parser
$parser
Definition: DefinitionBased.php:22
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\getRules
getRules()
Loads rules.
Definition: DefinitionBased.php:49
eZ\Publish\Core\Persistence\TransformationProcessor\PcreCompiler
Compiles the AST of parsed transformation rules into a set of PCRE replace regular expressions.
Definition: PcreCompiler.php:18
eZ\Publish\Core\Persistence\TransformationProcessor
Interface for processing a set of transformations on a string.
Definition: TransformationProcessor.php:15
eZ\Publish\Core\Persistence\TransformationProcessor\$compiledRules
$compiledRules
Definition: TransformationProcessor.php:36
eZ\Publish\Core\Persistence\TransformationProcessor\$compiler
$compiler
Definition: TransformationProcessor.php:43
eZ\Publish\Core\Persistence\TransformationProcessor\$ruleFiles
$ruleFiles
Definition: TransformationProcessor.php:29
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.