I love Sherlock, but just how did he pull off his own fake death at the end of series two? Molly was obviously involved, my wife thought he just threw Moriarty off the roof but on a second watch it doesn’t look that simple. Read the rest of this entry »
The Reichenbach Fall
January 24th, 20122012
January 1st, 2012All has been a bit quiet here of late, 2011 was a very busy year for me both with work and family life. With half an hour left of the first day of 2012 I thought I’d record a few resolutions for the oncoming year.
- Photography – I have a great Canon 40D camera which apart from a fabulous trip to New York City has been unloved in the past year. I want to photograph more in 2012, starting with my attempt at the 365 project over on Flickr
- Writing – I also love writing, when I give myself the time to do so. I intend to write more in 2012 and will try to get my writing published elsewhere than just my own blog.
- Family – With Daniel almost 2 and Billy 4, our two boys are becoming very interesting little people. It goes without saying the next year will be full of lots of family time, but it doesn’t stop me making sure I remember it should be my focus.
- Cycling – I rarely cycle to work these days, even though the 4 mile journey is less stressful via bike than car (and takes about the same time). Really need to do this more to offset the beer and pies
Let’s see how I do in a few months time!..
Taming MAMP on the command line (and upgrading PEAR)
June 24th, 2011I’ve posted a new article to our company website on how to get MAMP, the command line and PEAR working together in harmony.
Take a look at http://www.studio24.net/blog/taming-mamp-on-the-command-line-pear
“EMBARRASSING: Father caught daughter on webcam” Facebook exploit
May 17th, 2011I spotted a post today on Facebook which looked rather suspicious. The link was titled “EMBARRASSING: Father caught daughter on WEBCAM!!!” and was obviously designed to lure people in to clicking on the link. It went to the URL qok7.info which claimed to have a YouTube security verification notice (a CAPTCHA) you had to fill in before viewing the video.
In fact, it’s a clickjacking exploit that contains a hidden form which submits a public comment on your Facebook account with a link back to this site. I first came across clickjacking exploits on Chris Shiflett’s blog, it’s a cunning method of hiding a real form within an iframe behind something like an image that usually has something clickable on it. In this case it has a fake CAPTCHA form whose fake form elements are lined up to submit the real Facebook status update form hidden in the iframe.
This exploit may be related to the daughter on webcam issue reported by Sophos or this might just be an example of very successful keywords used by scammers.
I see it’s been reported on Facebook’s security pages, I don’t know if it’s something Facebook can technically fix but I would hope they can ban links from this website to avoid users inadvertently spreading this exploit.
So if you’re a Facebook user don’t go clicking on links about daughters on webcams. Or any suspicious links for that matter. Always check URLs and if it looks dodgy, get out of there!
Checking your Zend Framework route order
February 8th, 2011The order that you create your routes in Zend Framework is important, with the last route defined in your code being matched first. This allows you to set up custom routes and if these aren’t matched Zend Framework helpfully falls back to the default route which is set up first. If you have a lot of routes though, set up in different places, it can get difficult to verify the order of your routes.
Just use this snippet of code in your controller to return a list of route names set up in your ZF application in the order they are matched via the routing system (i.e. the route at number 1 is matched first, then route 2, etc).
// Output list of routes, in the order they are matched
echo '<ol>';
$routes = array_reverse($this->getFrontController()->getRouter()->getRoutes());
foreach ($routes as $name => $route) {
echo " <li>$name</li>\n";
}
echo '</ol>';
Find out more about the ZF Router at the ZF manual.
A contents index for Zend Framework manual pages
August 5th, 2010The good old Zend Framework manual pages do suffer from being somewhat lengthy. I’ve thought they could do with an index to make navigation easier on those oh-so-long pages. So I wrote a quick JavaScript bookmarklet to do just that.
Understanding the stack index for Zend Framework Controller plugins
July 15th, 2010Zend Framework Controller plugins are a powerful way to inject logic into your controller system at various points, such as before and after an action dispatch. Plugins are run in the order they are added, though it is possible to change the order by defining a custom stack index. ZF internal plugins such as Zend_Controller_Plugin_ErrorHandler, which displays a nice Error 404 page, has a stack index of 100 to ensure it runs near the end of any plugin cycle. However, it’s not so obvious from the ZF manual how to set a custom stack index.
Read the rest of this entry »
Sub-modules in Zend Framework
June 20th, 2010Following on from my post on Admin sub-modules I’ve refactored the code into a more generic sub-modules system. And fixed some bugs!
Its main features are:
- Organise modules into sub-folders where you need to support a complex collection of controllers, views, models, etc
- Supports URLs in the format: /sub-module/module/controller/action
- Supports ID route: /sub-module/module/controller/action/id
- Registers controller folder to support above URLs
- Autoloads module resources (using Zend_Application_Module_Autoloader) in the format: submodulenameModulename_Resource (i.e. AdminUser_Form_Registration)
This supports URL routes such as:
www.domain.com/admin/user/ ->
application/admin-modules/user/controllers/IndexController.php
www.domain.com/cms/news ->
application/cms-modules/news/controllers/IndexController.php
It’s a bootstrap resource that can be enabled in your application.ini file as so:
; 'admin' key is the name of sub-module group = path to sub-modules directory resources.subModules.admin.directory = APPLICATION_PATH "/admin-modules"
Zend Framework Application Patterns at DPC10
June 11th, 2010I’m currently in the fine city of Amsterdam enjoying what is incredibly my first PHP conference in ten years of developing with the language! Yesterday was tutorial day, with the full conference starting today, and I sat in Zend Framework Application Patterns by the informative and engaging Matthew Weier O’Phinney and Rob Allen.
The session was excellent, well worth attending, and dipped into many areas of ZF. Some of which I knew already, but there was certainly enough good tips on how to organise applications efficiently in ZF which I’ll be telling my team all about when I get back to the UK.
My notes from the tutorial day appear below, be warned they are rather long! You can also review the Zend Framework Workshop slides over at Slideshare.
Read the rest of this entry »
Admin sub-modules in Zend Framework
June 8th, 2010Modules in Zend Framework essentially allow us to organise a collection of controllers into sub-folders, giving URL to filesystem mapping such as:
domain.com/user/register -> app/modules/user/RegisterController.php
While useful when we need to expand our URLs (and organisation of code) beyond one set of controllers, there are a few things they don’t currently solve which I think would make them first-class citizens within ZF.
Read the rest of this entry »
me
I run web agency Studio 24 and I blog occassionally about PHP, web standards, usability and general web development.
archives
categories
- Community (3)
- CSS (2)
- JavaScript (2)
- Misc (10)
- PHP (2)
- Quick tips (3)
- Web development (1)
- Web standards (1)
- Zend Framework (6)