Created
December 21, 2011 22:37
-
-
Save cloudmanic/1508036 to your computer and use it in GitHub Desktop.
autoloader in CI
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
/* | |
| ------------------------------------------------------------------- | |
| 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