[+] CORE : Module properly upgraded with message even if no file upgrade file exist, add 'upgrade' button

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13551 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vSchoener
2012-02-23 11:02:35 +00:00
parent a7dfcd06f1
commit 2a760a56b4
6 changed files with 123 additions and 17 deletions
+31 -1
View File
@@ -2191,6 +2191,36 @@ FileETag INode MTime Size
$filtered_files[] = $dir.'/'.$file;
return $filtered_files;
}
/**
* Align 2 version with the same number of sub version
* version_compare will work better for its comparison :)
* (Means: '1.8' to '1.9.3' will change '1.8' to '1.8.0')
* @static
* @param $v1
* @param $v2
*/
public static function alignVersionNumber(&$v1, &$v2)
{
$len1 = count(explode('.', trim($v1, '.')));
$len2 = count(explode('.', trim($v2, '.')));
$len = 0;
$str = '';
if ($len1 > $len2)
{
$len = $len1 - $len2;
$str = &$v2;
}
else if ($len2 > $len1)
{
$len = $len2 - $len1;
$str = &$v1;
}
for ($len; $len > 0; $len--)
$str .= '.0';
}
}
/**
@@ -2217,4 +2247,4 @@ function cmpPriceDesc($a, $b)
elseif ((float)($a['price_tmp']) > (float)($b['price_tmp']))
return (-1);
return (0);
}
}