示例#1
0
 /**
  * Create a new (non-interactive) embedded application (e.g. for running
  * single commands).
  *
  * @param SessionInterface $session
  *
  * @return EmbeddedApplication
  */
 public static function createEmbeddedApplication(SessionInterface $session)
 {
     $container = new Container(self::MODE_EMBEDDED_COMMAND);
     $container->get('phpcr.session_manager')->setSession(new PhpcrSession($session));
     $application = $container->get('application');
     return $application;
 }
示例#2
0
 /**
  * Constructor - add the single command ShellCommand which
  * accepts the connection parameters for the shell.
  */
 public function __construct()
 {
     parent::__construct(PhpcrShell::APP_NAME, PhpcrShell::APP_VERSION);
     $container = new Container();
     $this->shellApplication = $container->get('application');
     $command = new ShellCommand($this->shellApplication);
     $command->setApplication($this);
     $this->add($command);
 }
示例#3
0
 protected function createTester()
 {
     // embbed a new session
     $session = $this->getSession(null, true);
     $container = new Container(PhpcrShell::MODE_EMBEDDED_SHELL);
     $container->get('phpcr.session_manager')->setSession(new PhpcrSession($session));
     $application = $container->get('application');
     $application->setShowUnsupported(true);
     $tester = new ApplicationTester($application);
     return $tester;
 }