4use \Bitrix\Main\Localization\Loc;
5Loc::loadMessages(__FILE__);
18 $version = getenv(
'BITRIX_VA_VER');
20 return version_compare($version, self::BX_ENV_MIN_VERSION ,
'>=');
25 return str_replace(
" ",
" ",
$str);
30 if(intval($minutes) <= 0)
31 throw new \Bitrix\Main\ArgumentNullException(
"minutes");
35 $contents = file_get_contents(\
Bitrix\
Main\Application::getDocumentRoot().
'/bitrix/modules/scale/server_off.html');
39 \CUtil::JSEscape(\COption::GetOptionString(
"main",
"site_name",
$_SERVER[
"SERVER_NAME"])),
50 "##AVAILABLE_MESSAGE##",
51 Loc::getMessage(
"SCALE_HLP_AV_MESSAGE"),
56 "##AVAILABLE_DATETIME##",
57 ($now+60*$minutes)*1000,
69 Loc::getMessage(
"SCALE_HLP_AV_HOURS").
" ",
75 Loc::getMessage(
"SCALE_HLP_AV_MINS").
" ",
81 Loc::getMessage(
"SCALE_HLP_AV_SECS").
" ",
91 throw new \Bitrix\Main\ArgumentNullException(
"DBHost");
93 throw new \Bitrix\Main\ArgumentNullException(
"DBName");
95 throw new \Bitrix\Main\ArgumentNullException(
"DBLogin");
98 $file = new \Bitrix\Main\IO\File(
$filename);
100 if(!$file->isExists())
108 file_put_contents(\
Bitrix\
Main\Application::getDocumentRoot().
"/bitrix/php_interface/dbconn.php.bak",
$content);
132 if(!isset(
$settings[
'connections'][
'value'][
'default']) || !is_array(
$settings[
'connections'][
'value'][
'default']))
150 $chars=
"abcdefghiknrstyzABCDEFGHKNQRSTYZ1234567890";
151 $charsCount = mb_strlen($chars);
154 for(
$i=0;
$i<$length;
$i++)
155 $result .= mb_substr($chars, rand(1, $charsCount) - 1, 1);
165 $dbCount =
count($dbList);
168 && !in_array($currentDb, $dbList)
186 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-node -o json");
187 $jsonData = $shellAdapter->getLastOutput();
191 $arData = json_decode($jsonData,
true);
193 if(isset($arData[
"params"][
"pool_interfaces"]))
194 $result = $arData[
"params"][
"pool_interfaces"];
198 foreach(
$result as $iface => $ip)
199 $result[$iface] = $iface.
" (".$ip.
")";
210 return getenv(
'BITRIX_VA_VER')
211 && mb_stristr(php_uname(
's'),
'linux')
212 &&
$DB->type ==
'MYSQL'
218 $path =
'/home/bitrix/.webdir';
219 $permissionsForOwnerOnly = 0700;
222 if(!file_exists(
$path))
223 $res = mkdir(
$path, $permissionsForOwnerOnly,
true);
static getConnection($name="")
static isScaleCanBeUsed()
static getNetworkInterfaces()
static getAvailabilityPage($minutes)
static modifySettings($DBHost, $DBName, $DBLogin, $DBPassword)
static generatePass($length=20)
static isExtraDbExist($hostname)
static checkBxEnvVersion($version=false)
static modifyDbconn($DBHost, $DBName, $DBLogin, $DBPassword)
static getDbList($hostname)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"