How to setup Docker container with legacy PHP 5.6 and Xdebug

PHP 5.6 is currently outdated and no more supported, but sometimes, in real World, you could be forced to setup and debug legacy projects that works with outdated technologies. I had to. And I always use Docker for this, of course. But I also need to use Xdebug in order to debug those legacy projects, and common Xdebug installation procedures don’t work with outdated PHP. If fact, if you try, you will get back something like this: [Read More]

Split, reduce and convert PDF to JPEG using PHP ImageMagick

During these days I’m working on a PHP project based on manipulation of PDF files uploaded by users. Documents must be truncated, splitted to images, quality reducted, etc. Because of the project’s nature, libraries' inclusion is problematic, so I was forced to study a solution for the issue that involves only PHP official extensions. The result is some code based on ImageMagick extension. In this post I’ll note down what I found because I hope that it can be useful for someone in my own situation. [Read More]

Quickly setup HTTPS on PHP Apache2 Docker container with self-signed SSL certificate

I often use local Docker images for development reasons, and sometimes, I need to implement features that only works in HTTPS environment: i.e. JWT Bearer token. So, I prepared a Docker container based on official PHP Apache2 Docker container, that quickly setup HTTPS environment with a self-signed certificate. Follows a starting docker-compose structure that you can be extended as needed. It contains only 2 files: docker-compose.yml apache2/Dockerfile Let’s see file content. [Read More]
Docker  PHP  SSL  HTTPS 

Hello World: l'origine dell'esempio per eccellenza

Chiunque abbia mai avuto il piacere o il dispiacere, a seconda dei casi, di trovarsi alle prese con un linguaggio di programmazione, saprà già a cosa si riferiscono queste due parole. Si tratta del più classico degli esempi informatici per eccellenza: il primo che solitamente si incontra in qualsiasi manuale, guida o corso di programmazione. Qualsiasi sia, infatti, il linguaggio a cui ci si sta approcciando, il primo esempio in assoluto che viene mostrato è quello che permette di stampare a video queste due famosissime parole: Hello World. [Read More]

Continous deploying via FTP of Hugo-based Website with Github Actions

UPDATE 2020-05-01: Some weeks after this post was published, SamKirkland released version 3 of FTP-Deploy-Action. So I updated code snippets. Old version of this post is available on archive.is. At the end of 2019 I discovered Hugo Framework, I started refactoring my personal websites and writing some posts about some solutions I had to implement to accomplish features I was wondering for. You can find more details in post How to add Iubenda prior blocking of cookie scripts to Hugo Disqus shortcode. [Read More]

How to add Iubenda prior blocking of cookie scripts to Hugo Disqus shortcode

In recent days, I worked to convert my Wordpress-based personal website to a static blog created using Hugo framework. The result of this conversion is the blog you are reading at the moment. I made this decision because I was bored to continously update and take care of a complete Wordpress instance with the purpose of keep online a simple personal blog. But this is another story… Anyway, I discovered Hugo Framework at the suggestion of my friend Giuseppe Pugliese (Magnetarman) and, after some scouting on official documentation, I understood that Hugo was what I was looking for: a fast and simple framework to build websites. [Read More]

Perché la Net Neutrality ci riguarda tutti?

Il prossimo 14 Dicembre la U.S. Federal Communications Commission, ente che regolamenta il traffico Internet negli Stati Uniti, deciderà se abolire o meno il principio della Neutralità della rete (conosciuto come Net Neutrality). La decisione non riguarda solo la regolamentazione negli USA ma, ovviamente, le ripercussioni saranno di livello globale. In parole estremamente semplici, la Net Neutrality è quella norma che impedisce ai provider di servizi Internet di penalizzare o favorire il traffico generato da un determinato fornitore di servizi. [Read More]

La responsabilità di dire “No”

Lo scorso 4 novembre, durante la ScotlandPHP Conference 2017, ho avuto il piacere di assistere ad un inspirato intervento di Adam Culp sul tema dello sviluppo di codice pulito. Ho trovato tale intervento particolarmente interessante perché, se pur ribadendo concetti che tutti gli addetti ai lavori conoscono (o dovrebbero conoscere), Adam ha voluto porre l’accento sull’aspetto professionale della questione e sulle responsabilità dei soggetti coinvolti. L’idea che molti hanno dello sviluppo software (talvolta anche in ambienti professionali) è che il lavoro consista semplicemente nella scrittura, nel minor tempo possibile, di codice privo di errori di sintassi e che restituisca l’output desiderato. [Read More]

Building ZF3 composed pages using Nesting View Models and Forward Controller Plugin

Normally in ZF3 MVC projects, each controller action matches one view and use it to render its output. Occasionally, we may want to build your ZF3 pages by dispatching various controllers from within the matched controller and merging outputs into a unique final view. In this way we can aggregate one or more views to create complex pages like report summaries or widget dashboards. In this post, we will see how to write few lines of code to include output of an arbitrary action into action matched from route. [Read More]

How to inject Zend Service Manager in ZF3 Controllers

Zend Service Manager component is Zend Framework’s implementation of service locator pattern. This object is very usefull component for an application and is largely used in ZF applications. Unfortunately in ZF3 default application, Service Manager component is no more available in controllers. An official solution exsists for this, but in this little tutorial, I want to share an easy solution to inject Service Manager in all controllers. To implement this solution, we will write our controllers by extending an abstract controller class written to handle a Service Manager instance. [Read More]