title: Composer Package: AutoLoad and Extend Another Package
body: <p>I was just creating one of my first PHP Packages using Composer and I hit a problem.</p>
  
  <p>Currently I'm working on a package that his main class extends a class from another package, so on my <code>composer.json</code> I've the package I'm extending declared as a requirement:</p>
  
  <pre><code>"require": {
          "php": "&gt;=5.3.0",
          "ext-mbstring": "*",
          "author/BasePackage": "dev-master"
  },
  </code></pre>
  
  <p>And, If I issue <code>composer update</code> I get a nice <code>vendor</code> directory inside my project with the <code>author/BasePackage</code> dependency downloaded there.</p>
  
  <p>So my question is, on my main class file <code>src\Extended.php</code> I need to manually do something like <code>require_once __DIR__ . "/../vendor/autoload.php";</code> in order to autoload the <code>BasePackage</code> so I can do <code>class Extended extends \BasePackage\BasePackage</code>.</p>
  
  <p>Is this ok? How am I supposed to load my package dependencies? When I commit this package to GitHub or so, I'm ignoring the <code>vendor</code> directory and if someone uses this by requiring it on their projects <code>require_once __DIR__ . "/../vendor/autoload.php";</code> will fail because it won't be where I expected it to be.</p>
  
  <p>How should I do this?</p>
  
  <p>Thank you.</p>