Symfony Cache Component with SncRedisBundle

Since version 3.1 there is a Cache component with a PSR-6 implementation integrated in Symfony.
So we do not need to add a 3rd party lib as Doctrine Cache anymore when we need caching these days.

Doctrine Cache does the job but by implementing a standard the Symfony Cache seems to have another advantage besides its delievered anyway. So i checked it out.

Documentation is still a bit sparse and the best resource so far is this blogpost:
https://symfony.com/blog/new-in-symfony-3-1-cache-component

I wont go into detail on how you use the Cache but rather how you integrate it with Redis, which is my favourite Cache backend.
Continue reading “Symfony Cache Component with SncRedisBundle”

[symfony 1.4] Class ‘sfLoader’ not found

Sollte man mal eine symfony 1.2.x Anwendung auf symfony 1.4.x migrieren und man stößt auf diesen Fehler:

Class 'sfLoader' not found

Dann hat man versucht einen Helper in der Action zu laden zB so:

sfLoader::loadHelpers('String');

Der sfLoader ist in 1.4 allerdings entfernt worden.
Stattdessen sollte man dann sowas schreiben:

$this->getContext()->getConfiguration()->loadHelpers('String');

Dann klappts.

symfony und Google Analytics

Ich weiss nicht ob Ihr es wußtet:
Es gibt ein feines Plugin für Google Analytics für symfony.
Kris Wallsmith sei dank.

Da kann man sich fragen, warum denn ein Plugin dafür?
Die paar Zeilen Code kopier ich doch schnell ins Layout.
Über das Plugin kann man jedoch Analytics “environment aware” einbinden.
Man will ja nicht das die Test- oder gar Entwicklungsumgebung die Messung verfälscht.

Continue reading “symfony und Google Analytics”