X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2Fclasses%2FHubSub.php;h=e7ac23af5821ee5dfdfa4e480d0ddc1c4b301b94;hb=4101de7dd7cf059816c29c666c816f260a84c252;hp=7db528a4e85772a23ad35823cb5592e0edde6951;hpb=a1b25b46bc4bf3dbe7766e865e0a47056786bf0c;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php index 7db528a4e8..e7ac23af58 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * PuSH feed subscription record * @package Hub @@ -54,7 +58,6 @@ class HubSub extends Memcached_DataObject * * @return array array of column definitions */ - function table() { return array('hashkey' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, @@ -112,7 +115,6 @@ class HubSub extends Memcached_DataObject * * @return array key definitions */ - function keyTypes() { return array('hashkey' => 'K'); @@ -206,7 +208,8 @@ class HubSub extends Memcached_DataObject if ($status >= 200 && $status < 300) { common_log(LOG_INFO, "Verified $mode of $this->callback:$this->topic"); } else { - throw new ClientException("Hub subscriber verification returned HTTP $status"); + // TRANS: Client exception. %s is a HTTP status code. + throw new ClientException(sprintf(_m('Hub subscriber verification returned HTTP %s.'),$status)); } $old = HubSub::staticGet($this->topic, $this->callback); @@ -307,9 +310,9 @@ class HubSub extends Memcached_DataObject /** * Queue up a large batch of pushes to multiple subscribers * for this same topic update. - * + * * If queues are disabled, this will run immediately. - * + * * @param string $atom well-formed Atom feed * @param array $pushCallbacks list of callback URLs */ @@ -352,11 +355,9 @@ class HubSub extends Memcached_DataObject if ($response->isOk()) { return true; } else { - throw new Exception("Callback returned status: " . - $response->getStatus() . - "; body: " . - trim($response->getBody())); + // TRANS: Exception. %1$s is a response status code, %2$s is the body of the response. + throw new Exception(sprintf(_m('Callback returned status: %1$s. Body: %2$s'), + $response->getStatus(),trim($response->getBody()))); } } } -