Google Vision: detect text in PDFs synchronously with PHP

The Vision API now supports online (synchronous) small batch annotation (PDF/TIFF/GIF) for all features. To do so, the relevant documentation is Small batch file annotation online. Let’s see how can we do this with PHP. Context Having PHP >= 7.4, the packages to require are: google/cloud-vision google/cloud-storage Code How to upload the file in the storage Soon. Text … Continue Reading

Handling execution time for PHP (FPM)

The problem: setting max_execution_time / using set_time_limit() I don’t get the wanted results If you are here, you are probably looking for an answer to the question: why set_time_limit() is not working properly and the script is killed before? or why ini_set(‘max_execution_time’, X), is not working properly and the script is killed before? The answer is not exactly … Continue Reading

Magento2 database transactions: how to save multiple model instances

Sometimes in your logic you have to save different model instances at once. Magento1 already had the concept of transaction, using the classic singleton model: Mage::getModel(‘core/resource_transaction’) Magento2 has its concept of transaction, too, so let’s see with a simple example how to use this feature. Let’s say we have a DB table ‘table’ described as … Continue Reading