Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/worker/src/MWP/Monolog/Processo...
File: TimeUsageProcessor.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
* This file is part of the ManageWP Worker plugin.
[2] Fix | Delete
*
[3] Fix | Delete
* (c) ManageWP LLC <contact@managewp.com>
[4] Fix | Delete
*
[5] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[6] Fix | Delete
* file that was distributed with this source code.
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
class MWP_Monolog_Processor_TimeUsageProcessor implements Monolog_Processor_ProcessorInterface
[10] Fix | Delete
{
[11] Fix | Delete
public function callback(array $record)
[12] Fix | Delete
{
[13] Fix | Delete
$timeUsage = $this->getTimeUsage();
[14] Fix | Delete
[15] Fix | Delete
if ($timeUsage) {
[16] Fix | Delete
$record['extra'] = array_merge($record['extra'], $timeUsage);
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
return $record;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
private function getTimeUsage()
[23] Fix | Delete
{
[24] Fix | Delete
if (!function_exists('getrusage')) {
[25] Fix | Delete
return null;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
$ru = getrusage();
[29] Fix | Delete
[30] Fix | Delete
return array(
[31] Fix | Delete
'user_time' => $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] / 1000000,
[32] Fix | Delete
'system_time' => $ru['ru_stime.tv_sec'] + $ru['ru_stime.tv_usec'] / 1000000,
[33] Fix | Delete
);
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function