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.
About installing Gearman Job Server - you can read here.
If everything worked out according to the Gearman installation instructions, then you can continue.
To begin with, for proper operation, you will need to create a certain worker (worker) with which the client (client) in Php will communicate, queuing its tasks in the background or waiting for a response.
I will create the simplest example on two files, which will allow you to understand the logic of Gearman. Our polygon will consist of two files:

server.php - the file in which we will create a worker that will process all requests. In this example, it will be available via a local link: http://test1.loc/server.php
client.php - the file in which we will set tasks for the created worker. This will be our client, who will need to set background tasks. In this example, it will be available via a local link: http://test1.loc/client.php
1. Let's look at the server.php worker's pending task part :
<?php
$gmw = new GearmanWorker();
/**
* Pokey what to look at initiating addServer() for shutting down
* This method is required for rendering on which machine the worker works
*/
$gmw->addServer();
/**
* log_client - on the side of the client to work with alice
* work_log - function, on how to throwtime a worker, on a
* on alice log_client will come.
*/
$gmw->addFunction('log_client', 'work_log');
/**
*Specially broken task
* If you simply call $gmw->work(), the task will end immediately
* after the end of the task. To do this only once.
*/
while($gmw->work());
/**
* Write logs to the file
* @param JSON $param - Accepts only a row, which is passed to json as needed
  ;*/
function work_log($param) {
/*Get data sent by the client*/
$data = $param->workload();
/**
* Piece by piece robimo navantazhennya, schob bula іmitatsіya great ochіkuvannya.
* Here we care that the client script is not checkable for 100 seconds,
* but set the task and forget about it.
*/
for ($i = 0; $i < 100; $i++) {
sleep(1);
file_put_contents('log.txt', $data, FILE_APPEND);
}
}
2. Let's look at the client's backlog, which is the command to the worker client.php:
<?php
$client = new GearmanClient();
/**
A worker is checking on us. While everything is being fixed after the lock
*/
$client->addServer();
/**
* doBackground() - we can do the task
* log_client - alice to the work_log() function from server.php to the function work_log();
*/
$client->doBackground('log_client', "Test LOG. \r\n");
You have been shown the simplest working prototype of the task put on the Php side in the background mode.
3. How does it work?
Scheme of the operation of the Gearman service is idle. server.php contains the digest itself. For the time being, it will run in the browser, but then send to http://test1.loc/server.php. Forces the browser to become permanently cleared through rows of while($gmw->work());
To run $gmw->work(); not in a cycle, then after the launch of the client part, the script runs 1 time and ends.
Last weekend we will run client.php against http://test1.loc/client.php. Alternatively, the work_log() function of server.php will run and write the word that is sent by the client to the log.txt file for 100 seconds, 100 times.
Yakby didn't work without gearman, but the script took 100 seconds to finish. Ale zavdyaka background zadanny doBackground(), the client does not mind the time and the script ends without a check-in.
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.