X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpackages.inc;h=70d3be491a19bcc9b7b89445436bdd1fd348721e;hb=b0cf01e322af8291c73fb5e4478347aaa0070c02;hp=feab3d78dd502a754ec7ed6b04047169e3b2fa3c;hpb=17b390efcf904072b02ec866b2a427490471a260;p=fa-stable.git diff --git a/includes/packages.inc b/includes/packages.inc index feab3d78..70d3be49 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -725,3 +725,21 @@ function get_package_info($pkg, $type=null, $filter=array(), $outkey=null, $down return get_pkg_or_list($type, $pkg, $filter, null, false); } +/* + Check basic extension source compatibility. +*/ +function check_src_ext_version($ext_v) +{ + global $src_version; + + $compat_levels = 2; // current policy is keeping compatibility on major version level. + $app = explode('.', strspn($src_version, "0123456789.")); + $pkg = explode('.', strspn($ext_v, "0123456789.")); + + for ($i=0; $i < min($compat_levels, count($app)); $i++) + if ($pkg[$i] < $app[$i]) + return false; + + return true; +} +