-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDefaultController.php
More file actions
139 lines (122 loc) · 4.8 KB
/
DefaultController.php
File metadata and controls
139 lines (122 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends AbstractController
{
/**
* @Route("/", name="index")
*/
public function indexAction(): Response
{
return $this->render('default/index.html.twig', [
'active_tab' => 'index',
]);
}
/**
* @Route("/stats/", name="stats")
*/
public function statsAction(\App\TrackerChartFactory $factory): Response
{
$trackerStart = new \DateTime('2006-01-01T00:00:00+00:00');
$ascraeusCreatedVsResolved = $factory->create()
->selectAscraeus()
->createdVsResolved()
->daysSince($trackerStart)
->quarterly()
->cumulative(true)
->showUnresolvedTrend()
->get();
$ascraeusAvgAge = $factory->create()
->selectAscraeus()
->averageAge()
->daysSince($trackerStart)
->monthly()
->get();
$rheaCreatedVsResolved = $factory->create()
->selectRhea()
->createdVsResolved()
->daysSince($trackerStart)
->quarterly()
->cumulative(true)
->showUnresolvedTrend()
->get();
$rheaAvgAge = $factory->create()
->selectRhea()
->averageAge()
->daysSince($trackerStart)
->monthly()
->get();
$proteusCreatedVsResolved = $factory->create()
->selectProteus()
->createdVsResolved()
->daysSince($trackerStart)
->quarterly()
->cumulative(true)
->showUnresolvedTrend()
->get();
$proteusAvgAge = $factory->create()
->selectProteus()
->averageAge()
->daysSince($trackerStart)
->monthly()
->get();
return $this->render('default/stats.html.twig', [
'active_tab' => 'stats',
'ascraeus_created_vs_resolved' => $ascraeusCreatedVsResolved,
'ascraeus_avg_age' => $ascraeusAvgAge,
'rhea_created_vs_resolved' => $rheaCreatedVsResolved,
'rhea_avg_age' => $rheaAvgAge,
'proteus_created_vs_resolved' => $proteusCreatedVsResolved,
'proteus_avg_age' => $proteusAvgAge,
]);
}
/**
* @Route("/projects/", name="projects")
*/
public function projectsAction(): Response
{
return $this->render('default/projects.html.twig', [
'active_tab' => 'projects',
]);
}
/**
* @Route("/docs{path}", requirements={"path"=".*"}, defaults={"path"=""})
*/
public function docsRedirectAction($path): RedirectResponse
{
if (str_starts_with($path, '/3')) {
return $this->redirect('http://area51.phpbb.com/docs/30x'.$path, 301);
}
return $this->redirect($this->generateUrl('index'), 301);
}
/**
* @Route("/downloads/", name="downloads")
*/
public function downloadsAction(): Response
{
// Make this false when the most recent release is not an RC/Alpha/Beta
$latestDevelopment = true;
$previousVersions = ['3.3.14', '3.3.13', '3.3.12', '3.3.11', '3.3.10', '3.3.9', '3.3.8', '3.3.7', '3.3.6', '3.3.5', '3.3.4', '3.3.3', '3.3.2', '3.3.1', '3.3.0', '3.2.10', '3.2.9', '3.2.8', '3.2.7', '3.2.6', '3.2.5', '3.2.4', '3.2.3', '3.2.2', '3.2.1', '3.2.0', '3.1.12', '3.1.11', '3.1.10', '3.1.9', '3.1.8', '3.1.7-pl1', '3.1.6', '3.1.5', '3.1.4', '3.1.3', '3.1.2', '3.1.1', '3.1.0'];
$currentVersion = '3.3.15-RC1';
$mainPackageSha = 'c92312e28db0000fffa5d25acb73ff1fca967997aea2ca3754d515497cd25a82';
$currentBranch = '3.3/unstable';
$currentVersionFiles = 'https://download.phpbb.com/pub/release/' . $currentBranch
. '/' . $currentVersion . '/';
$currentUpgradeFiles = 'https://download.phpbb.com/pub/release/' . $currentBranch
. '/' . $currentVersion . '/';
return $this->render('default/downloads.html.twig', [
'active_tab' => 'downloads',
'later' => false,
'latestDevelopment' => $latestDevelopment,
'previousVersions' => $previousVersions,
'currentVersion' => $currentVersion,
'currentVersionFiles' => $currentVersionFiles,
'currentUpgradeFiles' => $currentUpgradeFiles,
'mainPackageSha' => $mainPackageSha,
]);
}
}