Subversion Repositories oidplus

Rev

Rev 1441 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1441 Rev 1442
Line 415... Line 415...
415
 
415
 
416
                $cache_file = OIDplus::localpath() . 'userdata/cache/master_changelog.json';
416
                $cache_file = OIDplus::localpath() . 'userdata/cache/master_changelog.json';
417
                if ((file_exists($cache_file)) && (time()-filemtime($cache_file) <= 10*60/*10 Minutes*/)) {
417
                if ((file_exists($cache_file)) && (time()-filemtime($cache_file) <= 10*60/*10 Minutes*/)) {
418
                        $changelog = file_get_contents($cache_file);
418
                        $changelog = file_get_contents($cache_file);
419
                } else {
419
                } else {
420
                        $master_changelog = OIDplus::getEditionInfo()['master_changelog'];
420
                        $changelog_candidates = OIDplus::getEditionInfo()['master_changelog'];
-
 
421
                        if (!is_array($changelog_candidates)) $changelog_candidates = [ $changelog_candidates ];
-
 
422
 
-
 
423
                        $changelog = false;
-
 
424
                        foreach ($changelog_candidates as $master_changelog) {
421
                        if ((stripos($master_changelog,'http://')===0) || (stripos($master_changelog,'https://')===0)) {
425
                                if ((stripos($master_changelog,'http://')===0) || (stripos($master_changelog,'https://')===0)) {
422
                                $changelog = @url_get_contents($master_changelog);
426
                                        $changelog = @url_get_contents($master_changelog);
423
                        } else {
427
                                } else {
424
                                $changelog = @file_get_contents($master_changelog);
428
                                        $changelog = @file_get_contents($master_changelog);
425
                        }
429
                                }
-
 
430
                                if ($changelog) break;
-
 
431
                        }
-
 
432
 
426
                        if (!$changelog) return false;
433
                        if (!$changelog) return false;
427
                        file_put_contents($cache_file, $changelog);
434
                        file_put_contents($cache_file, $changelog);
428
                }
435
                }
429
 
436
 
430
                $json = @json_decode($changelog, true);
437
                $json = @json_decode($changelog, true);