Here are Rob's Blog entries for June 2009.
- BBC NEWS | Magazine | The Tome Lord Before video and DVD, Dr Who fans who wanted a fix of the Time Lord in between the TV shows relied on a series of official novels. Writing for the Magazine, Mark Gatiss recalls his love of Dr Who's adventures in print
- Bauer ditches Ditto.net - Brand Republic News - Brand Republic LONDON - Ditto.net, the planned film and music consumer venture from Bauer Media, has been shelved following about £1m of development costs.
- 11 Time Lords plan charity shindig • The Register The BBC will unite every incarnation of Doctor Who for a one-off Children in Need special in November - with new Time Lord Matt Smith making his debut alongside William Hartnell, Patrick Troughton, Jon Pertwee, Tom Baker, Peter Davison, Colin Baker, Sylvester McCoy, Paul McGann, Christopher Eccleston and David Tennant.
- Bauer relaunches online ticket outlet Aloud.com - Brand Republic News - Brand Republic LONDON - Bauer Media has relaunched Aloud.com, the online ticket outlet that services its music and radio brands, including Q, Mojo, Kerrang, Magic and the Big City Network.
- Bauer overhauls Aloud.com | News | New Media Age Bauer Media has relaunched Aloud.com, the online ticketing shop for its sites including Kiss, Kerrang, Q and Mojo.
- Aloud.Com Relaunches With New Ticketing Partners - Bauer Media The official press release on the Aloud.com relaunch. I did the technical build of the site.
Bookmarks from del.icio.us
Entered: 2009-06-24 00:15:04
I've been doing quite a bit of work with the Catalyst MVC framework lately.
Moving from development to live, the config system has really shown it's usefulness. Instead of hardcoding values, we can simply move them out to the site's config file and access these value programatically. It means we can run the same codebase on multiple machines and just tweak the config to pick up things like different database connection strings, cache settings etc.
I like to have my config file in Config::General format as it's similar to Apache's config files, but Catalyst can also handle config files in INI, JSON, Perl, XML or YAML, so you can use whatever you are most comfortable with.
Let's have a look at a few examples. We'll assume the Catalyst Application is called MyApp. This means we'll have a perl module in our lib directory called MyApp.pm, and a config file called myapp.conf in the root directory.
MyApp.pm contains all the default values, but you can override these with myapp.conf. myapp.conf always takes priority.
Let's create a simple string to say where our application is running. In MyApp.pm, in the __PACKAGE__->config we add an entry to the hash like this...
servername => 'dev',
Now when we run our application, we can access this value using the following code...
$c->config->{servername};
This will return "dev". We can override this in the conf file, so in myapp.conf we can add...
servername production
Now when we run our application code, we'll see "production" instead of "dev".
A more practical use of the config file is to move out the database connection details. Let's assume we have a simple MySQL based model in our lib/Model directory called Model::MyApp that handles our database work. We can override database connection details stored here in myapp.conf using something like this...
<"Model::MyApp">
connect_info dbi:mysql:myapp
connect_info www-rw
connect_info password
<connect_info>
AutoCommit 1
</connect_info>
</"Model::MyApp">
Now when we run the application, the connection details we entered in our conf file will be used instead. This is very useful as it means we don't have to alter our codebase when we move the application to different servers that may have different databases. It's also good for keeping dev, staging and live seperate as all that's needed is a change to one config file.
For more information on how Catalyst can use a config file, have a look at
Catalyst::Plugin::ConfigLoader.
Entered: 2009-06-19 14:22:20
Bookmarks from del.icio.us
Entered: 2009-06-04 00:15:03
Bookmarks from del.icio.us
Entered: 2009-06-02 00:15:07