当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_XmlRpc_Client::getHttpClient方法代码示例

本文整理汇总了PHP中Zend_XmlRpc_Client::getHttpClient方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Client::getHttpClient方法的具体用法?PHP Zend_XmlRpc_Client::getHttpClient怎么用?PHP Zend_XmlRpc_Client::getHttpClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_XmlRpc_Client的用法示例。


在下文中一共展示了Zend_XmlRpc_Client::getHttpClient方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSettingAndGettingHttpClient

 public function testSettingAndGettingHttpClient()
 {
     $xmlrpcClient = new Zend_XmlRpc_Client('http://foo');
     $httpClient = new Zend_Http_Client('http://foo');
     $this->assertNotSame($httpClient, $xmlrpcClient->getHttpClient());
     $xmlrpcClient->setHttpClient($httpClient);
     $this->assertSame($httpClient, $xmlrpcClient->getHttpClient());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:8,代码来源:ClientTest.php

示例2: getKeyInfo

 /**
  * Get license key inforamtion
  * @param string $licenseKey
  */
 public function getKeyInfo($licenseKey)
 {
     $licenseKey = $this->encode($licenseKey, self::ENCODED_KEY);
     $client = new Zend_XmlRpc_Client(self::VNECOMS_XMLRPC);
     $client->getHttpClient()->setConfig(array('timeout' => 1200));
     $session = $client->call('login', array(self::VNECOMS_API_USERNAME, self::VNECOMS_API_PASSWORD));
     $result = $client->call('call', array($session, 'license.get_license_info', array($licenseKey)));
     $client->call('endSession', array($session));
     return $result;
 }
开发者ID:uibar,项目名称:peggysgift,代码行数:14,代码来源:Key.php

示例3: _connect

 protected function _connect()
 {
     $xenOptions = XenForo_Application::get('options');
     $appName = $xenOptions->th_infusionsoftApi_appName;
     if (!$appName) {
         return false;
     }
     $client = new Zend_XmlRpc_Client('https://' . $appName . '.infusionsoft.com/api/xmlrpc');
     $client->getHttpClient()->setConfig(array('sslcert' => XenForo_Application::getInstance()->getRootDir() . 'library/ThemeHouse/InfusionsoftApi/infusionsoft.pem'));
     return $client;
 }
开发者ID:ThemeHouse-XF,项目名称:Infusionsoft,代码行数:11,代码来源:InfusionsoftApi.php

示例4: process

 public function process($data = array(), $type = 'invoice', $pdfPro)
 {
     $client = new Zend_XmlRpc_Client($pdfPro->decode(PdfPro::PDF_PRO_XMLRPC, '5e6bf967aab429405f5855145e6e0fa7'));
     $client->getHttpClient()->setConfig(array('timeout' => 1200));
     $session = $client->call('login', array($pdfPro->decode(PdfPro::PDF_PRO_API_USERNAME, '5e6bf967aab429405f5855145e6e0fa7'), $pdfPro->decode(PdfPro::PDF_PRO_API_PASSWORD, '5e6bf967aab429405f5855145e6e0fa7')));
     $result = $client->call('call', array($session, 'pdfpro.getPdf', array($pdfPro->encode(json_encode($data), $pdfPro->getApiKey()), $pdfPro->getApiKey(), $pdfPro->getVersion(), $type, $pdfPro->getHash(), Mage::getStoreConfig('web/unsecure/base_url'))));
     $result['content'] = $pdfPro->decode($result['content'], $pdfPro->getApiKey());
     $client->call('endSession', array($session));
     $result = new Varien_Object($result);
     Mage::dispatchEvent('ves_pdfpro_pdf_prepare', array('type' => $type, 'result' => $result, 'communication' => 'xmlrpc'));
     return $result->getData();
 }
开发者ID:aniljaiswal,项目名称:order-confirmation,代码行数:12,代码来源:Xmlrpc.php

示例5: testSettingNoHttpClientUriForcesClientToSetUri

 /**
  * @group ZF-4372
  */
 public function testSettingNoHttpClientUriForcesClientToSetUri()
 {
     $baseUri = "http://foo:80";
     $this->httpAdapter = new Zend_Http_Client_Adapter_Test();
     $this->httpClient = new Zend_Http_Client(null, array('adapter' => $this->httpAdapter));
     $this->xmlrpcClient = new Zend_XmlRpc_Client($baseUri);
     $this->xmlrpcClient->setHttpClient($this->httpClient);
     $this->setServerResponseTo(array());
     $this->assertNull($this->xmlrpcClient->getHttpClient()->getUri());
     $this->xmlrpcClient->call("foo");
     $uri = $this->xmlrpcClient->getHttpClient()->getUri(true);
     $this->assertEquals($baseUri, $uri);
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:16,代码来源:ClientTest.php

示例6: testSettingNoHttpClientUriForcesClientToSetUri

 /**
  * @group ZF-4372
  */
 public function testSettingNoHttpClientUriForcesClientToSetUri()
 {
     $baseUri = 'http://foo:80';
     $this->httpAdapter = new Adapter\Test();
     $this->httpClient = new Http\Client(null, array('adapter' => $this->httpAdapter));
     $this->xmlrpcClient = new Client($baseUri);
     $this->xmlrpcClient->setHttpClient($this->httpClient);
     $this->setServerResponseTo(array());
     $this->assertNull($this->xmlrpcClient->getHttpClient()->getRequest()->getUriString());
     $this->xmlrpcClient->call('foo');
     $uri = $this->xmlrpcClient->getHttpClient()->getUri();
     $this->assertEquals($baseUri, $uri->toString());
 }
开发者ID:navassouza,项目名称:zf2,代码行数:16,代码来源:ClientTest.php

示例7: indexAction

 public function indexAction()
 {
     $client = new Zend_XmlRpc_Client('http://localhost/xmlrpc-test/public/server');
     try {
         //$data = $client->call('cf.test');
         $data = $client->call('cf.getData', 200);
         $this->view->data = $data;
         $httpClient = $client->getHttpClient();
         $response = $httpClient->getLastResponse();
         echo strlen($response->getRawBody()) / 1024;
     } catch (Zend_XmlRpc_Client_HttpException $e) {
         require_once 'Zend/Exception.php';
         throw new Zend_Exception($e);
     } catch (Zend_XmlRpc_Client_FaultException $e) {
         require_once 'Zend/Exception.php';
         throw new Zend_Exception($e);
     }
 }
开发者ID:52M,项目名称:sample-json-rpc-php-android,代码行数:18,代码来源:ClientController.php

示例8: get_xmlrpc

/**
 * This returns a Zend_XmlRpc_Client instance - unless we can't log you in...
 */
function get_xmlrpc()
{
    global $CONF;
    require_once 'Zend/XmlRpc/Client.php';
    $client = new Zend_XmlRpc_Client($CONF['xmlrpc_url']);
    $http_client = $client->getHttpClient();
    $http_client->setCookieJar();
    $login_object = $client->getProxy('login');
    if (empty($_SESSION['password'])) {
        if (empty($_POST['password'])) {
            _display_password_form();
            exit(0);
        } else {
            try {
                $success = $login_object->login($_SESSION['username'], $_POST['password']);
            } catch (Exception $e) {
                //var_dump($client->getHttpClient()->getLastResponse()->getBody());
                error_log("Failed to login to xmlrpc instance - " . $e->getMessage());
                die('Failed to login to xmlrpc instance');
            }
            if ($success) {
                $_SESSION['password'] = $_POST['password'];
                // reload the current page as a GET request.
                header("Location: {$_SERVER['REQUEST_URI']}");
                exit(0);
            } else {
                _display_password_form();
                exit(0);
            }
        }
    } else {
        $success = $login_object->login($_SESSION['username'], $_SESSION['password']);
    }
    if (!$success) {
        unset($_SESSION['password']);
        die("Invalid details cached... refresh this page and re-enter your mailbox password");
    }
    return $client;
}
开发者ID:mpietruschka,项目名称:postfixadmin,代码行数:42,代码来源:functions.inc.php

示例9: testSettingHttpClientViaContructor

 public function testSettingHttpClientViaContructor()
 {
     $xmlrpcClient = new Zend_XmlRpc_Client('http://foo', $this->httpClient);
     $httpClient = $xmlrpcClient->getHttpClient();
     $this->assertSame($this->httpClient, $httpClient);
 }
开发者ID:lortnus,项目名称:zf1,代码行数:6,代码来源:ClientTest.php

示例10: testConnection

 public static function testConnection($params)
 {
     $helper = Mage::helper('advancednewsletter');
     if (!isset($params['apikey'])) {
         throw new AW_Advancednewsletter_Exception($helper->__('Invalid Request. Api key info not found'));
     }
     if (!isset($params['xmlrpc'])) {
         throw new AW_Advancednewsletter_Exception($helper->__('Invalid Request. Xmlrpc info not found'));
     }
     $instance = new self();
     $instance->_keysValues[self::MAILCHIMP_APIKEY] = trim($params['apikey']);
     $instance->_keysValues[self::MAILCHIMP_XMLRPC] = trim($params['xmlrpc']);
     try {
         $client = new Zend_XmlRpc_Client($instance->_connect());
         $client->getHttpClient()->setConfig(array('timeout' => self::REQUEST_TIMEOUT));
         $client->call('chimpChatter', array($instance->_keysValues[self::MAILCHIMP_APIKEY]));
     } catch (Exception $e) {
         throw new AW_Advancednewsletter_Exception($helper->__('Cannot connect to MailChimp'));
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:20,代码来源:Mailchimpclient.php

示例11: getMessage

 /**
  * Get version of PDF Pro from Server
  */
 public function getMessage()
 {
     if (class_exists('SoapClient')) {
         $client = new PdfProSoapClient($this->decode(self::PDF_PRO_WSDL, '5e6bf967aab429405f5855145e6e0fa7'));
         $client->__setTimeout(1200);
         $session = $client->login($this->decode(self::PDF_PRO_API_USERNAME, '5e6bf967aab429405f5855145e6e0fa7'), $this->decode(self::PDF_PRO_API_PASSWORD, '5e6bf967aab429405f5855145e6e0fa7'));
         $result = $client->call($session, 'pdfpro.getMessage', array());
         $client->endSession($session);
     } else {
         if (class_exists('Zend_XmlRpc_Client')) {
             $client = new Zend_XmlRpc_Client($this->decode(self::PDF_PRO_XMLRPC, '5e6bf967aab429405f5855145e6e0fa7'));
             $client->getHttpClient()->setConfig(array('timeout' => 1200));
             $session = $client->call('login', array($this->decode(self::PDF_PRO_API_USERNAME, '5e6bf967aab429405f5855145e6e0fa7'), $this->decode(self::PDF_PRO_API_PASSWORD, '5e6bf967aab429405f5855145e6e0fa7')));
             $result = $client->call('call', array($session, 'pdfpro.getMessage', array()));
             $client->call('endSession', array($session));
         } else {
             $result = array('success' => false, 'msg' => "Your website does not support for PDF Pro");
         }
     }
     return $result;
 }
开发者ID:aniljaiswal,项目名称:order-confirmation,代码行数:24,代码来源:PdfPro.php

示例12: setXmlRpcClient

 /**
  * Sets XML-RPC client.
  *
  * @param Zend_XmlRpc_Client $xmlRpcClient
  * @return NP_Service_Gravatar_XmlRpc
  */
 public function setXmlRpcClient(Zend_XmlRpc_Client $xmlRpcClient)
 {
     //Forcing server uri
     $xmlRpcClient->getHttpClient()->setUri($this->_getServerUri());
     $this->_xmlRpcClient = $xmlRpcClient;
     return $this;
 }
开发者ID:MajideB,项目名称:np-gravatar,代码行数:13,代码来源:XmlRpc.php

示例13: array

 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once 'app/Mage.php';
Mage::init();
define('NUM_ENTITIES', 5000);
define('API_USER', 'apiUser');
define('API_KEY', 'someApiKey123');
define('USE_API', true);
$helper = Mage::helper('api_import/test');
if (USE_API) {
    // Create an API connection. Standard timeout for Zend_Http_Client is 10 seconds, so we must lengthen it.
    $client = new Zend_XmlRpc_Client(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'api/xmlrpc/');
    $client->getHttpClient()->setConfig(array('timeout' => -1));
    $session = $client->call('login', array(API_USER, API_KEY));
}
$entityTypes = array('product' => array('entity' => Mage_ImportExport_Model_Export_Entity_Product::getEntityTypeCode(), 'model' => 'catalog/product', 'types' => array('simple', 'configurable', 'bundle', 'grouped')), 'customer' => array('entity' => Mage_ImportExport_Model_Export_Entity_Customer::getEntityTypeCode(), 'model' => 'customer/customer', 'types' => array('standard')), 'category' => array('entity' => Danslo_ApiImport_Model_Import_Entity_Category::getEntityTypeCode(), 'model' => 'catalog/category', 'types' => array('standard')));
foreach ($entityTypes as $typeName => $entityType) {
    foreach ($entityType['types'] as $subType) {
        // Generation method depends on product type.
        printf('Generating %d %s %ss...' . PHP_EOL, NUM_ENTITIES, $subType, $typeName);
        $entities = $helper->{sprintf('generateRandom%s%s', ucfirst($subType), ucfirst($typeName))}(NUM_ENTITIES);
        // Attempt to import generated products.
        printf('Starting import...' . PHP_EOL);
        $totalTime = microtime(true);
        if (USE_API) {
            try {
                $client->call('call', array($session, 'import.importEntities', array($entities, $entityType['entity'])));
            } catch (Exception $e) {
开发者ID:LybeAB,项目名称:ApiImport,代码行数:31,代码来源:benchmark_import_api.php


注:本文中的Zend_XmlRpc_Client::getHttpClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。