How to Properly Read Colon Tags (<p:id>) in google_merchant.xml in PHP
How to read xml with tags that have a colon <p:id>, like in Google Merchant upload. Using registerXPathNamespace or referencing the tag directly.
In order not to describe again, I give a link to the details . Based on this topic, we will try to start the worker through the console and give it some work through the client.
Let's make some changes to the code. Instead of saving data to a file, we will use console output.
file_put_contents("php://stdin", 'output string');
I will demonstrate the server.php file with the new changes.
<?php
$gmw = new GearmanWorker();
/**
* For now, consider the default initialization of addServer()
* This method is needed to declare which machine this worker is running on
*/
$gmw->addServer();
/**
* log_client - from the client side use this alice
* work_log - the function that the worker will throw on if
* something will come to alice log_client.
*/
$gmw->addFunction('log_client', 'work_log');
/**
* Specially done
* If you just declare $gmw->work(), then the task will end immediately
* after execution. That is, it will only work once.
*/
while($gmw->work());
/**
* Write logs to a file
* @param JSON $param - Accepts only a string, so pass it to json if needed
  ;*/
function work_log($param) {
/*Retrieves data sent by the client*/
$data = $param->workload();
/**
* We artificially create a load to simulate a long wait.
* Here we will see that the client script will not wait for the end of 100 seconds,
* and hang up the task and forget about it.
*/
for ($i = 0; $i < 100; $i++) {
sleep(1);
file_put_contents("php://stdin", $data); // Changed for console output
}
}
Launching from the console is done like this (our project is in the /var/www/test1.loc directory):
php /var/www/test1.loc/server.php
This line in the console will hang the worker on hold. It will wait until the console closes or the max_input_time in php.ini times out.

It can be seen that the console is waiting (Warning indicates a possible problem in the Gearman library itself). After running client.php , you can clearly see that everything is completed in the browser, and the console works by itself. If you close the console and then start the worker again, it will continue to work from the moment it left off.

How to read xml with tags that have a colon <p:id>, like in Google Merchant upload. Using registerXPathNamespace or referencing the tag directly.
Parsing JWT HS256 encryption, decrypting JWT HS256, comparing sha256 signatures for information integrity.
Let's look at fixing the disappearance of spaces before variables in the old version of Twig on php 7.4 without updating the version.
Consider the possibility of quickly creating a CSV file with automatic file download. Consider the formation, separators and header for the ability to download the file.
Latest templates from ImageCMS 4.12, authorization is required to download.