title: Using the ServiceManager in a non ZF2-MVC environment
body: <p>I'm currently using ZF2 as a library. </p>
  
  <p>Currently, I'm pretty much cascading an injection of my database object into the controllers via the route. Obviously, had I started to use zend framework 2 in the first place, I would have stored the DB into an instance of ServiceManager and sent that through instead. </p>
  
  <p>Anyway, I have a <strong>service</strong> class which is full of static method. These methods are basic, and all they do is report back information. They're pretty much brainless. A method I have: <code>UserService::getCurrentUser()</code> is meant to return an object containing the current user information.</p>
  
  <p>However, one problem I'm dealing with, is that inside this method, I'm doing this:</p>
  
  <pre><code>    $user = new objects\user();
      $user-&gt;setUserId(self::currentUserId());
  
  
      $data = new \model\dao\users($database);
      $user = $data-&gt;loadUser($user);
  
      return $user;
  </code></pre>
  
  <p>I seem to now have a black hole in that I have no way of getting the $database, in this case, an instance of <code>Zend\Db\Adapter</code>.</p>
  
  <p>Any ideas how I can plug this hole?</p>