2014-02-06 62 views
0

昨天我發佈了這個question,很快得到了一個很好的答案。所以我向前邁進Magento。任何出口Magento的人都可以告訴我在哪裏可以獲得最新的版本號。 (具體我需要Magento社區版的版本號)以編程方式獲取最新的magento版本

在此先感謝。

+0

你有沒有找到解決這個問題的方法? – TheWebsiteGuy

回答

1

編輯:因此,要獲得當前的Magento安裝的版本號,使用以下命令:

$mage = new Mage; 
$version = $mage->getVersion(); 
echo $version; 

從Magento的自己獲得最新版本,如果你下載的官方「下載」 here版本,看看線408,你會看到:

public function download() 
{ 
    if(self::DEVELOPMENT_MODE) { 
     if(file_exists($this->getDestinationFilePath())) { 
      return $this; 
     } 
    } 
    $downloadPackage = self::DOWNLOAD_PACKAGE; 
    $downloadFile ='releases.xml'; 
    $file = $this->downloadFile($downloadPackage . '/' . $downloadFile); 

    $releases = simplexml_load_file($file); 
    unlink($file); 
    $version = $this->getStabilityRelease($releases); 

    $downloadFile = sprintf('%s-%s.tgz', $downloadPackage, $version); 
    $file = $this->downloadFile($downloadPackage . '/' . $version . '/' . $downloadFile); 

    copy($file, $this->getDestinationFilePath()); 
    unlink($file); 

    return $this; 
} 

...我想可以給你如何從中獲取最新版本的版本號的一些想法。然而,這比我所能做到的要複雜一點,但希望它有幫助!

+0

感謝您的幫助,但我的意思是官方發佈的最新版本,而不是我的magento網站的最新版本。 –

相關問題