3 namespace Friendica\Core\Worker\Factory;
5 use Friendica\BaseFactory;
6 use Friendica\Capabilities\ICanCreateFromTableRow;
7 use Friendica\Core\Worker\Entity;
9 class Process extends BaseFactory implements ICanCreateFromTableRow
11 public function createFromTableRow(array $row): Entity\Process
13 return new Entity\Process(
16 new \DateTime($row['created'] ?? 'now', new \DateTimeZone('UTC'))
21 * Creates a new process entry for a given PID
25 * @return Entity\Process
27 public function create(int $pid): Entity\Process
29 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
31 $command = basename($trace[0]['file']);
33 return $this->createFromTableRow([
35 'command' => $command,