getRepository() public method

{@inheritDoc} Jackrabbit repositories have no default repository, passing null as parameters will always return null.
public getRepository ( array $parameters = null )
$parameters array
Esempio n. 1
0
 public function getRepository(Config $config)
 {
     $params = ['jackalope.jackrabbit_uri' => $config['repo_url']];
     $factory = new RepositoryFactoryJackrabbit();
     $repository = $factory->getRepository($params);
     return $repository;
 }
Esempio n. 2
0
 protected function getSession($workspaceName = null, $force = false)
 {
     if ($workspaceName === null) {
         $workspaceName = $this->currentWorkspaceName;
     }
     static $sessions = array();
     if (false === $force && isset($sessions[$workspaceName])) {
         $session = $sessions[$workspaceName];
         return $session;
     }
     $params = array('jackalope.jackrabbit_uri' => 'http://localhost:8080/server/');
     $factory = new RepositoryFactoryJackrabbit();
     $repository = $factory->getRepository($params);
     $credentials = new SimpleCredentials('admin', 'admin');
     $sessions[$workspaceName] = $repository->login($credentials, $workspaceName);
     return $sessions[$workspaceName];
 }
Esempio n. 3
0
 /**
  * Creates session.
  *
  * @param array $parameter
  *
  * @return SessionInterface
  */
 private function getSession($parameter)
 {
     $factory = new RepositoryFactoryJackrabbit();
     $repository = $factory->getRepository(array('jackalope.jackrabbit_uri' => $parameter['jackrabbit_uri']));
     $credentials = new SimpleCredentials($parameter['user'], $parameter['password']);
     return $repository->login($credentials, $parameter['workspace']);
 }