X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FProcess.php;h=75d898065cdf71b9f6120ae22a9b388ed01bdd1f;hb=78114c13d5ce27b36682a960859056d4ebf9d9be;hp=a960777129813f25a83254b1a758ae46bfb1bda9;hpb=a526573075bf343db2f10799f4d6cd51d0bcd897;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();