Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/landing/lib/site/ |
Upload File : |
<?php namespace Bitrix\Landing\Site; class Version { private const VERSIONS = [ 0 => null, 1 => \Bitrix\Landing\Site\Update\ChatSales::class, 2 => \Bitrix\Landing\Site\Update\ChatSalesOrder::class, 3 => \Bitrix\Landing\Site\Update\DomainUa::class, 4 => \Bitrix\Landing\Site\Update\DomainBy::class, 5 => \Bitrix\Landing\Site\Update\DomainByUpdate::class, ]; protected static $process = false; /** * Updates specific site if needed. * @param int $siteId Site id. * @param int|null $version Site version. * @return void */ public static function update(int $siteId, ?int $version = 0): void { if (self::$process) { return; } self::$process = true; $version = intval($version); if ($version >= count(self::VERSIONS) - 1) { return; } \Bitrix\Landing\Rights::setGlobalOff(); foreach (self::VERSIONS as $updateVersion => $updateClass) { if ($updateVersion <= $version) { continue; } if (!$updateClass || !class_exists($updateClass)) { continue; } if ($updateClass::update($siteId)) { $version = $updateVersion; } else { break; } } \Bitrix\Landing\Internals\SiteTable::update($siteId, [ 'VERSION' => $version ]); \Bitrix\Landing\Rights::setGlobalOn(); self::$process = false; } }