Guest User

Untitled

a guest
May 14th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.38 KB | None | 0 0
  1. <?php
  2.  
  3. namespace ION\System;
  4.  
  5. class Config {
  6.    
  7.     private $initialize = [
  8.         'ion_root_path' => '$document.root'
  9.     ];
  10.    
  11.     /*
  12.      * mysql
  13.      */
  14.     private $mysql_host = 'localhost';
  15.     private $mysql_user = 'root';
  16.     private $mysql_password = '';
  17.     private $mysql_database = '';
  18.     private $mysql_port = 3306;
  19.    
  20.     /*
  21.      * ION
  22.      */
  23.     private $ion_root_path;
  24.     private $ion_directory = '/ion';
  25.    
  26.     /*
  27.      * Routing
  28.      */
  29.     private $routing_key = 'route';
  30.     private $routing_use_short_form = false;
  31.    
  32.     ########################################################################
  33.     public function __construct() {
  34.         foreach($this->initialize as $var => $val)
  35.             $this->$var = str_replace(['$document.root'], [$_SERVER['DOCUMENT_ROOT']], $val);
  36.        
  37.         unset($this->initialize);
  38.     }
  39.    
  40.     public function getMySQLHost() { return $this->mysql_host; }
  41.     public function getMySQLUser() { return $this->mysql_user; }
  42.     public function getMySQLPassword() { return $this->mysql_password; }
  43.     public function getMySQLDatabase() { return $this->mysql_database; }
  44.     public function getMySQLPort() { return $this->mysql_port; }
  45.    
  46.     public function getIONRootPath() { return $this->ion_root_path; }
  47.     public function getIONDirectory() { return $this->ion_directory; }
  48.    
  49.     public function getRoutingKey() { return $this->routing_key; }
  50.     public function isRoutingUsingShortForm() { return $this->routing_use_short_form; }
  51. }
Add Comment
Please, Sign In to add comment