Magento Connect – Where Installed Packages and Versions Are Tracked

extensionsmagento-connectupgrade

We have an extension which was initially installed via Magento Connect. Since then the extension was modified locally, and there have been several patch releases from the vendor. Upgrading the extension via Magento Connect would no longer work, so I did the upgrades locally (unzipping the package and re-applying our changes, etc).

After upgrading the extension I've found that the update is live and running, and the core_resource table in the database has registered that it's upgraded. However, I noticed that Magento Connect still thinks I'm running the previous version.

Where does Magento Connect track which versions have been installed? Since I'm no longer using Magento Connect to upgrade this extension what steps should I take?

Best Answer

In the downloader folder there's a file named cache.cfg

$ ls -l downloader/cache.cfg 
-rw-r--r--  1 alanstorm  staff  323546 May 13 07:03 downloader/cache.cfg

This file contains a gziped, PHP serialized array that contains all the current configuration information for you Magento Connect instance. This is where Magento Connect stores extension versions. (Extension versions are different than module versions, since a Magento extension is just a collection of files that may or may not contain a module)

You can peek at this data with the following

<?php
$contents       = file_get_contents('cache.cfg');
$uncompressed   = gzuncompress($contents);
$unserialized   = unserialize($uncompressed);

var_dump($unserialized['channels_by_name']['community']['packages']);
var_dump($unserialized);

and I believe the Magento Connect downloader saves and loads this file via the load and save methods in

#File: lib/Mage/Connect/Singleconfig.php
Related Topic