示例#1
0
 private function initializeNamespaces(OutputInterface $output, WorkspaceInterface $workspace)
 {
     $output->writeln('  <info>content namespaces</>:');
     $namespaceRegistry = $workspace->getNamespaceRegistry();
     $existingPrefixes = $namespaceRegistry->getPrefixes();
     foreach (['sulu' => 'http://sulu.io/phpcr', 'sec' => 'http://sulu.io/phpcr/sec', 'settings' => 'http://sulu.io/phpcr/settings', $this->languageNamespace => 'http://sulu.io/phpcr/locale'] as $prefix => $uri) {
         if (in_array($prefix, $existingPrefixes)) {
             $output->writeln(sprintf('  [ ] %s:%s', $prefix, $uri));
             continue;
         }
         $output->writeln(sprintf('  [+] %s:%s', $prefix, $uri));
         $namespaceRegistry->registerNamespace($prefix, $uri);
     }
 }
示例#2
0
 public function testVariantNamespaceRegistered()
 {
     $nr = $this->workspace->getNamespaceRegistry();
     $this->assertEquals(Translation::LOCALE_NAMESPACE_URI, $nr->getURI(Translation::LOCALE_NAMESPACE));
 }
 public function testGetNamespaceRegistry()
 {
     $nr = $this->workspace->getNamespaceRegistry();
     $this->assertInstanceOf('PHPCR\\NamespaceRegistryInterface', $nr);
 }