public function containerFromString ($data) {
        if (strpos($data, 'PK') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new BdocContainer($file));
        } elseif (strpos(trim($data), '<') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new DdocContainer($file));
        }
        throw new DigidocException('Invalid container format');
    }
public function containerFromString ($data) {
        if (strpos($data, 'PK') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new BdocContainer($file));
        } elseif (strpos(trim($data), '<') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new DdocContainer($file));
        }
        throw new DigidocException('Invalid container format');
    }
public function containerFromString ( $ data ) { if ( strpos ( $ data , 'PK' ) === 0 ) { $ file = $ this -> createFile ( ) ; file_put_contents ( $ file , $ data ) ; return new SessionContainerAdapter ( $ this , new BdocContainer ( $ file ) ) ; } elseif ( strpos ( trim ( $ data ) , '<' ) === 0 ) { $ file = $ this -> createFile ( ) ; file_put_contents ( $ file , $ data ) ; return new SessionContainerAdapter ( $ this , new DdocContainer ( $ file ) ) ; } throw new DigidocException ( 'Invalid container format' ) ; }
Creates container from string.

Internally stores container data in a file and returns {@link SessionContainerAdapter}
pointing to {@link FileContainer} with created file.

Created files will be delete when {@link DigidocSession::end()} is called.

@param string $data

@throws DigidocException in case of invalid input.
@return StringContainer
Creates container from string .