Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // Reading data from config file
  2. protected function readData() {
  3. $configFile = './../data/_config.db';
  4. if($data = file($configFile)) {
  5. foreach($data as $line) {
  6. if(substr($line, 0, 2) != '//' && strlen($line) >= 3) {
  7. $dat = explode('=', $line);
  8. $parameter = trim($dat[0]);
  9. $this->$parameter = trim($dat[1]);
  10. }
  11. }
  12. }
  13. else {
  14. throw new Exception('Unable to configure settings.');
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement