Revision 333133363533 () - Diff

Link to this snippet: https://friendpaste.com/5Shdqz44xBlOnq4LsDdE2g
Embed:
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
<?php
class test
{
private static $instance = null;
public $dispatcher;
public function __construct()
{
$this->dispatcher = new testclass();
}

public static function get_instance()
{
if (is_null(self::$instance))
{
self::$instance = new test();
}
return self::$instance;
}

public function serve()
{
$this->dispatcher->test();
}
}

class testclass
{
private $request_config;
public function __construct()
{
$this->request_config = $this->get_midgard_connection()->get_request_config();
}

public function get_midgard_connection()
{
return midgard_connection::get_instance();
}

public function test()
{
$host = $this->request_config->get_host();
foreach ($this->request_config->get_pages() as $page)
{
var_dump($page);
}
}
}

test::get_instance()->serve();

?>