title: Creating new service providers in Silex
body: <p>I've been using Silex for a while now without any issues. I've been able to add new services, create basic sites, etc. Unfortunately I'm stuck now on creating a new service from scratch... I'm not too sure what I'm doing wrong and I figured a nudge in the right direction would be useful right about now.</p>
  
  <p>I have a basic structure like this:</p>
  
  <pre><code>cache
  resources
  src
    -app.php
    -autoload.php
    -config.php
    -controllers.php
    -etc
  vendor
    -assetic
    -Company
      -src
        -Postback.php &lt;-- The classes I need to load
    -silex
    -etc
  views
  web
  </code></pre>
  
  <p>So, in <code>app.php</code>:</p>
  
  <pre><code>use SilexExtension\CompanyPostbackServiceProvider;
  
  $app-&gt;register(new CompanyPostbackServiceProvider(), array(
      'company.class_path' =&gt; __DIR__ . '/../vendor/Company/src'
  ));
  </code></pre>
  
  <p>in <code>src/autoload.php</code>:</p>
  
  <pre><code>$loader-&gt;registerNamespaces(array(
      'Symfony'           =&gt; array(__DIR__.'/../vendor/silex/vendor', __DIR__.'/../vendor'),
      'Silex'             =&gt; __DIR__.'/../vendor/silex/src',
      'SilexExtension'    =&gt; __DIR__.'/../vendor/Silex-extentions/src',
      'Assetic'           =&gt; __DIR__.'/../vendor/assetic/src',
      'Company'           =&gt; __DIR__.'/../vendor/Company/src'
  ));
  </code></pre>
  
  <p>in <code>silex/vendor/Silex-extensions/src/SilexExtension/CompanyPostbackServiceProvider.php</code>:</p>
  
  <pre><code>namespace SilexExtension;
  
  use Silex\Application;
  use Silex\ServiceProviderInterface;
  
  class CompanyPostbackServiceProvider implements ServiceProviderInterface
  {
      public function register(Application $app)
      {
          if ( isset( $app['company.class_path'] ) )
          {
              $app['autoloader']-&gt;registerNamespace(
                  'Company', $app['company.class_path']
              );
          }
      }
  }
  </code></pre>
  
  <p>I've tried several variations of this, but calling Postback from controller.php results in no classes being found, and declaring the class methods of CompanyPostbackServiceProvider results in just the register function which belongs to Silex\Application.</p>
  
  <p>Any ideas? I know I'm doing something stupid, but for some reason it just isn't clicking.</p>
  
  <p>Thanks!</p>