title: Add external libraries to Symfony2 project
body: <p>I am trying to add an external library (PHP Simple DOM Parser, <a href="http://simplehtmldom.sourceforge.net/index.htm" rel="noreferrer">http://simplehtmldom.sourceforge.net/index.htm</a>) to a Symfony2 project. I took a tutorial that explains how to include third party libraries to Symfony2 <a href="http://www.kiwwito.com/article/add-third-party-libraries-to-symfony-2" rel="noreferrer">http://www.kiwwito.com/article/add-third-party-libraries-to-symfony-2</a>.</p>
  
  <p>I set up a class file like:</p>
  
  <pre><code># vendor/phpsimpledom/lib/Phpsimpledom/simple_html_dom.php
  
  require_once __DIR__.'/src/simple_html_dom.php';
  
  class Phpsimpledom_Phpsimpledom extends simple_html_dom_node {
  }
  </code></pre>
  
  <p>and registered my class in my Autoloader (autoload.php):</p>
  
  <pre><code>$loader-&gt;registerNamespaces(array(
  ...
  'Phpsimpledom' =&gt; __DIR__.'/../vendor/phpsimpledom/lib/',
  ...
  ),));
  </code></pre>
  
  <p>I am trying to call:</p>
  
  <pre><code>$phpsimpledom = new \Phpsimpledom();
  </code></pre>
  
  <p>but this throughs me an error (Fatal error: Class 'simple_html_dom_node' not found).</p>
  
  <p>However: The main file of the library (simple_html_dom.php) consists of functions that do not belong to a class.</p>
  
  <p>When I try to use the file directly, it also doesn't work:</p>
  
  <pre><code>    $loader-&gt;registerNamespaces(array(
  ...
  'Phpsimpledom' =&gt; __DIR__.'/../vendor/phpsimpledom/lib/Phpsimpledom/src/simple_html_dom.php',
  ...
  ),));
  </code></pre>
  
  <p>Any hints?</p>
  
  <p>THANKS!</p>