diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-24 09:19:51 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-24 09:19:51 +0000 |
commit | cc9eba54622e8eac3f0abb5c6d5c9a43b3a8c8d1 (patch) | |
tree | f8e05e1be960386d0d1ddf9ea7f186bcd6068c5a /engine/lib | |
parent | eddb94b493ac1799759e3de1ac431f614ebbe7b7 (diff) | |
download | elgg-cc9eba54622e8eac3f0abb5c6d5c9a43b3a8c8d1.tar.gz elgg-cc9eba54622e8eac3f0abb5c6d5c9a43b3a8c8d1.tar.bz2 |
New site pinger, refs #149
git-svn-id: https://code.elgg.org/elgg/trunk@1507 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/ping.php | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/engine/lib/ping.php b/engine/lib/ping.php new file mode 100644 index 000000000..7a40334f6 --- /dev/null +++ b/engine/lib/ping.php @@ -0,0 +1,60 @@ +<?php + /** + * This module pings us on the first install. + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Poveysend_api_get_call + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + /** + * The api for the pinger. + */ + $NOTIFICATION_SERVER = "http://ping.elgg.org/services/api/rest.php"; + + + /** + * Run once and only once. + */ + function ping_run_once() + { + global $NOTIFICATION_SERVER, $CONFIG; + + include_once($CONFIG->path . "version.php"); + + // Get export + $export = export($CONFIG->site_id); + + return send_api_post_call($NOTIFICATION_SERVER, + array( + 'method' => 'elgg.system.ping' + ), + array( + 'version' => $version, + 'release' => $release, + ), + $export, + 'text/xml' + ); + } + + /** + * Notify the server. + */ + function ping_init() + { + global $CONFIG; + + if ($CONFIG->ping_home) + { + // Now run this stuff, but only once + run_function_once("ping_run_once"); + } + } + + // Register a startup event + register_elgg_event_handler('init','system','ping_init'); +?>
\ No newline at end of file |