summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'SemanticMediaWiki/includes/query/profiler')
-rw-r--r--SemanticMediaWiki/includes/query/profiler/DescriptionProfile.php75
-rw-r--r--SemanticMediaWiki/includes/query/profiler/DurationProfile.php52
-rw-r--r--SemanticMediaWiki/includes/query/profiler/FormatProfile.php50
-rw-r--r--SemanticMediaWiki/includes/query/profiler/NullProfile.php93
-rw-r--r--SemanticMediaWiki/includes/query/profiler/ProfileAnnotator.php37
-rw-r--r--SemanticMediaWiki/includes/query/profiler/ProfileAnnotatorDecorator.php79
6 files changed, 0 insertions, 386 deletions
diff --git a/SemanticMediaWiki/includes/query/profiler/DescriptionProfile.php b/SemanticMediaWiki/includes/query/profiler/DescriptionProfile.php
deleted file mode 100644
index 2f64ed1a..00000000
--- a/SemanticMediaWiki/includes/query/profiler/DescriptionProfile.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-use SMW\DIProperty;
-
-use SMWDescription as QueryDescription;
-use SMWDINumber as DINumber;
-use SMWDIBlob as DIBlob;
-
-/**
- * Provides access to some QueryDescription profiling data
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-class DescriptionProfile extends ProfileAnnotatorDecorator {
-
- /** @var QueryDescription */
- protected $description;
-
- /**
- * @since 1.9
- *
- * @param ProfileAnnotator $profileAnnotator
- */
- public function __construct( ProfileAnnotator $profileAnnotator, QueryDescription $description ) {
- parent::__construct( $profileAnnotator );
- $this->description = $description;
- }
-
- /**
- * @since 1.9
- */
- protected function addPropertyValues() {
- $this->addQueryString( $this->description->getQueryString() );
- $this->addQuerySize( $this->description->getSize() );
- $this->addQueryDepth( $this->description->getDepth() );
- }
-
- /**
- * @since 1.9
- */
- private function addQueryString( $queryString ) {
- $this->getSemanticData()->addPropertyObjectValue(
- new DIProperty( '_ASKST' ),
- new DIBlob( $queryString )
- );
- }
-
- /**
- * @since 1.9
- */
- private function addQuerySize( $size ) {
- $this->getSemanticData()->addPropertyObjectValue(
- new DIProperty( '_ASKSI' ),
- new DINumber( $size )
- );
- }
-
- /**
- * @since 1.9
- */
- private function addQueryDepth( $depth ) {
- $this->getSemanticData()->addPropertyObjectValue(
- new DIProperty( '_ASKDE' ),
- new DINumber( $depth )
- );
- }
-
-} \ No newline at end of file
diff --git a/SemanticMediaWiki/includes/query/profiler/DurationProfile.php b/SemanticMediaWiki/includes/query/profiler/DurationProfile.php
deleted file mode 100644
index 0aa19287..00000000
--- a/SemanticMediaWiki/includes/query/profiler/DurationProfile.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-use SMW\DIProperty;
-use SMWDINumber as DINumber;
-
-/**
- * Adds duration profiling annotation
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-class DurationProfile extends ProfileAnnotatorDecorator {
-
- /** @var integer */
- protected $duration;
-
- /**
- * @since 1.9
- *
- * @param ProfileAnnotator $profileAnnotator
- */
- public function __construct( ProfileAnnotator $profileAnnotator, $duration ) {
- parent::__construct( $profileAnnotator );
- $this->duration = $duration;
- }
-
- /**
- * @since 1.9
- */
- protected function addPropertyValues() {
- if ( $this->duration > 0 ) {
- $this->addGreaterThanZeroQueryDuration( $this->duration );
- }
- }
-
- /**
- * @since 1.9
- */
- private function addGreaterThanZeroQueryDuration( $duration ) {
- $this->getSemanticData()->addPropertyObjectValue(
- new DIProperty( '_ASKDU' ),
- new DINumber( $duration )
- );
- }
-
-} \ No newline at end of file
diff --git a/SemanticMediaWiki/includes/query/profiler/FormatProfile.php b/SemanticMediaWiki/includes/query/profiler/FormatProfile.php
deleted file mode 100644
index 6341975f..00000000
--- a/SemanticMediaWiki/includes/query/profiler/FormatProfile.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-use SMW\DIProperty;
-use SMWDIBlob as DIBlob;
-
-/**
- * Provides access to Format profiling data
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-class FormatProfile extends ProfileAnnotatorDecorator {
-
- /** @var array */
- protected $format;
-
- /**
- * @since 1.9
- *
- * @param ProfileAnnotator $profileAnnotator
- */
- public function __construct( ProfileAnnotator $profileAnnotator, $format ) {
- parent::__construct( $profileAnnotator );
- $this->format = $format;
- }
-
- /**
- * @since 1.9
- */
- protected function addPropertyValues() {
- $this->addQueryFormat( $this->format );
- }
-
- /**
- * @since 1.9
- */
- private function addQueryFormat( $format ) {
- $this->getSemanticData()->addPropertyObjectValue(
- new DIProperty( '_ASKFO' ),
- new DIBlob( $format )
- );
- }
-
-} \ No newline at end of file
diff --git a/SemanticMediaWiki/includes/query/profiler/NullProfile.php b/SemanticMediaWiki/includes/query/profiler/NullProfile.php
deleted file mode 100644
index 2915795e..00000000
--- a/SemanticMediaWiki/includes/query/profiler/NullProfile.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-use SMW\Subobject;
-use SMW\IdGenerator;
-use SMW\DIProperty;
-
-/**
- * Provides access to the Null object for handling profiling data
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-class NullProfile implements ProfileAnnotator {
-
- /** @var Subobject */
- protected $subobject;
-
- /** @var string */
- protected $queryId = null;
-
- /**
- * @since 1.9
- *
- * @param Subobject $subobject
- * @param IdGenerator $queryId
- */
- public function __construct( Subobject $subobject, IdGenerator $queryId ) {
- $this->subobject = $subobject;
- $this->queryId = $queryId;
- }
-
- /**
- * Returns errors collected during processing
- *
- * @since 1.9
- *
- * @return array
- */
- public function getErrors() {
- return $this->subobject->getErrors();
- }
-
- /**
- * ProfileAnnotator::getProperty
- *
- * @since 1.9
- *
- * @return array
- */
- public function getProperty() {
- return new DIProperty( '_ASK' );
- }
-
- /**
- * ProfileAnnotator::getContainer
- *
- * @since 1.9
- *
- * @return SemanticData
- */
- public function getContainer() {
- return $this->subobject->getContainer();
- }
-
- /**
- * ProfileAnnotator::getSemanticData
- *
- * @since 1.9
- *
- * @return SemanticData
- */
- public function getSemanticData() {
- return $this->subobject->getSemanticData();
- }
-
- /**
- * ProfileAnnotator::addAnnotation
- *
- * @since 1.9
- */
- public function addAnnotation() {
- $this->subobject->setSemanticData(
- $this->subobject->generateId( $this->queryId->setPrefix( '_QUERY' ) )
- );
- }
-
-} \ No newline at end of file
diff --git a/SemanticMediaWiki/includes/query/profiler/ProfileAnnotator.php b/SemanticMediaWiki/includes/query/profiler/ProfileAnnotator.php
deleted file mode 100644
index b3a0bb3f..00000000
--- a/SemanticMediaWiki/includes/query/profiler/ProfileAnnotator.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-use SMW\PropertyAnnotator;
-
-/**
- * Specifing the ProfileAnnotator interface
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-interface ProfileAnnotator extends PropertyAnnotator {
-
- /**
- * Returns the query meta data property
- *
- * @since 1.9
- *
- * @return DIProperty
- */
- public function getProperty();
-
- /**
- * Returns the query meta data container
- *
- * @since 1.9
- *
- * @return DIContainer
- */
- public function getContainer();
-
-}
diff --git a/SemanticMediaWiki/includes/query/profiler/ProfileAnnotatorDecorator.php b/SemanticMediaWiki/includes/query/profiler/ProfileAnnotatorDecorator.php
deleted file mode 100644
index b01a7766..00000000
--- a/SemanticMediaWiki/includes/query/profiler/ProfileAnnotatorDecorator.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-
-namespace SMW\Query\Profiler;
-
-/**
- * Decorator implementing the ProfileAnnotator interface
- *
- * @ingroup SMW
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-abstract class ProfileAnnotatorDecorator implements ProfileAnnotator {
-
- /** @var ProfileAnnotator */
- protected $profileAnnotator;
-
- /**
- * @since 1.9
- *
- * @param ProfileAnnotator $profileAnnotator
- */
- public function __construct( ProfileAnnotator $profileAnnotator ) {
- $this->profileAnnotator = $profileAnnotator;
- }
-
- /**
- * ProfileAnnotator::getProperty
- *
- * @since 1.9
- *
- * @return DIProperty
- */
- public function getProperty() {
- return $this->profileAnnotator->getProperty();
- }
-
- /**
- * ProfileAnnotator::getContainer
- *
- * @since 1.9
- *
- * @return DIContainer
- */
- public function getContainer() {
- return $this->profileAnnotator->getContainer();
- }
-
- /**
- * @see ProfileAnnotator::getSemanticData
- *
- * @since 1.9
- *
- * @return SemanticData
- */
- public function getSemanticData() {
- return $this->profileAnnotator->getSemanticData();
- }
-
- /**
- * ProfileAnnotator::addAnnotation
- *
- * @since 1.9
- *
- * @return ProfileAnnotator
- */
- public function addAnnotation() {
- $this->profileAnnotator->addAnnotation();
- $this->addPropertyValues();
- }
-
- /**
- * @since 1.9
- */
- protected abstract function addPropertyValues();
-
-}