Archived entries for Playground

Drumming Retrospective

Since I haven’t posted anything in a while I decided it is time for a music post. Here are some tracks that I recorded with various bands I played in as a drummer. Some of the recording are pretty bad but I’ve put them up anyway ;)
Hope you like at least some of the tracks.

Here they are:
[1996] Implicite – Competition
[1998] Implicite – New Ideals (live recording)
[1999] Motorno Ulje – Zadnja litra
[2001] The Farewell Reason – Thank You
[2003] Youth Against – War Against War (live recording)
[2005] The Farewell Reason – Embrace Me, Erase Me
[2005] Outre – Rose
[2005] Outre – They Call Themselves Hardcore
[2009] The Farewell Reason – Sunday Suit Fade Out

Integration of RedBean ORM with CodeIgniter

I still haven’t updated my work, so here’s something in the meantime.

I’ve managed to successfuly integrate RedBean into the CodeIgniter PHP framework. I don’t think any additional explanation is necesary since it’s pretty simple and basic stuff.

Here are the reuired steps:

  1. Download RedBean and put it into /app/thirdparty/redbean/
  2. Create a library (/app/libraries/redbean.php). The class shoud be called Redbean, and the __construct() function should look something like this:
    $this->ci =& 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->ci->rb = $toolbox->getRedBean();

  3. Your controllers can then do some fun stuff like this:
    $post = $this->rb->dispense("post");
    $post->title = 'My first post from CodeIgniter';
    $post->body ='Lorem ipsum dolor sit amet, consectetur adipisicing elit....';
    $post->created = time();
    $id = $this->rb->store($post);

Haven’t tested it much but everything seems to work.
If someone has a better sollution just let me know.



Copyright © 2008–2009. All rights reserved.

RSS Feed. This blog is proudly powered by Wordpress.