Start stubbing out the design doc interfaces
[hoplite.git] / http / root_controller.php
1 <?php
2 // Hoplite
3 // Copyright (c) 2011 Blue Static
4 //
5 // This program is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by the Free
7 // Software Foundation, either version 3 of the License, or any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 // more details.
13 //
14 // You should have received a copy of the GNU General Public License along with
15 // this program. If not, see <http://www.gnu.org/licenses/>.
16
17 namespace hoplite\http;
18
19 /*!
20 The RootController is meant to be invoked from the index.php of the
21 application.
22 */
23 class RootController
24 {
25 /*!
26 Creates the controller with the request context information, typicallhy
27 from the global scope ($GLOBALS), but can be injected for testing.
28 @param globals
29 */
30 public function __construct($globals)
31 {}
32
33 /*!
34 Createst the Request and Response that are used throughout the duration of
35 the execution.
36 */
37 public function Run()
38 {}
39
40 /*!
41 Prevents any other Actions from executing. This starts the OutputFilter and
42 then exits.
43 */
44 public function Stop()
45 {}
46
47 /*!
48 Invoked by Run() and can be invoked by others to evaluate and perform the
49 lookup in the UrlMap. This then calls InvokeAction().
50 @param string The URL fragment to look up in the
51 */
52 public function RouteRequest($url_fragment)
53 {}
54
55 /*!
56 Used to run an Action and drive it through its states.
57 @param Action
58 */
59 public function InvokeAction(Action $action)
60 {}
61
62 /*!
63 Performs a reverse-lookup in the UrlMap for the pattern/fragment for the
64 name of a given Action class.
65 @param string Class name.
66 */
67 public function LookupAction($class)
68 {}
69 }