Skip to content

Instantly share code, notes, and snippets.

@boffbowsh
Created January 8, 2009 12:55
Show Gist options
  • Save boffbowsh/44720 to your computer and use it in GitHub Desktop.
Save boffbowsh/44720 to your computer and use it in GitHub Desktop.
Bootstrapping Kohana to just use it's libraries
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