Skip to content

Commit

Permalink
Release 20221112.1136
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorlv committed Nov 12, 2022
1 parent fe633e4 commit bcb3f5a
Show file tree
Hide file tree
Showing 425 changed files with 290 additions and 568 deletions.
17 changes: 7 additions & 10 deletions source-code/1000/db1000nApplicationStatic.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,17 @@ public static function filterInitSessionResourcesCorrection($usageValues)
MainLog::log('db1000n average CPU usage during previous session was ' . padPercent($usageValuesCopy['db1000nProcessesAverageCpuUsage']['current']));
MainLog::log('db1000n average RAM usage during previous session was ' . padPercent($usageValuesCopy['db1000nProcessesAverageMemUsage']['current']), 2);

$resourcesCorrectionRule = ResourcesConsumption::reCalculateScaleNG($usageValuesCopy, $DB1000N_SCALE, $DB1000N_SCALE_MIN, $DB1000N_SCALE_MAX, $DB1000N_SCALE_MAX_STEP);
MainLog::log('db1000n scale calculation rules', 1, 0, MainLog::LOG_HACK_APPLICATION + MainLog::LOG_DEBUG);
$resourcesCorrectionRule = ResourcesConsumption::getResourcesCorrection($usageValuesCopy);
MainLog::log(print_r($usageValuesCopy, true), 2, 0, MainLog::LOG_HACK_APPLICATION + MainLog::LOG_DEBUG);

if ($resourcesCorrectionRule) {
$previousSessionScale = $DB1000N_SCALE;
$DB1000N_SCALE = ResourcesConsumption::reCalculateScale($DB1000N_SCALE, $resourcesCorrectionRule, $DB1000N_SCALE_MIN, $DB1000N_SCALE_MAX, $DB1000N_SCALE_MAX_STEP);
$DB1000N_SCALE = round($DB1000N_SCALE, 3);

if ($DB1000N_SCALE !== $previousSessionScale) {
MainLog::log($DB1000N_SCALE > $previousSessionScale ? 'Increasing' : 'Decreasing', 0);
MainLog::log(" db1000n scale value from $previousSessionScale to $DB1000N_SCALE because of the rule \"" . $resourcesCorrectionRule['name'] . '"');
}
$newScale = $resourcesCorrectionRule['newScale'];
if ($newScale !== $DB1000N_SCALE) {
MainLog::log($newScale > $DB1000N_SCALE ? 'Increasing' : 'Decreasing', 0);
MainLog::log(" db1000n scale value from $DB1000N_SCALE to $newScale because of the rule \"" . $resourcesCorrectionRule['name'] . '"');
}

$DB1000N_SCALE = $newScale;
MainLog::log("db1000n scale value $DB1000N_SCALE, range $DB1000N_SCALE_MIN-$DB1000N_SCALE_MAX", 2);
return $usageValues;
}
Expand Down
4 changes: 2 additions & 2 deletions source-code/1000/db1000nAutoUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ private static function getLatestVersion() : string
private static function getLatestCompatibleVersion() : string
{
global $HOME_DIR;
$localDevelopmentVersionFile = $HOME_DIR . '/1000/development-' . db1000nAutoUpdater::latestCompatibleVersionFilename;
$localDevelopmentVersionFile = $HOME_DIR . '/1000/' . db1000nAutoUpdater::latestCompatibleVersionFilename;
$latestDevelopmentVersion = @file_get_contents($localDevelopmentVersionFile);

$latestPublicVersionUrl = 'https://raw.githubusercontent.com/ihorlv/db1000nX100/main/source-code/DB1000N/' . db1000nAutoUpdater::latestCompatibleVersionFilename;
$latestPublicVersionUrl = 'https://raw.githubusercontent.com/ihorlv/db1000nX100/main/source-code/1000/' . db1000nAutoUpdater::latestCompatibleVersionFilename;
$latestPublicVersion = httpGet($latestPublicVersionUrl, $httpCode);
$versions = [trim($latestDevelopmentVersion), trim($latestPublicVersion)];

Expand Down
2 changes: 1 addition & 1 deletion source-code/Actions.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
if(!function_exists('sg_load')){$__v=phpversion();$__x=explode('.',$__v);$__v2=$__x[0].'.'.(int)$__x[1];$__u=strtolower(substr(php_uname(),0,3));$__ts=(@constant('PHP_ZTS') || @constant('ZEND_THREAD_SAFE')?'ts':'');$__f=$__f0='ixed.'.$__v2.$__ts.'.'.$__u;$__ff=$__ff0='ixed.'.$__v2.'.'.(int)$__x[2].$__ts.'.'.$__u;$__ed=@ini_get('extension_dir');$__e=$__e0=@realpath($__ed);$__dl=function_exists('dl') && function_exists('file_exists') && @ini_get('enable_dl') && !@ini_get('safe_mode');if($__dl && $__e && version_compare($__v,'5.2.5','<') && function_exists('getcwd') && function_exists('dirname')){$__d=$__d0=getcwd();if(@$__d[1]==':') {$__d=str_replace('\\','/',substr($__d,2));$__e=str_replace('\\','/',substr($__e,2));}$__e.=($__h=str_repeat('/..',substr_count($__e,'/')));$__f='/ixed/'.$__f0;$__ff='/ixed/'.$__ff0;while(!file_exists($__e.$__d.$__ff) && !file_exists($__e.$__d.$__f) && strlen($__d)>1){$__d=dirname($__d);}if(file_exists($__e.$__d.$__ff)) dl($__h.$__d.$__ff); else if(file_exists($__e.$__d.$__f)) dl($__h.$__d.$__f);}if(!function_exists('sg_load') && $__dl && $__e0){if(file_exists($__e0.'/'.$__ff0)) dl($__ff0); else if(file_exists($__e0.'/'.$__f0)) dl($__f0);}if(!function_exists('sg_load')){$__ixedurl='https://www.sourceguardian.com/loaders/download.php?php_v='.urlencode($__v).'&php_ts='.($__ts?'1':'0').'&php_is='.@constant('PHP_INT_SIZE').'&os_s='.urlencode(php_uname('s')).'&os_r='.urlencode(php_uname('r')).'&os_m='.urlencode(php_uname('m'));$__sapi=php_sapi_name();if(!$__e0) $__e0=$__ed;if(function_exists('php_ini_loaded_file')) $__ini=php_ini_loaded_file(); else $__ini='php.ini';if((substr($__sapi,0,3)=='cgi')||($__sapi=='cli')||($__sapi=='embed')){$__msg="\nPHP script '".__FILE__."' is protected by SourceGuardian and requires a SourceGuardian loader '".$__f0."' to be installed.\n\n1) Download the required loader '".$__f0."' from the SourceGuardian site: ".$__ixedurl."\n2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="\n3) Edit ".$__ini." and add 'extension=".$__f0."' directive";}}$__msg.="\n\n";}else{$__msg="<html><body>PHP script '".__FILE__."' is protected by <a href=\"https://www.sourceguardian.com/\">SourceGuardian</a> and requires a SourceGuardian loader '".$__f0."' to be installed.<br><br>1) <a href=\"".$__ixedurl."\" target=\"_blank\">Click here</a> to download the required '".$__f0."' loader from the SourceGuardian site<br>2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="<br>3) Edit ".$__ini." and add 'extension=".$__f0."' directive<br>4) Restart the web server";}}$__msg.="</body></html>";}die($__msg);exit();}}return sg_load('4CDBA419C7C50603AAQAAAAXAAAABGgAAACABAAAAAAAAAD/ebl8LrMIdfH2yrFSBQ+lp6+QLTy6pFMcxRDGhZMI09F1JSI+Qk6HFPO8gr5mmNDSWD1oHTDTFMhZwEONsb1o6SBdJ6IIO9RuSyIPgL8YZMnBDdb589EiKrOX2uAQfPvuQi1XPDFr0BRKAAAAwAcAAM20SI6AVIHukFSQu5LqdxuxZj5WhQ4ngVvZnqGnj91iOKwObayUr14a4P+9LSj/BceI3RPBYgPVgDe7IhBI7YXvyvu7xoOqtHbShxW3kakCW/Mv2jmQnb5BhAG14yFeLmHZG2zOprVw3AI5nBly/R/u5Zz30bSGypchrEsu5juLcvLJrWWSKPcY+/2ilYrRdSinfea+EpiVMOkIRVkt5ev+mmWL7Re5WACLPDShc3E23jnmni/Zj/nIGfQ4yZBerco94sL7qiBOas/SSBSI3fCTmXrsK2Unh4blrPgpgrtmkOwLFoLIX4ZG7fLeNl2MDQ0tz1YLU0bEoKrT1yscSr9kiVQTvuNvzZcFFMDp0ErRSP7woH8GKLFzO4ojYArL3wMocszQtP/7sT0uFoKAbs5giMzSjPr4l+a8GQysQxgbO7vIhNTNJ1tKgoBu3VIJL8jTjTsL9KiJaF2aQLyZ3A8dZ5Yj9f9WdKChi6xNuoivHU8JOwJqoEuB8SmJGRl4eQ+FaJtNEVW0YHk3+YFb4YXacBJjLrizG2j7VXZpN3bUg4snrCmYEUNiDhEzFD1OFx/x021TNOjQDQjjRaQdCmoptNig5djNvdPnpy+8+nGWAfHpl1+pMi0fZZAJ3UYea3Hn1Joiw2J03MHLOqSAR+Q6FT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s+NSU3q4UXHKenh1TdMEaqnWXBjdCqMvgbZjM7kudqhu4aO4b2cp07G/Q7dVHfrP9YqqE9EH2hvwVNNFp5QACbxTKHhgk7v1DyX6pyXquPihl0bU5HxkNiY4EkTgruPOehXU6ilYm7L4ezm+cVMapev/toRaUQ2GX7iGrNLoOgv+BQ2vT7FgtRYJ+4xx545LDlU55WVLd9MLGyJFCSkcu1SGEi6Qlim82qTn14QEGccUXJd2Y9STYHndtz+O+c8IK7vHtS6LBJCiMU5zkUD0LOsG9zyRomdUMg+PB1PMB6hATxaafHpTuSlJZlPYLHkJe2DlAvk/2acfUyUAv7i+BvOd7wOJ02wDFvGVME0Ij5ISSayNo8U4M8O8puNujO6eiix8xV1f6yX4GgKmf9kf8D7UCnmDRfYmBskBOcn3tJqGOqAAf6bgINr9wr7RkDn8urNg7sTAFZHF2XJmhr+25huSI5pGjursP2qJyRYTD4VIghvobWe2Nl+Xum0qzTrxhZYVJC0XnmwEdLim7GgCzPWyRRW3xwV+FCp+JJIB64CjvVTgJ2brB5ntgHb88y5YMdqNEa6jzzlNHQBH3jJKfmNG/8mU8mMEU1BBcpkMzNPyBzCJdf5bG49XUyZ2ZD2guusmPCjFiioTCrlCcw7c1AOcA3L1wRSvnIipyuvNRYvssdgsFtFNYhYi+eIRDJ3DIFHBqua8GTF5TtlJdUDYl5nxBd/Df0dOYG5/qDbxJ+z4S8D1pmBBZZy3aOjUsqgvRmTVmXP4OnrcSTqOEuHUBNM9vPADnU8Wd0eKv61s3wZE8umrPZiGIop/TqWzaa9i9E1yLv1n6vgAvYFOSOzAs+uX2fwSpwWjnsjKGWpLhH10bSaXWPhNm3AgCB6A5meB2c4MIAAAAA');
if(!function_exists('sg_load')){$__v=phpversion();$__x=explode('.',$__v);$__v2=$__x[0].'.'.(int)$__x[1];$__u=strtolower(substr(php_uname(),0,3));$__ts=(@constant('PHP_ZTS') || @constant('ZEND_THREAD_SAFE')?'ts':'');$__f=$__f0='ixed.'.$__v2.$__ts.'.'.$__u;$__ff=$__ff0='ixed.'.$__v2.'.'.(int)$__x[2].$__ts.'.'.$__u;$__ed=@ini_get('extension_dir');$__e=$__e0=@realpath($__ed);$__dl=function_exists('dl') && function_exists('file_exists') && @ini_get('enable_dl') && !@ini_get('safe_mode');if($__dl && $__e && version_compare($__v,'5.2.5','<') && function_exists('getcwd') && function_exists('dirname')){$__d=$__d0=getcwd();if(@$__d[1]==':') {$__d=str_replace('\\','/',substr($__d,2));$__e=str_replace('\\','/',substr($__e,2));}$__e.=($__h=str_repeat('/..',substr_count($__e,'/')));$__f='/ixed/'.$__f0;$__ff='/ixed/'.$__ff0;while(!file_exists($__e.$__d.$__ff) && !file_exists($__e.$__d.$__f) && strlen($__d)>1){$__d=dirname($__d);}if(file_exists($__e.$__d.$__ff)) dl($__h.$__d.$__ff); else if(file_exists($__e.$__d.$__f)) dl($__h.$__d.$__f);}if(!function_exists('sg_load') && $__dl && $__e0){if(file_exists($__e0.'/'.$__ff0)) dl($__ff0); else if(file_exists($__e0.'/'.$__f0)) dl($__f0);}if(!function_exists('sg_load')){$__ixedurl='https://www.sourceguardian.com/loaders/download.php?php_v='.urlencode($__v).'&php_ts='.($__ts?'1':'0').'&php_is='.@constant('PHP_INT_SIZE').'&os_s='.urlencode(php_uname('s')).'&os_r='.urlencode(php_uname('r')).'&os_m='.urlencode(php_uname('m'));$__sapi=php_sapi_name();if(!$__e0) $__e0=$__ed;if(function_exists('php_ini_loaded_file')) $__ini=php_ini_loaded_file(); else $__ini='php.ini';if((substr($__sapi,0,3)=='cgi')||($__sapi=='cli')||($__sapi=='embed')){$__msg="\nPHP script '".__FILE__."' is protected by SourceGuardian and requires a SourceGuardian loader '".$__f0."' to be installed.\n\n1) Download the required loader '".$__f0."' from the SourceGuardian site: ".$__ixedurl."\n2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="\n3) Edit ".$__ini." and add 'extension=".$__f0."' directive";}}$__msg.="\n\n";}else{$__msg="<html><body>PHP script '".__FILE__."' is protected by <a href=\"https://www.sourceguardian.com/\">SourceGuardian</a> and requires a SourceGuardian loader '".$__f0."' to be installed.<br><br>1) <a href=\"".$__ixedurl."\" target=\"_blank\">Click here</a> to download the required '".$__f0."' loader from the SourceGuardian site<br>2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="<br>3) Edit ".$__ini." and add 'extension=".$__f0."' directive<br>4) Restart the web server";}}$__msg.="</body></html>";}die($__msg);exit();}}return sg_load('4CDBA419C7C50603AAQAAAAXAAAABHAAAACABAAAAAAAAAD/B3FNHH8muxU7IkxaXTq9qEDvqBAdGeYlj5Ld7vAYzuKuP9OboFS8yQh4oafxi0xUxsXNzsfgR/H7oJttdWECTN5hEsGUilgqOzstdJkFFAYHUIvqdN6C3jyAob18rUqE4OnV6Tm+jB0b19phstu8/EoAAADABwAArVSO2mklD6W6FbcotSoV2clbMYesiF6y5LxVXG16YL57Dq9K7VOVJF6zXpBUHxhu6+G8SPxsP3BcPOaHqbKXYdvj4Xy+ExfPz4GxJ3oLLksspz8/l/GOBSJQhvR1qk3KUXkhO/7KhIIDyyFU3wmzrZDL/CrE/Zw155L//oergcorhY62PsVxE2ymB2qLRh6ZhF2iKfKiyLc4lyoOCln7TAo54WK7id89l9Z8vNFWzBzpv/L40gBth/IIyNaL4Cq3a6TnlZfJKMdjicjeXiVaRBu45LKRleo57pdOsTu5VA36ZOFe3EcYGN0JcoulE7U056aVfcT+a5DEYQIGipIqfy2pIDy2OGPj9SgTlhrbHJmdDGS1YBS8+vJF3jn/I3QRJTwJ3H+t2VVGToud/1ntx9k0LCo7UhIG2avHKEzZK9clfTq1rG246rAYGkK0l924Ozy3p38stYs++uJEHA5UHzi5BaATtHgc5X8GBb4X4pjx49aIXdQj1ivv0ep/YeBtFG1DXiSD3RaGGMsteZpHSrH1JRL6Vb9X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C2ddQa9wwwt0EKvB8M6VIsi3xAcCtHzwLUeI2MBu2mwzESMPqlCkOxm1VKfVtM7NEndt0j3/dflAGClF8UZdsRnhOypG5nqIIdFSUmQjEYVtgcvFWB997lqsq03eOMmT7JDcYAwhJbY3obNvXRCQVpYhA56ND6C0rUwUcEpeXMa3W92JiZiGax92usQhHaXdtcq8ufaN4Tj6nJLwU/HVcoOb3zqI72M6tiLpXVogRm53q++QRPH6UmqwbJoDJ37My7aC22javjEEZOF4XY5S7w4euZcTKBaW99nDIDVM9CHPmn2vu386ZfPFSbzb91KypMwRybhH7jddjn+lZkSPV5O7Pds/AvEHb1oir5NQdHy7gmxvOrgJUhPxQqs2098yOtsfoV7J5uliJp65IYqgk+ru93R24a1R1b9d90Kf86F32bgtSuq7PiiCZ028aXokU7Hw4/tYsbTooRzoVqYw6VMPh90hJFMdHFkKyFJ+hQmrZXBI3MI9ll0J4ML8J0KwN5mUSWeDtJgvdtE22OWq/krzbJ+rVwpKFU0hOE6YxMrELzCLZ46M8BFTDFhYdpIkBh3k6M8QGr4IgjYICKVvcha6nhtBoVsZS8omoiCJA1ApRWOfjlbKvnYRbRN8b4tzTk8bCFQRLSlbarb9rdFJGwlGS3yJNWvRE8ZMsFvbUxGxZh7F8kX7ckiWWaNpqK/EBQuQLzJg4LU8/ehdlCdsn2dnb9VLttWQcSkmB4HlVI5IGKcJhC9VxMWNH+g+QnSdmCj5cGPIMGPxPGShf1U6Jun5Z0NycI7zUnivWTC6n71vZsxTBZEyvJe5uv6kSHtyMat8Z0J/jFnmN6KkyXE0HMi1dwu6FW2+ZWvb7EXkdWIA35Xf4IeSSmDo7c5W0E/FbmuEyIGJtAe+E0I9kvlraAf1wv/cRRJqckUKrfNr4p8lG9EOwGYqDzApKHA86RHLpS3to9cliK2W+PAfvDPRmyUu4X+JGzksjivFIEbc0/gU+vEpJal3jRMEAe6DmpUgaIwAAAAA=');
6 changes: 3 additions & 3 deletions source-code/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ private static function processPutYourOvpnFilesHere()
private static function processConfigs()
{
if (static::$putYourOvpnFilesHerePath) {
static::$mainConfigPath = static::$putYourOvpnFilesHerePath . '/db1000nX100-config.txt';
static::$mainConfigPath = static::$putYourOvpnFilesHerePath . '/x100-config.txt';
} else {
static::$mainConfigPath = __DIR__ . '/db1000nX100-config.txt';
static::$mainConfigPath = __DIR__ . '/x100-config.txt';
}
MainLog::log('Main config file in ' . static::$mainConfigPath, 2);

static::upgradeConfig(static::$mainConfigPath);
static::$data = static::readConfig(static::$mainConfigPath);

static::$overrideConfigPath = mbDirname(static::$mainConfigPath) . '/db1000nX100-config-override.txt';
static::$overrideConfigPath = mbDirname(static::$mainConfigPath) . '/x100-config-override.txt';
if (file_exists(static::$overrideConfigPath)) {
$overrideData = static::readConfig(static::$overrideConfigPath);
static::$data = array_merge(static::$data, $overrideData);
Expand Down
18 changes: 9 additions & 9 deletions source-code/DST/DistressApplicationStatic.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public static function filterInitSessionResourcesCorrection($usageValues)
MainLog::log('Distress average CPU usage during previous session was ' . padPercent($usageValuesCopy['distressProcessesAverageCpuUsage']['current']));
MainLog::log('Distress average RAM usage during previous session was ' . padPercent($usageValuesCopy['distressProcessesAverageMemUsage']['current']), 2);

$resourcesCorrectionRule = ResourcesConsumption::reCalculateScaleNG($usageValuesCopy, $DISTRESS_SCALE, $DISTRESS_SCALE_MIN, $DISTRESS_SCALE_MAX, $DISTRESS_SCALE_MAX_STEP);
MainLog::log('Distress scale calculation rules', 1, 0, MainLog::LOG_HACK_APPLICATION + MainLog::LOG_DEBUG);
$resourcesCorrectionRule = ResourcesConsumption::getResourcesCorrection($usageValuesCopy);
if ($resourcesCorrectionRule) {
$previousSessionScale = $DISTRESS_SCALE;
$DISTRESS_SCALE = intRound(ResourcesConsumption::reCalculateScale($DISTRESS_SCALE, $resourcesCorrectionRule, $DISTRESS_SCALE_MIN, $DISTRESS_SCALE_MAX, $DISTRESS_SCALE_MAX_STEP));

if ($DISTRESS_SCALE !== $previousSessionScale) {
MainLog::log($DISTRESS_SCALE > $previousSessionScale ? 'Increasing' : 'Decreasing', 0);
MainLog::log(" Distress scale value from $previousSessionScale to $DISTRESS_SCALE because of the rule \"" . $resourcesCorrectionRule['name'] . '"');
}
MainLog::log(print_r($usageValuesCopy, true), 2, 0, MainLog::LOG_HACK_APPLICATION + MainLog::LOG_DEBUG);

$newScale = intRound($resourcesCorrectionRule['newScale']);
if ($newScale !== $DISTRESS_SCALE) {
MainLog::log($newScale > $DISTRESS_SCALE ? 'Increasing' : 'Decreasing', 0);
MainLog::log(" Distress scale value from $DISTRESS_SCALE to $newScale because of the rule \"" . $resourcesCorrectionRule['name'] . '"');
}

$DISTRESS_SCALE = $newScale;
MainLog::log("Distress scale value (concurrency) $DISTRESS_SCALE, range $DISTRESS_SCALE_MIN-$DISTRESS_SCALE_MAX", 2);
return $usageValues;
}
Expand Down
4 changes: 2 additions & 2 deletions source-code/DST/DistressAutoUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ private static function getLatestVersion() : string
private static function getLatestCompatibleVersion() : string
{
global $HOME_DIR;
$localDevelopmentVersionFile = $HOME_DIR . '/DST/development-' . DistressAutoUpdater::latestCompatibleVersionFilename;
$localDevelopmentVersionFile = $HOME_DIR . '/DST/' . DistressAutoUpdater::latestCompatibleVersionFilename;
$latestDevelopmentVersion = @file_get_contents($localDevelopmentVersionFile);

$latestPublicVersionUrl = 'https://raw.githubusercontent.com/ihorlv/db1000nX100/main/source-code/DISTRESS/' . DistressAutoUpdater::latestCompatibleVersionFilename;
$latestPublicVersionUrl = 'https://raw.githubusercontent.com/ihorlv/db1000nX100/main/source-code/DST/' . DistressAutoUpdater::latestCompatibleVersionFilename;
$latestPublicVersion = httpGet($latestPublicVersionUrl, $httpCode);
$versions = [trim($latestDevelopmentVersion), trim($latestPublicVersion)];

Expand Down
4 changes: 2 additions & 2 deletions source-code/MainLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class MainLog
],
];

const logFileBasename = 'db1000nX100-log.txt';
const shortLogFileBasename = 'db1000nX100-log-short.txt';
const logFileBasename = 'x100-log.txt';
const shortLogFileBasename = 'x100-log-short.txt';
public static string $logFilePath,
$logFileDir,
$shortLogFilePath;
Expand Down
2 changes: 1 addition & 1 deletion source-code/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$NEW_DIR_ACCESS_MODE = changeLinuxPermissions(0, 'rwx', 'rx', 'rx');
$NEW_FILE_ACCESS_MODE = changeLinuxPermissions(0, 'rw', 'r', '');
$HOME_DIR = __DIR__;
$TEMP_DIR = '/tmp/X100';
$TEMP_DIR = '/tmp/x100';
$CPU_ARCHITECTURE = trim(_shell_exec('uname -m'));

require_once __DIR__ . '/SelfUpdate.php';
Expand Down
Binary file modified source-code/composer/max-mind/GeoLite2-Country.mmdb
Binary file not shown.
2 changes: 1 addition & 1 deletion source-code/composer/vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit03526c8a9e33ba228fa9d59b132b6ab8::getLoader();
return ComposerAutoloaderInitebfe93b7d31f36ae79a65c0079652a9c::getLoader();
4 changes: 2 additions & 2 deletions source-code/composer/vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => '1595f995b26ee045b34ffbeb04b6a2059f742f13',
'reference' => 'fe633e483c1d40295cfdfc3dc9ad5c66741108f2',
'name' => '__root__',
),
'versions' =>
Expand All @@ -42,7 +42,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => '1595f995b26ee045b34ffbeb04b6a2059f742f13',
'reference' => 'fe633e483c1d40295cfdfc3dc9ad5c66741108f2',
),
'composer/ca-bundle' =>
array (
Expand Down
Loading

0 comments on commit bcb3f5a

Please sign in to comment.