title: Custom composer namespace doesn't find class
body: <p>I'm trying to use my custom namespace for my personal classes.</p>
  
  <p>The directory structure is (as usual):</p>
  
  <pre>
      my_project/
        - src/
           |- myComponent.class.php
           \- myWrapper.class.php
        - vendor
           |- OtherLibrary
           \- Symfony
        - composer.json
        - index.php
  </pre>
  
  <p>in my <strong>composer.json</strong> I specify my own namespace with:</p>
  
  <pre><code>"autoload": {
      "psr-0": {
          "my_namespace\\": "src/"
      }
  }`
  </code></pre>
  
  <p>then in my PHP code I have something like:</p>
  
  <h2>myComponent.class.php</h2>
  
  <pre><code>namespace my_namespace;
  
  class myComponent
  {
   .... code
  }
  </code></pre>
  
  <h2>index.php</h2>
  
  <pre><code>namespace my_namespace;
  
  require_once __DIR__.'/vendor/autoload.php';
  
  $component = new myComponent();
  </code></pre>
  
  <h1>Running this I get a:</h1>
  
  <blockquote>
    <p>Fatal error: Class 'my_namespace\myComponent' not found in /path_to_root/my_project/index.php on line 5</p>
  </blockquote>
  
  <h1>while...</h1>
  
  <ul>
  <li><p>I would expect <em>myComponent</em> to be searched under <em>my_project/src/</em>, as specified in the <em>composer.json</em> and as defined into <em>vendor/composer/autoload_namespaces.php</em> (<code>'my_namespace\\' =&gt; array($baseDir . '/src')</code>).</p></li>
  <li><p>I would expect to directly call my custom <strong>myComponent</strong>, when I define the namespace to my own namespace. Am I wrong?</p></li>
  </ul>
  
  <p>What's wrong in my code and my assumptions?
  How should I fix it?</p>