Passed
Push — master ( 0af99d...dddfaf )
by Nils
04:42
created
scripts/background_tasks___userKeysCreation.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 $processToPerform = DB::queryfirstrow(
71 71
     'SELECT *
72
-    FROM ' . prefixTable('background_tasks') . '
72
+    FROM ' . prefixTable('background_tasks').'
73 73
     WHERE (finished_at IS NULL OR finished_at = "") AND process_type = %s
74 74
     ORDER BY increment_id ASC',
75 75
     'create_user_keys'
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             // Extract the subtask parameters
116 116
             $subTaskParams = json_decode($subTask['task'], true);
117 117
 
118
-            error_log('Subtask in progress: '.$subTask['increment_id']." (".$taskId.") - ".print_r($subTaskParams,true));
118
+            error_log('Subtask in progress: '.$subTask['increment_id']." (".$taskId.") - ".print_r($subTaskParams, true));
119 119
 /*
120 120
             $fichier = fopen(__DIR__.'/log.txt', 'a');
121 121
             fwrite($fichier, 'Step : '.$subTaskParams['step']." - index : ".$subTaskParams['index']."\n");
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                     // Get total number of items
129 129
                     DB::query(
130 130
                         'SELECT *
131
-                        FROM ' . prefixTable('items') . '
131
+                        FROM ' . prefixTable('items').'
132 132
                         '.(isset($taskArgumentsArray['only_personal_items']) === true && $taskArgumentsArray['only_personal_items'] === 1 ? 'WHERE perso = 1' : '')
133 133
                     );
134 134
                     createAllSubTasks($subTaskParams['step'], DB::count(), $subTaskParams['nb'], $taskId);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     // Get total number of items
138 138
                     DB::query(
139 139
                         'SELECT *
140
-                        FROM ' . prefixTable('log_items') . '
140
+                        FROM ' . prefixTable('log_items').'
141 141
                         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
142 142
                     );
143 143
                     createAllSubTasks($subTaskParams['step'], DB::count(), $subTaskParams['nb'], $taskId);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                     // Get total number of items
147 147
                     DB::query(
148 148
                         'SELECT *
149
-                        FROM ' . prefixTable('categories_items') . '
149
+                        FROM ' . prefixTable('categories_items').'
150 150
                         WHERE encryption_type = "teampass_aes"'
151 151
                     );
152 152
                     createAllSubTasks($subTaskParams['step'], DB::count(), $subTaskParams['nb'], $taskId);
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
                     // Get total number of items
164 164
                     DB::query(
165 165
                         'SELECT *
166
-                        FROM ' . prefixTable('files') . ' AS f
167
-                        INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
168
-                        WHERE f.status = "' . TP_ENCRYPTION_NAME . '"'
166
+                        FROM ' . prefixTable('files').' AS f
167
+                        INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
168
+                        WHERE f.status = "' . TP_ENCRYPTION_NAME.'"'
169 169
                     );
170 170
                     createAllSubTasks($subTaskParams['step'], DB::count(), $subTaskParams['nb'], $taskId);
171 171
                 }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     // Check if subtasks have to be created
193 193
     DB::query(
194 194
         'SELECT *
195
-        FROM ' . prefixTable('background_subtasks') . '
195
+        FROM ' . prefixTable('background_subtasks').'
196 196
         WHERE task_id = %i AND task LIKE %ss',
197 197
         $taskId,
198 198
         $action
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 function countActiveSymfonyProcesses() {
225 225
     // Compter le nombre de processus actifs
226 226
     return DB::queryFirstField(
227
-        'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . 
227
+        'SELECT COUNT(*) FROM '.prefixTable('background_subtasks'). 
228 228
         ' WHERE process_id IS NOT NULL AND finished_at IS NULL'
229 229
     );
230 230
 }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 function getSubTasks($taskId) {
236 236
     $task_to_perform = DB::query(
237 237
         'SELECT *
238
-        FROM ' . prefixTable('background_subtasks') . '
238
+        FROM ' . prefixTable('background_subtasks').'
239 239
         WHERE task_id = %i AND finished_at IS NULL
240 240
         ORDER BY increment_id ASC',
241 241
         $taskId
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 function reloadSubTask($subTaskId) {
287 287
     // Récupérer les informations de la sous-tâche de la base de données
288 288
     $subTask = DB::queryFirstRow(
289
-        'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE increment_id = %i', 
289
+        'SELECT * FROM '.prefixTable('background_subtasks').' WHERE increment_id = %i', 
290 290
         $subTaskId
291 291
     );
292 292
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     // Get all processes
333 333
     $subtasks = DB::query(
334 334
         'SELECT *
335
-        FROM ' . prefixTable('background_subtasks') . '
335
+        FROM ' . prefixTable('background_subtasks').'
336 336
         WHERE process_id IS NOT NULL AND finished_at IS NULL'
337 337
     );
338 338
 
Please login to merge, or discard this patch.
api/inc/bootstrap.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -24,21 +24,21 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 
27
-define("API_ROOT_PATH", __DIR__ . "/..");
27
+define("API_ROOT_PATH", __DIR__."/..");
28 28
 
29 29
 // include main configuration file
30
-require API_ROOT_PATH . '/../sources/main.functions.php';
30
+require API_ROOT_PATH.'/../sources/main.functions.php';
31 31
 
32 32
 // init
33 33
 loadClasses('DB');
34 34
 
35 35
 // include the base controller file
36
-require API_ROOT_PATH . "/Controller/Api/BaseController.php";
36
+require API_ROOT_PATH."/Controller/Api/BaseController.php";
37 37
 
38 38
 // include the use model file
39
-require API_ROOT_PATH . "/Model/UserModel.php";
40
-require API_ROOT_PATH . "/Model/ItemModel.php";
41
-require API_ROOT_PATH . "/Model/FolderModel.php";
39
+require API_ROOT_PATH."/Model/UserModel.php";
40
+require API_ROOT_PATH."/Model/ItemModel.php";
41
+require API_ROOT_PATH."/Model/FolderModel.php";
42 42
 
43 43
 /**
44 44
  * Launch expected action for ITEM
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
         );
58 58
     }
59 59
     // Perform the action
60
-    require API_ROOT_PATH . "/Controller/Api/ItemController.php";    
60
+    require API_ROOT_PATH."/Controller/Api/ItemController.php";    
61 61
     $objFeedController = new ItemController();
62
-    $strMethodName = $actions[0] . 'Action';
62
+    $strMethodName = $actions[0].'Action';
63 63
     $objFeedController->{$strMethodName}($userData);
64 64
 }
65 65
 
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
         );
81 81
     }
82 82
     // Perform the action
83
-    require API_ROOT_PATH . "/Controller/Api/FolderController.php";
83
+    require API_ROOT_PATH."/Controller/Api/FolderController.php";
84 84
     $objFeedController = new FolderController();
85
-    $strMethodName = $actions[0] . 'Action';
85
+    $strMethodName = $actions[0].'Action';
86 86
     $objFeedController->{$strMethodName}($userData);
87 87
 }
88 88
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
  */
109 109
 function apiIsEnabled(): string
110 110
 {
111
-    include API_ROOT_PATH . '/../includes/config/tp.config.php';
111
+    include API_ROOT_PATH.'/../includes/config/tp.config.php';
112 112
 
113 113
     if (isset($SETTINGS) === true && isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
114 114
         return json_encode(
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function verifyAuth(): string
139 139
 {
140
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
140
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
141 141
     $bearer_token = get_bearer_token();
142 142
 
143 143
     if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  */
168 168
 function getDataFromToken(): string
169 169
 {
170
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
170
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
171 171
     $bearer_token = get_bearer_token();
172 172
 
173 173
     if (empty($bearer_token) === false) {
Please login to merge, or discard this patch.