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

Source for file example-obj.php

Documentation is available at example-obj.php

  1. <?php
  2. //error_reporting(E_ALL|E_STRICT);
  3.  
  4. set_include_path(dirname(__FILE__'/../' . PATH_SEPARATOR . get_include_path());
  5.  
  6. require_once 'Services/ProjectHoneyPot.php';
  7.  
  8. /**
  9.  * config.php, includes:
  10.  * <?php $access_key = '...'; ?>
  11.  * 
  12.  * ... is the access key
  13.  */
  14. include dirname(__FILE__'/config.php';
  15.  
  16. try {
  17.     $sphp Services_ProjectHoneyPot::factory($access_key);
  18.     $sphp->setResponseFormat('object');
  19.  
  20.     $status $sphp->query($harvester);
  21.  
  22. }
  23.     echo "\nMSG: " .$e->getMessage();
  24.     echo "\nCODE: " $e->getCode();
  25.     exit;
  26. }
  27. if ($status === false)
  28. {
  29.     echo 'Don\'t bother. Probably a regular user. ;-)';
  30.     exit;
  31. }
  32.  
  33. if ($status->isHarvester()) {
  34.     echo '<h1>OMG, a harvester!!!</h1>';
  35.     echo '<pre>'var_dump($status->getAll()); echo '</pre>';
  36. }
  37. ?>

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