From f193f01a7d6ed4946b5ec4a4b92294bb75b294cb Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 15 Jan 2018 19:27:48 -0500 Subject: [PATCH] Fix issues in changed files - Initializes $return in Process::insert - Update the type hint of dba::fetch - Remove unused $a parameter in worker_init() - Fix uses --- include/dba.php | 2 +- mod/worker.php | 5 ++--- scripts/worker.php | 2 +- src/Model/Process.php | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/dba.php b/include/dba.php index 6471d36451..b1b689fdf7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -659,7 +659,7 @@ class dba { /** * @brief Fetch a single row * - * @param PDOStatement|mysqli_result|mysqli_stmt $stmt statement object + * @param mixed $stmt statement object * @return array current row */ public static function fetch($stmt) { diff --git a/mod/worker.php b/mod/worker.php index 056416e799..1bd5880789 100644 --- a/mod/worker.php +++ b/mod/worker.php @@ -4,11 +4,10 @@ * @brief Module for running the worker as frontend process */ -use Friendica\Core\Worker; use Friendica\Core\Config; -use Friendica\Core\PConfig; +use Friendica\Core\Worker; -function worker_init($a){ +function worker_init(){ if (!Config::get("system", "frontend_worker")) { return; diff --git a/scripts/worker.php b/scripts/worker.php index d69b089aec..ccf24b7b43 100755 --- a/scripts/worker.php +++ b/scripts/worker.php @@ -6,8 +6,8 @@ */ use Friendica\App; -use Friendica\Core\Worker; use Friendica\Core\Config; +use Friendica\Core\Worker; // Ensure that worker.php is executed from the base path of the installation if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { diff --git a/src/Model/Process.php b/src/Model/Process.php index 6b2d2fb64b..fbc844c8d2 100644 --- a/src/Model/Process.php +++ b/src/Model/Process.php @@ -23,6 +23,8 @@ class Process extends BaseObject */ public static function insert($command, $pid = null) { + $return = true; + dba::transaction(); if (!dba::exists('process', ['pid' => getmypid()])) { -- 2.39.5