Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $errorNode = new ConfigBuilderNode('error');
     $errorNode->addAttribute('pattern');
     $errorNode->addAttribute('presenter');
     $configBuilder->addNode($errorNode);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $variableNode = new ConfigBuilderNode('variable');
     $variableNode->addAttribute('name');
     $variableNode->addAttribute('value');
     $configBuilder->addNode($variableNode);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $errorNode = new ConfigBuilderNode('snippet');
     $errorNode->addAttribute('class');
     $errorNode->addAttribute('method');
     $configBuilder->addNode($errorNode);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
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);
 }
 /**
  * {@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);
 }
Ejemplo n.º 7
0
 public function setUp()
 {
     $this->config = new ConfigBuilder();
     $xmlReader = new XmlFileReader(__DIR__ . '/../../Asset/Config/ConfigBuilder/example.xml');
     $this->config->addReader($xmlReader);
     $xmlReader = new XmlFileReader(__DIR__ . '/../../Asset/Config/ConfigBuilder/example2.xml');
     $this->config->addReader($xmlReader);
     $argumentNode = new ConfigBuilderNode('argument');
     $argumentNode->addAttribute('type');
     $argumentNode->addAttribute('value');
     $methodNode = new ConfigBuilderNode('method');
     $methodNode->addAttribute('name');
     $methodNode->addNode($argumentNode);
     $serviceNode = new ConfigBuilderNode('service');
     $serviceNode->addAttribute('name');
     $serviceNode->addAttribute('class');
     $serviceNode->addAttribute('singletone', 'true');
     $serviceNode->addNode($methodNode);
     $this->config->addNode($serviceNode);
     $variableNode = new ConfigBuilderNode('variable');
     $this->config->addNode($variableNode);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
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());
 }
Ejemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 public function doConfig(ConfigBuilder $configBuilder)
 {
     $importNode = new ConfigBuilderNode('import');
     $importNode->addAttribute('file');
     $configBuilder->addNode($importNode);
 }