Ejemplo n.º 1
0
 /**
  * @since 2.5
  */
 public function outputStatistics()
 {
     $this->outputFormatter->setPageTitle($this->getMessage('smw-smwadmin-operational-statistics-title'));
     $this->outputFormatter->addParentLink();
     $semanticStatistics = ApplicationFactory::getInstance()->getStore()->getStatistics();
     $this->outputFormatter->addHTML(Html::rawElement('p', array(), $this->getMessage(array('smw-smwadmin-operational-statistics'), Message::PARSE)));
     $this->outputFormatter->addHTML(Html::element('h2', array(), $this->getMessage('semanticstatistics')));
     $this->outputFormatter->addHTML('<pre>' . $this->outputFormatter->encodeAsJson(array('propertyValues' => $semanticStatistics['PROPUSES'], 'errorCount' => $semanticStatistics['ERRORUSES'], 'propertyTotal' => $semanticStatistics['USEDPROPS'], 'ownPage' => $semanticStatistics['OWNPAGE'], 'declaredType' => $semanticStatistics['DECLPROPS'], 'oudatedEntities' => $semanticStatistics['DELETECOUNT'], 'subobjects' => $semanticStatistics['SUBOBJECTS'], 'queries' => $semanticStatistics['QUERY'], 'concepts' => $semanticStatistics['CONCEPTS'])) . '</pre>');
     $this->outputFormatter->addHTML(Html::element('h2', array(), $this->getMessage('smw-smwadmin-statistics-querycache-title')));
     $cachedQueryResultPrefetcher = ApplicationFactory::getInstance()->singleton('CachedQueryResultPrefetcher');
     if (!$cachedQueryResultPrefetcher->isEnabled()) {
         return $this->outputFormatter->addHTML(Html::rawElement('p', array(), $this->getMessage(array('smw-smwadmin-statistics-querycache-disabled'), Message::PARSE)));
     }
     $this->outputFormatter->addHTML(Html::rawElement('p', array(), $this->getMessage(array('smw-smwadmin-statistics-querycache-explain'), Message::PARSE)));
     $this->outputFormatter->addHTML('<pre>' . $this->outputFormatter->encodeAsJson($cachedQueryResultPrefetcher->getStats()) . '</pre>');
 }
 /**
  * @since 2.5
  *
  * @param string $message
  */
 public function reportMessage($message)
 {
     $this->outputFormatter->addHTML($message);
 }
 public function testAddHTML()
 {
     $this->outputPage->expects($this->once())->method('addHTML');
     $instance = new OutputFormatter($this->outputPage);
     $instance->addHTML('Foo');
 }
 private function outputMessage($message)
 {
     $this->outputFormatter->addHTML('<p>' . $this->getMessage($message) . '</p>');
 }