| Server IP : 87.98.154.146 / Your IP : 216.73.216.101 Web Server : Apache System : Linux webm005.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : bsiadvisil ( 110003) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/bsiadvisil/www/libraries/msframework/helpers/ |
Upload File : |
<?php
/**
* MS Framework
*
* @package MS Framework Library
* @version 1.2.1.573
*
* @author Michael Snoeren
* @link https://snoerendevelopment.nl/
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
// Deny direct access
defined('_JEXEC') or die;
abstract class MSFrameworkUpdater
{
/**
* List of versions
* @var Array
* @access Protected
*/
protected static $versions = [
'1.1.3',
'1.1.8'
];
/**
* Run the update script for this version
* @access Public
* @return Boolean
*/
public static function execute()
{
$currentVersion = MSFramework::VERSION;
$error = false;
JLog::add('Started the update script', JLog::INFO, 'plg_msframework');
foreach (self::$versions as $version) {
// If the current version is the same or newer
if (version_compare($currentVersion, $version) >= 0) {
$versionNr = preg_replace('/[^0-9]/', '', $version);
$function = 'v' . $versionNr;
// Try to execute the function
if (!method_exists('MSFrameworkUpdater', $function)) {
JLog::add(
'Skipping version ' . $version . ' due to the function that does not exist.',
JLog::WARNING,
'plg_msframework'
);
continue 1;
}
JLog::add('Executing for version ' . $version, JLog::INFO, 'plg_msframework');
// Execute the update function
$status = self::$function();
if (!$status) {
JLog::add('Executing failed for version ' . $version, JLog::WARNING, 'plg_msframework');
}
// Make sure one true stays true which indicates an error during one of the functions
if (!$error) {
$error = !$status;
}
}
}
JLog::add('Update script done', JLog::INFO, 'plg_msframework');
return !$error;
}
/**
* Update function for version 1.1.3
* @access Protected
* @return Boolean
*/
protected static function v113()
{
// Remove old files
$files = array(
'plugins/system/msframework/helper/http.php',
'plugins/system/msframework/helper/update.php',
'plugins/system/msframework/helper/message.php',
'plugins/system/msframework/helper/updatesite.php',
'plugins/system/msframework/helper/layout.php',
);
$error = false;
foreach ($files as $file) {
$file = rtrim(str_replace('\\', '/', JPATH_ROOT), '/') . '/' . $file;
if (JFile::exists($file)) {
if (!JFile::delete($file)) {
$error = true;
}
}
}
return !$error;
}
/**
* Update function for version 1.1.8
* @access Protected
* @return Boolean
*/
protected static function v118()
{
// Remove the update site file
return JFile::delete(JPATH_ROOT . '/libraries/msframework/helpers/updatesite.php');
}
}