Esempio n. 1
0
 /**
  * @return same result with buildDiff but getting information from local repo
  */
 function buildDiffLocal($product, $newVersion)
 {
     if (!($productDir = $this->getLocalVersionsPath($product))) {
         return false;
     }
     //
     $newVerDir = $productDir . $newVersion . '/';
     if (!JFolder::exists($newVerDir)) {
         return false;
     }
     $vUpgrade = new stdClass();
     $vUpgrade->crc = $this->getVersionChecksum($newVerDir);
     //
     $orgVerDir = $productDir . $product->version . '/';
     if (JFolder::exists($orgVerDir)) {
         $vServer = new stdClass();
         $vServer->crc = $this->getVersionChecksum($orgVerDir);
     }
     //
     $pro = new jaProducts($product, $this->config, true);
     $oldPro = $pro->getFullInfo();
     //
     $compare = new jaCompareTool();
     if (isset($vServer)) {
         return $compare->checkToUpgrade($oldPro, $vServer, $vUpgrade);
     } else {
         return $compare->checkToBuildUpgradePackage($oldPro, $vUpgrade);
     }
 }
 /**
  * compare from 3 versions
  *
  * @param (object) $args - arguments from user request
  * @return unknown
  */
 public function buildDiff($args)
 {
     global $config;
     if (empty($args->product) || empty($args->newVersion)) {
         $this->doResponse("Missing information to build difference view", true);
     }
     $oldPro = $args->product;
     $newVersion = $args->newVersion;
     $vServer = $this->getProduct($oldPro);
     $newPro = $oldPro;
     $newPro->version = $newVersion;
     $vUpgrade = $this->getProduct($newPro);
     $compare = new jaCompareTool();
     if ($vServer !== false) {
         return $compare->checkToUpgrade($oldPro, $vServer, $vUpgrade);
     } else {
         //if not found original version on server
         return $compare->checkToBuildUpgradePackage($oldPro, $vUpgrade);
     }
 }