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

Source for file Digg.php

Documentation is available at Digg.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * API for Digg's web services
  7.  *
  8.  * PHP version 5.1.0+
  9.  *
  10.  * LICENSE: This source file is subject to the New BSD license that is
  11.  * available through the world-wide-web at the following URI:
  12.  * http://www.opensource.org/licenses/bsd-license.php. If you did not receive
  13.  * a copy of the New BSD License and are unable to obtain it through the web,
  14.  * please send a note to license@php.net so we can mail you a copy immediately.
  15.  *
  16.  * @category    Services
  17.  * @package     Services_Digg
  18.  * @author      Joe Stump <joe@joestump.net>
  19.  * @copyright   2007 Digg.com, Inc.
  20.  * @license     http://www.opensource.org/licenses/bsd-license.php
  21.  * @version     CVS: $Id:$
  22.  * @link        http://pear.php.net/package/Services_Digg
  23.  */ 
  24.  
  25. require_once 'Services/Digg/Common.php';
  26. require_once 'Services/Digg/Exception.php';
  27.  
  28. /**
  29.  * Services_Digg
  30.  *
  31.  * @category    Services
  32.  * @package     Services_Digg
  33.  * @author      Joe Stump <joe@joestump.net>
  34.  * @link        http://apidoc.digg.com/ToolkitsServicesDigg
  35.  * @link        http://groups.google.com/group/diggapi
  36.  */
  37. abstract class Services_Digg 
  38. {
  39.     /**
  40.      * Digg API URI
  41.      *
  42.      * @access      protected
  43.      * @var         string      $uri 
  44.      * @static
  45.      */
  46.     static public $uri = 'http://services.digg.com';    
  47.  
  48.     /**
  49.      * Your API Key
  50.      *
  51.      * The value of the appKey argument must be a URI that idenfitifes the
  52.      * application making the request. The URI might point to:
  53.      *
  54.      * - The application itself, if it's a web application.
  55.      * - A web page describing the application.
  56.      * - A web page offering the application for download.
  57.      * - The author's web site.
  58.      *
  59.      * @access      public
  60.      * @var         string      $appKey 
  61.      * @static
  62.      */
  63.     static public $appKey = null;
  64.  
  65.     /**
  66.      * Create digg services
  67.      *
  68.      * @access      public
  69.      * @param       string      $endPoint 
  70.      * @return      mixed       PEAR_Error on failure, service on success
  71.      */
  72.     static public function factory($endPoint
  73.     {
  74.         $file 'Services/Digg/' $endPoint '.php';
  75.         if (!include_once($file)) {
  76.             throw new Services_Digg_Exception('Endpoint file not found: ' $file);
  77.         }
  78.  
  79.         $class 'Services_Digg_' $endPoint;
  80.         if (!class_exists($class)) {
  81.             throw new Services_Digg_Exception('Endpoint class not found: ' $class);
  82.         }
  83.  
  84.         $instance = new $class();
  85.         return $instance;
  86.     }
  87. }
  88.  
  89. ?>

Documentation generated on Tue, 04 Dec 2007 15:00:06 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.