changed git call from https to git readonly
[atutor.git] / mods / wordpress / wp_connect.php
1 <?php
2 // Wordpress database connection setup for atutor_wordpress integration module
3 require('wp_config.php');
4 global $db_wp;
5
6 if (AT_INCLUDE_PATH !== 'NULL') {
7         $db_wp= @mysql_connect(WP_DB_HOST.':'.WP_DB_PORT, WP_DB_USER, WP_DB_PWD);       
8
9         if (!$db_wp) {
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 wp_config.php file.', E_USER_ERROR);
14                 exit;
15         }
16         if (!@mysql_select_db(WP_DB_NAME, $db_wp)) {
17                 require_once(AT_INCLUDE_PATH . 'classes/ErrorHandler/ErrorHandler.class.php');
18                 $err = new ErrorHandler();
19                 trigger_error('VITAL#DB connection established, but database "'.WP_DB_NAME.'" cannot be selected.',
20                                                 E_USER_ERROR);
21                 exit;
22         }
23
24 }
25 ?>