1 : <?php
2 :
3 : /**
4 : * Dictionaries of Old French and Latin
5 : *
6 : * PHP 5
7 : *
8 : * @category Application
9 : * @package DicFro
10 : * @author Michel Corne <mcorne@yahoo.com>
11 : * @copyright 2008-2010 Michel Corne
12 : * @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License, version 3 (GPLv3)
13 : * @link http://www.micmap.org/dicfro
14 : */
15 :
16 : require_once 'Engine/Front.php';
17 : require_once 'Engine/View.php';
18 :
19 : /**
20 : * Runs the application
21 : *
22 : * @category Application
23 : * @package DicFro
24 : * @author Michel Corne <mcorne@yahoo.com>
25 : * @copyright 2008-2010 Michel Corne
26 : * @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License, version 3 (GPLv3)
27 : */
28 :
29 : class Engine_Application
30 : {
31 : /**
32 : * The name of the file containing the configuration directives
33 : * @var string
34 : */
35 : public $configFile = null;
36 :
37 : /**
38 : * Constructor
39 : *
40 : * @param string $configFile the name of the file containing the configuration directives
41 : * @return void
42 : */
43 : public function __construct($configFile)
44 : {
45 0 : $this->configFile = $configFile;
46 0 : }
47 :
48 : /**
49 : * Runs the application
50 : *
51 : * @return void
52 : */
53 : public function run()
54 : {
55 : // reads the configuration directives
56 0 : $config = require $this->configFile;
57 :
58 : // creates the view and the front controller
59 0 : $view = new Engine_View($config);
60 0 : $front = new Engine_Front($config, $view);
61 :
62 : // runs the front controller and renders the view
63 0 : $front->run();
64 0 : $view->render();
65 0 : }
66 : }
|