title: Call to undefined method Composer\\Autoload\\ClassLoader::setPsr4()
body: <p>I have a project that have multiple subfolders. In one of the folders they are some "addons". All of these addons have a composer.json and a vendor-folder. I now wanted to build my own addon and created a new folder and put a <code>composer.json</code> into that directory. <code>composer install</code> works without any problems, but when I'm somehow installing my addon I'm getting the error</p>
  
  <pre><code>FastCGI: server "/fcgi-bin-php5-fpm-ezi" stderr: PHP message: PHP Fatal error:  Call to undefined method Composer\\Autoload\\ClassLoader::setPsr4()
  </code></pre>
  
  <p>What could cause this problem? I already did <code>composer dump-autoload</code> and <code>composer global update</code>, because I found these solutions on the internet, but it still doesn't work. Do I have to do something special to make it work in sub-folders?</p>
  
  <p>This is currently my composer.json</p>
  
  <pre><code>{
    "name": "namespace/projectname-addonname",
    "autoload": {
      "psr-4": {
        "namespace1\\namespace2\\namespace3\\" : "src"
      }
    }
  }
  </code></pre>
  
  <p>I don't know if that helps, but when I <code>var_dump</code> the loader this is the result</p>
  
  <pre><code>object(Composer\Autoload\ClassLoader)#138 (4) {
    ["prefixes":"Composer\Autoload\ClassLoader":private]=&gt;
    array(0) {
    }
    ["fallbackDirs":"Composer\Autoload\ClassLoader":private]=&gt;
    array(0) {
    }
    ["useIncludePath":"Composer\Autoload\ClassLoader":private]=&gt;
    bool(false)
    ["classMap":"Composer\Autoload\ClassLoader":private]=&gt;
    array(0) {
    }
  }
  </code></pre>
  
  <p>After that the <code>$loader-&gt;setPsr4</code> method is called and I'm getting the fatal error.</p>
  
  <p>The strange thing is, that when using <code>classmap</code> instead of <code>psr-4</code> for autoloading, it works without any problems.</p>