aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/extension/controller.php
blob: 6e47948156caedd9ad854e18084b9ffef3e2d456 (plain)
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
<?php
/**
*
* @package extension
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Abstract class extended by extension front controller classes
*
* @package extension
*/
abstract class phpbb_extension_controller implements phpbb_extension_controller_interface
{
	/**
	* @var phpbb_request Request class object
	*/
	protected $request;

	/**
	* @var dbal DBAL class object
	*/
	protected $db;

	/**
	* @var user User class object
	*/
	protected $user;

	/**
	* @var phpbb_template Template class object
	*/
	protected $template;

	/**
	* @var array Config array
	*/
	protected $config;

	/**
	* @var string PHP Extension
	*/
	protected $phpEx;

	/**
	* @var string Relative path to board root
	*/
	protected $phpbb_root_path;

	/**
	* Constructor method that provides the common phpBB objects as inherited class
	* properties for automatic availability in extension controllers
	*/
	function __construct()
	{
		global $request, $db, $user, $template, $config;
		global $phpEx, $phpbb_root_path;

		$this->request = $request;
		$this->db = $db;
		$this->user = $user;
		$this->template = $template;
		$this->config = $config;
		$this->phpEx = $phpEx;
		$this->phpbb_root_path = $phpbb_root_path;
	}

	/**
	* Handle the request to display a page from an extension
	*
	* @return	null
	*/
	abstract public function handle();
}