Archive for the ‘PHP’ Category

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

Here are some notes / interesting products/thoughts that were mentioned (apologies this is more of a set of notes for me than a proper blog post – if I get time I will refine this!)

Started the day on a conference call back to the office so had to miss the keynote which was a shame as it was by quite an eccentric guy who Microsoft have hired (as a UX Architect Evangelist) largely about keeping thing simple and usability from what I gathered of the end of the talk.

Day was very tough as a I had a late night catching up on various things to allow me to free up the Friday – its difficult sitting through talks when really tired!

Met with several former colleagues from my last company (and former colleagues from my current company) so was a bit of a blast from the past at times.

There appear to be a lot of development and interest around NoSQL / document based databases at the moment – definitely something to keep an eye on as it matures as a technology.
http://www.phpconference.co.uk/talks

RDBMS in the social networks age
by Lorenzo Alberton

Database Graph Structures via advanced features of SQL, using SQL-99 and SQL-2003 functionality that certainly MySQL doesn’t have any many other DBs won’t have the 2003 extensions. Obviously using this kind of advanced functionality will have an impact on Database server load.

This talk felt a bit like it was flying in the wind of most new thinking at the moment (although to be fair – this is partly what Lorenzo has now put on his website below) which is to keep your database tier minimally loaded as it’s the part that has most issues with vertical and horzontal scalability (keep most of the CPU load in the web app tier as its easier to add more nodes there).

Slides available at:
http://www.alberton.info/talks

Legacy Code Talk by Ibuildings
doxygen – code documentation for any language not just PHP

ctags.sourceforge.net

BOUML bouml.free.fr (reverse engineering capabilities)

phpcs – Codesniffer (part of PhpUnderControl)

Thoughts for tackling older PHP4 based projects and code bases – get them in Source Control, start to apply Continous Integration type approaches.

Suggestions made around
Full isolation (separate server)
Using wrapper classes
Possible code rewriting routes for legacy code:
Going from random mix of PHP business logic and HTML outputting to neater procedural based code
Procedural to OO
OO to full OO

CouchDB
Early sight of the possible future of web application data persistance and replication. Interesting that CouchDB makes uses of HTTP as the connecting protocol. Might be possible (but probably not desirable apart from specific cases) in the future to create web applications that are JS direct to CouchDB in certain cases?

http://couchdb.apache.org/

Web and mobile application monetisation models / Paypal X

Paypal appear to be launching a new platform / API

  • Adaptive Payments
  • Pay multiplerecipients at once
  • Partnership
  • Chained payments (e.g. commission based payments)

Bit disappointed by this one as it was about PayPal’s API (https://www.x.com) rather than strategies for monetisation which is what the title lead me to believe.

Web Services Best Practise
At the beginning lots of stuff about basic HTTP (eg HTTP headers, Verbs)that ever developer should know about.

Lorna (also from iBuildings) who gave this talk seems to have a bit of a sarcastic talking down to you type tone I found slightly annoying – maybe she gives training to newbies all the time or something. Or maybe I was just tired. She had some interesting things to say about Web Services design particularly towards the end of her talk. The talk was caveated as being a bit of “a rant” and it was exactly that in places – felt like she was having a go at everyone a lot of the time!

Beers at the end sponsored by Facebook were a nice touch though, although I only had time to grab a quick one whilst chatting to Mark Schaschke from iBuildings and a couple of guys from my previous company. Think next year I will sit this one out to allow more developers to attend as think they will get more value out of it.



October 24, 2008
Filed Under (Open Source, PHP, Technology, Web Development, Zend Framework) by Ollie Cronk on 24-10-2008

Today we put live the new Intranet at AEA which has been Kat’s major project (should get to spend more time with her now its launched!) with some support from me and impressive efforts from the dev team.

Previously we had a static HTML Intranet which wasn’t really serving the needs of the business as well as it could. The new site is based on the AEA Framework – which I’ve blogged about a bit before. Essentially an extension of the Zend Framework glueing Silverstripe and other 3rd party components together with a single sign on approach (in this case we are also using LDAP to do logins from our current Novell infrastructure). We built on our HTML content crawler tool to hoover in the static HTML into the Content Management System.

Over time we will leverage the framework to create more efficient web 2.0 style business processes and work with PPC to combine it with other off the shelf tools that they specialise in; and hopefully push it globally across the group…

I’ve also had some exciting news this week which I will share when I can.

All exciting stuff!



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…



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!