You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
387 B
PHP
21 lines
387 B
PHP
<?php
|
|
namespace Workerman\Lib;
|
|
use Workerman\Worker;
|
|
|
|
$bot_loop = new Worker();
|
|
$bot_loop->count = 1;
|
|
$bot_loop->name = "LuCodePhpBot";
|
|
|
|
function BotFunc()
|
|
{
|
|
$db = Db::get();
|
|
$info = $db->getRow('select * from admin where id = 1');
|
|
var_dump($info);
|
|
}
|
|
|
|
$bot_loop->onWorkerStart = function () {
|
|
Timer::add(2, function () {
|
|
BotFunc();
|
|
});
|
|
};
|