Created
October 22, 2010 18:55
-
-
Save dkobia/641155 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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