[MediaWiki-commits] [Gerrit] Revert Introduce an UnloggedHttpError and use it in EntityD... - change (mediawiki...Wikibase)

2015-04-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert Introduce an UnloggedHttpError and use it in 
EntityDataRequestHandler
..


Revert Introduce an UnloggedHttpError and use it in EntityDataRequestHandler

No longer needed now that T85795 is solved.

This reverts commit 8f3f6455ab65c7a312c5153aace976e07a22138c.

Bug: T76458
Change-Id: I3174299b95769a0dbb20d7e07aee14cc90f6e8e5
---
D lib/includes/UnloggedHttpError.php
M repo/includes/LinkedData/EntityDataRequestHandler.php
2 files changed, 13 insertions(+), 39 deletions(-)

Approvals:
  JanZerebecki: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/UnloggedHttpError.php 
b/lib/includes/UnloggedHttpError.php
deleted file mode 100644
index b59edb0..000
--- a/lib/includes/UnloggedHttpError.php
+++ /dev/null
@@ -1,25 +0,0 @@
-?php
-
-namespace Wikibase;
-
-use HttpError;
-
-/**
- * Unlogged variant of HttpError.
- * Needed until https://phabricator.wikimedia.org/T85795 got solved.
- *
- * @since 0.5
- * @license GNU GPL v2+
- * @author Marius Hoch  h...@online.de 
- */
-class UnloggedHttpError extends HttpError {
-   /**
-* @see MWException::isLoggable
-*
-* @return bool
-*/
-   public function isLoggable() {
-   return false;
-   }
-
-}
diff --git a/repo/includes/LinkedData/EntityDataRequestHandler.php 
b/repo/includes/LinkedData/EntityDataRequestHandler.php
index 7fb1795..7a29deb 100644
--- a/repo/includes/LinkedData/EntityDataRequestHandler.php
+++ b/repo/includes/LinkedData/EntityDataRequestHandler.php
@@ -137,7 +137,7 @@
 * @param WebRequest $request
 *
 * @return bool
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function canHandleRequest( $doc, WebRequest $request ) {
if ( $doc === '' || $doc === null ) {
@@ -165,7 +165,7 @@
 * @note: Instead of an output page, a WebResponse could be sufficient, 
but
 *redirect logic is currently implemented in OutputPage.
 *
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function handleRequest( $doc, WebRequest $request, OutputPage 
$output ) {
$revision = 0;
@@ -182,13 +182,13 @@
// If there is no ID, fail
if ( $id === null || $id === '' ) {
//TODO: different error message?
-   throw new UnloggedHttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
+   throw new \HttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
}
 
try {
$entityId = $this-entityIdParser-parse( $id );
} catch ( EntityIdParsingException $ex ) {
-   throw new UnloggedHttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
+   throw new \HttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
}
 
//XXX: allow for logged in users only?
@@ -233,7 +233,7 @@
 * @param string $format
 *
 * @return string
-* @throws UnloggedHttpError code 415 if the format is not supported.
+* @throws HttpError code 415 if the format is not supported.
 *
 */
public function getCanonicalFormat( $format ) {
@@ -248,7 +248,7 @@
$canonicalFormat = $this-serializationService-getFormatName( 
$format );
 
if ( $canonicalFormat === null ) {
-   throw new UnloggedHttpError( 415, wfMessage( 
'wikibase-entitydata-unsupported-format' )-params( $format ) );
+   throw new \HttpError( 415, wfMessage( 
'wikibase-entitydata-unsupported-format' )-params( $format ) );
}
 
return $canonicalFormat;
@@ -271,14 +271,14 @@
/**
 * Applies HTTP content negotiation.
 * If the negotiation is successfull, this method will set the 
appropriate redirect
-* in the OutputPage object and return. Otherwise, an UnloggedHttpError 
is thrown.
+* in the OutputPage object and return. Otherwise, an HttpError is 
thrown.
 *
 * @param WebRequest $request
 * @param OutputPage $output
 * @param EntityId $id The ID of the entity to show
 * @param int  $revision The desired revision
 *
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function httpContentNegotiation( WebRequest $request, OutputPage 
$output, EntityId $id, $revision = 0 ) {
$headers = $request-getAllHeaders();
@@ -308,7 +308,7 @@
 
if ( $format === null ) {
$mimeTypes = implode( ', ', 

[MediaWiki-commits] [Gerrit] Revert Introduce an UnloggedHttpError and use it in EntityD... - change (mediawiki...Wikibase)

2015-04-04 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/201918

Change subject: Revert Introduce an UnloggedHttpError and use it in 
EntityDataRequestHandler
..

Revert Introduce an UnloggedHttpError and use it in EntityDataRequestHandler

No longer needed now that T85795 is solved.

This reverts commit 8f3f6455ab65c7a312c5153aace976e07a22138c.

Bug: T76458
Change-Id: I3174299b95769a0dbb20d7e07aee14cc90f6e8e5
---
D lib/includes/UnloggedHttpError.php
M repo/includes/LinkedData/EntityDataRequestHandler.php
2 files changed, 13 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/18/201918/1

diff --git a/lib/includes/UnloggedHttpError.php 
b/lib/includes/UnloggedHttpError.php
deleted file mode 100644
index b59edb0..000
--- a/lib/includes/UnloggedHttpError.php
+++ /dev/null
@@ -1,25 +0,0 @@
-?php
-
-namespace Wikibase;
-
-use HttpError;
-
-/**
- * Unlogged variant of HttpError.
- * Needed until https://phabricator.wikimedia.org/T85795 got solved.
- *
- * @since 0.5
- * @license GNU GPL v2+
- * @author Marius Hoch  h...@online.de 
- */
-class UnloggedHttpError extends HttpError {
-   /**
-* @see MWException::isLoggable
-*
-* @return bool
-*/
-   public function isLoggable() {
-   return false;
-   }
-
-}
diff --git a/repo/includes/LinkedData/EntityDataRequestHandler.php 
b/repo/includes/LinkedData/EntityDataRequestHandler.php
index 7fb1795..7a29deb 100644
--- a/repo/includes/LinkedData/EntityDataRequestHandler.php
+++ b/repo/includes/LinkedData/EntityDataRequestHandler.php
@@ -137,7 +137,7 @@
 * @param WebRequest $request
 *
 * @return bool
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function canHandleRequest( $doc, WebRequest $request ) {
if ( $doc === '' || $doc === null ) {
@@ -165,7 +165,7 @@
 * @note: Instead of an output page, a WebResponse could be sufficient, 
but
 *redirect logic is currently implemented in OutputPage.
 *
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function handleRequest( $doc, WebRequest $request, OutputPage 
$output ) {
$revision = 0;
@@ -182,13 +182,13 @@
// If there is no ID, fail
if ( $id === null || $id === '' ) {
//TODO: different error message?
-   throw new UnloggedHttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
+   throw new \HttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
}
 
try {
$entityId = $this-entityIdParser-parse( $id );
} catch ( EntityIdParsingException $ex ) {
-   throw new UnloggedHttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
+   throw new \HttpError( 400, wfMessage( 
'wikibase-entitydata-bad-id' )-params( $id ) );
}
 
//XXX: allow for logged in users only?
@@ -233,7 +233,7 @@
 * @param string $format
 *
 * @return string
-* @throws UnloggedHttpError code 415 if the format is not supported.
+* @throws HttpError code 415 if the format is not supported.
 *
 */
public function getCanonicalFormat( $format ) {
@@ -248,7 +248,7 @@
$canonicalFormat = $this-serializationService-getFormatName( 
$format );
 
if ( $canonicalFormat === null ) {
-   throw new UnloggedHttpError( 415, wfMessage( 
'wikibase-entitydata-unsupported-format' )-params( $format ) );
+   throw new \HttpError( 415, wfMessage( 
'wikibase-entitydata-unsupported-format' )-params( $format ) );
}
 
return $canonicalFormat;
@@ -271,14 +271,14 @@
/**
 * Applies HTTP content negotiation.
 * If the negotiation is successfull, this method will set the 
appropriate redirect
-* in the OutputPage object and return. Otherwise, an UnloggedHttpError 
is thrown.
+* in the OutputPage object and return. Otherwise, an HttpError is 
thrown.
 *
 * @param WebRequest $request
 * @param OutputPage $output
 * @param EntityId $id The ID of the entity to show
 * @param int  $revision The desired revision
 *
-* @throws UnloggedHttpError
+* @throws HttpError
 */
public function httpContentNegotiation( WebRequest $request, OutputPage 
$output, EntityId $id, $revision = 0 ) {
$headers = $request-getAllHeaders();
@@ -308,7 +308,7 @@
 
if ( $format === null ) {
$mimeTypes =