[ create a new paste ] login | about

Link: http://codepad.org/55frEyr3    [ raw code | fork | 1 comment ]

hwsamuel - PHP, pasted on Apr 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Rb {
	
	function __construct() {
		// Include database configuration
		include(APPPATH.'/config/database.php');
		
		// Get Redbean
		include(APPPATH.'/third_party/rb/rb.php');
		
		// Database data
		$host = $db[$active_group]['hostname'];
		$user = $db[$active_group]['username'];
		$pass = $db[$active_group]['password'];
		$db = $db[$active_group]['database'];
		
		// Setup DB connection
		R::setup("mysql:host=$host;dbname=$db", $user, $pass);
	} //end __contruct()
} //end Rb


Create a new paste based on this one


Comments:
posted by hwsamuel on Apr 24
RedBeanPHP library for integration with CodeIgniter
reply