Guest User

Untitled

a guest
Jan 22nd, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. <?php
  2.  
  3. class Contaolove extends Controller
  4. {
  5.     /**
  6.      * Current object instance (Singleton)
  7.      * @var object
  8.      */
  9.     protected static $objInstance;
  10.  
  11.  
  12.     /**
  13.      * Contaolove configuration
  14.      * @var object
  15.      */
  16.     public $Config;
  17.  
  18.  
  19.     /**
  20.      * Contaolove image
  21.      * @var object
  22.      */
  23.     public $Image;
  24.  
  25.  
  26.     /**
  27.      * Set up Contaolove load configuration and image class.
  28.      */
  29.     protected function __construct()
  30.     {
  31.         parent::__construct();
  32.         $this->import('Database');
  33.         $this->import('FrontendUser', 'User');
  34.  
  35.         $this->setConfiguration();
  36.  
  37.         // Init Image after loading configuration
  38.         if (TL_MODE == 'FE')
  39.         {
  40.             $this->Image = new CvImage();
  41.         }
  42.     }
  43.  
  44.  
  45.     /**
  46.      * Prevent cloning of the object (Singleton)
  47.      */
  48.     final private function __clone() {}
  49.  
  50.  
  51.     /**
  52.      * Instantiate a Contaolove object and return it (Factory)
  53.      * @return object
  54.      */
  55.     public static function getInstance()
  56.     {
  57.         if (!is_object(self::$objInstance))
  58.         {
  59.             self::$objInstance = new Contaolove();
  60.         }
  61.  
  62.         return self::$objInstance;
  63.     }
  64.  
  65.  
  66.     /**
  67.      * Set configuration
  68.      * @return void
  69.      */
  70.     public function setConfiguration($intConfiguration)
  71.     {
  72.         $this->Config = new CvConfig((int)$intConfiguration);
  73.     }
  74. }
  75.  
  76. ?>
Add Comment
Please, Sign In to add comment