search
top

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 Responses to “Directory paths in Magento”

  1. Peter says:

    Wow!!!!!!!!!!!!!!!
    Nice one about Magento.

  2. my nm says:

    echo Mage::getBaseDir(‘log’);
    magento/var/cache

    is this right?

Leave a Reply to Peter

top