Pragmatism in the real world

2012 in pictures

As another year draws to a close, I continue my tradition of showing off some photos that recap our year as I have done in 2008, 2009, 2010 and 2011. January January 2012 was a quiet month. I released Daily Jotter 1.3 and started using Sublime Text as my editor of choice for programming. Photographically, the highlight of the month was the Worcester Flickr Group's scavenger hunt. February It snowed in Feburary and I started… continue reading.

Zend Framework 1 is not dead; ensure you upgrade!

I'm delighted to announce that Zend Framework 1.12.1 has been released! This release fixes 50 issues which is a great result. I'd like to thank everyone who submitted a patch to ZF1 and to Matthew Weier O'Phinney, Frank Brückner and Mike Willibanks in particular for their work on this release. There's a few important things to note: There's a security fix in 1.12.1. Please read ZF2012-05 if you use Zend_Feed_Rss or Zend_Feed_Atom. The minimum PHP… continue reading.

Some notes on git

This set of notes covers the main things that I think you need to know about working with git. It is not comprehensive and mainly serves as a reminder for myself. Remotes In a typical open source workflow using GitHub or BitBucket, you would fork the main repository into your own and then clone that copy to your local computer: git clone git@github.com:akrabat/joind.in.git You then need to connect your local repository to the main repository.… continue reading.

Git export from BitBucket

One of the consequences of moving to git is that I needed to get our deployment scripts working with it. The first requirement was an equivalent to svn export. This is simple enough, but, as usual, I wanted to save myself some effort and created a script that wrapped it up for me. git-export.sh: #!/bin/sh # # USAGE: export.sh REPO_NAME BRANCH_NAME [DIRECTORY_NAME] [BITBUCKET_ACCOUNT_NAME] # # BITBUCKET_ACCOUNT_NAME=akrabat GITROOT=git@bitbucket.org:${BITBUCKET_ACCOUNT_NAME} if [ -z "$1" ]; then echo "Usage… continue reading.

Migrating to BitBucket from Subversion

I've recently started the process of moving all of my Subversion repositories to BitBucket. BitBucket is my preferred git hosting supplier as its pricing structure suits me much better; that is, I have lots of private repositories and GitHub is too expensive for my case! As I needed to migrate over one hundred repositories from Subversion to BitBucket, I automated it via a simple shell script. Rather usefully, BitBucket has an API that let me… continue reading.

Using ZendSession

This is a quick note on how to use ZendSession. Although the component name is ZendSession, you actually interact with ZendSessionContainer to store and retrieve session data: use ZendSessionContainer; $session = new Container('SomeKeyName'); ZendSessionContainer's constructor takes a string argument which is the name for this container ('SomeKeyName' in this case). It's optional and if you don't set it, then it is set to 'Default'. The name allows you to use the same session keys in… continue reading.

Integrating BjyAuthorize with ZendNavigation

If you are using BjyAuthorize for ACL configuration and want to use ZendNavigation's ZendAcl integration features, then you need to set the Acl and Role information into ZendNavigation. The easiest way to do this is to add the following to ApplicationModule::onBoostrap(): $sm = $e->getApplication()->getServiceManager(); // Add ACL information to the Navigation view helper $authorize = $sm->get('BjyAuthorizeServiceAuthorize'); $acl = $authorize->getAcl(); $role = $authorize->getIdentity(); ZendViewHelperNavigation::setDefaultAcl($acl); ZendViewHelperNavigation::setDefaultRole($role); This assumes that you've set up BjyAuthorize with some resources and… continue reading.

Introducing AkrabatSession

One of the requirements for a new app that I'm writing is that it has a specific session name. In Zend Framework 2, this is done by creating a SessionManager with the correct configuration and then setting the default manager on the Session Container: use ZendSessionConfigSessionConfig; use ZendSessionSessionManager; use ZendSessionContainer; $sessionConfig = new SessionConfig(); $sessionConfig->setOptions(array('name'=>'MY_SESSION_NAME'); $sessionManager = new SessionManager($config); Container::setDefaultManager($sessionManager); Obviously, I need to be able to configure the name (and potentially other session configuration… continue reading.

Zend Framework 1 or 2 training in Belgium in January 2013?

I will be in Belgium in the last week of January (from the 28th). If your company could benefit from one or two days training or consultancy in Zend Framework 1 or 2, get in touch and let's see if we can make it happen. I'm able to provide training on ZF1/ZF2 to small groups of developers at your offices and can customise the course to suit your needs and the experience of your team.… continue reading.

Martin Shwalbe: Getting Started with REST and Zend Framework 2

Martin Shwalbe: has posted Getting Started with REST and Zend Framework 2 Today i want to show you how to build a rest application. This tutorials assume you have completed the Getting Started. I will be repeating lot of the steps already explained in there. As the title of the article suggests, this is a good article on how to get started with REST and ZF2.