aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/ping.php
blob: af42b9a87dc6988dfe842d4fec06b833b7fb50f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
	/**
	 * This module pings us on the first install.
	 * 
	 * @package Elgg
	 * @subpackage Core
	 * @author Curverider Ltdsend_api_get_call
	 * @link http://elgg.org/
	 */

	/**
	 * The api for the pinger.
	 * TODO: Have this configurable and/or updatable
	 */
	$NOTIFICATION_SERVER = "http://ping.elgg.org/pg/api/rest/php/";
	
	
	/**
	 * Run once and only once.
	 * 
	 * @param ElggSite $site The site who's information to use
	 */
	function ping_home(ElggSite $site)
	{
		global $NOTIFICATION_SERVER, $CONFIG;
	
		// Get version information
		$version = get_version();
		$release = get_version(true);
		
		// Get export
		$export = export($site->guid);
		
		return send_api_post_call($NOTIFICATION_SERVER,
			array(
				'method' => 'elgg.system.ping',
			
				'url'	  => $site->url,
				'version' => $version,
				'release' => $release,
			),
			array(),
			$export,
			'text/xml'
		);
	}
?>