/** * Attempts to notify the server of targetUri that sourceUri refers to it. * * @param object Controller object */ public function pingbackUrl($sourceUri, $targetUri) { $urlData = $this->Socket->get($targetUri); $pingbackServerUri = $this->_determinePingbackUri($this->Socket->response); if (!empty($pingbackServerUri)) { $XmlRpcClient = new XmlRpcClient($pingbackServerUri); try { $Request = new XmlRpcRequest('pingback.ping', array(new XmlRpcValue($sourceUri), new XmlRpcValue($targetUri))); $result = $XmlRpcClient->call($Request); } catch (Exception $e) { // pingback server return error. we will ignore it } } }
/** * Send message to weblog system */ public function blogPing(&$model, $type, $serverUrl, $blogName, $blogUrl, $siteUrl = '', $rssUrl = '', $tags = array()) { $XmlRpcClient = new XmlRpcClient($serverUrl); if ($type == 'extendedPing') { try { if (is_array($tags)) { $tags = join('|', $tags); } $Request = new XmlRpcRequest('weblogUpdates.extendedPing', array(new XmlRpcValue($blogName), new XmlRpcValue($siteUrl), new XmlRpcValue($blogUrl), new XmlRpcValue($rssUrl), $tags)); $result = $XmlRpcClient->call($Request); } catch (XmlRpcResponseException $e) { // Nothing. } } else { try { $Request = new XmlRpcRequest('weblogUpdates.ping', array(new XmlRpcValue($blogName), new XmlRpcValue($blogUrl))); $result = $XmlRpcClient->call($Request); } catch (XmlRpcResponseException $e) { // Nothing. } } }