JFACTORY-GETCONFIG-001
JFactory::getConfig()
Factory::getConfig()
Config lives on the application. Factory::getConfig() is deprecated.
JFactory::getConfig() → $app->getConfig() / $app->get('sitename')
What you will see
- Factory::getConfig is deprecated
Symptoms people search
getConfig deprecation
Replace this code
Swap JFactory::getConfig() for $app->getConfig() / $app->get('sitename').
Joomla 3
Remove or stop calling this
$sitename = JFactory::getConfig()->get('sitename');Joomla 4 / 6
Use this instead
$sitename = Factory::getApplication()->get('sitename');How to fix it
- 1Prefer $app->get($key).
- 2Or $app->getConfig().
Also known as
getConfig
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getXml() / JXMLElement
JFactory::getXML() → SimpleXMLElement
- Joomla 3 → 4Joomla API
Factory::getEditor()
JFactory::getEditor() → Editor::getInstance()