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.

37 lines
839 B
PHP

<?php
namespace Eater\Glim\Handler;
use Eater\Glim\Model\ServerQuery;
use Eater\Glim\Service\GitHub;
class Home extends Session
{
protected $shouldHaveUser = false;
function handle()
{
/** @var GitHub $github */
$github = $this->get('github');
/** @var string $repo */
$repo = $this->get('github-repo');
/** @var string $author */
$author = $this->get('author');
$info = $github->getRepoInfo();
if ($info !== false) {
$author = $info['owner']['login'];
}
return $this->render("home.html.twig", [
'author' => $author,
'contributors' => $github->getContributors(),
'githubRepo' => $repo,
'serverCount' => ServerQuery::create()->findByStatus('signed')->count()
]);
}
}