Skip to main content


Yii 2 pros and cons

I am still surprised about the Yii 2 popularity: I love this framework and I have based a couple of important projects on this framework. I love its presentation, code generators and the easy way you start, develop and test each element of your project. You can even have a test database and test all database operations. So I thi... [...]

What's new with Symfony 3

We waited so long but now Symfony 3 is here! It's really amazing and we have a lot of new features and documentation to read. There is no time to waste. Let's see all news. Demo Application Finally we have an amazing blog application where we can see how an application is built with CRUD operations, Doctrine, multi... [...]

Connecting to a PostgreSQL database with Python

I have used psycopg2 to connect the database and a little trick to switch the schema from development to production and viceversa. I have used an ini file to store informations about the database. You can store any other informations in the file and keeping them tidy using the ini sections. Let's start with my config.ini fil... [...]

Clean code part 3: functions

That's what we do: we write function and methods. Following the discipline of clean code we must follow the rules and be sure we are proceeding in the right way. Small! Functions must be even smaller than that! Functions must be small! And the other rules is: the must be smaller than that Maximum 5 rows, 3 rows i... [...]

Clean code: refactoring

It's time for an effective refactoring! Extract from long functions (extract until you drop), edit in line, extract methods or new classes. On TDD, after a test is passed, refactoring is the 3rd and probably the most important step of the small cycle red \ green \ blue. Let's explore the refactoring techniques with a sho... [...]

PHP features history

We have PHP 7 but I was wondering how we can have a sort of timeline with the most important feature for each version of PHP. On there is the release page but it's not enough for our purposes. From the history of PHP to the PHP museum, we can navigate and download the various PHP versions. WIth PHP 4 the language sta... [...]

Agile testing: the first quadrant

The first quadrant contains unit tests and component tests. The following image is about Lisa Crispin's 4 quadrants  Unit tests Testing function, classes, and methods following the discipline of test-driven development and other extreme programming practices. We have a lot of unit testing frameworks that can... [...]

Installing PHP and the Oracle Oci8 extension

This post is the right and updated procedure to install the PHP Oci8 extension with the Oracle instant client on Linux (Ubuntu, Kali, Debian distributions). That's because I have spent a lot of time finding the right steps and combinations. The procedure seems very long but I ensure you will not need more than 10 minutes! I... [...]

Getting started with Redis

From "Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker". To scale an application can be a big problem and using the right tools can make the difference. Redis is excellent and many big companies are choosing it. Let's see how to use it in p... [...]

Getting started with Rabbit MQ

Rabbit MQ is a software for messaging that implements the Advanced Messaging Queuing Protocol. About the definition of Rabbit MQ from the official website: Robust messaging for applications Easy to use Runs on all major operating systems Supports a huge number of developer platforms Open source and commercially sup... [...]

Kali Linux 2 installation and post installation

Kali Linux 2 came out in August 2015. I removed my Ubuntu installation after an ugly kernel panic caused by the ACPI probe failed error (I've not solved this problem with my PC!). I can tell Kali is really amazing: you will have all tools for security, penetration testing and even web development like PHP, MySQL, Git, Java,... [...]

Getting started with Laravel 5

I like PHP MVC frameworks and now Laravel has all my curiosity. It's fast, modern, clean, more lightweight and with good documentation both in the code and on the official website. Built using Symfony and the Symfony components, Laravel has tools and libraries to work even more efficiently with all modern features like diffe... [...]

Web security: XSS

XSS is one of the most common security issues we have to worry about. It can be simple to prevent it but sometimes it's not. We must pay attention not only on our PHP code but even on HTML and Javascript ocde without forgetting old browsers. Some malicious users can use old version of Internet Explorer to explore the DOM and... [...]

Clean Code part 2: variables names

We have the power to assign a name to a variable and it's a great power! We must assign a name to a variable that it must reveal its intents just when I read the name of the variable. If we can assign the right name and understand what the variable will do and its role on the software and on the algorithm, it would be perfec... [...]

Clean code: bad code

What is bad code? Why we write bad code? Well Uncle Bob ask us many questions and then help us to understand how to improve gradually and start writing clean and maintainable code. We must learn to recognize bad code (code smell) and let us to update and improve existing code without breaking anything (refactoring). Let's st... [...]

Becoming a Zend PHP engineer

I have finally passed the test for the Zend PHP certification. The exam consists in 70 questions and you will have 90 minutes. You have to answer right at least to 70% of them (49 questions). You need to buy the voucher from the official Zend website and, optionally, the Zend Study Guide for PHP 5.5. Be sure to select and b... [...]

Setting a LAMP enviroment on Linux

Yet another tutorial about installing a LAMP on Linux (I'm using Ubuntu). I've found all info I needed online but for it wasn't so easy. All informations are different, for different tools and purposes and you can't find them in single tutorial. Here I'm listing all commands we need to set up a good PHP devel... [...]

PHPStorm and PHPUnit autocomplete

To work with PHPUnit without autocomplete is almost impossible and sometimes PHPStorm doesn't show it. We must ensure we have enabled the IDE to see where PHPUnit is installed. I use the phar file. Since when  they have removed the PEAR installation, we have to install PHPUnit with the phar file. So download the phar fi... [...]

Zurb Foundation and HTML5 accessibility

Ok this year Symfony3 will be launched but in the best practice book there are some good recommendations and warning for the next future. I'll try to summarize the most interesting concepts and warnings. There are a lot hints about what you can or must do and some warning about common mistakes and what you must not do.... [...]

Symfony2 best practice

Ok this year Symfony3 will be launched but in the best practice book there are some good recommendations and warning for the next future. I'll try to summarize the most interesting concepts and warnings. There are a lot hints about what you can or must do and some warning about common mistakes and what you must not do.... [...]