@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->builder->create( |
| 22 | 22 | $this->table, |
| 23 | - function ($table) { |
|
| 23 | + function($table) { |
|
| 24 | 24 | $table->bigIncrements('id'); |
| 25 | 25 | |
| 26 | 26 | $table->string('name')->index(); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->builder->create( |
| 22 | 22 | $this->table, |
| 23 | - function ($table) { |
|
| 23 | + function($table) { |
|
| 24 | 24 | $table->bigIncrements('id'); |
| 25 | 25 | |
| 26 | 26 | $table->string('name')->index(); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function migrateUp() |
| 13 | 13 | { |
| 14 | - $this->builder->table('tracker_query_arguments', function ($table) { |
|
| 14 | + $this->builder->table('tracker_query_arguments', function($table) { |
|
| 15 | 15 | $table->foreign('query_id') |
| 16 | 16 | ->references('id') |
| 17 | 17 | ->on('tracker_queries') |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | ->onDelete('cascade'); |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | - $this->builder->table('tracker_route_paths', function ($table) { |
|
| 22 | + $this->builder->table('tracker_route_paths', function($table) { |
|
| 23 | 23 | $table->foreign('route_id') |
| 24 | 24 | ->references('id') |
| 25 | 25 | ->on('tracker_routes') |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ->onDelete('cascade'); |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | - $this->builder->table('tracker_route_path_parameters', function ($table) { |
|
| 30 | + $this->builder->table('tracker_route_path_parameters', function($table) { |
|
| 31 | 31 | $table->foreign('route_path_id') |
| 32 | 32 | ->references('id') |
| 33 | 33 | ->on('tracker_route_paths') |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | ->onDelete('cascade'); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | - $this->builder->table('tracker_referers', function ($table) { |
|
| 38 | + $this->builder->table('tracker_referers', function($table) { |
|
| 39 | 39 | $table->foreign('domain_id') |
| 40 | 40 | ->references('id') |
| 41 | 41 | ->on('tracker_domains') |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ->onDelete('cascade'); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $this->builder->table('tracker_sessions', function ($table) { |
|
| 46 | + $this->builder->table('tracker_sessions', function($table) { |
|
| 47 | 47 | $table->foreign('device_id') |
| 48 | 48 | ->references('id') |
| 49 | 49 | ->on('tracker_devices') |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ->onDelete('cascade'); |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - $this->builder->table('tracker_sessions', function ($table) { |
|
| 54 | + $this->builder->table('tracker_sessions', function($table) { |
|
| 55 | 55 | $table->foreign('agent_id') |
| 56 | 56 | ->references('id') |
| 57 | 57 | ->on('tracker_agents') |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | ->onDelete('cascade'); |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | - $this->builder->table('tracker_sessions', function ($table) { |
|
| 62 | + $this->builder->table('tracker_sessions', function($table) { |
|
| 63 | 63 | $table->foreign('referer_id') |
| 64 | 64 | ->references('id') |
| 65 | 65 | ->on('tracker_referers') |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->onDelete('cascade'); |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | - $this->builder->table('tracker_sessions', function ($table) { |
|
| 70 | + $this->builder->table('tracker_sessions', function($table) { |
|
| 71 | 71 | $table->foreign('cookie_id') |
| 72 | 72 | ->references('id') |
| 73 | 73 | ->on('tracker_cookies') |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ->onDelete('cascade'); |
| 76 | 76 | }); |
| 77 | 77 | |
| 78 | - $this->builder->table('tracker_sessions', function ($table) { |
|
| 78 | + $this->builder->table('tracker_sessions', function($table) { |
|
| 79 | 79 | $table->foreign('geoip_id') |
| 80 | 80 | ->references('id') |
| 81 | 81 | ->on('tracker_geoip') |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ->onDelete('cascade'); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | - $this->builder->table('tracker_log', function ($table) { |
|
| 86 | + $this->builder->table('tracker_log', function($table) { |
|
| 87 | 87 | $table->foreign('session_id') |
| 88 | 88 | ->references('id') |
| 89 | 89 | ->on('tracker_sessions') |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ->onDelete('cascade'); |
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | - $this->builder->table('tracker_log', function ($table) { |
|
| 94 | + $this->builder->table('tracker_log', function($table) { |
|
| 95 | 95 | $table->foreign('path_id') |
| 96 | 96 | ->references('id') |
| 97 | 97 | ->on('tracker_paths') |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | ->onDelete('cascade'); |
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | - $this->builder->table('tracker_log', function ($table) { |
|
| 102 | + $this->builder->table('tracker_log', function($table) { |
|
| 103 | 103 | $table->foreign('query_id') |
| 104 | 104 | ->references('id') |
| 105 | 105 | ->on('tracker_queries') |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ->onDelete('cascade'); |
| 108 | 108 | }); |
| 109 | 109 | |
| 110 | - $this->builder->table('tracker_log', function ($table) { |
|
| 110 | + $this->builder->table('tracker_log', function($table) { |
|
| 111 | 111 | $table->foreign('route_path_id') |
| 112 | 112 | ->references('id') |
| 113 | 113 | ->on('tracker_route_paths') |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ->onDelete('cascade'); |
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | - $this->builder->table('tracker_log', function ($table) { |
|
| 118 | + $this->builder->table('tracker_log', function($table) { |
|
| 119 | 119 | $table->foreign('error_id') |
| 120 | 120 | ->references('id') |
| 121 | 121 | ->on('tracker_errors') |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ->onDelete('cascade'); |
| 124 | 124 | }); |
| 125 | 125 | |
| 126 | - $this->builder->table('tracker_events_log', function ($table) { |
|
| 126 | + $this->builder->table('tracker_events_log', function($table) { |
|
| 127 | 127 | $table->foreign('event_id') |
| 128 | 128 | ->references('id') |
| 129 | 129 | ->on('tracker_events') |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ->onDelete('cascade'); |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $this->builder->table('tracker_events_log', function ($table) { |
|
| 134 | + $this->builder->table('tracker_events_log', function($table) { |
|
| 135 | 135 | $table->foreign('class_id') |
| 136 | 136 | ->references('id') |
| 137 | 137 | ->on('tracker_system_classes') |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | ->onDelete('cascade'); |
| 140 | 140 | }); |
| 141 | 141 | |
| 142 | - $this->builder->table('tracker_events_log', function ($table) { |
|
| 142 | + $this->builder->table('tracker_events_log', function($table) { |
|
| 143 | 143 | $table->foreign('log_id') |
| 144 | 144 | ->references('id') |
| 145 | 145 | ->on('tracker_log') |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | ->onDelete('cascade'); |
| 148 | 148 | }); |
| 149 | 149 | |
| 150 | - $this->builder->table('tracker_sql_query_bindings_parameters', function ($table) { |
|
| 150 | + $this->builder->table('tracker_sql_query_bindings_parameters', function($table) { |
|
| 151 | 151 | $table->foreign('sql_query_bindings_id', 'tracker_sqlqb_parameters') |
| 152 | 152 | ->references('id') |
| 153 | 153 | ->on('tracker_sql_query_bindings') |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | ->onDelete('cascade'); |
| 156 | 156 | }); |
| 157 | 157 | |
| 158 | - $this->builder->table('tracker_sql_queries_log', function ($table) { |
|
| 158 | + $this->builder->table('tracker_sql_queries_log', function($table) { |
|
| 159 | 159 | $table->foreign('log_id') |
| 160 | 160 | ->references('id') |
| 161 | 161 | ->on('tracker_log') |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | ->onDelete('cascade'); |
| 164 | 164 | }); |
| 165 | 165 | |
| 166 | - $this->builder->table('tracker_sql_queries_log', function ($table) { |
|
| 166 | + $this->builder->table('tracker_sql_queries_log', function($table) { |
|
| 167 | 167 | $table->foreign('sql_query_id') |
| 168 | 168 | ->references('id') |
| 169 | 169 | ->on('tracker_sql_queries') |
@@ -202,6 +202,9 @@ |
||
| 202 | 202 | return $this->dataRepositoryManager->getRoutePathId($this->route, $this->request); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $item |
|
| 207 | + */ |
|
| 205 | 208 | private function logUntrackable($item) |
| 206 | 209 | { |
| 207 | 210 | if ($this->config->get('log_untrackable_sessions') && !isset($this->loggedItems[$item])) { |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | try { |
| 23 | 23 | $this->builder->table( |
| 24 | 24 | $this->table, |
| 25 | - function ($table) { |
|
| 25 | + function($table) { |
|
| 26 | 26 | $table->dropUnique('tracker_agents_name_unique'); |
| 27 | 27 | |
| 28 | 28 | $table->string('name_hash', 65)->nullable(); |
| 29 | 29 | } |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | - Agent::all()->each(function ($agent) { |
|
| 32 | + Agent::all()->each(function($agent) { |
|
| 33 | 33 | $agent->name_hash = hash('sha256', $agent->name); |
| 34 | 34 | |
| 35 | 35 | $agent->save(); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $this->builder->table( |
| 39 | 39 | $this->table, |
| 40 | - function ($table) { |
|
| 40 | + function($table) { |
|
| 41 | 41 | $table->unique('name_hash'); |
| 42 | 42 | } |
| 43 | 43 | ); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | try { |
| 57 | 57 | $this->builder->table( |
| 58 | 58 | $this->table, |
| 59 | - function ($table) { |
|
| 59 | + function($table) { |
|
| 60 | 60 | $table->dropUnique('tracker_agents_name_hash_unique'); |
| 61 | 61 | |
| 62 | 62 | $table->dropColumn('name_hash'); |
@@ -21,21 +21,21 @@ discard block |
||
| 21 | 21 | try { |
| 22 | 22 | $this->builder->table( |
| 23 | 23 | $this->table, |
| 24 | - function ($table) { |
|
| 24 | + function($table) { |
|
| 25 | 25 | $table->dropUnique('tracker_agents_name_unique'); |
| 26 | 26 | } |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | $this->builder->table( |
| 30 | 30 | $this->table, |
| 31 | - function ($table) { |
|
| 31 | + function($table) { |
|
| 32 | 32 | $table->mediumText('name')->change(); |
| 33 | 33 | } |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | $this->builder->table( |
| 37 | 37 | $this->table, |
| 38 | - function ($table) { |
|
| 38 | + function($table) { |
|
| 39 | 39 | $table->unique('id', 'tracker_agents_name_unique'); // this is a dummy index |
| 40 | 40 | } |
| 41 | 41 | ); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | try { |
| 55 | 55 | $this->builder->table( |
| 56 | 56 | $this->table, |
| 57 | - function ($table) { |
|
| 57 | + function($table) { |
|
| 58 | 58 | $table->string('name', 255)->change(); |
| 59 | 59 | $table->unique('name'); |
| 60 | 60 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ]); |
| 124 | 124 | |
| 125 | 125 | return Datatables::of($query) |
| 126 | - ->edit_column('route_name', function ($row) { |
|
| 126 | + ->edit_column('route_name', function($row) { |
|
| 127 | 127 | $path = $row->routePath; |
| 128 | 128 | |
| 129 | 129 | return $row->routePath |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | : ($row->path ? $row->path->path : ''); |
| 132 | 132 | }) |
| 133 | 133 | |
| 134 | - ->edit_column('route', function ($row) { |
|
| 134 | + ->edit_column('route', function($row) { |
|
| 135 | 135 | $route = null; |
| 136 | 136 | |
| 137 | 137 | if ($row->routePath) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | return $route; |
| 144 | 144 | }) |
| 145 | 145 | |
| 146 | - ->edit_column('query', function ($row) { |
|
| 146 | + ->edit_column('query', function($row) { |
|
| 147 | 147 | $query = null; |
| 148 | 148 | |
| 149 | 149 | if ($row->logQuery) { |
@@ -155,23 +155,23 @@ discard block |
||
| 155 | 155 | return $query; |
| 156 | 156 | }) |
| 157 | 157 | |
| 158 | - ->edit_column('is_ajax', function ($row) { |
|
| 158 | + ->edit_column('is_ajax', function($row) { |
|
| 159 | 159 | return $row->is_ajax ? 'yes' : 'no'; |
| 160 | 160 | }) |
| 161 | 161 | |
| 162 | - ->edit_column('is_secure', function ($row) { |
|
| 162 | + ->edit_column('is_secure', function($row) { |
|
| 163 | 163 | return $row->is_secure ? 'yes' : 'no'; |
| 164 | 164 | }) |
| 165 | 165 | |
| 166 | - ->edit_column('is_json', function ($row) { |
|
| 166 | + ->edit_column('is_json', function($row) { |
|
| 167 | 167 | return $row->is_json ? 'yes' : 'no'; |
| 168 | 168 | }) |
| 169 | 169 | |
| 170 | - ->edit_column('wants_json', function ($row) { |
|
| 170 | + ->edit_column('wants_json', function($row) { |
|
| 171 | 171 | return $row->wants_json ? 'yes' : 'no'; |
| 172 | 172 | }) |
| 173 | 173 | |
| 174 | - ->edit_column('error', function ($row) { |
|
| 174 | + ->edit_column('error', function($row) { |
|
| 175 | 175 | return $row->error ? 'yes' : 'no'; |
| 176 | 176 | }) |
| 177 | 177 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | ]); |
| 214 | 214 | |
| 215 | 215 | return Datatables::of($query) |
| 216 | - ->edit_column('updated_at', function ($row) { |
|
| 216 | + ->edit_column('updated_at', function($row) { |
|
| 217 | 217 | return "{$row->updated_at->diffForHumans()}"; |
| 218 | 218 | }) |
| 219 | 219 | ->make(true); |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | $username_column = Tracker::getConfig('authenticated_user_username_column'); |
| 232 | 232 | |
| 233 | 233 | return Datatables::of(Tracker::users($session->getMinutes(), false)) |
| 234 | - ->edit_column('user_id', function ($row) use ($username_column) { |
|
| 234 | + ->edit_column('user_id', function($row) use ($username_column) { |
|
| 235 | 235 | return "{$row->user->$username_column}"; |
| 236 | 236 | }) |
| 237 | - ->edit_column('updated_at', function ($row) { |
|
| 237 | + ->edit_column('updated_at', function($row) { |
|
| 238 | 238 | return "{$row->updated_at->diffForHumans()}"; |
| 239 | 239 | }) |
| 240 | 240 | ->make(true); |
@@ -262,13 +262,13 @@ discard block |
||
| 262 | 262 | ]); |
| 263 | 263 | |
| 264 | 264 | return Datatables::of($query) |
| 265 | - ->edit_column('id', function ($row) use ($username_column) { |
|
| 265 | + ->edit_column('id', function($row) use ($username_column) { |
|
| 266 | 266 | $uri = route('tracker.stats.log', $row->uuid); |
| 267 | 267 | |
| 268 | 268 | return '<a href="'.$uri.'">'.$row->id.'</a>'; |
| 269 | 269 | }) |
| 270 | 270 | |
| 271 | - ->add_column('country', function ($row) { |
|
| 271 | + ->add_column('country', function($row) { |
|
| 272 | 272 | $cityName = $row->geoip && $row->geoip->city ? ' - '.$row->geoip->city : ''; |
| 273 | 273 | |
| 274 | 274 | $countryName = ($row->geoip ? $row->geoip->country_name : '').$cityName; |
@@ -282,11 +282,11 @@ discard block |
||
| 282 | 282 | return "$flag $countryName"; |
| 283 | 283 | }) |
| 284 | 284 | |
| 285 | - ->add_column('user', function ($row) use ($username_column) { |
|
| 285 | + ->add_column('user', function($row) use ($username_column) { |
|
| 286 | 286 | return $row->user ? $row->user->$username_column : 'guest'; |
| 287 | 287 | }) |
| 288 | 288 | |
| 289 | - ->add_column('device', function ($row) use ($username_column) { |
|
| 289 | + ->add_column('device', function($row) use ($username_column) { |
|
| 290 | 290 | $model = ($row->device && $row->device->model && $row->device->model !== 'unavailable' ? '['.$row->device->model.']' : ''); |
| 291 | 291 | |
| 292 | 292 | $platform = ($row->device && $row->device->platform ? ' ['.trim($row->device->platform.' '.$row->device->platform_version).']' : ''); |
@@ -298,27 +298,27 @@ discard block |
||
| 298 | 298 | : ''; |
| 299 | 299 | }) |
| 300 | 300 | |
| 301 | - ->add_column('browser', function ($row) use ($username_column) { |
|
| 301 | + ->add_column('browser', function($row) use ($username_column) { |
|
| 302 | 302 | return $row->agent && $row->agent |
| 303 | 303 | ? $row->agent->browser.' ('.$row->agent->browser_version.')' |
| 304 | 304 | : ''; |
| 305 | 305 | }) |
| 306 | 306 | |
| 307 | - ->add_column('language', function ($row) use ($username_column) { |
|
| 307 | + ->add_column('language', function($row) use ($username_column) { |
|
| 308 | 308 | return $row->language && $row->language |
| 309 | 309 | ? $row->language->preference |
| 310 | 310 | : ''; |
| 311 | 311 | }) |
| 312 | 312 | |
| 313 | - ->add_column('referer', function ($row) use ($username_column) { |
|
| 313 | + ->add_column('referer', function($row) use ($username_column) { |
|
| 314 | 314 | return $row->referer ? $row->referer->domain->name : ''; |
| 315 | 315 | }) |
| 316 | 316 | |
| 317 | - ->add_column('pageViews', function ($row) use ($username_column) { |
|
| 317 | + ->add_column('pageViews', function($row) use ($username_column) { |
|
| 318 | 318 | return $row->page_views; |
| 319 | 319 | }) |
| 320 | 320 | |
| 321 | - ->add_column('lastActivity', function ($row) use ($username_column) { |
|
| 321 | + ->add_column('lastActivity', function($row) use ($username_column) { |
|
| 322 | 322 | return $row->updated_at->diffForHumans(); |
| 323 | 323 | }) |
| 324 | 324 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Display all messages. |
| 20 | 20 | * |
| 21 | - * @param $type |
|
| 21 | + * @param string $type |
|
| 22 | 22 | * @param $messages |
| 23 | 23 | */ |
| 24 | 24 | public function displayMessages($type, $messages) |
@@ -28,8 +28,8 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function addMessage($message) |
| 30 | 30 | { |
| 31 | - collect((array) $message)->each(function ($item) { |
|
| 32 | - collect($item)->flatten()->each(function ($flattened) { |
|
| 31 | + collect((array) $message)->each(function($item) { |
|
| 32 | + collect($item)->flatten()->each(function($flattened) { |
|
| 33 | 33 | $this->messageList->push($flattened); |
| 34 | 34 | }); |
| 35 | 35 | }); |