/** * * @return void * */ public static function domainChanged() { self::$domain_changed = true; }
/** * * @param bool $bActive * @return bool * */ public function SetActive($bActive) { /** * @global CMain $APPLICATION */ global $APPLICATION; if ($bActive) { if (!self::IsActive()) { try { $o = CBitrixCloudCDNConfig::getInstance()->loadRemoteXML(); $o->saveToOptions(); RegisterModuleDependences("main", "OnEndBufferContent", "bitrixcloud", "CBitrixCloudCDN", "OnEndBufferContent"); self::$domain_changed = false; } catch (exception $e) { $ex = new CApplicationException($e->getMessage()); $APPLICATION->ThrowException($ex); return false; } } elseif (self::$domain_changed) { try { $o = CBitrixCloudCDNConfig::getInstance()->loadRemoteXML(); $o->saveToOptions(); self::$domain_changed = false; } catch (exception $e) { $ex = new CApplicationException($e->getMessage()); $APPLICATION->ThrowException($ex); return false; } } } else { if (self::IsActive()) { try { self::stop(); UnRegisterModuleDependences("main", "OnEndBufferContent", "bitrixcloud", "CBitrixCloudCDN", "OnEndBufferContent"); } catch (exception $e) { UnRegisterModuleDependences("main", "OnEndBufferContent", "bitrixcloud", "CBitrixCloudCDN", "OnEndBufferContent"); $ex = new CApplicationException($e->getMessage()); $APPLICATION->ThrowException($ex); return false; } } } return true; }