- md5
- a8ea4b35c4ac4fe1a28d411df334d299
- sha1
- a821809bdb4999237408bf48ed4c840e5f08a98b
- sha256
- 155bc476eea158e9b644520df85f99dd617f57651fc580310ac99c99159f6953
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
<?php
/**
* @package Joomla.Installation
* @subpackage Model
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Installation\Model;
use Joomla\CMS\Factory;
use Joomla\Database\DatabaseAwareInterface;
use Joomla\Database\DatabaseAwareTrait;
use Joomla\Registry\Registry;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Automated Updates model for the Joomla Core Installer.
*
* @since 6.0.0
*/
class AutomatedUpdatesModel extends BaseInstallationModel implements DatabaseAwareInterface
{
use DatabaseAwareTrait;
/**
* @since 6.0.0
*/
public function __construct()
{
// Overrides application config and set the configuration.php file so tokens and database works.
if (file_exists(JPATH_BASE . '/configuration.php')) {
/** @phpstan-ignore class.notFound */
Factory::getApplication()->setConfiguration(new Registry(new \JConfig()));
}
parent::__construct();
}
/**
* Opt out from automated Updates
*
* @since 6.0.0
*/
public function disable()
{
// Get the params of com_joomlaupdate
$db = $this->getDatabase();
$query = $db->getQuery(true);
$query->select('params')
->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = ' . $db->quote('com_joomlaupdate'));
$params = new Registry($db->setQuery($query)->loadResult());
$params->set('autoupdate', 0);
$params->set('autoupdate_status', 0);
// Update the language settings in the language manager.
$query->clear()
->update($db->quoteName('#__extensions'))
->set($db->quoteName('params') . ' = ' . $db->quote($params->toString()))
->where($db->quoteName('element') . ' = ' . $db->quote('com_joomlaupdate'));
$db->setQuery($query)->execute();
return true;
}
}
No other release has this exact content. See every version of this file.