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
Category
PHP
Dialogflow API, support for versions and environments
Even if currently it’s a beta feature, you can create multiple versions of your agent and publish them to separate environments. The problem is that the REST URI bindings do not appear to have been updated in the API definition for this feature. I wrote an issue in the cloud-php Github project, and John Pedrie, … 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
Setting a different receiver (payee) for PayPal payments using the PayPal PHP SDK with Express Checkout
Magento2 API: get product details by ID or URL key
So, you are using the Magento2 APIs and you need to access a product. The core API forces you to access product by its SKU: GET /V1/products/:sku Sometimes you need to access a product by its ID, or by its URL key. Let’s see how we can create two simple APIs to perform this task. First … 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