Diary of a CodeIgniter Site Day 3

Always getting ahead of myself...

I still don't have a real codeigniter site. I've done the basics - the directory structure is in place, I have some HTML layouts to work with as the 'skeleton' of my views, but if you are viewing this site on Mar 12 in the early morning, you're looking at dumb old HTML. So far 've mostly been working locally in Dreamweaver, but for php stuff, I like Netbeans, so I have take a few minutes to re-organize my local development environment and get synched with my live webserver.

My toolbox

This is what I use for most development:

  • Dreamweaver - fine for HTML/CSS, but sucks at php development
  • Netbeans - my favorite IDE
  • Transmit/Text Wrangler - a nice, cheap duo that works great for quick edits (and, of course, Transmit for FTPing stuff generally, and Text Wrangler for general text editing). Yeah, i know about Text Mate, but I'm cheap.

Get Organized

So I have to take a few minutes to synch up my local site with my live site. I also have to modify my local copies of 2 of my codeigniter files to reflect my local environment - I also have to be mindful of not uploading those and overwriting my server copies, or my site won't work anymore. In Day 2, I modified the $system and $application variables in index.php, that has to be changed to point at my local paths. And in osxsuxApp, the $config['base_url'] variable in config.php has be modified to my local paths. I have to do some googling, must be an easy way to setup your configuartion so that it detects the environment and uses the appropriate variables. For now I just do this in index.php:

//remote
//$system_folder = "/kunden/homepages/99/d123456789/htdocs/osxsuxdotcom/CI172";
//local
$system_folder = "/Applications/MAMP/CI172";
//remote
//$application_folder = "/kunden/homepages/99/d123456789/htdocs/osxsuxdotcom/osxsuxApp";
//local
$application_folder = "../osxsuxApp";

and in osxsuxApp/config/config.php:

//$config['base_url'] = "http://www.osxsux.com/";
$config['base_url'] = "http://localhost/xsuxlive/www/";

As a side note to Netbeans, I also want to set up things so I have good code completion - by itself, Netbeans isn't fully aware of available classes and methods in CI, so I found this handy script that creates a properties file that works nicely with Netbeans. You can read more and download it here. Also set CI172 (the codeigniter system folder) in your Netbean project include path.

While we're at it...

May as well take care of the htaccess as well, so we don't need the 'index.php' in our url's. Again we need 2 versions of that - on the live server, this works (at least on a 1and1 server):

AddType x-mapp-php5 .php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
ErrorDocument 404 /index.php

You have to change the index.php path for the local server, and you probably don't need the x-mapp:

#AddType x-mapp-php5 .php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /xsuxlive/www/index.php?/$1 [L]
ErrorDocument 404 /xsuxlive/wwww/index.php

Stepping back...

Okay, so where are we? My goal was to keep a running diary of this development effort, and that in itself is taking time. I don't have a database yet, and were are still serving static pages, written in Dreamweaver. And I have the accompanying website management hell - even with only 3 pages and and index.html, I have to update all those files as I add single page. The wrong way to do it. If it weren't for the diary, my time would have been spent on the backend first, but then of course, you would have nothing to see until it was done. So this is really the wrong way to approach a dynamic website. Time to change that.

Moving forward

Behind schedule as usual. Time to take break and rechart my course. A few things need to happen concurrently at this point - a database to store this content, and view system to display it. Security wll be important if I intent to allow user comments. I'm tired and my brain is muddled. Weekend tommorrow, I can spend an obsessively large amount of time on this then. Get back to you soon...

Your Comment
(Not displayed)
 Prove You're Human


eNxnCu <a href="http://eqsfiyyagkcw.com/">eqsfiyyagkcw</a>, [url=http://exqgyiuzvjeg.com/]exqgyiuzvjeg[/url], [link=http://snwfeywsgyam.com/]snwfeywsgyam[/link], http://kdsnavjrszjo.com/

NUH3JW <a href="http://aaaqimkdmlpv.com/">aaaqimkdmlpv</a>, [url=http://pkfqgvqxxxvl.com/]pkfqgvqxxxvl[/url], [link=http://kvkzokwagrvh.com/]kvkzokwagrvh[/link], http://ajobhpabclnv.com/