PATH:
home
/
letacommog
/
letaweb
/
admin
/
classes
/
components
<?php class contextComponent extends CApplicationComponent { protected static $instance; public $values = array(); public function __construct() { $current_dir = Yii::app()->url->get_current_dir(); $website_name = basename($current_dir); $parent_website_path = dirname($current_dir); $website_type = basename($parent_website_path); $this->__set('base_website_name', $website_name); $this->__set('website_name', $website_name); $this->__set('website_type', $website_type); } public static function getContext() { $c = '__'.get_called_class().'__instance'; if (!isset(self::$instance)) { self::$instance = new Context(); //$_SESSION[$c] = self::$instance; } return self::$instance; } public function cloneContext() { return clone($this); } public function __get($key) { $c = '__'.get_class($this).'__'.$key; return isset($this->values[$key]) ? $this->values[$key] : false; } public function __isset($key) { $c = '__'.get_class($this).'__'.$key; if (isset($this->values[$key])) { return true; } if (isset($_SESSION[$c])) { //return true; } return false; } public function __set($key, $value) { $c = '__'.get_class($this).'__'.$key; // $_SESSION[$c] = $value; $c = '__'.get_called_class().'__instance'; $this->values[$key] = $value; //$_SESSION[$c] = $this; //self::$instance = $this; } public function __unset($key) { $c = '__'.get_class($this).'__'.$key; // $_SESSION[$c] = $value; $c = '__'.get_called_class().'__instance'; unset($this->values[$key]); //$_SESSION[$c] = $this; //self::$instance = $this; } }
[+]
..
[-] colorComponent.php
[edit]
[-] authorizationComponent.php
[edit]
[-] hostingComponent.php
[edit]
[-] configComponent.php
[edit]
[-] siteComponent.php
[edit]
[-] urlComponent.php
[edit]
[-] paymentComponent.php
[edit]
[-] authManager.php
[edit]
[-] guestComponent.php
[edit]
[-] cmsComponent.php
[edit]
[-] languageComponent.php
[edit]
[-] contextComponent.php
[edit]
[-] cartComponent.php
[edit]
[-] customerComponent.php
[edit]