Created
January 8, 2009 12:55
-
-
Save boffbowsh/44720 to your computer and use it in GitHub Desktop.
Bootstrapping Kohana to just use it's libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __autoload( $sClass ) | |
{ | |
// Your own autoload code goes here | |
// Failed to load, try Kohana's autoloader | |
// Bootstrap it first | |
if ( !defined('SYSPATH') ) | |
{ | |
define('SYSPATH', ROOT.'kohana/system/'); | |
define('APPPATH', ROOT.'kohana/application/'); | |
define('EXT', '.php'); | |
require_once( SYSPATH.'core/Kohana'.EXT ); | |
require_once( SYSPATH.'core/utf8'.EXT ); | |
require_once( SYSPATH.'core/Event'.EXT ); | |
Kohana::config('core'); | |
Kohana::include_paths(true); | |
} | |
if ( Kohana::auto_load( $sClass ) ) | |
return true; | |
if ( Kohana::auto_load( "{$sClass}_Core" ) ) | |
return true; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment