Directory paths in Magento

Hello All,

I am writing here the code to get various base directory paths, which might be useful.

Assuming the directory is named ‘magento’ where your site is present and its the root directory of the filesystem.

echo Mage::getBaseDir('base');
magento	

echo Mage::getBaseDir('app');
magento/app

echo Mage::getBaseDir('code');
magento/app/code

echo Mage::getModel('core/config')->getOptions()->getCodeDir();
magento/app/code

echo Mage::getBaseDir('design');
magento/app/design

echo Mage::getBaseDir('etc');
magento/app/etc

echo Mage::getBaseDir('lib');
magento/lib

echo Mage::getBaseDir('locale');
magento/app/locale

echo Mage::getBaseDir('media');
magento/media

echo Mage::getBaseDir('skin');
magento/skin

echo Mage::getBaseDir('var');
magento/var

echo Mage::getBaseDir('tmp');
magento/var/tmp

echo Mage::getBaseDir('cache');
magento/var/cache

echo Mage::getBaseDir('log');
magento/var/log

echo Mage::getBaseDir('session');
magento/var/session

echo Mage::getBaseDir('upload');
magento/media/upload

echo Mage::getBaseDir('export');
magento/var/export
	

3 thoughts on “Directory paths in Magento

Leave a Reply to Pragnesh Cancel reply

Your email address will not be published. Required fields are marked *

Scroll to top