changed git call from https to git readonly
[atutor.git] / mods / mediawiki / mw_connect.php
1 <?php
2 // MediaWiki database connection setup for atutor_mediawiki integration module
3 require('mw_config.php');
4 global $db_mw;
5
6 if (AT_INCLUDE_PATH !== 'NULL') {
7         $db_mw= @mysql_connect(MW_DB_HOST.':'.MW_DB_PORT, MW_DB_USER, MW_DB_PWD);       
8
9         if (!$db_mw) {
10                 /* AT_ERROR_NO_DB_CONNECT */
11                 require_once(AT_INCLUDE_PATH . 'classes/ErrorHandler/ErrorHandler.class.php');
12                 $err = new ErrorHandler();
13                 trigger_error('VITAL#Unable to connect to db. Set database information in the module\'s mw_config.php file.', E_USER_ERROR);
14                 exit;
15         }
16         if (!@mysql_select_db(MW_DB_NAME, $db_mw)) {
17                 require_once(AT_INCLUDE_PATH . 'classes/ErrorHandler/ErrorHandler.class.php');
18                 $err = new ErrorHandler();
19                 trigger_error('VITAL#DB connection established, but database "'.MW_DB_NAME.'" cannot be selected.',
20                                                 E_USER_ERROR);
21                 exit;
22         }
23
24 }
25 ?>