Web Development

Book review: CodeIgniter 1.7 by Jose Argudo Blanco and David Upton (Packt Publishing)

The CodeIgniter framework is a secret weapon for many web developers as it allows you to quickly build complex web applications in a structured and organised way. I started using CodeIgniter over a year ago now so I've approached Packt's CodeIgniter 1.7 by Jose Argudo Blanco and David Upson as a way of expanding upon when I've already learnt from the user guide, forums and a book which I had previously read from Wrox called Professional CodeIgniter by Thomas Myer.

'PHP Nature' missing from 'Project Natures' in Aptana Studio 2.0

For some reason, even though I have the PHP Development Tools (PDT) installed in Aptana Studio (2.0), I'm not able to select 'PHP nature' in the 'Project natures' of an imported project. I can start a new PHP Project which will have the 'PHP nature' selected as primary nature, but this doesn't even appear as an option in imported projects. The only two natures that are available are 'Remote Nature' and 'Web Nature'. The 'PHP nature' adds some really useful functions, like grouping my @todos into Aptana's Tasks view and also other handy things like auto-completing PHP docblocks.

To get the 'PHP nature' associated with your imported project you can manually edit the .project file which Aptana creates in your imported project directory so that it contains the 'PHP nature'. To do this, add the following code between the <natures> tags in your .project file:

<natures>
   <nature>org.eclipse.php.core.PHPNature</nature>     
</natures>

You may need to re-load Aptana to refresh the project but you should now find that your imported project has a primary 'PHP nature' set.

Note: Please do this at your own risk; although it worked fine for me I don't know if it will cause any side effects to the project or Aptana.

CodeIgniter 1.7 by Jose Argudo Blanco and David Upton

CodeIgniter 1.7I was recently sent a copy of a book from Packt Publishing to read and review called CodeIgniter 1.7 by Jose Argudo Blanco and David Upton. I'll be interested to see how the book compares to what I've learnt so far about CodeIgniter (>1 years experience CodeIgniter and >4 years php) and see what else it can offer, especially in terms of planning and managing application projects. The description on the Packt Publishing website says:

"This book explains how to work with CodeIgniter in a clear logical way. It is not a detailed guide to the syntax of CodeIgniter, but makes an ideal complement to the existing online CodeIgniter user guide, helping you grasp the bigger picture and bringing together many ideas to get your application development started as smoothly as possible.

This book will start you from the basics, installing CodeIgniter, understanding its structure and the MVC pattern. You will also learn how to use some of the most important CodeIgniter libraries and helpers, upload it to a shared server, and take care of the most common problems. If you are new to CodeIgniter, this book will guide you from bottom to top. If you are an experienced developer or already know about CodeIgniter, here you will find ideas and code examples to compare to your own."

I'll be posting a review of the book on my blog shortly. This review is now online.

Links

Firefox or Chrome

Chrome VS FirefoxHere's an edgy stand-off I find myself in the middle of every so often – Google Chrome or Mozilla Firefox as my default browser. From a day to day, quick browse, everything is on the web perspective I'd have to say I prefer Google Chrome. It's fast(er), simple and gets the job done. However, from a web developer perspective Firefox has the add-ons that you so sorely need. I've tried designing a Drupal Zen sub-theme with Chrome's 'inspect element' feature but it's not as comprehensive as the Firebug add-on for Firefox which I couldn't work without. However, when I want to check my daily barrage of social sites Chrome shaves off valuable seconds. For today, I'll leave Firefox as my default browser simply because of the add-ons – they're useful, I need them and I don't mind sacrificing a bit of speed.

Twitter and the short URL conundrum

Although the spam seems to be dying down a little on Twitter since they introduced their 'report as spam' option I'm still a little cautious about clicking some shortened URLs - SO many of the links seem to lead to spam (spam and more spam). The whole concept seems to have gone full circle as well with people using extensions like Long URL Please to make the short URL long again. Although I think this is a good a useful add-on, the whole process seems a little excessive. I can see benefit in using shortened URLs in printed media but, when it comes to the web, why are we making links short just to make them long again? I guess Twitter has a big part to play in this by restricting messages to only 140 characters, but surely there's got to be a better way?! With this in mind, I've been trying to get some perspective on the issues. Shortened URLs:

  • You can't see where the link is going to take you (without a plugin)
  • Because most are obscure, they are difficult to remember
  • Multiple links may be created to the same resource
  • Added overheads in the redirection process
  • People can track who has visited the link
  • Spam links look the same as legitimate links

With this in mind

Maybe Twitter could implement a better way for sharing links without using shortened URLs. If links could be 'attached' to tweets and replaced with a token in your message then it would be like wrapping an HTML 'a' tag around some text. You would be able to see where the link is taking you and the message is still short (or even shorter, as there is no more http://).

Free subversion repository hosting accounts

Rails Code

I've come across a few subversion hosting services which offer free accounts so I thought I'd share the links. Most of these seem to offer a limited free account and a range of paid accounts. If you're working with subversion a lot and you come to rely on them then you may want to upgrade in the future - at least you can try them out first for free. However, if you're developing one or two projects on your own you may be happy to stick with the free account. These details are for the free accounts only, and most offer a lot more for the paid account (for example, SSL access, more users, repositories, etc.).

Service Storage space Active projects/repositories Users SSL
Beanstalk 100mb 1 3 No
ProjectLocker 500mb Unlimited 5 Yes
Slik SVN 10mb 1 1 Yes
Springloops 100mb 3 Unlimited No
Unfuddle 200mb 1 2 No
XP-Dev 500mb Unlimited Unlimited No

These details are only up to date as of when I submit this post so make sure you have a look through the links to see what you're getting. If you're looking at hosting an open source project you may want to look at Google Code (http://code.google.com/projecthosting/) and SourceForge (http://sourceforge.net/).

CodeIgniter 1.7.0 Released

It's that wonderful time again! CodeIgniter 1.7.0 has been released, so it's time to upgrade.

http://codeigniter.com/user_guide/installation/upg...

Upgrading looks fairly straight forward - here are some notable changes (http://codeigniter.com/user_guide/changelog.html):

Protecting a Drupal site from hotlinking

What is hotlinking?

Hotlinking, sometimes called image leeching or hot linking, is where another website embeds an image which is stored on your web host. So, for example, if you want to add an image to your website, you can upload the file to your web host then embed the image into your HTML referencing the source for the image as the location of the file on your web host. When someone accesses the HTML page where the image is embedded the file will be downloaded from your web host. If you don't protect against hotlinking, someone could embed that same image on their web page, which means that every time someone accesses their page, the image will be downloaded from your web host and drain your bandwidth. Don't do this, it's not cool and some sites see it as stealing.

Dreamweaver closes straight after opening

This really is one of the strangest software bugs I've come across!

The Problem

Dreamweaver crashes and won't open again. When you try and open Dreamweaver it just closes straight away, with nothing more than a glimpse of the splash screen.

The Solution

One of the CSS files in the site you were working on has a file size which is a multiple of 8kb (mine was 24kb). You can try anything; rebooting, reinstalling, but Dreamweaver won't play ball if the file is still there. You need open the CSS file in another text editor and add a few dummy lines of comment text to increase the file size slightly; you should then find Dreamweaver will open again normally.

Thanks to David Powers for this. Please feel free to leave any comments below.

Welcome Drupal 6

Drupal 6 was released today! After having a play with the beta and release candidates...well, I don't have to say; this really is a phenomenal release! Here are some of my favourite new features which I'm looking forward to using:

  • Extended logging - You can set Drupal for OS level logging
  • Batch API - A progress bar can track tasks running in the background through multiple HTTP requests
  • Scripting from the command line - This is really cool! You can now run Drupal code through the command line
  • Forum improvements - Granular permissions can allow more control over forum moderation
  • Sticky table headers - Does what it says on the tin
  • Drag and drop features - Again, the tin...
  • CSS only theming - Define regions etc. in .info files without writing any php code, then set styles in CSS

Well done to everyone who has been clearly working hard on this!

Syndicate content