*
*/
class CRM_Utils_VersionCheck {
- CONST
+ const
PINGBACK_URL = 'http://latest.civicrm.org/stable.php?format=json',
// timeout for when the connection or the server is slow
CHECK_TIMEOUT = 5,
* @var array
*/
protected $stats = array();
-
+
/**
* Path to cache file
*
/**
* Class constructor
- *
- * @access private
*/
- function __construct() {
+ public function __construct() {
global $civicrm_root;
$config = CRM_Core_Config::singleton();
$this->cacheFile = $config->uploadDir . self::CACHEFILE_NAME;
if (file_exists($localFile)) {
- require_once ($localFile);
+ require_once $localFile;
}
if (function_exists('civicrmVersion')) {
$info = civicrmVersion();
*
* @return CRM_Utils_VersionCheck
*/
- static function &singleton() {
+ public static function &singleton() {
if (!isset(self::$_singleton)) {
self::$_singleton = new CRM_Utils_VersionCheck();
}
public function versionAlert() {
$versionAlertSetting = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionAlert', NULL, 1);
$securityAlertSetting = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'securityUpdateAlert', NULL, 3);
- $settingsUrl = CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1', FALSE, NULL, FALSE, FALSE, TRUE);
+ $settingsUrl = CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1', FALSE, NULL, FALSE, FALSE, TRUE);
if (CRM_Core_Permission::check('administer CiviCRM') && $securityAlertSetting > 1 && $this->isSecurityUpdateAvailable()) {
$session = CRM_Core_Session::singleton();
if ($session->timer('version_alert', 24 * 60 * 60)) {