Changeset 1231:415e762385aa for inc/core/class.dc.update.php
- Timestamp:
- 07/26/13 09:14:57 (12 years ago)
- Branch:
- Ticket 1412
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.update.php
r1179 r1231 32 32 33 33 protected $cache_ttl = '-6 hours'; 34 protected $nocache_ttl = '-2 mins'; 34 35 protected $forced_files = array(); 35 36 … … 55 56 * 56 57 * @param version string Current version to compare 58 * @param nocache boolean Force checking 57 59 * @return string Latest version if available 58 60 */ 59 public function check($version )60 { 61 $this->getVersionInfo( );61 public function check($version, $nocache=false) 62 { 63 $this->getVersionInfo($nocache); 62 64 $v = $this->getVersion(); 63 65 if ($v && version_compare($version,$v,'<')) { … … 68 70 } 69 71 70 public function getVersionInfo() 71 { 72 public function getVersionInfo($nocache=false) 73 { 74 # Check minimum time without cache (prevents from server flood) 75 if ($nocache && is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->nocache_ttl)) { 76 $nocache = false; 77 } 78 72 79 # Check cached file 73 if (is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->cache_ttl) )80 if (is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->cache_ttl) && !$nocache) 74 81 { 75 82 $c = @file_get_contents($this->cache_file);
Note: See TracChangeset
for help on using the changeset viewer.