1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2014 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic |
||
6 | * |
||
7 | * @link http://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\ConfigBundle\Controller; |
||
13 | |||
14 | use Mautic\CoreBundle\Controller\FormController; |
||
15 | use Symfony\Component\HttpFoundation\JsonResponse; |
||
16 | |||
17 | /** |
||
18 | * Class SysinfoController. |
||
19 | */ |
||
20 | class SysinfoController extends FormController |
||
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
21 | { |
||
22 | /** |
||
23 | * @param int $page |
||
24 | * |
||
25 | * @return JsonResponse|\Symfony\Component\HttpFoundation\Response |
||
26 | */ |
||
27 | public function indexAction($page = 1) |
||
28 | { |
||
29 | if (!$this->user->isAdmin() || $this->coreParametersHelper->get('sysinfo_disabled')) { |
||
30 | return $this->accessDenied(); |
||
31 | } |
||
32 | |||
33 | /** @var \Mautic\ConfigBundle\Model\SysinfoModel $model */ |
||
34 | $model = $this->getModel('config.sysinfo'); |
||
35 | $phpInfo = $model->getPhpInfo(); |
||
36 | $folders = $model->getFolders(); |
||
37 | $log = $model->getLogTail(40); |
||
38 | |||
39 | return $this->delegateView([ |
||
40 | 'viewParameters' => [ |
||
41 | 'phpInfo' => $phpInfo, |
||
42 | 'folders' => $folders, |
||
43 | 'log' => $log, |
||
44 | ], |
||
45 | 'contentTemplate' => 'MauticConfigBundle:Sysinfo:index.html.php', |
||
46 | 'passthroughVars' => [ |
||
47 | 'activeLink' => '#mautic_sysinfo_index', |
||
48 | 'mauticContent' => 'sysinfo', |
||
49 | 'route' => $this->generateUrl('mautic_sysinfo_index'), |
||
50 | ], |
||
51 | ]); |
||
52 | } |
||
53 | } |
||
54 |