This article shows, by example, the usage and syntax of the Symfony2 Expression Language component in service files written in XML or Yaml. This component allows you to add dynamism to configuration files.
I learned software programming with PHP language. This language evolve a lot and I'm usig it for +20 years. In these posts I'm talking about basic stuff but also some more advanced and ready to use solution, with most of the time real world usage.
This article shows, by example, the usage and syntax of the Symfony2 Expression Language component in service files written in XML or Yaml. This component allows you to add dynamism to configuration files.
In this article, I show how to group its code in a PHP Phar archive. This step a little complicated, is now greatly facilitated by tools available on Github. I illustrate here, the use of clue/phar-dial.
Elastic provides a light weight PHP library: elasticsearch-php to connect to Elasticsearch cluster. This Library is an API client with all possible options. It's light weight and lets developer chose implementation to use it. It's a very good alternative to Elastica and his abstraction layer. On this blog I'm using elasticseach-php with Twig to manage my indices and query Elasticsearch.
Today, we use more and more external libraries in our projects. Though it saves us time, it is possible that we may introduce security vulnerabilities via these libraries. Controlling this is unfortunately not systematic, and particularly seldom automated. I'll show you in this post how to automate this control using SensioLabs' tool and Jenkins.
This article talks about the Config component of symfony which allows to semantically expose a configuration and validate it. To often break my teeth on it, I decided to compile here some useful tips that do not appear in the official documentation.
Sometimes the processing of a message causes an error. In this case, it is common to move this message to another queue to try to process it later. All this, can be automated in RabbitMQ with the DLX / DLK option and the application of a TTL. But be careful not to create an infinite loop of attempted treatment, in this article I will introduce x-death header to control the number of retries.
Following the article on the manipulation of dates in SQL, I realized that, in fact, the manipulation of date in php was not so simple and known as that. There are many functions on dates in PHP and I still find a lot of code that gets confused trying to calculate dates with mktime, manipulating timestamps. While a very practical class exists: DateTime. So it is she, and her companions, that I will present.
Most sites use cookies. Whether for tracking or persisting data, unfortunately good security practices are not always apply. In this article I will present the different options available in PHP and how to implement them with Symfony.
Manipulating dates in a programming language (PHP, Java ....) is simple and known to all. But what about in the MySQL database? In this article I present what it is possible to do in SQL queries: operation, date interval ...
I use very little Vim editor to develop, but when I have my PHP code in black and white is not very practical. There are several solutions to color code (PHP, javascript .....) in Vim, here is an easy to install.