Changeset 1735

Show
Ignore:
Timestamp:
01/20/2008 09:20:15 AM (12 months ago)
Author:
Shadowhand
Message:

Fixing #326.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/core/Kohana.php

    r1720 r1735  
    380380                ); 
    381381 
    382                 if ($level = Config::item('core.output_compression')) 
     382                if (ini_get('output_handler') != 'ob_gzhandler' AND ini_get('zlib.output_compression') == 0 AND $level = Config::item('core.output_compression')) 
    383383                { 
    384384                        if ($level < 1 OR $level > 9) 
     
    582582        public static function auto_load($class) 
    583583        { 
     584                static $prefix; 
     585 
     586                // Set the extension prefix 
     587                empty($prefix) and $prefix = Config::item('core.extension_prefix'); 
     588 
    584589                if (class_exists($class, FALSE)) 
    585590                        return TRUE; 
    586591 
    587                 $type = strrpos($class, '_'); 
    588  
    589                 if ($type !== FALSE) 
    590                 { 
     592                if (($type = strrpos($class, '_')) !== FALSE) 
     593                { 
     594                        // Find the class suffix 
    591595                        $type = substr($class, $type + 1); 
    592596                } 
     
    630634                if ($type === 'libraries' OR $type === 'helpers') 
    631635                { 
    632                         if ($extension = self::find_file($type, Config::item('core.extension_prefix').$class)) 
    633                         { 
    634                                 require $extension; 
    635                         } 
    636                         elseif (substr($class, -5) !== '_Core' AND class_exists($class.'_Core', TRUE)) 
    637                         { 
     636                        if ($extension = self::find_file($type, $prefix.$class)) 
     637                        { 
     638                                // Load the class extension 
     639                                require_once $extension; 
     640                        } 
     641                        elseif (substr($class, -5) !== '_Core' AND class_exists($class.'_Core', FALSE)) 
     642                        { 
     643                                // Transparent class extensions are handled using eval. This is 
     644                                // a disgusting hack, but it works very well. 
    638645                                eval('class '.$class.' extends '.$class.'_Core { }'); 
    639646                        }