ecom
E-commerce cms
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
home
isundil
Project
ecom
core
tools
Context.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Tools
;
4
10
class
Context
11
{
18
private
$hookManager
;
19
26
private
$moduleManager
;
27
35
private
$router
;
36
44
private
$cart
;
45
52
private
$user
;
53
59
private
$controller
;
60
65
public
function
__construct
()
66
{
67
$this->hookManager =
new
Hooks
($this);
68
$this->router =
new
Router
($this);
69
if
(!\
Entity
\ModelBase::init())
70
{
71
@require_once(getcwd().
'/core/setup/index.php'
);
72
die;
73
}
74
$this->router->init();
75
$this->moduleManager =
new
ModuleManager
($this);
76
$this->hookManager->trigger(
"routerSetup"
);
77
try
78
{
79
$this->controller = $this->router->serveUrl();
80
if
(!$this->controller)
81
throw
new \Exception\Error404();
82
$this->controller->start();
83
}
84
catch
(\
Exception
\Error404 $e)
85
{
86
echo
"404"
;
87
}
88
}
89
93
public
function
__get
($key)
94
{
95
switch
($key)
96
{
97
case
"router"
:
return
$this->router;
break
;
98
case
"cart"
:
return
$this->cart;
break
;
99
case
"user"
:
return
$this->user;
break
;
100
case
"moduleManager"
:
return
$this->moduleManager;
break
;
101
case
"hookManager"
:
return
$this->hookManager;
break
;
102
}
103
throw
new \Exception(
"Cannot access attribute {$key}"
);
104
}
105
}
106
Tools\Context\$user
$user
Definition:
Context.php:52
Tools\Context\__construct
__construct()
Definition:
Context.php:65
Tools\Context\$cart
$cart
Definition:
Context.php:44
Entity
Definition:
Address.php:3
Tools\ModuleManager
Definition:
ModuleManager.php:9
Tools\Context\$hookManager
$hookManager
Definition:
Context.php:18
Tools\Context\$moduleManager
$moduleManager
Definition:
Context.php:26
Exception
Definition:
Error404.php:3
Tools\Router
Definition:
Router.php:9
Tools\Context\$router
$router
Definition:
Context.php:35
Tools\Context
Definition:
Context.php:10
Tools\Context\__get
__get($key)
Definition:
Context.php:93
Tools\Context\$controller
$controller
Definition:
Context.php:59
Tools\Hooks
Definition:
Hooks.php:8
Tools
Definition:
AController.php:3
Generated on Tue Aug 4 2015 00:33:19 for ecom by
1.8.8