createWorkspace() public method

{@inheritDoc}
public createWorkspace ( $name, $srcWorkspace = null )
 public function setUp()
 {
     parent::setUp();
     $conn = $this->getConnection();
     $options = array('disable_fks' => $conn->getDatabasePlatform() instanceof SqlitePlatform);
     $schema = new RepositorySchema($options, $conn);
     // do not use reset as we want to ignore exceptions on drop
     foreach ($schema->toDropSql($conn->getDatabasePlatform()) as $statement) {
         try {
             $conn->exec($statement);
         } catch (\Exception $e) {
             // ignore
         }
     }
     foreach ($schema->toSql($conn->getDatabasePlatform()) as $statement) {
         $conn->exec($statement);
     }
     $this->transport = new \Jackalope\Transport\DoctrineDBAL\Client(new \Jackalope\Factory(), $conn);
     $this->transport->createWorkspace('default');
     $this->repository = new \Jackalope\Repository(null, $this->transport);
     try {
         $this->transport->createWorkspace($GLOBALS['phpcr.workspace']);
     } catch (\PHPCR\RepositoryException $e) {
         if ($e->getMessage() != "Workspace '" . $GLOBALS['phpcr.workspace'] . "' already exists") {
             // if the message is not that the workspace already exists, something went really wrong
             throw $e;
         }
     }
     $this->session = $this->repository->login(new \PHPCR\SimpleCredentials("user", "passwd"), $GLOBALS['phpcr.workspace']);
 }
 public function setUp()
 {
     parent::setUp();
     $conn = $this->getConnection();
     $this->loadFixtures($conn);
     $this->transport = $this->getClient($conn);
     $this->transport->createWorkspace('default');
     $this->repository = new \Jackalope\Repository(null, $this->transport);
     try {
         $this->transport->createWorkspace($GLOBALS['phpcr.workspace']);
     } catch (\PHPCR\RepositoryException $e) {
         if ($e->getMessage() != "Workspace '" . $GLOBALS['phpcr.workspace'] . "' already exists") {
             // if the message is not that the workspace already exists, something went really wrong
             throw $e;
         }
     }
     $this->session = $this->repository->login(new \PHPCR\SimpleCredentials("user", "passwd"), $GLOBALS['phpcr.workspace']);
 }
Example #3
0
 /**
  * {@inheritDoc}
  */
 public function createWorkspace($name, $srcWorkspace = null)
 {
     return $this->transport->createWorkspace($name, $srcWorkspace);
 }
 /**
  * {@inheritDoc}
  *
  */
 public function createWorkspace($name, $srcWorkspace = null)
 {
     parent::createWorkspace($name, $srcWorkspace = null);
     $this->caches['meta']->delete('workspaces');
     $this->caches['meta']->save("workspace: {$name}", 1);
 }