adjusted autoloader priority for best performance.
This commit is contained in:
parent
3854165595
commit
d55a5e722b
|
@ -69,20 +69,6 @@ protected static function find($class)
|
||||||
return LIBRARY_PATH.str_replace('_', '/', $file).EXT;
|
return LIBRARY_PATH.str_replace('_', '/', $file).EXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since not all controllers will be resolved by the controller resolver,
|
|
||||||
// we will do a quick check in the controller directory for the class.
|
|
||||||
// For instance, since base controllers would not be resolved by the
|
|
||||||
// controller class, we will need to resolve them here.
|
|
||||||
if (strpos($class, '_Controller') !== false)
|
|
||||||
{
|
|
||||||
$controller = str_replace(array('_Controller', '_'), array('', '/'), $class);
|
|
||||||
|
|
||||||
if (file_exists($path = strtolower(CONTROLLER_PATH.$controller.EXT)))
|
|
||||||
{
|
|
||||||
return $path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Next we will search through the common Laravel paths for the class file.
|
// Next we will search through the common Laravel paths for the class file.
|
||||||
// The Laravel framework path, along with the libraries and models paths
|
// The Laravel framework path, along with the libraries and models paths
|
||||||
// will be searched according to the Laravel class naming standard.
|
// will be searched according to the Laravel class naming standard.
|
||||||
|
@ -105,6 +91,20 @@ protected static function find($class)
|
||||||
|
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since not all controllers will be resolved by the controller resolver,
|
||||||
|
// we will do a quick check in the controller directory for the class.
|
||||||
|
// For instance, since base controllers would not be resolved by the
|
||||||
|
// controller class, we will need to resolve them here.
|
||||||
|
if (strpos($class, '_Controller') !== false)
|
||||||
|
{
|
||||||
|
$controller = str_replace(array('_Controller', '_'), array('', '/'), $class);
|
||||||
|
|
||||||
|
if (file_exists($path = strtolower(CONTROLLER_PATH.$controller.EXT)))
|
||||||
|
{
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue