title: Access CakePHP controller or request object outside mvc
body: <p>Is there any way to access the current controller or request object outside mvc in CakePHP(2.*)?</p>
  
  <p>Basically I need to access the request object in a library that is designed for CakePHP but should function on its own as much as possible - in other words I'd like to avoid any unnecessary lib-specific initialization code in the controller itself to keep the.</p>
  
  <p>I have written a component for this purpose but not all calls to the lib will be directly from the controller. I'd also like to avoid passing the $controller or $request variable around anywhere else but inside the lib.</p>
  
  <p>I've never looked into CakePHP class loading much, but I can recall something about ClassRegistry from when CakePHP 1.3 was new. Soon after testing ClassRegistry in a controller action I found it to be empty(<em>determined with ClassRegistry::keys() and pr()'ing directly from the class</em>)</p>
  
  <p>So, is there any friendly way to get the request object or should I resort to uglier methods?</p>