Nik has uploaded a new change for review.

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

Change subject: Added namespace to Publisher library.
......................................................................

Added namespace to Publisher library.

Change-Id: I034123b9ffd343eebbe994f63cb2ead0ae5b8bd1
---
R lib/Publisher.php
1 file changed, 11 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PubSubHubbub 
refs/changes/24/123224/1

diff --git a/lib/publisher.php b/lib/Publisher.php
similarity index 87%
rename from lib/publisher.php
rename to lib/Publisher.php
index c90baec..e4a4560 100644
--- a/lib/publisher.php
+++ b/lib/Publisher.php
@@ -22,6 +22,8 @@
  * @file
  */
 
+namespace PubSubHubbub;
+
 /**
  * A publisher client library for PubSubHubbub.
  *
@@ -48,10 +50,10 @@
         */
        public function __construct ( $hub_url ) {
                if ( !isset ( $hub_url ) )
-                       throw new Exception ( "Please specify a hub url" );
+                       throw new \Exception ( "Please specify a hub url" );
 
                if ( !preg_match ( "|^https?://|i" , $hub_url ) )
-                       throw new Exception ( "The specified hub url does not 
appear to be valid: " . $hub_url );
+                       throw new \Exception ( "The specified hub url does not 
appear to be valid: " . $hub_url );
 
                $this->hub_url = $hub_url;
        }
@@ -64,7 +66,7 @@
         */
        public function publish_update ( $topic_urls, $http_function = false ) {
                if ( !isset ( $topic_urls ) )
-                       throw new Exception ( "Please specify a topic URL" );
+                       throw new \Exception ( "Please specify a topic URL" );
 
                // Check that we're working with an array
                if ( !is_array ( $topic_urls ) ) {
@@ -78,7 +80,7 @@
 
                        // Lightweight check that we're actually working with a 
valid url
                        if ( !preg_match ( "|^https?://|i", $topic_url ) )
-                               throw new Exception ( "The specified topic URL 
does not appear to be valid: " . $topic_url );
+                               throw new \Exception ( "The specified topic URL 
does not appear to be valid: " . $topic_url );
 
                        // Append the topic URL parameters
                        $post_string .= "&hub.url=" . urlencode ($topic_url );
@@ -114,14 +116,14 @@
                        CURLOPT_USERAGENT => 
"MediaWiki-PubSubHubbub-Publisher/1.0"
                );
 
-               $ch = curl_init ();
-               curl_setopt_array ( $ch, $options );
+               $ch = \curl_init ();
+               \curl_setopt_array ( $ch, $options );
 
-               $response = curl_exec ( $ch );
+               $response = \curl_exec ( $ch );
                $this->last_response = $response;
-               $info = curl_getinfo ( $ch );
+               $info = \curl_getinfo ( $ch );
 
-               curl_close ( $ch );
+               \curl_close ( $ch );
 
                // All good
                if ( $info['http_code'] == 204 )

-- 
To view, visit https://gerrit.wikimedia.org/r/123224
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I034123b9ffd343eebbe994f63cb2ead0ae5b8bd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PubSubHubbub
Gerrit-Branch: master
Gerrit-Owner: Nik <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to