]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/LRDD/lib/discovery.php
A bit more instructive debugging
[quix0rs-gnu-social.git] / plugins / LRDD / lib / discovery.php
index f9b8d2930f37f8bb179a5e236f6cdc94e5538ca8..c8cf3277e27bcaa9238021bfd9a7d3dfe67e61b5 100644 (file)
@@ -23,7 +23,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Discovery
- * @package   GNUSocial
+ * @package   GNUsocial
  * @author    James Walker <james@status.net>
  * @author    Mikael Nordfeldth <mmn@hethane.se>
  * @copyright 2010 StatusNet, Inc.
@@ -39,6 +39,7 @@ class Discovery
     const LRDD_REL    = 'lrdd';
     const UPDATESFROM = 'http://schemas.google.com/g/2010#updates-from';
     const HCARD       = 'http://microformats.org/profile/hcard';
+    const MF2_HCARD   = 'http://microformats.org/profile/h-card';   // microformats2 h-card
 
     const JRD_MIMETYPE_OLD = 'application/json';    // RFC6415 uses this
     const JRD_MIMETYPE = 'application/jrd+json';
@@ -92,6 +93,8 @@ class Discovery
         // Normalize the incoming $id to make sure we have a uri
         $uri = self::normalize($id);
 
+        common_debug(sprintf('Performing discovery for "%s" (normalized "%s")', $id, $uri));
+
         foreach ($this->methods as $class) {
             try {
                 $xrd = new XML_XRD();
@@ -116,7 +119,7 @@ class Discovery
                     $headers[] = "Accept: {$link->type}";
                 }
 
-                $response = $client->get($xrd_uri, $headers); 
+                $response = $client->get($xrd_uri, $headers);
                 if ($response->getStatus() != 200) {
                     throw new Exception('Unexpected HTTP status code.');
                 }
@@ -198,5 +201,3 @@ class Discovery
         return $template;
     }
 }
-
-