コード例 #1
0
 public function testLoad()
 {
     $loader = new XmlFileLoader(new FileLocator(__DIR__ . '/../Fixtures/Resources/config'));
     $schema = $loader->load('settings.xml');
     $this->assertCount(2, $schema);
 }
コード例 #2
0
 /**
  * @param                  $config
  * @param ContainerBuilder $container
  *
  * @return array
  */
 protected function loadDynamicParametersSchema($config, ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     $schema = array();
     foreach ($config['bundles'] as $bundle) {
         $reflector = new \ReflectionClass($bundles[$bundle]);
         $loader = new Parser\XmlFileLoader(new FileLocator(dirname($reflector->getFileName()) . '/Resources/config'));
         $schema = array_merge($loader->load('settings.xml'), $schema);
     }
     $container->setParameter('wizad_settings.schema', $schema);
     return $schema;
 }