diff options
Diffstat (limited to 'class/PackagistClient.php')
-rw-r--r-- | class/PackagistClient.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/class/PackagistClient.php b/class/PackagistClient.php index 2fbb522..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) { @@ -81,7 +80,11 @@ class PackagistClient 'unstable' => NULL, 'state' => NULL, ); - foreach ($pkgs['package']['versions'] as $pkver => $pkg) { + 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); } |