Silex Starter Stubs

There are several preconfigured Silex Apps on github. They let you start your Silex project in no time, which is good.
This makes Silex an even more simple rabbithole into the symfony2 world.

I started one myself and had a close look on the others, so i thought i share this.
They all differ a bit so you must choose what fits your needs the best.

They all follow some kind of “best practise” structure, some more, some less.

Continue reading “Silex Starter Stubs”

tell redis db to not persist

redis persists its memory data in snapshot style in every n seconds depending on your configuration.
read more here.
perhaps you would like to use redis as a pure in-memory db, like f.e. memchache.
you can tell redis to not persist and save some bits&miliseconds.
this could be the case when using redis as a f.e. realtime queue, you wont need persistence,
because you could say: nobody needs is newsfeed from the that day before the machine crashed ;)

alright, do so by:
Continue reading “tell redis db to not persist”

Symfony 2 – Set Default Locale On Form Login #2

A small update/correction out of sequence:

A few weeks ago i described how to hook into the form login process in order to change the user session´s locale.

In the meantime a non backwards compatible code modification has been introduced that outdated this article. From now on (Symfony 2.0.4) the locale and default locale settings are maintained within the request object (and not as used to be in the session).

So, here is a little update – under reserve – because the locale setting´s logic will probably change again in the future.

Continue reading “Symfony 2 – Set Default Locale On Form Login #2”

Silex, Twig und HTML5 BoilerPlate

Alright, there is a bundle for H5BP for symfony2 and there is Assetic, you can probably use both with Silex and thats just fine.
But in case you want to keep your Silex project lean (since its micro) you can use Twig and H5BP only and build / deploy your app from the outside.

With a little tuning of the H5BP build, of course / unfortunatly. (Ok thats the caveat)

So i have a structure like so:
web/
(this is the webroot, here is js/css/images, all that asset stuff and the index, here we use the recommended H5BP stuff’n’structure)
views/
(this is outside of webroot and here are all of the *.twig)
Continue reading “Silex, Twig und HTML5 BoilerPlate”