public function parseSchema($schema_path)
 {
     $document = $this->createDomDocument($schema_path);
     $module_schema_element = $document->documentElement;
     $xpath = new \DOMXPath($document);
     $module_definition_parser = ModuleDefinitionXpathParser::create();
     $aggregates_parser = AggregateDefinitionXpathParser::create();
     return Schema\ModuleSchema::create(array('namespace' => $module_schema_element->getAttribute('namespace'), 'package' => $module_schema_element->getAttribute('package'), 'module_definition' => $module_definition_parser->parseXpath($xpath, array('context' => $module_schema_element)), 'aggregate_definitions' => $aggregates_parser->parseXpath($xpath, array('context' => $module_schema_element))));
 }
Example #2
0
 public function __construct(Schema\ModuleSchema $module_schema, Schema\ModuleDefinition $module_definition = null)
 {
     $this->twig = new \Twig_Environment(new \Twig_Loader_Filesystem(__DIR__ . DIRECTORY_SEPARATOR . 'templates'));
     $this->module_schema = $module_schema;
     $this->module_definition = $module_definition ? $module_definition : $module_schema->getModuleDefinition();
 }