Speed up your tests (the easy one)Tests

by Andrea Giuliano on 18 dicembre 2014 with 0 comments

How many times do you run your tests and get stuck waiting points to appear in your shell? Well, other than take a look in writing tests (I’ll write an article about that, I promise), probably your cli-php is running on top of xdebug. Xdebug do lots of things but, if your programming style is …

leggi ...

Value objects in DoctrineMethodologies

by Andrea Giuliano on 3 aprile 2014 with 0 comments

Value object definition “A small simple object, like money or a data range, whose equality isn’t based on identity”1 Use case Let’s assume for example that you want to represent addresses in your application domain. What is really important to represent addresses is the value they hold and not the exact instance they could become. …

leggi ...

Make your session namespacedSymfony 2, Tip and tricks

by Andrea Giuliano on 9 ottobre 2013 with 0 comments

Separating the scope of variables in session is a good practice for organizing attributes. Symfony comes with the Session component, a powerful way to manage the session. Imagine you want to store some attributes of some volatile structure in your application. You can store them in this way: $session->set(’promo_code’, ‘MY_PROMO_CODE’); $session->set(’promo_name’, ‘MY_PROMO_NAME’); That’s all right. …

leggi ...

Install your own PHP developer environment in a powerful wayMac Os X

by Andrea Giuliano on 18 aprile 2013 with 0 comments

With this article, I’ll show you how to perform a XAMP installation environment on Mac Os X. First thing: ensure you’ve Command Line Tools installed. [Mac Os X < 10.8] Open Xcode and go to Preferences > Downloads. Here you can install Command Line Tools simply by pushing the install button: [Mac Os X >= …

leggi ...

Advanced Web RankingSEO

by Andrea Giuliano on 1 novembre 2012 with 0 comments

Advanced Web Ranking is a cool application for SEO analysis. The newer version is completely redesigned compared to older version. AWR allows to add websites, setting up search engine like Google, Bing, Yahoo and most other and setting up custom keywords that you want to trace. Updating your project, AWR search for you the keywords …

leggi ...

Specifiche personalizzate per le colonne del databaseDoctrine, Symfony 2

by Andrea Giuliano on 23 settembre 2012 with 0 comments

Doctrine, nella versione 2.1 ha eliminato il supporto alla parola chiave DEFAULT  per impostare un valore predefinito ad un campo. Come descritto nelle FAQ di Doctrine, per settare un valore di default, basta semplicemente definire una variabile di classe con il valore predefinito. Seguendo la procedura nelle FAQ ed effettuando la build dell’entità, il campo …

leggi ...

Symfony 2.1 validazione a cascataForm, Symfony 2

by Andrea Giuliano on 20 agosto 2012 with 0 comments

In symfony 2 incorporare i form è davvero facile come mostrato nella guida ufficiale di Symfony per la creazione e l’associazione di due form. In questo tip parleremo della validazione in cascata di sottoform. Supponiamo di avere un ProductForm che incorpora CategoryForm, entrambi con annotazioni che impostano i diversi vincoli di validazione per ciascuna classe. …

leggi ...