Changeset 1735
- Timestamp:
- 01/20/2008 09:20:15 AM (12 months ago)
- Files:
-
- 1 modified
-
trunk/system/core/Kohana.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r1720 r1735 380 380 ); 381 381 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')) 383 383 { 384 384 if ($level < 1 OR $level > 9) … … 582 582 public static function auto_load($class) 583 583 { 584 static $prefix; 585 586 // Set the extension prefix 587 empty($prefix) and $prefix = Config::item('core.extension_prefix'); 588 584 589 if (class_exists($class, FALSE)) 585 590 return TRUE; 586 591 587 $type = strrpos($class, '_'); 588 589 if ($type !== FALSE) 590 { 592 if (($type = strrpos($class, '_')) !== FALSE) 593 { 594 // Find the class suffix 591 595 $type = substr($class, $type + 1); 592 596 } … … 630 634 if ($type === 'libraries' OR $type === 'helpers') 631 635 { 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. 638 645 eval('class '.$class.' extends '.$class.'_Core { }'); 639 646 }
