CodeIgniter

CodeIgniter URL Rewrite with .htacccess AND populated $_GET variables

Posted in CodeIgniter, How To, PHP, Web Development on December 7th, 2010 by j3nnings – Be the first to comment

Everytime I start a new CodeIgniter project on Dreamhost I face the same two problems.

  1. How can I get URL rewriting to work properly?
  2. How can I repopulate $_GET variables once they are stripped by CodeIgniter?

The problem with this pair of tasks is that task 2 is dependent on how you solve task 1. I’ve solved both problems (on dreamhost) with the following fixes:

Make sure your config.php has these values set:

$config['base_url'] = "http://domain.com/";
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['enable_query_strings'] = TRUE;

Your .htaccess looks like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|favicon\.ico|static|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

And add this to the top of any Controller you wish to use $_GET variables in.

function __construct() {
parse_str(substr(strrchr($_SERVER['REQUEST_URI'], "?"), 1), $_GET);
parent::Controller();
}

Now you’ll be able to access the $_GET variables as you would expect:

echo $this->input->get('foo');

Ventstatus.com, what it is and how it works.

Posted in CodeIgniter, Rant, Ventstatus.com, Web Development on October 15th, 2009 by j3nnings – Be the first to comment

Ventrilo is a VOIP or voice over internet protocol. In other words, it lets users chat with each other over the internet instantly. Ventrilo is known for its super high quality voice codecs, and for being simple and reliable. The difference between Ventrilo and something like Skype is that Skype creates a direct connection between two or more clients through a peer to peer network. Ventrilo, on the other hand, first gives this information to a server where it is then transmitted to everybody else connected to that server.

This method makes Ventrilo an attractive resource for gamers. The servers are more stable and more reliable than direct connections, and the voice quality is supreme. The program also happens to be very lightweight, as to not distract processing power from high performance games. Ventrilo is the choice application for gamers who want to talk to other gamers.

read more »

Find SQL Bottlenecks With CodeIgniter

Posted in CodeIgniter, How To, PHP, Web Development on April 6th, 2009 by j3nnings – 3 Comments

I have been using my latest project, VentStatus, as a an opportunity to learn a new framework: CodeIgniter. It has treated me well so far, most problems encountered only required a short workaround. Lately I’ve been concerned with the scale-ability of VentStatus, it’s my first project on this large of a scale. Luckily, CodeIgniter has some benchmarking classes built in, and it really helped me cut down my load times.
read more »