Update Twitter Bootstrap to release 3 in Zend Framework 2

Recently I started a new project based on Zend Framework 2, using Twitter Bootstrap as CSS framework. Some days ago, new Bootstrap v3 was released and introduced a lot of changes and improvements. Because of ZF2 Skeleton Application comes out-of-box with Twitter Bootstap 2, I decided to setup the new project skeleton and update CSS framework to latest available release. In this post, I’ll describe the process to update Bootstrap to v3 into a ZF2 project. [Read More]

Fix Hibernation after swap partition resize

Hibernation can be an important feature for many users: it allows people to turn on the PC and get it in the exact state session of when it was turned off (open files, running applications, configurations edited, terminals, etc.). This feature is based on usage of swap partition. In poor words: when user hibernate PC, all content of RAM memory is stored in this partition and is fetched at next startup time. [Read More]

Riattivare ibernazione dopo il ridimensionamento della partizione swap

L’ibernazione può essere un funzionalità importante per molti utenti: essa permette di spegnere il PC ed ottenere, alla riaccensione, la sessione nello stesso identico stato di quando è stata arrestata (file aperti, applicazioni caricate, configurazioni modificate, terminali, ecc.). Questa funzionalità si basa sull’utilizzo della partizione di swap. In parole povere: quando l’utente iberna il PC, tutto il contenuto della memoria RAM viene conservato in questa partizione e viene recuperato all’avvio successivo. [Read More]

Resize multiple images using Linux

Resize an image is a simple operation: there are many software able to do that. The most obvious are Gimpor Photoshop. But what’s the right procedure to resize lots of images? Imagine you have to prepare thumbnails for a gallery or resize all images to insert into a presentation or, again, reduce photos to send them by email, etc. Open each image with Gimp or Photoshop and resize them one by one is foolish. [Read More]

Ridimensionare un gran numero di immagini con Linux

Il problema Ridimensionare un immagine è un’operazione semplice: esistono molti software in grado di farlo. I più conosciuti sono Gimpe Photoshop. Ma qual’è la giusta procedura per ridimensionare un gran numero di immagini? Immaginate di dover preparare le anteprime per una galleria o di dover ridimensionare tutte le immagini da inserire in una presentazione o, ancora, di dover ridurre delle foto da mandare via email, e così via. Aprire le immagini con Gimp o Photoshop e ridimensionarle una ad una sarebbe una follia. [Read More]

PHP jobs with Gearman and Supervisor

The problem Often in a PHP project there could be operations that need to be executed asynchronously. Some example are: processing mail queues, indexing data, computation that requires long elaboration time. A common behavior is handle those operations by using cron to execute processes in background. However, using cron requires expedients to avoid cross executions and forces us to implement some specific procedures and mechanism to store data needed to elaborate. [Read More]
PHP 

Processi PHP con Gearman e Supervisor

Problema Spesso in un progetto PHP capita di dover eseguire operazioni in modo asincrono. Alcuni esempi sono: lavorazione di code email, indicizzazione di dati, calcoli che richiedono lunghi tempi di elaborazione. Prassi comune è gestire tali operazioni utilizzando cron per eseguire processi in backgroud. Tuttavia, utilizzare cron richiede espedienti per evitare l’accavallemento delle esecuzioni e ci costringe ad implementare procedure specifiche e meccanismi di stoccaggio dei dati necessari per l’elaborazione. [Read More]
PHP 

Zend Framework 3.0 branch started!

Yesterday, Evan Coury, Zend Framework contibutor, announced start of Zend Framework branch. Development goals will be merged between ZF team ideas and community suggestions that will be collected in this topic. Anyway, Evan immediatly specifies that development will be focused on avoid dramatic migration as was for transition from ZF1 to ZF2. For all developers that use Zend Framework for their projects, this is the best opportunity to take part to development process and be heard about their needs: power of Open Source. [Read More]

Configurare filtri Doctrine 2 in Zend Framework 2

Scenario Un filtro di Doctrine è uno strumento molto potente che può essere utilizzato per aggiungere condizioni a livello SQL all’interno del nostro gestore di oggetti Doctrine 2. Ciò significa che i filtri influenzeranno il comportamento di query DQL, collezioni, recupero dati, ecc. Come configurare ed utilizzare filtri in condizioni generali è ben spiegato in questo questo articolo della documentazione officiale di Doctrine, ma in un progetto basato su Zend Framework 2, la stessa operazione è un po' diversa. [Read More]

Setup Doctrine 2 filters in Zend Framework 2

Scenario Doctrine filter is a very powerfull tool that can be used to add conditional clauses at SQL level into our Doctrine 2 engine. This means that filters constraints will affect DQL queries, collections, lazy loading, etc. How to setup and use filters in generic conditions is well explained in this article of official Doctrine documentation, but in a Zend Framework 2 project, the same operation is a bit different. [Read More]