<?php
/*
Set cron Example:
/opt/php83/bin/php /var/www/bots_sdarks__usr/data/www/sdarks.ru/tg/cron.php
*/
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
require_once dirname(dirname(__FILE__)) . '/vendor/autoload.php';
require_once __DIR__ . "/core.php";
$databaseDirectory = __DIR__ . "/myDatabase";
use SleekDB\Store;
$token = file_get_contents(__DIR__.'/token.txt');
define('TOKEN', $token);
$configuration = [
"auto_cache" => false,
"cache_lifetime" => 0,
'timeout' => false
];
$startTime = time();
delTree($databaseDirectory . '/user/cache/');
mkdir($databaseDirectory . '/user/cache/');
$userStore = new Store("user", $databaseDirectory, $configuration);
$users = $userStore->findBy([[['pause', '<', time()]], "AND", [['status', '=', 2]]]);
echo '<pre>';
foreach ($users as $user) {
$user = (object) $user;
print_r($user);
$str = '';
$button = [];
$data = [];
$user->status = 0;
main_index($user);
}
echo 'good';