Exemplo n.º 1
0
 /**
  * Sends a weblogsUpdate.ping xmlrpc call to notifiy of changes in this blog
  *
  * @param blogInfo The BlogInfo object containing information about the blog
  * @return Returns true if successful or false otherwise.
  */
 function updateNotify($blogInfo)
 {
     // if this feature is not enabled, we quit
     $config =& Config::getConfig();
     if (!$config->getValue("xmlrpc_ping_enabled")) {
         return;
     }
     // get the array which contains the hosts
     $hosts = $config->getValue("xmlrpc_ping_hosts");
     // if it is not an array, quit
     if (!is_array($hosts)) {
         return;
     }
     // if no hosts, we can quit too
     if (empty($hosts)) {
         return;
     }
     // otherwise, we continue
     $xmlrpcPingResult = array();
     $rg =& RequestGenerator::getRequestGenerator($blogInfo);
     $blogLink = $rg->blogLink();
     foreach ($hosts as $host) {
         $client = new XmlRpcClient($host);
         $result = $client->ping($blogInfo->getBlog(), $blogLink);
         //print("result = ".$result. "is Error = ".$client->isError()." message: ".$client->getErrorMessage()."<br/>");
         //$xmlrpcPingResult[$result["host"]
         $xmlrpcPingResult = array_merge($xmlrpcPingResult, $result);
     }
     return $xmlrpcPingResult;
 }