<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Creo &#187; orm</title>
	<atom:link href="http://creolab.hr/tag/orm/feed/" rel="self" type="application/rss+xml" />
	<link>http://creolab.hr</link>
	<description>Portfolio and digital playground of Boris Strahija</description>
	<lastBuildDate>Mon, 14 Nov 2011 22:50:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Integration of RedBean ORM with CodeIgniter</title>
		<link>http://creolab.hr/2009/11/integration-of-redbean-orm-with-codeigniter/</link>
		<comments>http://creolab.hr/2009/11/integration-of-redbean-orm-with-codeigniter/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 21:55:04 +0000</pubDate>
		<dc:creator>Boris Strahija</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[orm]]></category>

		<guid isPermaLink="false">http://creolab.hr/?p=57</guid>
		<description><![CDATA[Updated version is up. Check it out! I still haven&#8217;t updated my work, so here&#8217;s something in the meantime. I&#8217;ve managed to successfuly integrate RedBean into the CodeIgniter PHP framework. I don&#8217;t think any additional explanation is necesary since it&#8217;s pretty simple and basic stuff. Here are the reuired steps: Download RedBean and put it [...]]]></description>
			<content:encoded><![CDATA[<h3>Updated version is up. <strong><a href="/2011/02/redbean-codeigniter-take-2/">Check it out!</a></strong></h3>
<p><del>I still haven&#8217;t updated my work, so here&#8217;s something in the meantime.</del></p>
<p><del>I&#8217;ve managed to successfuly integrate <a href="http://www.redbeanphp.com/">RedBean</a> into the <a href="http://codeigniter.com/">CodeIgniter</a> PHP framework. I don&#8217;t think any additional explanation is necesary since it&#8217;s pretty simple and basic stuff.</del></p>
<p><del>Here are the reuired steps:</del></p>
<ol>
<li>Download <a href="http://www.redbeanphp.com/">RedBean</a> and put it into /app/thirdparty/redbean/</li>
<li>Create a library (/app/libraries/redbean.php). The class shoud be called Redbean, and the __construct() function should look something like this:
<pre>$this-&gt;ci =&amp; get_instance();

// Include database configuration
include(APPPATH.'/config/database.php');

// Include required files
include(APPPATH.'/thirdparty/redbean/redbean.inc.php');

// Database data
$hostname     = $db[$active_group]['hostname'];
$username     = $db[$active_group]['username'];
$password     = $db[$active_group]['password'];
$database     = $db[$active_group]['database'];

// Create RedBean instance
$toolbox = RedBean_Setup::kickstartDev('mysql:host='.$hostname.';dbname='.$database, $username, $password);
$this-&gt;ci-&gt;rb = $toolbox-&gt;getRedBean();</pre>
</li>
<li>Your controllers can then do some fun stuff like this:
<pre>$post = $this-&gt;rb-&gt;dispense("post");
$post-&gt;title = 'My first post from CodeIgniter';
$post-&gt;body ='Lorem ipsum dolor sit amet, consectetur adipisicing elit....';
$post-&gt;created = time();
$id = $this-&gt;rb-&gt;store($post);</pre>
</li>
</ol>
<p>Haven’t tested it much but everything seems to work.<br />
If someone has a better sollution just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://creolab.hr/2009/11/integration-of-redbean-orm-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

