|
|
@ -5,7 +5,7 @@ $semaphore = sem_get(crc32('yggtracker.crontab.export.feed'), 1); |
|
|
|
|
|
|
|
|
|
|
|
if (false === sem_acquire($semaphore, true)) |
|
|
|
if (false === sem_acquire($semaphore, true)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
exit (PHP_EOL . 'yggtracker.crontab.export.feed process locked by another thread.' . PHP_EOL); |
|
|
|
exit (_('yggtracker.crontab.export.feed process locked by another thread.')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Bootstrap |
|
|
|
// Bootstrap |
|
|
@ -14,10 +14,21 @@ require_once __DIR__ . '/../../config/bootstrap.php'; |
|
|
|
// Init Debug |
|
|
|
// Init Debug |
|
|
|
$debug = |
|
|
|
$debug = |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
'dump' => [], |
|
|
|
'time' => [ |
|
|
|
'time' => [ |
|
|
|
'ISO8601' => date('c'), |
|
|
|
'ISO8601' => date('c'), |
|
|
|
'total' => microtime(true), |
|
|
|
'total' => microtime(true), |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
'http' => |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'total' => 0, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
'memory' => |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'start' => memory_get_usage(), |
|
|
|
|
|
|
|
'total' => 0, |
|
|
|
|
|
|
|
'peaks' => 0 |
|
|
|
|
|
|
|
], |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
// Define public registry |
|
|
|
// Define public registry |
|
|
@ -521,15 +532,26 @@ try |
|
|
|
// Debug output |
|
|
|
// Debug output |
|
|
|
$debug['time']['total'] = microtime(true) - $debug['time']['total']; |
|
|
|
$debug['time']['total'] = microtime(true) - $debug['time']['total']; |
|
|
|
|
|
|
|
|
|
|
|
print_r( |
|
|
|
$debug['memory']['total'] = memory_get_usage() - $debug['memory']['start']; |
|
|
|
array_merge($debug, [ |
|
|
|
$debug['memory']['peaks'] = memory_get_peak_usage(); |
|
|
|
'db' => [ |
|
|
|
|
|
|
|
'total' => [ |
|
|
|
$debug['db']['total']['select'] = $db->getDebug()->query->select->total; |
|
|
|
'select' => $db->getDebug()->query->select->total, |
|
|
|
$debug['db']['total']['insert'] = $db->getDebug()->query->insert->total; |
|
|
|
'insert' => $db->getDebug()->query->insert->total, |
|
|
|
$debug['db']['total']['update'] = $db->getDebug()->query->update->total; |
|
|
|
'update' => $db->getDebug()->query->update->total, |
|
|
|
$debug['db']['total']['delete'] = $db->getDebug()->query->delete->total; |
|
|
|
'delete' => $db->getDebug()->query->delete->total, |
|
|
|
|
|
|
|
] |
|
|
|
print_r($debug); |
|
|
|
] |
|
|
|
|
|
|
|
]) |
|
|
|
// Debug log |
|
|
|
); |
|
|
|
if (LOG_CRONTAB_EXPORT_FEED_ENABLED) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
@mkdir(LOG_DIRECTORY, 0770, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($handle = fopen(LOG_DIRECTORY . '/' . LOG_CRONTAB_EXPORT_FEED_FILENAME, 'a+')) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fwrite($handle, print_r($debug, true)); |
|
|
|
|
|
|
|
fclose($handle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chmod(LOG_DIRECTORY . '/' . LOG_CRONTAB_EXPORT_FEED_FILENAME, 0770); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |