Skip to content

Instantly share code, notes, and snippets.

@dkobia
Created October 22, 2010 18:55
Show Gist options
  • Save dkobia/641155 to your computer and use it in GitHub Desktop.
Save dkobia/641155 to your computer and use it in GitHub Desktop.
<?php
function _fetch_core_release()
{
// Current Version
$current = urlencode(Kohana::config('settings.ushahidi_version'));
// Extra Stats
$url = urlencode(preg_replace("/^https?:\/\/(.+)$/i","\\1", url::base()));
$ip_address = (isset($_SERVER['REMOTE_ADDR'])) ? urlencode($_SERVER['REMOTE_ADDR']) : "";
$version_url = "http://version.ushahidi.com/2/?v=".$current."u=".$url."&ip=".$ip_address;
$version_json_string = @file_get_contents($version_url);
// If we didn't get anything back...
if(!$version_json_string)
{
return "";
}
$version_details = json_decode($version_json_string);
return $version_details;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment