本文整理汇总了PHP中XML_RPC_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP XML_RPC_decode函数的具体用法?PHP XML_RPC_decode怎么用?PHP XML_RPC_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了XML_RPC_decode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawMachines
function drawMachines()
{
$cli = new XML_RPC_Client('/RPCSERVER', $_SESSION["host"], $_SESSION["port"]);
$req = new XML_RPC_Value(array("sut_username" => new XML_RPC_Value($_SESSION['username'], 'string')), "struct");
$msg = new XML_RPC_Message('listMachines', array($req));
$resp = $cli->send($msg);
if (hasErrors($resp)) {
return;
}
$machines = $resp->value();
$i = $machines->arraysize();
while ($i--) {
$m = XML_RPC_decode($machines->arraymem($i));
echo "<form name='{$m}' action='set_config.php?SUT_MACHINE={$m}' method='post'>\n <ul class='menu' >\n <li >\n <p onclick='javascript:toggleSpan(\"span{$m}\");' >{$m}<br/><span id='span{$m}'>{$m}\n <a href='javascript:;' onclick='addEvent(\"span{$m}\", \"sName{$m}\", \"sValue{$m}\");'><em class='butt'>Add</em></a>\n <input type='submit' value='Save'><br style='clear:both'>\n <a href='setup_machine.php?machine={$m}'><em class='butt'>Setup</em></a>\n <a href='start_manager.php?machine={$m}'><input type='button' value='StartManager'></a><br>\n\n <input id='sName{$m}' type='text' value='SUT_NAME' style='clear:both; float:left; width:25%;'/>\n <input id='sValue{$m}' type='text' value='Value'/><br>";
$params = new XML_RPC_Value(array("sut_username" => new XML_RPC_Value($_SESSION['username'], 'string'), "sut_machine" => new XML_RPC_Value($m, 'string')), "struct");
$msg = new XML_RPC_Message('getConfig', array($params));
$resp = $cli->send($msg);
if (hasErrors($resp)) {
return;
}
$cfgTable = $resp->value();
$j = $cfgTable->arraysize();
while ($j--) {
$cfgEntry = $cfgTable->arraymem($j);
$cfgEntry->structreset();
$symbol = XML_RPC_decode($cfgEntry->structmem("symbol"));
$value = XML_RPC_decode($cfgEntry->structmem("val"));
echo "<b>{$symbol}</b>";
echo "<input type='text' name='{$symbol}' value='{$value}' /><br>\n";
}
echo " </span></p>\n </li> </ul> </form>";
}
}
示例2: drawMachines
function drawMachines()
{
$cli = new XML_RPC_Client('/RPCSERVER', 'localhost', 5000);
$msg = new XML_RPC_Message('listMachines');
$resp = $cli->send($msg);
if (hasErrors($resp)) {
return;
}
$machines = $resp->value();
$i = $machines->arraysize();
#$i = 1;
while ($i--) {
$m = XML_RPC_decode($machines->arraymem($i));
echo "<form name='{$m}' action='set_config.php?SUT_MACHINE={$m}' method='post'> <ul id='menu'>\n <li ><p>{$m}\n <span id='span{$m}'>\n <a href='javascript:;' onclick='addEvent(\"span{$m}\", \"sName{$m}\", \"sValue{$m}\");'><em class='butt'>Add</em></a>\n <input type='submit' value='Save'>\n\n <input id='sName{$m}' type='text' value='SUT_NAME' style='text-align:right; clear:both; float:left; width:12em;'/>\n <input id='sValue{$m}' type='text' value='Value'/>\n\n\n ";
$params = array(new XML_RPC_Value($m, 'string'));
$msg = new XML_RPC_Message('getConfig', $params);
$resp = $cli->send($msg);
if (hasErrors($resp)) {
return;
}
$cfgTable = $resp->value();
$j = $cfgTable->arraysize();
while ($j--) {
$cfgEntry = $cfgTable->arraymem($j);
$cfgEntry->structreset();
$symbol = XML_RPC_decode($cfgEntry->structmem("symbol"));
$value = XML_RPC_decode($cfgEntry->structmem("val"));
echo "<b>{$symbol}</b>";
echo "<input type='text' name='{$symbol}' value='{$value}' /><br>\n";
}
echo "\n\n </span></p>\n </li>\n </ul>\n\n</form>";
}
}
示例3: fullGraph
/**
* Method to get a specific wiki page in HTML
*
* @param string $pagename
* @return string HTML
*/
public function fullGraph()
{
$msg = new XML_RPC_Message('dlGraphFull');
$pserv = $this->objSysConfig->getValue('package_server', 'packages');
$purl = $this->objSysConfig->getValue('package_url', 'packages');
$cli = new XML_RPC_Client($purl, $pserv);
$cli->setDebug(0);
// send the request message
$resp = $cli->send($msg);
if (!$resp) {
throw new customException($this->objLanguage->languageText("mod_filters_commserr", "filters") . ": " . $cli->errstr);
exit;
}
if (!$resp->faultCode()) {
$val = $resp->value();
$val = XML_RPC_decode($val);
if (is_array($val)) {
return $val['faultString'];
} else {
return $val;
}
} else {
/*
* Display problems that have been gracefully caught and
* reported by the xmlrpc server class.
*/
throw new customException($this->objLanguage->languageText("mod_filters_faultcode", "filters") . ": " . $resp->faultCode() . $this->objLanguage->languageText("mod_filters_faultreason", "filters") . ": " . $resp->faultString());
}
}
示例4: xmlrpc_smtp2pne
function xmlrpc_smtp2pne($message)
{
// パラメータを取得
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return $param;
}
$params = XML_RPC_decode($param);
// 入力チェック とりあえず空かどうかのみ
if (empty($params['prefix']) and empty($params['domain'])) {
return xmlrpc_get_response_faultDefault('incorrect_params');
}
if (empty($params['to'])) {
return xmlrpc_get_response_faultDefault('incorrect_params');
}
if (empty($params['from'])) {
return xmlrpc_get_response_faultDefault('incorrect_params');
}
// デコーダオブジェクトを作成
$options['from_encoding'] = 'UTF-8';
$options['to_encoding'] = 'UTF-8';
$options['img_tmp_dir'] = OPENPNE_VAR_DIR . '/tmp';
$options['img_max_filesize'] = IMAGE_MAX_FILESIZE * 1024;
$options['trim_doublebyte_space'] = OPENPNE_TRIM_DOUBLEBYTE_SPACE;
$decoder =& new OpenPNE_KtaiMail_RPC($options);
$decoder->assign($params);
// メール受信処理オブジェクトを起動
$mail_sns =& new mail_sns($decoder);
if (!$mail_sns->main()) {
//エラーの場合はfaultCodeを返す
return xmlrpc_get_fault_response(56, 'Can\'t Receive Mail');
}
return xmlrpc_get_response(0);
}
示例5: grabTracWikiPageHTML
/**
* Method to get a specific wiki page in HTML
*
* @param string $pagename
* @return string HTML
*/
public function grabTracWikiPageHTML($pagename)
{
$msg = new XML_RPC_Message('wiki.getPageHTML', array(new XML_RPC_Value($pagename, "string")));
$cli = new XML_RPC_Client($this->tracURL, $this->tracServ);
$cli->setDebug(0);
// send the request message
$resp = $cli->send($msg);
if (!$resp) {
throw new customException($this->objLanguage->languageText("mod_filters_commserr", "filters") . ": " . $cli->errstr);
exit;
}
if (!$resp->faultCode()) {
$val = $resp->value();
$val = XML_RPC_decode($val);
if (is_array($val)) {
return $val['faultString'];
} else {
return $val;
}
} else {
/*
* Display problems that have been gracefully caught and
* reported by the xmlrpc server class.
*/
throw new customException($this->objLanguage->languageText("mod_filters_faultcode", "filters") . ": " . $resp->faultCode() . $this->objLanguage->languageText("mod_filters_faultreason", "filters") . ": " . $resp->faultString());
}
}
示例6: xmlrpc_000_auth
/**
* 認証API
*/
function xmlrpc_000_auth($message)
{
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return false;
}
$params = XML_RPC_decode($param);
if (empty($params['sid'])) {
return false;
}
if (empty($params['mid'])) {
return false;
}
if (empty($params['dt'])) {
return false;
}
$c_member_id = $params['mid'];
$datetime = $params['dt'];
if (!db_member_c_member4c_member_id_LIGHT($c_member_id)) {
return xmlrpc_get_fault_response(56);
}
if (!($member_token = db_api_get_member_token($c_member_id))) {
return xmlrpc_get_fault_response(52);
}
$session_id = api_get_sid($c_member_id, $member_token, $datetime);
if ($params['sid'] != $session_id) {
return xmlrpc_get_fault_response(52);
}
return xmlrpc_get_response($c_member_id);
}
示例7: returnXmlRpcResponseData
function returnXmlRpcResponseData($oResponse)
{
if (!$oResponse->faultCode()) {
$oVal = $oResponse->value();
$data = XML_RPC_decode($oVal);
return $data;
} else {
die('Fault Code: ' . $oResponse->faultCode() . "\n" . 'Fault Reason: ' . $oResponse->faultString() . "\n");
}
}
示例8: xmlrpc_di_000_get_diary
function xmlrpc_di_000_get_diary($message)
{
$dummy = array();
$re_false = array('result' => 1, 'list' => $dummy);
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return xmlrpc_get_response($re_false);
}
$params = XML_RPC_decode($param);
if (empty($params['mid_to'])) {
//対象メンバID必須
return xmlrpc_get_response($re_false);
}
if (empty($params['count'])) {
//取得数必須
return xmlrpc_get_response($re_false);
}
if (!is_numeric($params['mid_to'])) {
//対象メンバIDは整数値
return xmlrpc_get_response($re_false);
}
if (!empty($params['mid_from'])) {
//アクセスメンバIDは(存在する場合は)整数値
if (!is_numeric($params['mid_from'])) {
return xmlrpc_get_response($re_false);
}
}
if (!is_numeric($params['count'])) {
//取得数は整数値
return xmlrpc_get_response($re_false);
}
if ($params['count'] < 0) {
//取得数は正
return xmlrpc_get_response($re_false);
}
$member_id_to = $params['mid_to'];
$member_id_from = $params['mid_from'];
$count = $params['count'];
if ($count > 100) {
//取得最大数は100
$count = 100;
}
if (!($arr = OP::op_diary_get_c_diary($member_id_to, $member_id_from, $count))) {
return xmlrpc_get_response($re_false);
} else {
foreach ($arr as $key => $value) {
$diary[$key]['id'] = $arr[$key]['c_diary_id'];
$diary[$key]['subject'] = $arr[$key]['subject'];
$diary[$key]['body'] = $arr[$key]['body'];
$diary[$key]['datetime'] = date('Y/m/d H:i:s', strtotime($arr[$key]['r_datetime']));
}
$re_true = array('result' => 0, 'list' => $diary);
return xmlrpc_get_response($re_true);
}
}
示例9: runTests
function runTests($cli)
{
/* Serialize the SUT Versions */
print "\nVersions:\n";
$versions = array();
for ($i = 0; $i < count($_GET['sut_versions']); ++$i) {
print " " . $_GET['sut_versions'][$i] . "\n";
$versions[] = new XML_RPC_Value($_GET['sut_versions'][$i], 'string');
}
$xversions = new XML_RPC_Value($versions, "array");
print "\nBuild:\n " . $_GET['sut_build'] . "\n";
/*--------------------------------------------*/
/* Serialize the OSes */
print "\nOS:\n";
$oses = array();
for ($i = 0; $i < count($_GET['sut_os']); ++$i) {
print " " . $_GET['sut_os'][$i] . "\n";
$oses[] = new XML_RPC_Value($_GET['sut_os'][$i], 'string');
}
$xoses = new XML_RPC_Value($oses, 'array');
/*--------------------------------------------*/
/* Serialize the TEST categories */
print "\nTests:\n";
$tests = array();
for ($i = 0; $i < count($_GET['sut_tests']); ++$i) {
print " " . $_GET['sut_tests'][$i] . "\n";
$tests[] = new XML_RPC_Value($_GET['sut_tests'][$i], 'string');
}
$xtests = new XML_RPC_Value($tests, "array");
/*--------------------------------------------*/
/* Serialize Method parameter */
$request = new XML_RPC_Value(array("sut_tests" => $xtests, "sut_versions" => $xversions, "sut_os" => $xoses, "sut_build" => new XML_RPC_Value($_GET['sut_build'], 'string')), "struct");
$params = array($request);
$msg = new XML_RPC_Message('runTests', $params);
/*--------------------------------------------*/
$resp = $cli->send($msg);
if (!$resp) {
echo 'Communication error: ' . $cli->errstr;
exit;
}
if (!$resp->faultCode()) {
$val = $resp->value();
$data = XML_RPC_decode($val);
echo $data;
} else {
/*
* Display problems that have been gracefully cought and
* reported by the xmlrpc.php script
*/
echo 'Fault Code: ' . $resp->faultCode() . "\n";
echo 'Fault Reason: ' . $resp->faultString() . "\n";
}
}
示例10: XML_RPC_decode
/**
* Send message to remote rpc server and get response.
*
* @return object result object. Type is depend on the calles method
*
* @access protected
*/
function &send()
{
include_once 'XML/RPC.php';
if (!($response =& $this->rpc_client->send($this->rpc_message, $this->response_timeout))) {
$this->log->write("ilRPCServerAdapter: Communication error");
return null;
}
if ($response->faultCode()) {
$this->log->write("ilRPCServerAdapter: Communication error: " . $response->faultString());
return null;
}
return XML_RPC_decode($response->value());
}
示例11: xmlrpc_002_get_member_point
/**
* @copyright 2005-2008 OpenPNE Project
* @license http://www.php.net/license/3_01.txt PHP License 3.01
*/
function xmlrpc_002_get_member_point($message)
{
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return false;
}
$params = XML_RPC_decode($param);
if (empty($params['c_member_id'])) {
return false;
}
$point = get_point($params['c_member_id']);
return xmlrpc_get_response($point);
}
示例12: call
/**
* Call a method
* @param string Method name, automatically gets "grav." prepended to it
* @param Array List of named arguments
*/
protected function call($method, $params = array())
{
#$params = array_map('XML_RPC_encode', $params);
$params = array_merge($params, array('apikey' => $this->apikey));
$msg = new XML_RPC_Message("grav.{$method}", array(XML_RPC_encode($params)));
$response = $this->client()->send($msg);
if (!$response->faultCode()) {
$value = $response->value();
$value = XML_RPC_decode($value);
return $value;
} else {
throw new GravatarException($response->faultString(), $response->faultCode());
}
}
示例13: xmlrpc_as_001_set_ashiato
function xmlrpc_as_001_set_ashiato($message)
{
$dummy = array();
$re_false = array('result' => 1);
$re_true = array('result' => 0);
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return xmlrpc_get_response($re_false);
}
$params = XML_RPC_decode($param);
//「あしあと」を付けたメンバID必須
if (empty($params['mid_from'])) {
return xmlrpc_get_response($re_false);
}
//「あしあと」を付けられたメンバID必須
if (empty($params['mid_to'])) {
return xmlrpc_get_response($re_false);
}
$mid_from = $params['mid_from'];
$mid_to = $params['mid_to'];
//登録済みのメンバか
if (!OP::op_member_is_active_c_member_id($mid_from)) {
return xmlrpc_get_response($re_false);
}
//登録済みのメンバか
if (!OP::op_member_is_active_c_member_id($mid_to)) {
return xmlrpc_get_response($re_false);
}
//あしあとを付けたメンバIDと付けられたメンバIDは同一か
if ($mid_from == $mid_to) {
return xmlrpc_get_response($re_true);
}
//一定時間内の連続アクセスか?
if (!OP::op_ashiato_check_access_minute($mid_to, $mid_from)) {
return xmlrpc_get_response($re_true);
}
//忍び足状態か?
if (USE_SHINOBIASHI) {
if (OP::op_member_is_shinobiashi($mid_from)) {
return xmlrpc_get_response($re_true);
}
}
if (!OP::op_ashiato_insert_c_ashiato($mid_to, $mid_from)) {
return xmlrpc_get_response($re_false);
}
//正常終了
return xmlrpc_get_response($re_true);
}
示例14: listOSes
function listOSes()
{
echo "ON Machine:<br>";
$req = new XML_RPC_Value(array("sut_username" => new XML_RPC_Value($_SESSION['username'], 'string')), "struct");
$msg = new XML_RPC_Message('listMachines', array($req));
$resp = $this->xmlrpc->send($msg);
if (hasErrors($resp)) {
return false;
}
$i = $resp->value()->arraysize();
echo "<select name='sut_os[]' multiple size='5'>";
while ($i--) {
echo "<option>" . XML_RPC_decode($resp->value()->arraymem($i)) . "</option>";
}
echo "</select>";
}
示例15: xmlrpc_as_000_get_ashiato
function xmlrpc_as_000_get_ashiato($message)
{
$dummy = array();
$re_false = array('result' => 1, 'list' => $dummy);
$param = $message->getParam(0);
if (!XML_RPC_Value::isValue($param)) {
return xmlrpc_get_response($re_false);
}
$params = XML_RPC_decode($param);
//対象メンバID必須
if (empty($params['mid'])) {
return xmlrpc_get_response($re_false);
}
//取得数必須
if (empty($params['count'])) {
return xmlrpc_get_response($re_false);
}
//取得数は数値
if (!is_numeric($params['count'])) {
return xmlrpc_get_response($re_false);
}
$member_id = $params['mid'];
$count = intval($params['count']);
$profile = $params['profile'];
//取得数は正
if ($count <= 0) {
return xmlrpc_get_response($re_false);
}
//登録済みのメンバか
if (!OP::op_member_is_active_c_member_id($member_id)) {
return xmlrpc_get_response($re_false);
}
//あしあとのあるメンバか
if (!OP::op_is_ahiato_member($member_id)) {
return xmlrpc_get_response($re_false);
}
//取得最大数は100
if ($count > 100) {
$count = 100;
}
$list = OP::op_ashiato_list_c_member_profile($member_id, $count, $profile);
if (empty($list)) {
return xmlrpc_get_respose($re_false);
}
return xmlrpc_get_response(array('result' => 0, 'list' => $list));
}