[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 4 lt_include( PLOG_CLASS_PATH."class/net/xmlrpc/IXR_Library.lib.php" ); 5 6 /** 7 * \ingroup Net 8 * 9 * Implements a basic XMLRPC client, which offers methods such as 10 * ping (implementing the weblogUpdates.ping methods) 11 */ 12 class XmlRpcClient extends IXR_Client 13 { 14 15 var $_url; 16 17 /** 18 * Creates an XMLRPC client 19 * 20 * @param url The path to the XMLRPC interface of the remote host 21 */ 22 function XmlRpcClient( $url ) 23 { 24 $this->IXR_Client( $url ); 25 26 $this->_url = $url; 27 } 28 29 /** 30 * Returns the url of the client 31 * 32 * @return The client url 33 */ 34 function getUrl() 35 { 36 return $this->_url; 37 } 38 39 /** 40 * Performs a weblogsUpdate.ping remote call to the host we've set in 41 * the constructor. 42 * Please check http://www.xmlrpc.com/discuss/msgReader$2014?mode=topic for reference 43 * on the weblogsUpdate.ping call. 44 * 45 * @param weblogName The name of the weblog. 46 * @param weblogUrl The url of the weblog. 47 * @return Returns An array whose key is the url and the value is either "OK" if successful 48 * or an error message as returned by the xmlrpc library otherwise. 49 */ 50 function ping( $weblogName, $weblogUrl ) 51 { 52 $this->debug=false; 53 $result = $this->query( "weblogUpdates.ping", $weblogName, $weblogUrl ); 54 $response = $this->getResponse(); 55 56 $pingResult = Array(); 57 if( !$result || $this->isError() || $response["flerror"] == 1 ) { 58 //print("there was an error!"); 59 //print("message = ".$response["message"]); 60 $pingResult[$this->_url] = $response["message"]; 61 } 62 else { 63 //print("no error!"); 64 $pingResult[$this->_url] = "OK"; 65 } 66 67 return $pingResult; 68 } 69 } 70 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |