X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FProcess.php;h=75d898065cdf71b9f6120ae22a9b388ed01bdd1f;hb=b0564ea40df08ecf8d1111d145cca749c993d0c4;hp=a960777129813f25a83254b1a758ae46bfb1bda9;hpb=32c1c04a1cea6111a56b71751322307daacc3385;p=friendica.git diff --git a/src/Model/Process.php b/src/Model/Process.php index a960777129..75d898065c 100644 --- a/src/Model/Process.php +++ b/src/Model/Process.php @@ -5,10 +5,10 @@ namespace Friendica\Model; use Friendica\BaseObject; +use Friendica\Util\DateTimeFormat; use dba; require_once 'include/dba.php'; -require_once 'include/datetime.php'; /** * @brief functions for interacting with a process @@ -26,10 +26,14 @@ class Process extends BaseObject { $return = true; + if (is_null($pid)) { + $pid = getmypid(); + } + dba::transaction(); - if (!dba::exists('process', ['pid' => getmypid()])) { - $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => datetime_convert()]); + if (!dba::exists('process', ['pid' => $pid])) { + $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => DateTimeFormat::utcNow()]); } dba::commit();