title: How to define the path to autoload.php with composer
body: <p>I have a composer project, call it <code>MyVendor\Database</code>.  That project uses composer and autoloading.  There are several files in that project that have:</p>
  
  <pre><code>require_once __DIR__."/../vendor/autoload.php";
  </code></pre>
  
  <p>in order to utilize autoloading.</p>
  
  <p>It all works great, until I include <code>MyVendor\Database</code> in another project.</p>
  
  <p>I have another project, call it <code>MyVendor\CoolPackage</code> that requires <code>MyVendor\Database</code>.</p>
  
  <p>I run composer install on <code>CoolPackage</code> and it downloads <code>MyVendor\Database</code> into the vendor folder.</p>
  
  <p>The problem from here though, is My files within <code>vendor\MyVendor\Database</code> fail because they call <code>require_once __DIR__."/../vendor/autoload.php"</code>, but there is not vendor folder inside of <code>\vendor\MyVendor\Database</code>.</p>