title: Composer vendor/ path
body: <p>As stated anywhere on the web, a webroot folder should only contain an entry point (index.php) and the assets folder. Application source code must go in an upper directory, not accessible throw the web.</p>
  
  <p>Since I'll have several domains using the same app, I did something like this:</p>
  
  <pre><code>drwxrwxr-x 7 teo teo 4096 Apr  9 16:43 app
  -rw-rw-r-- 1 teo teo  334 Apr  9 14:51 composer.json
  -rw-rw-r-- 1 teo teo 9213 Apr  9 14:51 composer.lock
  -rw-rw-r-- 1 teo teo 1965 Apr  9 13:01 deploy.ant
  lrwxrwxrwx 1 teo teo   12 Apr  7 19:28 webroot2 -&gt; app/webroot/
  lrwxrwxrwx 1 teo teo   12 Apr  7 19:28 webroot3 -&gt; app/webroot/
  lrwxrwxrwx 1 teo teo   12 Apr  7 19:28 public_html -&gt; app/webroot/
  drwxrwxr-x 8 teo teo 4096 Apr  9 14:51 vendor
  </code></pre>
  
  <p>Each webroot folder is just a relative link to the folder <code>app/webroot</code>:</p>
  
  <pre><code>rwxrwxr-x 6 teo teo 4096 Apr  7 19:27 assets
  -rw-r--r-- 1 teo teo 1406 Apr  9 16:02 index.php
  </code></pre>
  
  <hr>
  
  <p>Then I added a package (<a href="http://phpdebugbar.com/" rel="nofollow">maximebf/debugbar</a>) with Composer and I found that the only way to make it run was including its assets in the webroot.</p>
  
  <p>So I added a link to <code>vendor</code> into <code>app/webroot</code>:</p>
  
  <pre><code>drwxrwxr-x 6 teo teo 4096 Apr  7 19:27 assets
  -rw-r--r-- 1 teo teo 1406 Apr  9 16:02 index.php
  lrwxrwxrwx 1 teo teo   13 Apr  7 23:49 vendor -&gt; ../../vendor/
  </code></pre>
  
  <p>I thought: if someone can access the source code of open source packages, it won't hurt...</p>
  
  <hr>
  
  <p>Then I started writing my first class, but I can't figure out where I should put the code:</p>
  
  <ul>
  <li>if I put it in a subfolder of <code>app/</code> (where I planned to place it),
  Composer won't insert it's namespace in the autoloader;</li>
  <li>if I put it
  in a <code>vendor/</code> subfolder, it will be linked inside the webroot.</li>
  </ul>
  
  <hr>
  
  <p>I'm sure I'm missing something, but I can't figure what...</p>