Changeset 2388:731ff8ef9ded
- Timestamp:
- 10/16/13 17:47:56 (10 years ago)
- Branch:
- 2.6
- Location:
- inc/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.store.parser.php
r2222 r2388 89 89 90 90 # First filter right now. If DC_DEV is set all modules are parse 91 if (defined('DC_DEV') && DC_DEV === true || version_compare(DC_VERSION,$item['dc_min'],'>=')) {91 if (defined('DC_DEV') && DC_DEV === true || dcUtils::versionsCompare(DC_VERSION, $item['dc_min'], '>=', false)) { 92 92 $this->items[$item['id']] = $item; 93 93 } -
inc/core/class.dc.store.php
r2270 r2388 82 82 foreach ($current as $p_id => $p_infos) { 83 83 if (isset($raw_datas[$p_id])) { 84 if ( self::compare($raw_datas[$p_id]['version'],$p_infos['version'],'>')) {84 if (dcUtils::versionsCompare($raw_datas[$p_id]['version'],$p_infos['version'],'>')) { 85 85 $updates[$p_id] = $raw_datas[$p_id]; 86 86 $updates[$p_id]['root'] = $p_infos['root']; -
inc/core/class.dc.utils.php
r1179 r2388 74 74 return $clean_ids; 75 75 } 76 77 /** 78 * Compare two versions with option of using only main numbers. 79 * 80 * @param string $current_version Current version 81 * @param string $required_version Required version 82 * @param string $operator Comparison operand 83 * @param boolean $strict Use full version 84 * @return boolean True if comparison success 85 */ 86 public static function versionsCompare($current_version, $required_version, $operator='>=', $strict=true) 87 { 88 if ($strict) { 89 $current_version = preg_replace('!-r(\d+)$!', '-p$1', $current_version); 90 $required_version = preg_replace('!-r(\d+)$!', '-p$1', $required_version); 91 } 92 else { 93 $current_version = preg_replace('/^([0-9\.]+)(.*?)$/', '$1', $current_version); 94 $required_version = preg_replace('/^([0-9\.]+)(.*?)$/', '$1', $required_version); 95 } 96 97 return (boolean) version_compare($current_version, $required_version, $operator); 98 } 76 99 } 77 100
Note: See TracChangeset
for help on using the changeset viewer.