1 : <?php
2 : namespace phMagick\Core;
3 :
4 : class System
5 : {
6 : private $actions = array();
7 : private $runner = null;
8 : private $settings = null;
9 : private $logger = null;
10 :
11 : public function getRunner()
12 : {
13 1 : $settings = $this->getSettings();
14 1 : $logger = $this->getLogger();
15 1 : $runner = $this->getVar('runner');
16 :
17 1 : $runner->debug($settings->isDebug());
18 1 : $runner->setLogger($logger);
19 1 : return $runner;
20 : }
21 :
22 : public function getLogger()
23 : {
24 2 : return $this->getVar('logger');
25 : }
26 :
27 : public function getSettings()
28 : {
29 2 : $settings = $this->getVar('settings');
30 2 : return $settings->getInstance();
31 : }
32 :
33 : private function getVar($name) {
34 3 : if (is_null($this->$name)) {
35 3 : $class = 'phMagick\Core\\' . ucfirst($name);
36 3 : $this->$name = &new $class();
37 3 : }
38 :
39 3 : return $this->$name;
40 : }
41 :
42 : /**
43 : * Adds an action to the action stack
44 : * @param Action $action
45 : */
46 : public function add(Action $action)
47 : {
48 : $this->actions[] = $action;
49 : }
50 :
51 : /**
52 : *
53 : * Executes the actions on the stack
54 : * destination of one action becomes the source of another action, so we
55 : * can chain several actions together
56 : */
57 : public function execute()
58 : {
59 :
60 : }
|