Changeset 2569

Show
Ignore:
Timestamp:
04/24/2008 10:38:16 PM (6 months ago)
Author:
Shadowhand
Message:

Slightly more logical organization of code.

Files:
1 modified

Legend:

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

    r2567 r2569  
    3434        public static function setup() 
    3535        { 
     36                if ( ! empty($_SERVER['QUERY_STRING'])) 
     37                { 
     38                        // Set the query string to the current query string 
     39                        self::$query_string = '?'.trim($_SERVER['QUERY_STRING'], '&'); 
     40                } 
     41 
     42                // Load routing configuration 
    3643                self::$routes = Config::item('routes'); 
    37  
    38                 // Make sure the default route is set 
    39                 if ( ! isset(self::$routes['_default'])) 
    40                         throw new Kohana_Exception('core.no_default_route'); 
    4144 
    4245                // Default route status 
     
    4548                if (self::$current_uri === '') 
    4649                { 
     50                        // Make sure the default route is set 
     51                        if ( ! isset(self::$routes['_default'])) 
     52                                throw new Kohana_Exception('core.no_default_route'); 
     53 
    4754                        // Use the default route when no segments exist 
    4855                        self::$current_uri = self::$routes['_default']; 
     
    5461                // Make sure the URL is not tainted with HTML characters 
    5562                self::$current_uri = html::specialchars(self::$current_uri, FALSE); 
    56  
    57                 if ( ! empty($_SERVER['QUERY_STRING'])) 
    58                 { 
    59                         // Set the query string to the current query string 
    60                         self::$query_string = '?'.trim($_SERVER['QUERY_STRING'], '&'); 
    61                 } 
    6263 
    6364                // At this point segments, rsegments, and current URI are all the same