Commit fe218f9b authored by Taylor Otwell's avatar Taylor Otwell

restore controller section of autoloader.

parent 8718b582
......@@ -86,6 +86,20 @@ class Autoloader {
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;
}
}
}
}
\ No newline at end of file
......@@ -6,24 +6,6 @@ use Laravel\Request;
use Laravel\Redirect;
use Laravel\Response;
/**
* Register a function on the autoload stack to lazy-load controller files.
* We register this function here to keep the primary autoloader smaller
* since this logic is not needed for every Laravel application.
*/
spl_autoload_register(function($controller)
{
if (strpos($controller, '_Controller') !== false)
{
$controller = str_replace(array('_Controller', '_'), array('', '/'), $controller);
if (file_exists($path = strtolower(CONTROLLER_PATH.$controller.EXT)))
{
return $path;
}
}
});
abstract class Controller {
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment