require_once not throwing any errors - white screen of death
I'm trying to load models via the following function.... I'm running into an issue where require_once is killing the page. The following code does NOT echo "not there", meaning the file must exist.
protected function modelFactory ($model, $input = array()) {
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
require_once APPPATH.'models/'.str_replace('.', '/', strtolower($model)).'.php';
exit('test'); //doesn't show, but if it's above require_once it does...
$class = str_replace('.', '', $model).'Model';
return new $class($input);
}
I can't think of what could be supressin开发者_开发技巧g any error messages coming out of this function that's preventing the rest of the page from loading
The exit keyword will prevent the program from running.
http://php.net/manual/en/function.exit.php
Turns out... the class I was loading is built to extend another class which wasn't loaded on the page. I'm still unsure why it didn't throw any errors...
精彩评论