ZFSnippets.com now managed by bescript.de

June 1st, 2010

Not so long ago, I posted requesting that people who fancied maintaining ZFSnippets.com should get in touch and see if I could hand it over. Thanks to everyone who volunteered (sorry I didn’t get back to you all individually!) and eventually I decided to hand it over to German PHP outfit, bescript.de. Ben was very clear and excited in his email and after discussing it with him I knew the handover would be nice and easy and bescript.de would take good care of the site. They have already added new features and ticked some items off the uservoice list!

Again, thanks to everyone who got in touch and best of luck to Ben and his team with the site.

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati

Set MySQL connection variables with mysql-proxy

June 1st, 2010

We recently moved the application I work on everyday to Amazon Web Services and bravely adopted their Relational Database Service (RDS) and have had little trouble thus far, but the other day I noticed since we kicked into BST, timestamps in the database where an hour behind. Low and behold, the default time zone cannot be changed. Luckily, we’ve been using mysql-proxy since we migrated and rather than changed our application, I managed to knock up a lua script that sets the timezone variable on every query. It would be nice if it could do it when it creates a connection, but I’ve not worked out how to do that yet!

---
-- read_query() can rewrite packets
--
function read_query( packet )
        if string.byte(packet) == proxy.COM_QUERY then
                proxy.queries:append(1, string.char(proxy.COM_QUERY) .. "SET time_zone = 'Europe/London'", {resultset_is_needed = true})
                proxy.queries:append(2, packet)
                return proxy.PROXY_SEND_QUERY
        end
end

---
-- read_query_result() is called when we receive a query result
-- from the server
--
function read_query_result(inj)
        if (inj.type == 1) then
            return proxy.PROXY_IGNORE_RESULT
        end
end

If anyone could point me in the general direction for setting the variable at connection time, it’d be appreciated. I assume I can create a create_connection function, but I don’t know where to go from there.

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati

Wanted: New home for zfsnippets.com

April 26th, 2010

Update 27/04/2010: I have received a number of enquiries via email and I’ll be going through them to try and find the best candidate, I’ll also make an effort to reply to all emails I’ve received. Thanks to all for your interest.

It’s been just over a year since I initially launched zfsnippets.com, it was a good little project for me to get used to the Zend Framework, but since then I’ve totally neglected it. I’d normally leave a website going despite my lack of enthusiasm, but I no longer need the VPS it is hosted on so I’m looking for someone else to take the project on and move to their hosting solution.

My interests have moved quite rapidly in the last year and the project is sadly no longer of interest to me. ZFSnippets receives approximately 2,500 visits a month, so I think it’s worth keeping the project alive.

screenshot2

If you’re interested in hosting the site and hopefully building on it and improving it, please email me, dave.marshall _at_ atstsolutions.co.uk.

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati

Review: Zend Framework 1.8 Web Application Development

February 11th, 2010

Zend book image

Sometime last year, I, along with quite a few others, was asked to review one of
Packt Publishing’s new books, Zend Framework 1.8 Web Application Development, written by Keith Pope. They sent me a copy, which was very good of them and although it’s taken me ages to finish and get round to writing this review, that’s not a true reflection of how good the book was, I’m just a very busy/lazy person! So lazy, that I did in fact say I’d have it done in two weeks, which turned into 4 months.

Packt asked if I’d be interested in reviewing the book, so watch this space, I’ll be back in a couple of weeks with a review.

My Post dated 15/10/2009

Introduction

Design, develop, and deploy feature-rich PHP web applications with this MVC framework

That is the books strap line, and it does exactly what it says on the tin. The bulk of the book actually takes you through the design, development, testing and deployment of a real world example application, called the Storefront. The book claims that it is written for PHP web developers that are either using or looking to start using the Zend Framework and that a basic knowledge of Object Oriented design would be helpful. While you might be able to manage without any OOD experience, I’d say you definitely need some to get the most out of this book, as the second chapter digs right under the hood of the Frameworks MVC architecture. My personal experience was that I got to learn all the things I haven’t had time to learn, I’ve been using the Framework for a couple of years now, always appreciating, but not always understanding what it was doing for me.

MVC Architecture

The first chapter gives you a brief overview of creating an MVC application in the Zend Framework, experienced users of the Framework will probably want to gloss over this part, whereas people looking to start using the framework should take their time and take things in. The next chapter is when I really started to enjoy the book. Each component of the MVC architecture is presented as it’s own topic, with each component getting a breakdown of Design Patterns/theory, default settings/configuration, usage and finally customisation.

The chapter is well put together and considering the amount of information portrayed, is not overwhelming.

Storefront Application

The rest of the book provides the information you need about the framework around a real world example application, called StoreFront, which is a basic e-commerce application. I should point out that I didn’t code the application as I went, if I’m reading I like to read, but where appropriate I have used the book as a reference when updating my existing Zend Framework applications.

The best thing about these chapters though, is some of the design theory you pick up on the way, that isn’t directly relevant to the Zend Framework, but can be applied to any framework out there. Best practices such as Fat Models, Composition, Fluent interfaces are all explained in detail, along with relevant and realistic examples. Further more, the applications MVC separation is excellent, taken in context (it might be a little overkill for the example application, but is there to show you the methods).

After taking you through the creation of the application, the book then takes you into optimisation and testing. The optimisation takes you though some general PHP optimisation techniques, but then ploughs into techniques like a transparent abstract cache that is applied to the models. Testing is carried out with the trusty PHPUnit, along with the frameworks extension of the library Zend_Test and the book goes on to integrate the test suites with apache ant (why not phing) and phpundercontrol.

Conclusion

In conclusion, I thought this book was an excellent read and I plan to follow it through again when I build my next ZF app (I have two good ideas in the pipeline). Find out more or and buy it!. Thanks to Packt for sending me a copy!

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati

Zend Framework 1.8 Web Application Development

October 15th, 2009

Packt Publishing have recently contacted me letting me know about one of their new books, Zend Framework 1.8 Web Application Development. It looks reasonably priced, and if you fancy having a quick look before you by, the author Keith Pope has a free chapter to download. Packt asked if I’d be interested in reviewing the book, so watch this space, I’ll be back in a couple of weeks with a review.

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati