Skip to content

Instantly share code, notes, and snippets.

@dustinlakin
Created April 5, 2012 08:53
Show Gist options
  • Save dustinlakin/2309302 to your computer and use it in GitHub Desktop.
Save dustinlakin/2309302 to your computer and use it in GitHub Desktop.
Settings Constructor
<?php
class Settings {
private $data = array();
private $db = null;
public function __construct(){
$this->siteRoot = str_replace("index.php", "", $_SERVER['PHP_SELF']);
$this->documentRoot = str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']);
$this->webRoot = $_SERVER['SERVER_NAME'] . $this->siteRoot;
$this->viewsPath = $this->documentRoot . "views/";
$this->jsPath = $this->siteRoot . "js/";
$this->cssPath = $this->siteRoot . "css/";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment