title: find directory where my extended class is with php
body: <p>lets say we have a dir</p>
  
  <p>script.php is a class that is extending a controller class from index.php, </p>
  
  <pre><code>application/helloworld/script.php
  index.php
  </code></pre>
  
  <p>is there a way to return the folder <code>helloworld</code> from index.php ( controller )  ?</p>
  
  <p>edit*</p>
  
  <p>script.php</p>
  
  <pre><code>class Helloworld extends Controller
  {
      function __construct()
      {
          echo 'helloworld';  
      }
  }
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>class Controller
  {
      function wherethescript(){
          # trying to find folder where helloworld.php is in from this class
      }
  }
  
  include_once 'application/helloworld/helloworld.php';
  $x=new Helloworld;
  $x-&gt;wherethescript();
  </code></pre>