Net_WebFinger
[ class tree: Net_WebFinger ] [ index: Net_WebFinger ] [ all elements ]

Source for file webfinger-cli.php

Documentation is available at webfinger-cli.php

  1. <?php
  2. if ($argc < 2{
  3.     echo <<<TXT
  4. Usage: $argv[0] user@example.com
  5.  
  6. TXT;
  7.     exit(1);
  8. }
  9. $identifier $argv[1];
  10.  
  11. if (is_dir(__DIR__ . '/../src/')) {
  12.         get_include_path(. PATH_SEPARATOR . __DIR__ . '/../src/'
  13.     );
  14. }
  15.         '/home/cweiske/Dev/pear/git-packages/XML_XRD/src/' . PATH_SEPARATOR . get_include_path()
  16.     );
  17. require_once 'Net/WebFinger.php';
  18.  
  19. function displayError(Exception $error{
  20.     echo $error->getMessage("\n";
  21.     if ($error->getPrevious()) {
  22.         echo ' Underlying error: ';
  23.         displayError($error->getPrevious());
  24.     }
  25. }
  26.  
  27. echo 'Discovering ' $identifier "\n";
  28.  
  29. $wf = new Net_WebFinger();
  30. $react $wf->finger($identifier);
  31.  
  32. echo 'Information secure? ' var_export($react->securetrue"\n";
  33. echo 'Data source URL: ' $react->url . "\n";
  34.  
  35. if ($react->error !== null{
  36.     echo 'Error: ';
  37.     displayError($react->error);
  38. }
  39.  
  40. if ($react->openid === null{
  41.     echo "No OpenID provider found\n";
  42. else {
  43.     echo 'OpenID provider: ' $react->openid . "\n";
  44. }
  45.  
  46. foreach ($react as $link{
  47.     echo 'Link: ' $link->rel . ': ' ($link->href ? $link->href : $link->template"\n";
  48. }
  49.  
  50. ?>

Documentation generated on Mon, 11 Mar 2019 15:57:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.