ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Private Attributes
Context Class Reference

Public Member Functions

 __construct ()
 
 __get ($key)
 

Private Attributes

 $hookManager
 
 $moduleManager
 
 $router
 
 $cart
 
 $user
 
 $controller
 

Detailed Description

Cms context Contains all website informations Will be passed to themes files and to modules

Definition at line 10 of file Context.php.

Constructor & Destructor Documentation

__construct ( )

Create context from $_SERVER environment and initialize all data

Definition at line 65 of file Context.php.

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  }

Member Function Documentation

__get (   $key)

Getter function

Definition at line 93 of file Context.php.

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  }

Field Documentation

Tools Cart $cart
private

TODO

/core/tools/Cart.php Not defined yet Can be accessed read-only via $instance->cart

Definition at line 44 of file Context.php.

Tools AController $controller
private

/core/tools/AController.php Controller being called by user's request

Definition at line 59 of file Context.php.

Tools Hooks $hookManager
private

/core/tools/Hooks.php allow triggering hooks and registers module's endpoints Can be accessed read-only via $instance->hookManager

Definition at line 18 of file Context.php.

Tools ModuleManager $moduleManager
private

/core/tools/ModuleManager.php load all active modules and contains informations about them Can be accessed read-only via $instance->moduleManager

Definition at line 26 of file Context.php.

Tools Router $router
private

/core/tools/Router.php Contains information about directories and paths Allow user to generate links Can be accessed read-only via $instance->router

Definition at line 35 of file Context.php.

Tools User $user
private

TODO

/core/tools/User.php Can be accessed read-only via $instance->user

Definition at line 52 of file Context.php.


The documentation for this class was generated from the following file: