title: Getting base url, development variable, the best way, without using globals
body: <p>In my application architecture I want to replace my globals with something that ain't gonna burn most of the developer's eyes, because I am using globals like this,</p>
  
  <pre><code>define('DEVELOPMENT_ENVIRONMENT', true);
  
  // Shorten DIRECTORY_SEPARATOR global,
  define('DS', DIRECTORY_SEPARATOR);
  
  // Set full path to the document root
  define('ROOT', realpath(dirname(__FILE__)) . DS);
  </code></pre>
  
  <p>how could I prevent this? I tried creating a class that reads an xml file, but this will give me a longer code like this</p>
  
  <pre><code>$c = new Config();
  if($c-&gt;devmode === TRUE) {}
  </code></pre>
  
  <p>or maybe something like this</p>
  
  <pre><code>$c = new Config()
  echo $c-&gt;baseurl;
  </code></pre>
  
  <p>Any better ways to do this?</p>