<?php // получаем параметры компонента com_users $params = JComponentHelper::getParams('com_users'); // устанавливаем требуемое значение $params->set('guest_usergroup', '1'); // записываем измененные параметры в БД $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->update($db->quoteName('#__extensions')); $query->set($db->quoteName('params') . '= ' . $db->quote((string)$params)); $query->where($db->quoteName('element') . ' = ' . $db->quote('com_users')); $query->where($db->quoteName('type') . ' = ' . $db->quote('component')); $db->setQuery($query); $db->execute(); ?>
In this example, it is important to pay attention to the reduction of the variable $params to string. As a result of this reduction JRegistry object it will be converted into JSON format and you want to record in the field params #__extensions table.