-use Friendica\BaseObject;
-use dba;
-
-require_once 'include/dba.php';
-require_once 'include/datetime.php';
+use Friendica\Database\DBA;
+use Friendica\Util\DateTimeFormat;
- 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()]);
- $processes = dba::select('process', ['pid']);
- while($process = dba::fetch($processes)) {
+ $processes = DBA::select('process', ['pid']);
+ while($process = DBA::fetch($processes)) {
if (!posix_kill($process['pid'], 0)) {
self::deleteByPid($process['pid']);
}
}
if (!posix_kill($process['pid'], 0)) {
self::deleteByPid($process['pid']);
}
}