本文整理汇总了PHP中Zend_XmlRpc_Client::setSkipSystemLookup方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Client::setSkipSystemLookup方法的具体用法?PHP Zend_XmlRpc_Client::setSkipSystemLookup怎么用?PHP Zend_XmlRpc_Client::setSkipSystemLookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_XmlRpc_Client
的用法示例。
在下文中一共展示了Zend_XmlRpc_Client::setSkipSystemLookup方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Sets the API key and instantiates the XML-RPC client
*
* @param string $apiKey
* @return void
*/
public function __construct($apiKey)
{
$this->_apiKey = (string) $apiKey;
/**
* @see Zend_XmlRpc_Client
*/
require_once 'Zend/XmlRpc/Client.php';
try {
$this->_client = new Zend_XmlRpc_Client('https://rpc.gandi.net/xmlrpc/2.0');
$this->_client->setSkipSystemLookup(true);
} catch (Zend_XmlRpc_Client_FaultException $e) {
throw new Exception('Fault Exception: ' . $e->getCode() . "\n" . $e->getMessage());
} catch (Zend_XmlRpc_Client_HttpException $e) {
throw new Exception('HTTP Exception: ' . $e->getCode() . "\n" . $e->getMessage());
}
}
示例2: testSkipsSystemCallWhenDirected
public function testSkipsSystemCallWhenDirected()
{
$this->mockHttpClient();
$this->mockedHttpClient->expects($this->once())->method('request')->with('POST')->will($this->returnValue($this->makeHttpResponseFor('foo')));
$this->xmlrpcClient->setHttpClient($this->mockedHttpClient);
$this->xmlrpcClient->setSkipSystemLookup(true);
$this->assertSame('foo', $this->xmlrpcClient->call('test.method'));
}
示例3: testSkipsSystemCallWhenDirected
public function testSkipsSystemCallWhenDirected()
{
$httpAdapter = $this->httpAdapter;
$response = $this->makeHttpResponseFor('foo');
$httpAdapter->setResponse($response);
$this->xmlrpcClient->setSkipSystemLookup(true);
$this->assertSame('foo', $this->xmlrpcClient->call('test.method'));
}
示例4: getWebserviceClient
/**
* Retrieve client object
*
* @return Zend_XmlRpc_Client
*/
public function getWebserviceClient()
{
if (is_null($this->_client)) {
if ($this->_options['so']) {
$this->_client = new Streamwide_Web_Webservice_Client($this->_options['serverUrl'], $this->getOptions());
} else {
$this->_client = new Zend_XmlRpc_Client($this->_options['serverUrl']);
$this->_client->setSkipSystemLookup(true);
}
}
return $this->_client;
}
示例5: getClient
/**
* @return Zend_XmlRpc_Client
*/
public function getClient()
{
if (!$this->client) {
$client = new Zend_XmlRpc_Client($this->getApiUrl());
$client->setSkipSystemLookup(true);
$this->client = SS_Cache::factory('drupal_menu', 'Class', array('cached_entity' => $client, 'lifetime' => $this->getCacheLifetime()));
/*
TODO: authenticate, to avoid hacking perms in Drupal.
$result = $this->client->call('user.login', array($this->Username, $this->Password));
$sessionName = $result['session_name'];
$sessid = $result['sessid'];
*/
}
return $this->client;
}
示例6: __construct
/**
* Конструктор.
*
* @param string $api_url URL доступа к API Спамоборца
*/
public function __construct($api_url = "http://localhost:8000/api/xml/")
{
$this->api_transport = new Zend_XmlRpc_Client($api_url);
$this->api_transport->setSkipSystemLookup(true);
}
示例7: getClient
/**
* @return Zend_XmlRpc_Client
*/
public function getClient()
{
if (!$this->client) {
$client = new Zend_XmlRpc_Client($this->getApiUrl());
$client->setSkipSystemLookup(true);
/*$this->client = SS_Cache::factory('drupal_content_source', 'Class', array(
'cached_entity' => $client,
'lifetime' => $this->getCacheLifetime()
));*/
$this->client = $client;
}
return $this->client;
}
示例8: array
$frontendOptions = array('debug_header' => false, 'caching' => true, 'lifetime' => (int) $config->cache->page->lifetime, 'logging' => true, 'logger' => $logger, 'ignore_user_abort' => true, 'default_options' => array('cache' => true, 'make_id_with_get_variables' => false, 'make_id_with_post_variables' => false, 'make_id_with_session_variables' => false, 'make_id_with_files_variables' => false, 'make_id_with_cookie_variables' => false), 'regexps' => array('^.*$' => array('cache' => false), '^/$' => array('cache' => true)));
$backendOptions = array('cache_dir' => $config->cache->dir, 'file_name_prefix' => $config->cache->page->prefix, 'cache_file_umask' => 0777);
try {
if (!is_dir($config->cache->dir)) {
mkdir($config->cache->dir, 0777);
}
$cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
$cache->start();
$logger->log('start cache', Zend_Log::DEBUG);
} catch (Zend_Cache_Exception $e) {
echo 'Exception: ' . $e->getCode() . "\n" . $e->__toString();
exit;
}
// GANDI XML-RPC
$client = new Zend_XmlRpc_Client($config->gandi->api);
$client->setSkipSystemLookup(true);
try {
$account = $client->call('account.info', array($config->gandi->apikey));
$vm_list = $client->call('vm.list', array($config->gandi->apikey));
} catch (Zend_XmlRpc_Client_FaultException $e) {
echo 'Exception: ' . $e->getCode() . "\n" . $e->getMessage();
exit;
} catch (Zend_XmlRpc_Client_HttpException $e) {
echo 'Exception: ' . $e->getCode() . "\n" . $e->getMessage();
exit;
}
// account
if ($config->gandi->account->showdetails) {
$fullname = $account['fullname'];
$resGranted = array('servers' => $account['resources']["granted"]["servers"], 'ips' => $account['resources']["granted"]["ips"], 'bandwidth' => $account['resources']["granted"]["bandwidth"], 'memory' => $account['resources']["granted"]["memory"], 'cores' => $account['resources']["granted"]["cores"], 'disk' => $account['resources']["granted"]["disk"]);
?>