title: Loading external library in Laravel-4
body: <p>I am trying to load the <a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM Parser</a> in my <code>Laravel-4</code> project. However, I can't get it to find the class. I am getting this error:</p>
  
  <pre><code>Class 'Libraries\SimpleHtmlDom\simple_html_dom_node' not found
  </code></pre>
  
  <p>I've put <code>simple_html_dom.php</code> in <code>app\libraries</code> and </p>
  
  <pre><code>namespace Libraries\SimpleHtmlDom;
  </code></pre>
  
  <p>in the top of <code>simple_html_dom.php</code>.</p>
  
  <p>In <code>global.php</code> I've added the <code>libraries</code> folder:</p>
  
  <pre><code>ClassLoader::addDirectories(array(
  
      app_path().'/commands',
      app_path().'/controllers',
      app_path().'/models',
      app_path().'/database/seeds',
      app_path().'/libraries',
  
  ));
  </code></pre>
  
  <p>And finally, in my controller, I am trying to instantiate it:</p>
  
  <pre><code>$parser = new Libraries\SimpleHtmlDom\simple_html_dom_node;
  </code></pre>
  
  <p>What am I doing wrong?</p>