<?php
/*
 * Software Name: Eorisis Setup
 * Software URI: https://eorisis.com/shop/software/joomla/setup
 * Author: Eorisis
 * Author URI: https://eorisis.com
 * Copyright: Copyright (C) 2011-2025 EORISIS. All Rights Reserved.
 * License: GNU General Public License version 2; See https://eorisis.com/gpl
 * Terms of Service: https://eorisis.com/tos
 */
namespace eorisis_setup\framework\install\lib\core\update;
\defined('_JEXEC') or die;

class v2_2_5
{
	public function __construct() {}

	// --------------------------------------------------

	public function execute(string $version)
	{
		// Rebuild update sites

		if (\defined('EORISIS_UPDSITES_REBUILT') or
			\version_compare(JVERSION, '3.6', '<') or
			\version_compare(JVERSION, 4, '>='))
		{
			return;
		}

		$model = \eorisis_setup\framework\install\lib\core\cms\application::get_model('Updatesites', 'InstallerModel');
		if (!\is_object($model))
		{
			return;
		}

		$model->rebuild();
		\define('EORISIS_UPDSITES_REBUILT', true);
	}
}
