fix(cli): Fix errors in fetch-ton cli command

This commit is contained in:
celestora 2025-02-22 17:52:29 +02:00
parent ee0dd8c749
commit 6bb2c2fd1d
2 changed files with 4 additions and 3 deletions

View file

@ -17,7 +17,7 @@ define("NANOTON", 1000000000);
class FetchToncoinTransactions extends Command
{
private $images;
private $transactions;
protected static $defaultName = "fetch-ton";
@ -76,7 +76,6 @@ class FetchToncoinTransactions extends Command
$header->writeln("Gonna up the balance of users");
foreach ($response["result"] as $transfer) {
$outputArray;
preg_match('/' . OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["regex"] . '/', $transfer["in_msg"]["message"], $outputArray);
$userId = ctype_digit($outputArray[1]) ? intval($outputArray[1]) : null;
if (is_null($userId)) {

View file

@ -443,7 +443,9 @@ function downloadable_name(string $text): string
}
return (function () {
_ovk_check_environment();
if (php_sapi_name() != "cli")
_ovk_check_environment();
require __DIR__ . "/vendor/autoload.php";
setlocale(LC_TIME, "POSIX");