47 lines
931 B
PHP
47 lines
931 B
PHP
<?php
|
|
/**
|
|
* Copyright since 2024 Webshop System
|
|
*
|
|
* Zentrale Registry für den aktuellen Webshop-Kontext (User, Shop, Sprache, etc.)
|
|
*
|
|
* @author Webshop System
|
|
* @license GPL v3
|
|
*/
|
|
|
|
class Context
|
|
{
|
|
/** @var Context */
|
|
protected static $instance;
|
|
|
|
/** @var Shop */
|
|
public $shop;
|
|
/** @var Language */
|
|
public $language;
|
|
/** @var Country */
|
|
public $country;
|
|
/** @var Configuration */
|
|
public $configuration;
|
|
/** @var Cookie */
|
|
public $cookie;
|
|
/** @var Session */
|
|
public $session;
|
|
/** @var array */
|
|
public $controller;
|
|
|
|
private function __construct()
|
|
{
|
|
// Initialisierung erfolgt später
|
|
}
|
|
|
|
/**
|
|
* Singleton-Instanz holen
|
|
* @return Context
|
|
*/
|
|
public static function getContext()
|
|
{
|
|
if (!isset(self::$instance)) {
|
|
self::$instance = new Context();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
}
|