Show
Ignore:
Timestamp:
01/20/2008 05:14:16 PM (12 months ago)
Author:
Shadowhand
Message:

Follow up to r1753:

  • Removed URI::construct()
  • Loader, URI, and Input will only be loaded for the first Controller
  • Slight optimizations to Kohana::instance()
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Controller.php

    r1753 r1754  
    1010class Controller_Core { 
    1111 
    12         // Always loaded libraries 
    13         public $load; 
    14         public $uri; 
    15         public $input; 
    16  
    1712        /** 
    1813         * Constructor: __construct 
     
    2116        public function __construct() 
    2217        { 
    23                 if (Kohana::$instance == FALSE) 
     18                if (empty(Kohana::$instance)) 
    2419                { 
     20                        // Set the instance to the first controller loaded 
    2521                        Kohana::$instance = $this; 
     22 
     23                        // Loader should always be available 
     24                        $this->load = new Loader; 
     25 
     26                        // URI should always be available 
     27                        $this->uri = new URI; 
     28 
     29                        // Input should always be available 
     30                        $this->input = new Input; 
    2631                } 
    27  
    28                 // Loader should always be available 
    29                 $this->load = new Loader(); 
    30  
    31                 // URI should always be available 
    32                 $this->uri = new URI(); 
    33  
    34                 // Input should always be available 
    35                 $this->input = new Input(); 
    3632        } 
    3733