config class

A class used for application settings

  • getSettings(), returns DB settings for easy reuse
  • getsecret(), returns secret key for use in session and hashing (example- password hashing, or anything that needs a plain text key)

<?php
class SystemComponent {
var $settings;
var $key;
function getSettings() {
// Database variables
$settings['dbhost'] = 'hostname'; //hostname
$settings['dbusername'] = 'username'; // DB user login
$settings['dbpassword'] = 'password'; // password
$settings['dbname'] = 'dbname'; //database to be used
return $settings;
}
//end of getsettings
function getsecret() {
// put a secret key here for encryption and session purposes
$secret = "your_secret_key";
return $secret;
}
// end of function
}
// end of class
?>