Guest User

Untitled

a guest
May 26th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. // Includes
  3. require_once(dirname(__FILE__)."/template.php"); // Templating System
  4. require_once(dirname(__FILE__)."/session.php"); // Variable System
  5. require_once(dirname(__FILE__)."/database.php"); // Database System
  6.  
  7. class Site
  8. {
  9. private $class_vars;
  10. public $db;
  11. public $tpl;
  12. public $session;
  13.  
  14. function __construct()
  15. {
  16. $this->db = new Database;
  17. $this->session = new Session;
  18. $this->tpl = new Template;
  19. }
  20. function directory_array()
  21. {
  22. $dir_ra = array();
  23. foreach(explode("/",$_SERVER["REQUEST_URI"]) as $dir)
  24. {
  25. if(trim($dir)) { $dir_ra[] = $dir; }
  26. }
  27. return $dir_ra;
  28. }
  29.  
  30. function __set($var,$val) { $this->class_vars[$var] = $val; }
  31. function &__get($var) { return $this->class_vars[$var]; }
  32. }
Add Comment
Please, Sign In to add comment