diff options
Diffstat (limited to 'class/PackagistClient.php')
-rw-r--r-- | class/PackagistClient.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/class/PackagistClient.php b/class/PackagistClient.php index 2120d36..5ea8429 100644 --- a/class/PackagistClient.php +++ b/class/PackagistClient.php @@ -68,10 +68,9 @@ class PackagistClient return ($rep ? json_decode($rep, true) : false); } - function getPackage($name) + function getPackage($name, $crt=0, $max=0) { $unstable = array('alpha', 'beta', 'rc'); - $ret = false; $pkgs = $this->getPackageData($name); if ($pkgs) { @@ -83,6 +82,9 @@ class PackagistClient ); foreach ($pkgs['package']['versions'] as $notused => $pkg) { $pkver = $pkg['version']; + if ($pkver < $crt || $pkver > $max) { + continue; + } if (preg_match('/^v[0-9]/', $pkver)) { $pkver = substr($pkver, 1); } |