Applied fixes from StyleCI
This commit is contained in:
parent
a540b0a4cf
commit
aed44236d1
|
@ -64,7 +64,7 @@ class Logging
|
||||||
if (!is_string($param)) {
|
if (!is_string($param)) {
|
||||||
$param = var_export($param, true);
|
$param = var_export($param, true);
|
||||||
}
|
}
|
||||||
$param = basename(debug_backtrace()[0]["file"], '.php').': '.$param;
|
$param = basename(debug_backtrace()[0]['file'], '.php').': '.$param;
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case '1':
|
case '1':
|
||||||
error_log($param);
|
error_log($param);
|
||||||
|
|
|
@ -63,10 +63,12 @@ class MsgIdHandler extends MessageHandler
|
||||||
ksort($this->incoming_messages);
|
ksort($this->incoming_messages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function generate_message_id() {
|
|
||||||
|
public function generate_message_id()
|
||||||
|
{
|
||||||
$ms_time = (time() + $this->timedelta) * 1000;
|
$ms_time = (time() + $this->timedelta) * 1000;
|
||||||
$int_message_id = (int) (
|
$int_message_id = (int) (
|
||||||
((int)($ms_time / 1000) << 32) |
|
((int) ($ms_time / 1000) << 32) |
|
||||||
($this->posmod($ms_time, 1000) << 22) |
|
($this->posmod($ms_time, 1000) << 22) |
|
||||||
rand(0, 524288) << 2
|
rand(0, 524288) << 2
|
||||||
);
|
);
|
||||||
|
@ -76,6 +78,7 @@ class MsgIdHandler extends MessageHandler
|
||||||
$int_message_id += 4;
|
$int_message_id += 4;
|
||||||
}
|
}
|
||||||
$this->check_message_id($int_message_id, true);
|
$this->check_message_id($int_message_id, true);
|
||||||
|
|
||||||
return $int_message_id;
|
return $int_message_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ class PrimeModule extends Tools
|
||||||
{
|
{
|
||||||
$pqstr = (string) $pq;
|
$pqstr = (string) $pq;
|
||||||
|
|
||||||
$this->log->log("Trying to use the python factorization module");
|
$this->log->log('Trying to use the python factorization module');
|
||||||
if (function_exists('shell_exec')) {
|
if (function_exists('shell_exec')) {
|
||||||
try {
|
try {
|
||||||
$res = json_decode(shell_exec('python '.__DIR__.'/getpq.py '.$pqstr));
|
$res = json_decode(shell_exec('python '.__DIR__.'/getpq.py '.$pqstr));
|
||||||
|
@ -91,7 +91,7 @@ class PrimeModule extends Tools
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->log->log("Trying to use the wolfram alpha factorization module");
|
$this->log->log('Trying to use the wolfram alpha factorization module');
|
||||||
$query = 'Do prime factorization of '.$pqstr;
|
$query = 'Do prime factorization of '.$pqstr;
|
||||||
$params = [
|
$params = [
|
||||||
'async' => true,
|
'async' => true,
|
||||||
|
@ -120,7 +120,7 @@ class PrimeModule extends Tools
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->log->log("Trying to use the native factorization module");
|
$this->log->log('Trying to use the native factorization module');
|
||||||
$res = $this->find_small_multiplier_lopatin((int) $pqstr);
|
$res = $this->find_small_multiplier_lopatin((int) $pqstr);
|
||||||
$res = [$res, $pqstr / $res];
|
$res = [$res, $pqstr / $res];
|
||||||
if ($res[1] != 1) {
|
if ($res[1] != 1) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user