$messages = array();
if (Civi::settings()->get('versionCheck')) {
- $vc = CRM_Utils_VersionCheck::singleton();
+ $vc = new CRM_Utils_VersionCheck();
$newerVersion = $vc->isNewerVersionAvailable();
if ($newerVersion['version']) {
// cachefile expiry time (in seconds) - one day
CACHEFILE_EXPIRE = 86400;
- /**
- * We only need one instance of this object, so we use the
- * singleton pattern and cache the instance in this variable
- *
- * @var object
- */
- static private $_singleton = NULL;
-
/**
* The version of the current (local) installation
*
}
}
- /**
- * Static instance provider.
- *
- * Method providing static instance of CRM_Utils_VersionCheck,
- * as in Singleton pattern
- *
- * @return CRM_Utils_VersionCheck
- */
- public static function &singleton() {
- if (!isset(self::$_singleton)) {
- self::$_singleton = new CRM_Utils_VersionCheck();
- }
- return self::$_singleton;
- }
-
/**
* Finds the release info for a minor version.
* @param string $version
* @param mixed $expectedResult
*/
public function testNewerVersion($localVersion, $versionInfo, $expectedResult) {
- $vc = CRM_Utils_VersionCheck::singleton();
+ $vc = new CRM_Utils_VersionCheck();
// These values are set by the constructor but for testing we override them
$vc->localVersion = $localVersion;
$vc->localMajorVersion = $vc->getMajorVersion($localVersion);
* @param bool $expectedResult
*/
public function testSecurityUpdate($localVersion, $versionInfo, $expectedResult) {
- $vc = CRM_Utils_VersionCheck::singleton();
+ $vc = new CRM_Utils_VersionCheck();
// These values are set by the constructor but for testing we override them
$vc->localVersion = $localVersion;
$vc->localMajorVersion = $vc->getMajorVersion($localVersion);