title: Composer class not found fatal error - wordpress plugin development
body: <p>I am trying to use composer to autoload my classes in a wordpress plugin.</p>
  
  <p>I wish for my models and controllers to reside within the GD namespace, however I would like to put my models and controllers into their own directories.</p>
  
  <p>I am facing the error message: Fatal error: <code>Class 'GD\ShortcodeController' not found in /.. .../src/GD/App.php on line 10</code></p>
  
  <p><strong>directory/file structure</strong></p>
  
  <pre><code>plugins
      gd
          cache
              // location for twig template cache
          public
              // location for plugin assets
          src
              controllers
                  ShortcodeController.php
              models
              App.php
          templates
              test.html
          vendor
              // location for application dependencies installed via composer
              composer
                  autoload_namespaces.php
  </code></pre>
  
  <p><strong>composer.json</strong></p>
  
  <pre><code>{
      "require": {
          "twig/twig": "1.*"
      },
      "autoload": {
          "psr-0": {
              "GD": ["src/", "src/GD/", "src/GD/controllers/", "src/GD/models/"]
          }
      }
  }
  </code></pre>
  
  <p><strong>vendor/composer/autoload_namespaces.php</strong></p>
  
  <pre><code>return array(
      'Twig_' =&gt; array($vendorDir . '/twig/twig/lib'),
      'GD' =&gt; array($baseDir . '/src', $baseDir . '/src/GD', $baseDir . '/src/GD/controllers', $baseDir . '/src/GD/models'),
  );
  </code></pre>
  
  <p><strong>GD/src/App.php</strong></p>
  
  <p>
  
  <pre><code>class App
  {
      private $plugin_dir;
      private $twig;
  
      public function init()
      {
          $shortcodes = new ShortcodeController;
          add_shortcode( 'gd', [ $shortcodes , 'gd'] );
      }
  }
  </code></pre>
  
  <p><strong>GD/src/controllers/ShortcodeController.php</strong></p>
  
  <pre><code>&lt;?php namespace GD;
  
  class ShortcodeController
  {
      // STUFF IN HERE
  }
  </code></pre>
  
  <p>Should i be using autoload classmap instead of psr-0? How does composer deal with namespaced classes when using classmap?</p>