I am developing a module for Magento and wonder if it would be compatible with either Community or Enterprise platform versions. Is there any easier way to check that instead of doing it on each of its versions?
Thanks!!!
It depends on what your module uses from the Magento Core and templates I guess.
One option would be to install on the latest versions and on version CE 1.5 (and it's equivalent EE version). If it works on both you can be fairly sure everything in between works as well. If it breaks use the Magento change logs per version to see which change introduced the errors.
But at the end of the day the only way to be sure is to install it in each version as far as I know. This isn't a complete answer but hopefully will point you in the right direction
You could create an intermediary class that implements all the functions that you require and depending on the version of magento call parent's implementation or use your own implementation:
model/Int.php
<?php
if (!version_compare(Mage::getVersion(), '1.7', '>=')) {
class N_M_Model_Int extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
}
} else {
class N_M_Model_Int extends Varien_Data_Collection_Db
{
public function getMainTable()
{
// my implementation
}
}
}
?>
model/Final.php
<?php
class N_M_Model_Final extends N_M_Model_Int
{
// common code between all the versions
}
?>