Skip to content

Instantly share code, notes, and snippets.

@cloudmanic
Created December 21, 2011 22:37
Show Gist options
  • Save cloudmanic/1508036 to your computer and use it in GitHub Desktop.
Save cloudmanic/1508036 to your computer and use it in GitHub Desktop.
autoloader in CI
/*
| -------------------------------------------------------------------
| Native Auto-load
| -------------------------------------------------------------------
|
| Nothing to do with cnfig/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
*/
function __autoload($class)
{
if((strpos($class, 'CI_') !== 0) && (strpos($class, 'MY_') !== 0))
{
switch($class)
{
case 'CMS_Controller':
//include_once(SPARKPATH . 'cloudmanic-api/1.0.0/libraries/'. $class . EXT);
include_once(APPPATH . 'third_party/sigcms/libraries/'. $class . EXT);
break;
default:
@include_once(APPPATH . 'core/'. $class . EXT);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment