Search code examples
phpconfigurationjoomla

Script which allows to know Joomla 3 configuration.php details


I've one Joomla 3 project. I'm doing this project unformally. So I'm afraid that my money wouldn't be vanished. Does anyone know where is the best place (in Joomla 3 files) to hide script which would allow to view information of a configuration.php and how that script should be like?

I'm asking this question because I've tried insert a tiny script in include/framework.php bet I get an error.

Thank you,

Ugnius


Solution

  • Joomla has is own method of getting variables from the configuration.php file however do use with caution:

    $config = JFactory::getConfig();
    echo 'Site name is ' . $config->getValue( 'config.sitename' );
    echo 'Site name is ' . $config->getValue( 'config.offline_message' );
    echo 'Site name is ' . $config->getValue( 'config.dbtype' );
    

    and so on.

    Hope this helps