Archive for April, 2008

There’s a new planet – planet.php.ie

Wednesday, April 16th, 2008

After a bit of discussion on the php.ie mailing list, Kae Verens and David Coallier set up http://planet.php.ie to bundle together blog postings from people within the Irish PHP community – a big thank you is deserved for them.

If you want your blog added to this ‘planet’ please contact either Kae or myself.

On other news, I’m going to start documenting PEAR_Size real soon.

“unable to find swap space signature”

Tuesday, April 15th, 2008

My darling wife told me when I got home from work today that the laptop, running Ubuntu, was a bit slow.

On a hunch, I ran free -m and saw that the swap file wasn’t being used. I rebooted it, and sure enough saw the phrase “unable to find swap space signature”. This generally means that the swap file needs to be regenerated (this can happen with some laptops if they unexpectedly drop into hibernate mode), so I rebooted into Recovery Mode and:

  • I checked the output of fdisk -l to ascertain which partition the swap space was on (/dev/hda3)
  • Recreated the swap space with ‘mkswap /dev/hda3‘ and activated it with ‘swapon /dev/hda3
  • I then opened the file /etc/fstab and edited the line referring to the swap space so it would be referred by /dev/hda3 rather than the UUID value.
  • rebooted and kept my fingers crossed.

Everything worked just fine.

What I’ve done recently

Friday, April 11th, 2008

Travis asked What did you do today? recently – and what he did all sums up to an amazing level of work.

I felt a need to answer this question myself. This is what I’ve been keeping myself busy with recently:

  • Released version 0.18.0 of Date_Holidays – this includes drivers for Iceland, Romania and the Ukraine along with some bug fixes.
  • Released version 1.0.1 of Validate_IE, focused solely on adding validation for the 089/Tesco mobile phone network.
  • Released version version 0.1.2 of PEAR_Size. This includes integration with the PEAR command.
  • Wrote a review of CodeIgniter for Rapid PHP Application Development.
  • Kick-started a discussion on aggregating blogs of people in the Irish PHP Users Group.
  • I’m trying to decide what to do with the codebase for the website of the Irish Linux Users Group – at the moment it’s all rather cobbled together and isn’t providing as much functionality to the community as it could. I’ll most likely migrate it over to using a more general purpose framework plus ILUG/User Group specific components.
  • Book Review: CodeIgniter for Rapid PHP Application Development

    Thursday, April 10th, 2008

    A while ago packt sent me another book to review – this time it was “Code Igniter for Rapid PHP Application Development” by David Upton.

    Similar in size to the PEAR Installer Manifesto, this book weighs in at 240 pages, is aimed at developers new to CodeIgniter, and is split into 15 chapters:

    1. Introduction to CodeIgniter
    2. Two Minute’s Work: Setting up a CodeIgniter Site
    3. Navigating your site
    4. Using CI to Simplify Databases
    5. Simplifying HTML Pages and Forms
    6. Simplifying Sessions and Security
    7. CodeIgniter and Objects
    8. Using CI to Test Code
    9. Using CI to Communicate
    10. How CI Helps to Provide Dynamic Information
    11. Using CI to Handle Files and Images
    12. Production Versions, Updates, and Big Decisions
    13. Instant CRUD – or putting it all together
    14. The Verdict On CI
    15. Resources and Extensions

    Chapter one is a bare-bones introduction to what CodeIgniter is and why it was initially developed.
    Chapter two details how to set up an initial site with CodeIgniter.
    Chapter three introduces the reader to the concept of the MVC pattern, what it is about and how CodeIgniter implements it.
    Chapter four details the ActiveRecord class for interacting with databases.
    Chapter five shows the reader how to specify a View, how to nest them for better reuse and demonstrates CodeIgniter’s Validation class.
    Chapter six is about session management and securing applications.
    Chapter seven, if the reader requires a refresher, explains Object Oriented Programming and through some examples shows that CodeIgniter does not take advantage of PHP5′s enhancements in that regard. It also looks at the object model in CodeIgniter.
    Chapter eight details how to perform unit tests, benchmarking, profiling and how to use mock database objects for test purposes.
    Chapter nine is about various machine-to-machine communications: FTP, mail and using xml-rpc for providing webservices.
    Chapter ten focuses on internationalization, caching and string manipulation.
    Chapter eleven is about file uploads, downloads, compression and image manipulation.
    Chapter twelve discusses various topics relevant to migrating your code from your development servers to production.
    Chapter thirteen details CRUD operations in CodeIgniter.
    Chapter fourteen takes an objective look at what the book has covered as regards CodeIgniter’s abilities and what the author chose to not cover – one admitted omission is a lack of focus on AJAX.
    Chapter fifteen, the last one, provides a list of resources and extensions that the dear reader will want to investigate. These include, but are not limited to, graphing and AJAX classes, methods of authentication and CRUD libraries.

    The book is written well and the inevitable – yet thankfully small – number of spelling and grammar mistakes in the books don’t detract from the book as much as in the SOA one. I got the impression while reading chapter eleven that the author is not particularly knowledgeable about file permissions on linux/unix and specifies the most permissive options for those platforms which is a bit worrying.
    I was amused to find the book “PHP Programming with PEAR” gets a mention in the “Resources and Extensions” chapter, more so because CodeIgniter seems to be a framework that has a chronic case of “Not-Invented-Here” syndrome and attacks the PEAR framework on the main page of it’s website and userguide.

    All in all, I found the book to be a straight-forward, educational read and that it works very well alongside the CodeIgniter online documentation.
    Well worth the read if you are new to CodeIgniter.
    Addendum: Kae asked if reading this book might make me inclined to use CodeIgniter; while I found it very interesting I was also shocked that there is no inclination of embracing and utilising PHP5 enhancements and the chronic NIH present in the framework makes me feel very reluctant to use CodeIgniter. There is a spin-off or fork of CodeIgniter called Kohana that takes advantage of PHP5. It may well be worth investigating.