src/AppBundle/Twig/LiveExtension.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Twig;
use Biz\CloudPlatform\Client\CloudAPIIOException;
use Biz\File\Service\UploadFileService;
use Biz\Util\EdusohoLiveClient;
use Codeages\Biz\Framework\Context\Biz;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Biz\Course\Service\LiveReplayService;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class LiveExtension extends \Twig_Extension
{
/**
* @var ContainerInterface
*/
protected $container;
/**
* @var Biz
*/
protected $biz;
public function __construct(ContainerInterface $container, Biz $biz)
{
$this->container = $container;
$this->biz = $biz;
}
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('live_can_record', array($this, 'canRecord')),
new \Twig_SimpleFunction('is_live_finished', array($this, 'isLiveFinished')),
new \Twig_SimpleFunction('get_live_room_type', array($this, 'getLiveRoomType')),
new \Twig_SimpleFunction('get_live_account', array($this, 'getLiveAccount')),
new \Twig_SimpleFunction('get_live_replays', array($this, 'getLiveReplays')),
new \Twig_SimpleFunction('fresh_task_learn_stat', array($this, 'freshTaskLearnStat')),
);
}
public function freshTaskLearnStat(Request $request, $activityId)
{
$key = 'activity.'.$activityId;
$session = $request->getSession();
$taskStore = $session->get($key, array());
$taskStore['start'] = time();
$taskStore['lastTriggerTime'] = 0;
$session->set($key, $taskStore);
return true;
}
public function getLiveReplays($activityId)
{
$activity = $this->getActivityService()->getActivity($activityId, true);
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。