From 64f993db6f70554d5dd0e3fe2db672abc4e971de Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 20 Dec 2008 07:38:46 +0000 Subject: Update modified to Kohana r3823 (svn merge -c19322 vendor/kohana/modified/kohana trunk/kohana) --- kohana/core/Bootstrap.php | 4 ++-- kohana/core/Kohana.php | 52 ++++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 27 deletions(-) (limited to 'kohana/core') diff --git a/kohana/core/Bootstrap.php b/kohana/core/Bootstrap.php index 6b2aefaa..57db1648 100644 --- a/kohana/core/Bootstrap.php +++ b/kohana/core/Bootstrap.php @@ -10,8 +10,8 @@ * @license http://kohanaphp.com/license.html */ -define('KOHANA_VERSION', '2.2'); -define('KOHANA_CODENAME', 'efĂ­mera'); +define('KOHANA_VERSION', '2.3'); +define('KOHANA_CODENAME', 'accipiter'); // Test of Kohana is running in Windows define('KOHANA_IS_WIN', DIRECTORY_SEPARATOR === '\\'); diff --git a/kohana/core/Kohana.php b/kohana/core/Kohana.php index e6bfb3f1..c4812e63 100644 --- a/kohana/core/Kohana.php +++ b/kohana/core/Kohana.php @@ -975,37 +975,39 @@ final class Kohana { $file = $class; } - if (($filepath = self::find_file($type, $file)) === FALSE) + if ($filename = self::find_file($type, $file)) + { + // Load the class + require $filename; + } + else + { + // The class could not be found return FALSE; + } - // Load the file - require $filepath; - - if ($type === 'libraries' OR $type === 'helpers') + if ($filename = self::find_file($type, self::$configuration['core']['extension_prefix'].$class)) { - if ($extension = self::find_file($type, self::$configuration['core']['extension_prefix'].$class)) - { - // Load the extension - require $extension; - } - elseif ($suffix !== 'Core' AND class_exists($class.'_Core', FALSE)) - { - // Class extension to be evaluated - $extension = 'class '.$class.' extends '.$class.'_Core { }'; - - // Start class analysis - $core = new ReflectionClass($class.'_Core'); + // Load the class extension + require $filename; + } + elseif ($suffix !== 'Core' AND class_exists($class.'_Core', FALSE)) + { + // Class extension to be evaluated + $extension = 'class '.$class.' extends '.$class.'_Core { }'; - if ($core->isAbstract()) - { - // Make the extension abstract - $extension = 'abstract '.$extension; - } + // Start class analysis + $core = new ReflectionClass($class.'_Core'); - // Transparent class extensions are handled using eval. This is - // a disgusting hack, but it gets the job done. - eval($extension); + if ($core->isAbstract()) + { + // Make the extension abstract + $extension = 'abstract '.$extension; } + + // Transparent class extensions are handled using eval. This is + // a disgusting hack, but it gets the job done. + eval($extension); } return TRUE; -- cgit v1.2.3