public function work($json)
 {
     if (!isset($json['project'])) {
         return;
     }
     if (!projectExists($json['project'], $this->config)) {
         return;
     }
     $versions = allVersions($json['project'], $this->config);
     if ($versions != -1) {
         $versions_desc = array_reverse($versions);
         $latest = $versions_desc[0];
         $versionParts = explode(".", $latest);
         $this->addBody("Latest", $latest);
         $this->addBody("Major", (int) $versionParts[0]);
         $this->addBody("Minor", (int) $versionParts[1]);
         $this->addBody("Build", (int) $versionParts[2]);
     } else {
         $this->error("NOT_FOUND");
     }
 }
Exemple #2
0
function versionsBetween($versionA, $versionB, $project, $config)
{
    $versions = allVersions($project, $config);
    $vret = array();
    foreach ($versions as $v) {
        if (version_compare($v, $versionA, '>') && version_compare($v, $versionB, '<=')) {
            $vret[] = $v;
        }
    }
    return $vret;
}