Advertisement
RockstarPtr

Core - A small snippet of construction

Jan 14th, 2017
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1.         /**      Core File     **/
  2.         /** Important function **/
  3.         public function __construct () {
  4.            
  5.             /** Setup of Session-Handler **/
  6.             $key = 'example_key';
  7.             $this->pSession = new Session($key);
  8.            
  9.             /** Setup of MySQL-Connection **/
  10.             $this->connection = new MySQL('localhost', 'root', 'Development', 'master_database');
  11.            
  12.             /** Setup of Secure Sessions **/
  13.             ini_set('session.save_handler', 'files');
  14.             session_set_save_handler($this->pSession, true);
  15.            
  16.             /** Properties **/
  17.             $this->is_native_access_enabled = $this->GetSettingValueByName('native_access_enabled');
  18.             $this->is_ssl_enabled = $this->GetSettingValueByName('https_enabled');
  19.             if($this->is_ssl_enabled === 'true') {
  20.                 ini_set('allow_url_fopen', 'On');
  21.                 if(!extension_loaded('openssl'))
  22.                     die('Please enabled OpenSSL extension!');
  23.                 $this->protocol = 'https';
  24.             } else
  25.                 $this->protocol = 'http';
  26.             $this->www_address = $this->GetSettingValueByName('www_address');
  27.             $this->pagename = $this->GetSettingValueByName('pagename');
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement