There are 28 articles tagged as "zf"

Using Doctrine DBAL with Zend Expressive

on December 22, 2016. in Programming, Development, Software. A 2 minute read.

The Doctrine project comes with a database abstraction and access layer — Doctrine DBAL — which I prefer over other abstraction layers like Zend DB.

Events in a Zend Expressive application

on August 04, 2016. in Programming, Development. A 6 minute read.

Three weeks ago I wrote a post on how to utilize Tactician in a Zend Expressive application. Today I want to expand on that post a little by adding the possibility to trigger and listen to events using the Zend EventManager component.

I spent some time connecting the dots last week, so I decided to put together an example on how to get started with using Tactician in a Zend Expressive application. The example itself is not really useful, but it does show how to setup the dependencies and get started with these two libraries.

Unit testing Zend Framework 2 modules

on September 15, 2012. in Development, Programming, Software. A 5 minute read.

Porting this blog to Zend Framework 2, I decided to write some unit tests as well, while I’m at it. Not that the current code base doesn’t have unit tests, just it doesn’t have much of it… Anyway, I’d like to show how to get unit tests for modules up and running, as well how to throw in Mockery in the mix, as it can help us greatly with mocking out objects. Some of the parts shown here probably could be written in a more cleaner/nicer way, especially the autoloading bit, but so far it works for me.

Zend Framework hit a big milestone as version 2 was released last week. Sadly, I didn’t have time to contribute to it, or even to poke around it much. I decided to slowly, as time permits, port this blog to ZF2; it should be a good enough learning playground.

The latest, and last, release of the Zend Framework 1.x series is just around the corner as ZF 1.12.0RC1 was announced this week. As I still have projects running ZF1 I thought about giving the most interesting new feature (for me) a spin - the new autoloaders which are backported from ZF2.

Zend Framework full page cache tips

on February 11, 2012. in Development, Programming. A 2 minute read.

When I started rewriting this blog, I knew from start that I want to use Zend Framework’s full page caching,
as, I think, that’s the best cache for this purpose. Not much going on
on the front end, much more reads than writes, no ajax or any other
"dynamic" content. While implementing the cache, I ran into two issues.

The
first problem was that the cache files were created, but they were
never valid - on each request a new cache file was created. It was a
noob(ish) mistake - I had two calls to Zend_Session::startSession() in
my code, which made the session ID always to change which made the cache
validity test to fail. Removed the second call and all was well. Or so I
thought…

I moved the code to staging to run some final tests
before pushing it live, but the cache started failing again. This time
the cache files weren’t even being created! The same code works on my
machine, fails on staging. The only difference was that I had turned off
the loading of Google Analytics in the development environment. But…
that can’t be it, right? Wrong. On every request the values of the GA
cookies are different. The full page cache has a set of settings which
dictates what variables are taken into account when creating an ID for
the cache: make_id_with_xxx_varialbes where "xxx" is one of get, post, files, session, cookie and by default all are set to true. Setting make_id_with_cookie_variables to false made the cache to disregard the always changing GA cookies which made the cache start working again.

So,
if Zend Framework’s full page cache starts failing for you, check the
contents and behaviours of all the variables - get, post, files,
session, cookie - and play around with the cache settings until it
starts working again.

Happy hackin’!

Contributing to Zend Framework 2

on November 10, 2011. in Development, Programming. A 2 minute read.

Continue reading Contributing to Zend Framework 2...

A Zend Framework 2 EventManager use case

on October 19, 2011. in Development, Programming. A 4 minute read.

With Zend Framework 2 beta 1 released yesterday and some free time to spare, I decided to finally try and tackle one of the “scariest” additions to the Zend Framework - the EventManager component. Now, I won’t go into details about this whole event voodoo, Matthew already did that. Twice.

Helping out with Zend Framework 2

on July 27, 2011. in Development, Programming. A 3 minute read.

OK, here are some tips and resources so you can start helping out and contributing to Zend Framework 2.0 :)

Continue reading Helping out with Zend Framework 2...