Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. unset($CFG);
  2. global $CFG;
  3. $CFG = new stdClass();
  4.  
  5. $CFG->dbtype = 'mysqli';
  6. $CFG->dblibrary = 'native';
  7. $CFG->dbhost = 'localhost';
  8. $CFG->dbname = 'exam';
  9. $CFG->dbuser = 'root';
  10. $CFG->dbpass = '';
  11. $CFG->prefix = 'mdl_';
  12. $CFG->dboptions = array (
  13. 'dbpersist' => 0,
  14. 'dbport' => '',
  15. 'dbsocket' => '',
  16. );
  17. $CFG->wwwroot = "http://localhost/examination";
  18. $CFG->dataroot = 'F:\xampp\moodledata';
  19. $CFG->admin = 'admin';
  20.  
  21. $CFG->directorypermissions = 0777;
  22.  
  23. require_once(dirname(__FILE__) . '/lib/setup.php');
  24.  
  25. // There is no php closing tag in this file,
  26. // it is intentional because it prevents trailing whitespace problems!
  27.  
  28. // function to get ip addresss
  29. function getLocalIP(){
  30. exec("ipconfig /all", $output);
  31. foreach($output as $line){
  32. if (preg_match("/(.*)IPv4 Address(.*)/", $line)){
  33. $ip = $line;
  34. $ip = str_replace("IPv4 Address. . . . . . . . . . . :","",$ip);
  35. $ip = str_replace("(Preferred)","",$ip);
  36. }
  37. }
  38. return $ip;
  39. }
  40. //echo $ip = getLocalIP();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement