Use Elasticsearch with Symfony Framework and elasticsearch-php library

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. Read the post

Manipulate JSON in command line thanks to JQ example with cURL

I almost use only the command line to make calls on APIs using cURL. It's convenient and fast, easily scriptable if needed and the history of bash saves me time. But the response provided by cURL is not always readable especially when it comes to JSON. In this article I will introduce JQ that I use to display a pretty readable JSON and more. Read the post

Apply CI / CD principles to SQL migrations with Jenkins and some bash

Writing unit or functional tests on code has almost become a standard. Having a server that automates the verification of these tests and deploys the code is the goal of many development teams. Despite this, these good practices are rarely implemented for database schema migrations. In this article, I'll show you how with a little bash and Jenkins, I test and automate my SQL migrations. Read the post

Alter table in MySQL and MariaDB without locking table with Percona Toolkit

Alter table operation can be a very long task, depending on your database. It's often that database administrator wait too run these operations and do it late in the night to avoid disturbing user. But solutions exist to allow alter table without locking table, pt-online-schema-change from Percona Toolkit is one of these solutions. Read the post

Automatically controlling dependencies security with SensioLabs security checker, Jenkins

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. Read the post

Control the number of retries of a message with x-death header in RabbitMQ

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. Read the post

Use Dead Letter in RabbitMQ to delay messages in case of error

RabbitMQ is fast, sometimes a bit too much compared to the rest of the infrastructure. A database replication delay can crash the processing of a message. I show you how I handle this problem and use the dead letter exchange and dead letter routing key options to delay the processing of a message. Read the post

Manipulation of dates and times in PHP with the DateTime native class

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. Read the post

Secure cookie of you web application with PHP or Symfony

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. Read the post

Handling dates and times in SQL queries with MySQL & MariaDB

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 ... Read the post

Search