File indexing completed on 2024-05-12 06:03:05

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Service
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version    $Id$
0020  */
0021 
0022 
0023 /**
0024  * Zend_Http_Client
0025  */
0026 // require_once 'Zend/Http/Client.php';
0027 
0028 
0029 /**
0030  * @category   Zend
0031  * @package    Zend_Service
0032  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0033  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0034  */
0035 abstract class Zend_Service_Abstract
0036 {
0037     /**
0038      * HTTP Client used to query all web services
0039      *
0040      * @var Zend_Http_Client
0041      */
0042     protected static $_httpClient = null;
0043 
0044 
0045     /**
0046      * Sets the HTTP client object to use for retrieving the feeds.  If none
0047      * is set, the default Zend_Http_Client will be used.
0048      *
0049      * @param Zend_Http_Client $httpClient
0050      */
0051     final public static function setHttpClient(Zend_Http_Client $httpClient)
0052     {
0053         self::$_httpClient = $httpClient;
0054     }
0055 
0056 
0057     /**
0058      * Gets the HTTP client object.
0059      *
0060      * @return Zend_Http_Client
0061      */
0062     final public static function getHttpClient()
0063     {
0064         if (!self::$_httpClient instanceof Zend_Http_Client) {
0065             self::$_httpClient = new Zend_Http_Client();
0066         }
0067 
0068         return self::$_httpClient;
0069     }
0070 }
0071