Jackalope\Transport\Jackrabbit\Client::createWorkspace PHP Method

createWorkspace() public method

{@inheritDoc}
public createWorkspace ( $name, $srcWorkspace = null )
    public function createWorkspace($name, $srcWorkspace = null)
    {
        if (null != $srcWorkspace) {
            // https://issues.apache.org/jira/browse/JCR-3144
            throw new UnsupportedRepositoryOperationException('Can not create a workspace from a source workspace as we neither implemented clone nor have native support for this');
        }
        $curl = $this->getCurl();
        $uri = $this->server . $name;
        $request = $this->factory->get('Transport\\Jackrabbit\\Request', array($this, $curl, Request::MKWORKSPACE, $uri));
        $request->setCredentials($this->credentials);
        foreach ($this->defaultHeaders as $header) {
            $request->addHeader($header);
        }
        if (!$this->sendExpect) {
            $request->addHeader("Expect:");
        }
        $request->execute();
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function createWorkspace($name, $srcWorkspace = null)
 {
     $this->transport->createWorkspace($name, $srcWorkspace);
 }