getenv('TELEGRAM_BOT_TOKEN'), ]); if (getenv('env') == 'dev') { $cache = new \Doctrine\Common\Cache\ArrayCache(); $dozorApi = new \NeonXP\DozorApi($cache); $telegram->setCache($cache); $telegram->setScript(\NeonXP\BotScript::getScript($telegram, $dozorApi)); while(1) { $telegram->handleGetUpdates(); sleep(1); } } else { $cache = new \Doctrine\Common\Cache\ApcuCache(); $dozorApi = new \NeonXP\DozorApi($cache); $telegram->setCache($cache); $telegram->setScript(\NeonXP\BotScript::getScript($telegram, $dozorApi)); $telegram->handleWebhook(); }