Ejemplo n.º 1
0
 /**
  * Check available versions of gpEasy and addons
  * @static
  *
  */
 static function VersionsAndCheckTime()
 {
     global $config, $dataDir, $gpLayouts;
     $data_timestamp = self::VersionData($version_data);
     //check core version
     // only report new versions if it's a root install
     if (gp_remote_update && !defined('multi_site_unique') && isset($version_data['packages']['core'])) {
         $core_version = $version_data['packages']['core']['version'];
         if ($core_version && version_compare(gpversion, $core_version, '<')) {
             self::$new_versions['core'] = $core_version;
         }
     }
     //check addon versions
     if (isset($config['addons']) && is_array($config['addons'])) {
         self::CheckArray($config['addons'], $version_data);
     }
     //check theme versions
     if (isset($config['themes']) && is_array($config['themes'])) {
         self::CheckArray($config['themes'], $version_data);
     }
     //check layout versions
     self::CheckArray($gpLayouts, $version_data);
     // checked recently
     $diff = time() - $data_timestamp;
     if ($diff < 604800) {
         return;
     }
     //determin check in type
     includeFile('tool/RemoteGet.php');
     if (!gpRemoteGet::Test()) {
         self::VersionData($version_data);
         self::$update_status = 'checkincompat';
         return;
     }
     self::$update_status = 'embedcheck';
 }