コード例 #1
0
 /**
  * Starts the Tika server
  *
  * @return void
  */
 public function startServerAction()
 {
     $this->tikaService->startServer();
     // give it some time to start
     sleep(2);
     if ($this->tikaService->isServerRunning()) {
         $this->addFlashMessage('Tika server started.', FlashMessage::OK);
     }
     $this->forwardToIndex();
 }
コード例 #2
0
ファイル: ServerServiceTest.php プロジェクト: visol/ext-tika
 /**
  * @test
  */
 public function startServerStoresPidInRegistry()
 {
     // prepare
     $registryMock = $this->prophet->prophesize('TYPO3\\CMS\\Core\\Registry');
     GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Registry', $registryMock->reveal());
     $processMock = $this->prophet->prophesize('ApacheSolrForTypo3\\Tika\\Process');
     $processMock->start()->shouldBeCalled();
     $processMock->getPid()->willReturn(1000);
     GeneralUtility::addInstance('ApacheSolrForTypo3\\Tika\\Process', $processMock->reveal());
     // execute
     $service = new ServerService($this->getConfiguration());
     $service->startServer();
     // test
     $registryMock->set('tx_tika', 'server.pid', Argument::that(function ($arg) {
         return is_int($arg) && $arg == 1000;
     }))->shouldHaveBeenCalled();
 }