Archive for the ‘Web Development’ Category

July 21, 2008
Filed Under (Open Source, PHP, Technology, Ubuntu) by Ollie Cronk on 21-07-2008

Warning! Techy post – if your not into Web development you’ll want to skip this one…

I’ve been wanting to try out Zend Core (Zend’s standard PHP stack / extension or “Reliable PHP made easy”) for a while but as Ubuntu isn’t officially supported I’ve held off. A problem with some code running on the Ubuntu version of PHP 5 forced my hand – I discovered that its actually not that hard to get ZC up and running on Ubuntu. Thought I’d share in case this is helpful to anyone…

  1. Download, unpack and run the ./install command as per usual
  2. I opted to stick with the version of Apache already installed (as its slightly newer than the Zend bundled one)
  3. My experience of Zend attempting to configure Apache varied – one some boxes it almost worked, others it didn’t. If you find the installer crashing out just untick the configure Apache option and try again.
  4. Once Zend Core has completed you’ll need to tweak things abit…

PHP5 Module

The ZC installer will have probably left your Apache configured with 2 LoadModule php5_module entries (one in /etc/apache2/apache2.conf – thanks to ZC and the other Ubuntu one in /etc/apache2/mods-enabled/php5.load). So you can either do a sudo a2dismod php5 to remove the Ubuntu one or modify the Ubuntu one to the following:

LoadModule php5_module /usr/local/Zend/Core/modules/apache22/libphp5.so

In fact you can be cunning here by commenting out the Ubuntu PHP5 extension and adding the ZC one in this file – allowing you to effectively switch between the 2 different extensions should you need to.

MySQL extension – if you’re using MySQL then you’ll need to watch out for the fact that the bundled MySQL extensions look for the MySQL socket file in /tmp/mysql.sock rather than the Debian / Ubuntu location which is /var/run/mysqld/mysqld.sock

In most cases changing in php.ini:

mysql.default_socket =
to
mysql.default_socket = /var/run/mysqld/mysqld.sock

Does the trick; but alas not in all cases it seems (eg MySQL PDO). Really hacky fix to this (please do let me know if you have something better – other than editing the socket in the /etc/my.cnf file) is to run a scheduled (using crontab) symlink of /var/run/mysqld/mysql.sock to /tmp/mysql.sock

To do this run: sudo crontab -e
and add the following line:

 5 * * * * ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

And for now that works for me. If you want a copy of some of the relevant config files / snippets (including the extra bit that ZC adds to the apache2.conf) then I have zipped them up for ease.

Zend Core itself looks like a good product – being able to access to php.ini options via web based tool is pretty useful, as is knowing you are working on a consistent & tested version of PHP. Its a shame MySQL doesn’t offer a similar free / unsupported version of their MySQL Enterprise in a similar way really…



July 05, 2008
Filed Under (Technology, Web Development) by Ollie Cronk on 05-07-2008

I’ve blogged about Facebook before here and here when I was talking about privacy; came across a couple of videos on BBC news (talking of which is really impressive the video and audio quality has vastly improved over last time I used) about facebook – one of which is about a facebook privacy flaw relating to Google applications. What they don’t tell you is how you can fix this…

If you want a workaround to prevent this then when next logged in to FB go to “privacy” option (which is top right), then “applications” then “other application”, scroll down until you see the image below:

Click to view full size version

Note that I’ve unticked the Basic Info and Personal Info (I’ve actually now unticked Work and Education too) as can’t really see why a Facebook application really needs this stuff in any case.

The other video is about a police force developing some kind of app that allows the local community to help fight crime through alerting them to crimes and related news. Thats pretty innovative and cutting edge for a Police force and is definitely food for thought for other uses in the public sector.

I’ve also changed my facebook password as realised it was the same as a couple of other sites and seeing as Facebook is probably a massive target / security risk (as makes such a juicy target) decided that it wouldn’t be good if someone got hold of my personal details AND a password I use for some other stuff (note to self: use password management and more passwords!!!).

We’re doing some ISO27001 stuff at work at the moment which is really making me re-think information security stuff…



June 17, 2008
Filed Under (Environment, Web Development) by Ollie Cronk on 17-06-2008

Really impressed with the work my colleagues have done on the new AEA website (http://www.aeat.co.uk). This also includes the ecopath website which will be vastly expanded in due course.

AEA home pageI can’t claim to have been hugely involved (other than some bits and pieces behind the scenes) although this is partly because they kicked off the project whilst I was in Paris (talk about quick turn around!). The plan is to move it to the Silverstripe CMS in due course which will make management and updates easier.




May 02, 2008
Filed Under (Open Source, PHP) by Ollie Cronk on 02-05-2008

This blog is now running the latest version of WordPress which offers an overhauled admin area one of the first enhancements you notice is a nice new dashboard with metrics.

WordPress 2.5.1 dashboard screenshot

Widgets management in WordPress 2.5

I’ve discovered the dynamic sidebar (which allows widgets to be added using the visual admin interface rather than editing code in the template files) and switched on the tags widget in this version (I’ve been tagging articles for a while they’ve just never shown up). See the bottom screenshot – what you can’t see is the nice drag and drop re-ordering of the widgets in the sidebar.

Some playing around was needed to get the tags looking reasonable in the sidebar. By default tags are just rendered in text or flat mode. However by changing the line 1362 in widgets.php from

wp_tag_cloud();
to:
wp_tag_cloud($args = array('format' => 'list'));

The tag cloud will then render as a HTML list which looks a bit better (until I can get around to doing some styling and turn it into a true tag cloud – where the tag words get bigger the more popular they are).



March 27, 2008
Filed Under (Open Source, PHP, Technology, Web Development) by Ollie Cronk on 27-03-2008

Really impressed with the latest release of MediaWiki (the software that runs Wikipedia). Just upgraded the Wiki we use at work from 1.9 to 1.12 – the upgrade was pretty much problem free – some new features I’ve found useful:

  • Will now email you pages that change on your watchlist – if you give it your email address in the preferences section
  • Nice WYSIWYG editor – using the latest FCKEditor Plugin which is now hugely easier to setup (was an absolute pain and a hack to get it working before)
  • Discovered the Geshi syntax highlighting – thanks to Lorna‘s (from iBuildings) Blog

If you are looking for Wiki software (and don’t have the budget for Confluence – which looks very nice indeed) then check it out – mega easy to install and dead easy to use once you install the FCKeditor plugin (as Wiki text can be a bit of a barrier to adoption).

FishEye

Setup FishEye this week – if you have SVN or CVS then you have to check this out – has instantly made my life easier – and I think it will really help the growing dev team at AEA too…



March 15, 2008
Filed Under (Open Source, PHP, Ubuntu, Web Development, Zend Framework) by Ollie Cronk on 15-03-2008


March 12, 2008
Filed Under (Open Source, PHP, Web Development) by Ollie Cronk on 12-03-2008

Update: We have now gone for Vanilla forum which is really nice. PHP4 but has a really nice interface, next step Framework integration!

This is more for notes to myself for now – that I installed bbPress (by the same developers as WordPress that this blog runs on) and Phorum 5. To see if they are any good / worth using at work (eg will they integrate well with other web tools/the Zend/AEA Framework, how well are they written and documented, whats the licensing etc).

Dev site links and notes:
bbPress Logo

bbPress: http://blog.cronky.net/bbpress/

This integrates quite nicely with WordPress (uses the same users) would be good if it could use more of the WordPress installation stuff (eg templating). Also has a nice Poll plugin (although code for this looks a bit hacky).

Cons: PHP4 based, Doesn’t look very mature from its version number, GPL license might cause issues when integrating.

Phorum 5: http://sucrose.cronky.net/phorum/

Particularly interested in this one as it looks good / feature rich but it is also BSD licensed making it more flexible to customise and incorporate into other frameworks without having to re-release an Open Source version.

Cons: Again PHP 4 based.

Silverstripe Forum Module (need to install on dev box)

The other thing to consider is whether a dedicated tool like one of the above offers compelling advantages over the Silverstripe Forum module (although the Forum module is a bit alpha in our experience so far – but then it is at v0.1.2!)

Some benefits of the SS module include PHP5 / MVC implementation, that we are already using SS for CMS anyway…



January 20, 2008
Filed Under (Open Source, PHP, Web Development) by Ollie Cronk on 20-01-2008

Recently re-worked the website I put together for LSA Ltd: www.travelf1.com to allow for easier updates by Lynden and the team.

It now uses Silverstripe 2.2.1 – an excellent open source Content Management System (we are using it extensively at work for “brochureware” – or sites that would otherwise be static HTML files – put together in Dreamweaver or similar).

Check it out if you are looking for a CMS – has some great features for both the end administrator (nice visual interface) and the developer (uses PHP5 and MVC).



December 04, 2007
Filed Under (Environment, PHP, Web Development, Zend Framework) by Ollie Cronk on 04-12-2007

Green500 site Screenshot

London Green500 is an exciting project I’ve been working on for the last few months. The full details of the programme for the London Development Agency will go out next week.

In a nutshell its a Carbon Management program for large organisations in the London area – aimed at reducing CO2 emissions by 1.5 million tonnes over the next couple of years. Today the marketing site went live (which is mainly a Content Management System), later in the month the Customer and Administration parts will go live. This post also has a bit of an ulterior motive – getting the site into the search engines – as its brand new and I know my blog is crawled by Google etc.

From a development standpoint the Customer and Admin areas are more exciting as they are powered by the “AEA Framework” which is major initiative I have been working on since I joined AEA earlier in the year as Architect/Senior Developer. Zend Framework (and therefore PHP5) powered, with Smarty for views (of the MVC part) some nice templating and other modules to support the various projects at AEA.

When I can spare a bit more time I’ll post some more stuff on the AEA Framework. All I say for now is that at the moment I’m putting the finishing touches to what we are calling Advanced Forms. Forms that (as an Administrator) you can edit via the site right down to the field and validation level. So you can build complex multi-page forms and ultimately processes with less code – actually mostly from the site itself). We are also integrating YUI components such as the Datatable. Can’t wait to write more about it!

Update on Green500 – see http://www.londonclimatechange.co.uk/greenorganisations/making-it-happen/green500/
and http://www.london.gov.uk/view_press_release.jsp?releaseid=14873

It made it on to the BBC news site too – which is good news.



October 31, 2007
Filed Under (Open Source, PHP, Technology, Web Development) by Ollie Cronk on 31-10-2007

This will be the first in a series* of articles on web applications development – not the specifics about programming, but more tips on the infrastructure and processes that can make life easier, more productive, successful and better aligned with best practises. Its based on my experiences of being in development teams and leading development teams.

I see these articles as being useful to a development team thats growing from a 1 or 2 man operation to a larger team and is perhaps using Open Source development tools such as PHP/PERL/Python and perhaps aren’t in a very processes driven environment…

Documentation

Most developers won’t generally document their work as a matter of course – either they simply forget, overlook it or its just not that exciting for them. So 3 things:

  • Illustrate the value of documentation
  • Build it into the development process
  • Make it exciting (oh okay you can never make documentation that exciting – so lets settle for a bit more interesting!)

Illustrating the value – most developers are already sold on documentation being a generally good idea but others aren’t. Some fear that by documenting they loose control over the project or the work that they primarily work on (in fact the reality is that is the opposite…) or they just really don’t see the point. Highlight the facts that it enables team work, improves quality, makes support and changes easier etc. Also that holding all the knowledge up in your head means that you are stuck in your current role as its not easy to bring others in to do what you do so you can be promoted.

Another great benefit is inducting new team members – it allows you to point new team members at the wiki site to help them get up to speed quickly – and you can also use that process to fill in any gaps in the documentation (and get the new start to include their tips and findings as they learn the ropes…

Build it into the development process – obviously you need to have a development process if you haven’t got one but once you have it just becomes part of the steps:

  • Requirements Gathering – document
  • Spec/design – document
  • Build/development – document

So ensure that documents are required for each step in the process – and make time for that documention. The nice thing is that documentation is a lot easier if done throughout the project life cycle rather than all at the end (then it is just really daunting) – as generally what you plan to do is what gets delivered (and if things deviate from the spec during development you can just adjust it)…

Make it more interesting – its more that just that in reality as its picking a documentation tool that supports the above points and works for the team. For me development documentation seems to works well with an internal/Intranet Wiki (something like MediaWiki for example). The main benefits (over office docs for example) it allows easy collaboration, allows for a geographically disbursed team and is generally nicer than using word processing software. It’s made more interesting by feeling very “Web 2.0” (as much as I hate the phrase!) and has some great tracking features – like the recently edited articles page. Once the team have seen the advantages and you bore you colleagues to death with “the W word” then you’ll find that you have a healthy wiki site and documentation, documentation, documentation (with any luck with minimal pain!)

Categorising the Wiki – here are some ideas on some categories that work:

  • Projects – Pages under here relate to discrete projects the team is working on
  • Infrastructure – documentation on the dev, staging and production server environments (eg Server configs, IP addresses, SLA details)
  • Process – Reference guide to the development and other IT processes so the team can refer to them and also make contributions and feedback on what is working.
  • Meeting Notes – Agendas and minutes for meetings – if you get this right then these allow for team communications when needed (rather than at forced meeting dates) and are links to other pages on the Wiki where the full details of a proposal or a project is available.

Blogging

Another option (which has some other positive side effects including marketing) is blogging about development projects – and this is something I am considering for my current team. The Wiki will be for the more technical and internal documentation aspects and the blog for what the project actually does. The added benefit of the blog is that it can do some link / SEO stuff for your projects and raise the profile of the development work that your team is doing to a wider audience. This is particularly useful if you develop an Intranet system for your company – where you are adding new features or enhancements over time.

To make MediaWiki easier to use (for those who aren’t familar with the syntax used on Wikipedia) we enabled a WYSIWYG editor – FCKEditor. There is a whole range of great Wiki software out there if you don’t like the look of MediaWiki – just do a Google or have a look at wikimatrix.

The next articles will more than likely be about:

  • Project Management tools (eg FogBugz) –
  • Development Meetings and Communication
  • Using a Framework (eg Zend Framework)

… watch this space!

*I don’t know how many there will be yet but if they are received well then heck there might be as many as 3 or 4!