]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Process.php
Merge pull request #4836 from Angristan/patch-1
[friendica.git] / src / Model / Process.php
index a960777129813f25a83254b1a758ae46bfb1bda9..75d898065cdf71b9f6120ae22a9b388ed01bdd1f 100644 (file)
@@ -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();