Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 24
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
installer_index
0.00% covered (danger)
0.00%
0 / 24
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 handle
0.00% covered (danger)
0.00%
0 / 19
0.00% covered (danger)
0.00%
0 / 1
20
1<?php
2/**
3 *
4 * This file is part of the phpBB Forum Software package.
5 *
6 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7 * @license GNU General Public License, version 2 (GPL-2.0)
8 *
9 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14namespace phpbb\install\controller;
15
16use phpbb\path_helper;
17
18class installer_index
19{
20    /**
21     * @var helper
22     */
23    protected $helper;
24
25    /**
26     * @var \phpbb\language\language
27     */
28    protected $language;
29
30    /** @var path_helper */
31    protected $path_helper;
32
33    /**
34     * @var \phpbb\template\template
35     */
36    protected $template;
37
38    /**
39     * @var string
40     */
41    protected $phpbb_root_path;
42
43    /**
44     * Constructor
45     *
46     * @param helper                     $helper
47     * @param \phpbb\language\language    $language
48     * @param path_helper                $path_helper
49     * @param \phpbb\template\template    $template
50     * @param string                    $phpbb_root_path
51     */
52    public function __construct(helper $helper, \phpbb\language\language $language, path_helper $path_helper, \phpbb\template\template $template, $phpbb_root_path)
53    {
54        $this->helper = $helper;
55        $this->language = $language;
56        $this->path_helper = $path_helper;
57        $this->template = $template;
58        $this->phpbb_root_path = $phpbb_root_path;
59    }
60
61    public function handle($mode)
62    {
63        $this->helper->handle_language_select();
64
65        switch ($mode)
66        {
67            case "intro":
68                $title = $this->language->lang('INTRODUCTION_TITLE');
69                $install_docs_path = $this->path_helper->update_web_root_path($this->phpbb_root_path . 'docs/INSTALL.html');
70                $body = $this->language->lang('INTRODUCTION_BODY', $install_docs_path);
71            break;
72            case "support":
73                $title = $this->language->lang('SUPPORT_TITLE');
74                $body = $this->language->lang('SUPPORT_BODY');
75            break;
76            case "license":
77                $title = $this->language->lang('LICENSE_TITLE');
78                $body = implode("<br/>\n", file($this->phpbb_root_path . 'docs/LICENSE.txt'));
79            break;
80        }
81
82        $this->template->assign_vars(array(
83            'TITLE'    => $title,
84            'BODY'    => $body,
85        ));
86
87        return $this->helper->render('installer_main.html', $title, true);
88    }
89}