Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $variableNode = new ConfigBuilderNode('variable');
     $variableNode->addAttribute('name');
     $variableNode->addAttribute('value');
     $configBuilder->addNode($variableNode);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $errorNode = new ConfigBuilderNode('error');
     $errorNode->addAttribute('pattern');
     $errorNode->addAttribute('presenter');
     $configBuilder->addNode($errorNode);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $errorNode = new ConfigBuilderNode('snippet');
     $errorNode->addAttribute('class');
     $errorNode->addAttribute('method');
     $configBuilder->addNode($errorNode);
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $actionNode = new ConfigBuilderNode('action');
     $actionNode->addAttribute('class');
     $actionNode->addAttribute('method');
     $actionNode->addAttribute('route');
     $actionNode->addAttribute('presenter');
     $configBuilder->addNode($actionNode);
 }
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $actionSessionNode = new ConfigBuilderNode('authenticate');
     $actionSessionNode->addAttribute('unauth-redirect', false);
     $actionSessionNode->addAttribute('auth-redirect', false);
     $actionNode = $configBuilder->getNode('action');
     $actionNode->addNode($actionSessionNode);
     $sessionNode = new ConfigBuilderNode('authenticate');
     $sessionNode->addAttribute('max-time', 0);
     $configBuilder->addNode($sessionNode);
 }
Пример #6
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $argumentNode = new ConfigBuilderNode('argument');
     $argumentNode->addAttribute('storage');
     $argumentNode->addAttribute('name');
     $argumentNode->addAttribute('pattern', '');
     $argumentNode->addAttribute('validator', '');
     $argumentNode->addAttribute('mapper', '');
     $argumentNode->addAttribute('default', false);
     $actionNode = $configBuilder->getNode('action');
     $actionNode->addNode($argumentNode);
 }
Пример #7
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $argumentNode = new ConfigBuilderNode('argument');
     $argumentNode->addAttribute('type');
     $argumentNode->addAttribute('value');
     $methodNode = new ConfigBuilderNode('method');
     $methodNode->addAttribute('name');
     $methodNode->addNode($argumentNode);
     $serviceNode = new ConfigBuilderNode('presenter');
     $serviceNode->addAttribute('name');
     $serviceNode->addAttribute('class');
     $serviceNode->addNode($methodNode);
     $configBuilder->addNode($serviceNode);
 }
Пример #8
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $argumentNode = new ConfigBuilderNode('argument');
     $argumentNode->addAttribute('type');
     $argumentNode->addAttribute('value');
     $methodNode = new ConfigBuilderNode('method');
     $methodNode->addAttribute('name');
     $methodNode->addNode($argumentNode);
     $bindNode = new ConfigBuilderNode('bind');
     $bindNode->addAttribute('name');
     $bindNode->addAttribute('method');
     $eventNode = new ConfigBuilderNode('event');
     $eventNode->addAttribute('class');
     $eventNode->addNode($methodNode);
     $eventNode->addNode($bindNode);
     $configBuilder->addNode($eventNode);
 }
Пример #9
0
 /**
  * Init framework config
  */
 private function initConfig()
 {
     //config structure
     $structureConfig = new ConfigBuilder();
     $xmlReader = new XmlFileReader($this->environment->getConfigPath() . '/structure.xml');
     $structureConfig->addReader($xmlReader);
     $structureNode = new ConfigBuilderNode('structure');
     $structureNode->addAttribute('class');
     $structureConfig->addNode($structureNode);
     $structureContainer = $structureConfig->parse();
     $xmlReader = new XmlFileReader($this->environment->getConfigPath() . '/' . $this->environment->getName() . '.xml');
     $importConfig = new ConfigBuilder();
     $importConfig->addReader($xmlReader);
     //config import
     $importNode = new ConfigBuilderNode('import');
     $importNode->addAttribute('file');
     $importConfig->addNode($importNode);
     $importContainer = $importConfig->parse();
     //config main
     $mainConfig = new ConfigBuilder();
     foreach ($importContainer->getNodes('import') as $importNode) {
         /**
          * @var ConfigContainer $importNode
          */
         $xmlReader = new XmlFileReader($this->environment->getConfigPath() . '/' . $importNode->getAttribute('file'));
         $mainConfig->addReader($xmlReader);
     }
     foreach ($structureContainer->getNodes('structure') as $structureNode) {
         /**
          * @var ConfigContainer $structureNode
          */
         $className = $structureNode->getAttribute('class');
         /**
          * @var Structure $structureObj
          */
         $structureObj = new $className();
         $structureObj->doConfig($mainConfig);
     }
     $this->config = new Config($mainConfig->parse());
 }
Пример #10
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $importNode = new ConfigBuilderNode('import');
     $importNode->addAttribute('file');
     $configBuilder->addNode($importNode);
 }