Browse Source

Update to latest clockwork

- refresh its config
- ignore its sqlite default path
- remove manual loads as they're not needed anymore since 5.5
pull/3549/head
nanaya 9 months ago
parent
commit
2861babe74
6 changed files with 225 additions and 109 deletions
  1. 0
    1
      app/Http/Kernel.php
  2. 1
    1
      composer.json
  3. 17
    14
      composer.lock
  4. 0
    1
      config/app.php
  5. 206
    92
      config/clockwork.php
  6. 1
    0
      storage/.gitignore

+ 0
- 1
app/Http/Kernel.php View File

@@ -41,7 +41,6 @@ class Kernel extends HttpKernel
41 41
         Middleware\VerifyPrivilegedUser::class,
42 42
         Middleware\CheckUserBanStatus::class,
43 43
         Middleware\UpdateUserLastvisit::class,
44
-        \Clockwork\Support\Laravel\ClockworkMiddleware::class,
45 44
         Middleware\TurbolinksSupport::class,
46 45
         \ChaseConey\LaravelDatadogHelper\Middleware\LaravelDatadogMiddleware::class,
47 46
     ];

+ 1
- 1
composer.json View File

@@ -23,7 +23,7 @@
23 23
     "graham-campbell/github": "*",
24 24
     "graham-campbell/markdown": "*",
25 25
     "guzzlehttp/guzzle": "*",
26
-    "itsgoingd/clockwork": "~1.14",
26
+    "itsgoingd/clockwork": ">=3.0",
27 27
     "laravel/framework": "5.5.*",
28 28
     "laravel/passport": "*",
29 29
     "laravel/tinker": "~1.0",

+ 17
- 14
composer.lock View File

@@ -1,10 +1,10 @@
1 1
 {
2 2
     "_readme": [
3 3
         "This file locks the dependencies of your project to a known state",
4
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
4
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "content-hash": "87569f1f280af105c239512262a0f6a9",
7
+    "content-hash": "362348dac82eab0fba6ab926584cc276",
8 8
     "packages": [
9 9
         {
10 10
             "name": "aws/aws-sdk-php",
@@ -1584,20 +1584,20 @@
1584 1584
         },
1585 1585
         {
1586 1586
             "name": "itsgoingd/clockwork",
1587
-            "version": "v1.14.5",
1587
+            "version": "v3.0",
1588 1588
             "source": {
1589 1589
                 "type": "git",
1590 1590
                 "url": "https://github.com/itsgoingd/clockwork.git",
1591
-                "reference": "55ec557cc8cc60944de0eefbe27f905d538a8f70"
1591
+                "reference": "8a489bf1f701bcdd6f65be1369bd4dffb0aabda2"
1592 1592
             },
1593 1593
             "dist": {
1594 1594
                 "type": "zip",
1595
-                "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/55ec557cc8cc60944de0eefbe27f905d538a8f70",
1596
-                "reference": "55ec557cc8cc60944de0eefbe27f905d538a8f70",
1595
+                "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/8a489bf1f701bcdd6f65be1369bd4dffb0aabda2",
1596
+                "reference": "8a489bf1f701bcdd6f65be1369bd4dffb0aabda2",
1597 1597
                 "shasum": ""
1598 1598
             },
1599 1599
             "require": {
1600
-                "php": ">=5.3.9",
1600
+                "php": ">=5.5",
1601 1601
                 "psr/log": "1.*"
1602 1602
             },
1603 1603
             "type": "library",
@@ -1624,18 +1624,21 @@
1624 1624
                 {
1625 1625
                     "name": "itsgoingd",
1626 1626
                     "email": "itsgoingd@luzer.sk",
1627
-                    "homepage": "http://twitter.com/itsgoingd"
1627
+                    "homepage": "https://twitter.com/itsgoingd"
1628 1628
                 }
1629 1629
             ],
1630
-            "description": "Server-side component of Clockwork, a Chrome extension for PHP development",
1631
-            "homepage": "http://github.com/itsgoingd/clockwork",
1630
+            "description": "php dev tools integrated to your browser",
1631
+            "homepage": "https://underground.works/clockwork",
1632 1632
             "keywords": [
1633
+                "Devtools",
1633 1634
                 "debugging",
1634 1635
                 "laravel",
1635 1636
                 "logging",
1636
-                "profiling"
1637
+                "lumen",
1638
+                "profiling",
1639
+                "slim"
1637 1640
             ],
1638
-            "time": "2017-09-15T14:50:14+00:00"
1641
+            "time": "2018-07-30T22:51:45+00:00"
1639 1642
         },
1640 1643
         {
1641 1644
             "name": "jakub-onderka/php-console-color",
@@ -2664,9 +2667,9 @@
2664 2667
                 "slack"
2665 2668
             ],
2666 2669
             "support": {
2667
-                "source": "https://github.com/nanaya/slack-php/tree/laravel-5.4"
2670
+                "source": "https://github.com/nanaya/slack-php/tree/1.7.1"
2668 2671
             },
2669
-            "time": "2017-02-16 06:27:23"
2672
+            "time": "2017-02-16T06:27:23+00:00"
2670 2673
         },
2671 2674
         {
2672 2675
             "name": "mariuzzo/laravel-js-localization",

+ 0
- 1
config/app.php View File

@@ -203,7 +203,6 @@ return [
203 203
         /*
204 204
          * Package Service Providers...
205 205
          */
206
-        Clockwork\Support\Laravel\ClockworkServiceProvider::class,
207 206
         GrahamCampbell\Markdown\MarkdownServiceProvider::class,
208 207
         GrahamCampbell\GitHub\GitHubServiceProvider::class,
209 208
         Maknz\Slack\SlackServiceProvider::class,

+ 206
- 92
config/clockwork.php View File

@@ -2,97 +2,211 @@
2 2
 
3 3
 return [
4 4
 
5
-    /*
6
-    |--------------------------------------------------------------------------
7
-    | Enable Clockwork
8
-    |--------------------------------------------------------------------------
9
-    |
10
-    | You can explicitly enable or disable Clockwork here. When enabled, special
11
-    | headers for communication with the Clockwork Chrome extension will be
12
-    | included in your application responses and requests data will be available
13
-    | at /__clockwork url.
14
-    | When set to null, Clockwork behavior is controlled by app.debug setting.
15
-    | Default: null
16
-    |
17
-    */
18
-
19
-    'enable' => null,
20
-
21
-    /*
22
-    |--------------------------------------------------------------------------
23
-    | Enable data collection, when Clockwork is disabled
24
-    |--------------------------------------------------------------------------
25
-    |
26
-    | This setting controls, whether data about application requests will be
27
-    | recorded even when Clockwork is disabled (useful for later analysis).
28
-    | Default: false
29
-    |
30
-    */
31
-
32
-    'collect_data_always' => false,
33
-
34
-    /*
35
-    |--------------------------------------------------------------------------
36
-    | Filter collected data
37
-    |--------------------------------------------------------------------------
38
-    |
39
-    | You can filter collected data by specifying what you don't want to collect
40
-    | here.
41
-    |
42
-    */
43
-
44
-    'filter' => [
45
-        'routes',    // collecting routes data on every request might use a lot of disk space
46
-        'viewsData', // collecting views data, including all variables passed to the view on every request might use a lot of disk space
47
-    ],
48
-
49
-    /*
50
-    |--------------------------------------------------------------------------
51
-    | Disable data collection for certain URIs
52
-    |--------------------------------------------------------------------------
53
-    |
54
-    | You can disable data collection for specific URIs by adding matching
55
-    | regular expressions here.
56
-    |
57
-    */
58
-
59
-    'filter_uris' => [
60
-        '/__clockwork/.*', // disable collecting data for clockwork-web assets
61
-    ],
62
-
63
-    /*
64
-    |--------------------------------------------------------------------------
65
-    | Additional data sources
66
-    |--------------------------------------------------------------------------
67
-    |
68
-    | You can use this option to register additional data sources with Clockwork.
69
-    | Keys specify the name under which the data source will be registered in the
70
-    | IoC container, values are closures accepting Laravel application instance as
71
-    | the only argument and returning an instance of the data source.
72
-    |
73
-    */
74
-
75
-    'additional_data_sources' => [
76
-        // 'clockwork.doctrine' => function($app)
77
-        // {
78
-        // 	return new \Clockwork\DataSource\DoctrineDataSource($app['Doctrine\ORM\EntityManager'], $app['log']);
79
-        // }
80
-    ],
81
-
82
-    /*
83
-    |--------------------------------------------------------------------------
84
-    | Send Headers for AJAX request
85
-    |--------------------------------------------------------------------------
86
-    |
87
-    | When trying to collect data the AJAX method can sometimes fail if it is
88
-    | missing required headers. For example, an API might require a version
89
-    | number using Accept headers to route the HTTP request to the correct
90
-    | codebase.
91
-    |
92
-    */
93
-
94
-    'headers' => [
95
-        // 'Accept' => 'application/vnd.com.whatever.v1+json',
96
-    ],
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Enable Clockwork
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| You can explicitly enable or disable Clockwork here. When enabled, special
11
+	| headers for communication with the Clockwork Chrome extension will be
12
+	| included in your application responses and requests data will be available
13
+	| at /__clockwork url.
14
+	| When set to null, Clockwork behavior is controlled by app.debug setting.
15
+	| Default: null
16
+	|
17
+	*/
18
+
19
+	'enable' => env('CLOCKWORK_ENABLE', null),
20
+
21
+	/*
22
+	|--------------------------------------------------------------------------
23
+	| Enable web UI
24
+	|--------------------------------------------------------------------------
25
+	|
26
+	| Enable or disable the Clockwork web UI available at  http://your.app/__clockwork.
27
+	| You can also set whether to use the dark theme by default.
28
+	| Default: true
29
+	|
30
+	*/
31
+
32
+	'web' => env('CLOCKWORK_WEB', true),
33
+
34
+	'web_dark_theme' => env('CLOCKWORK_WEB_DARK_THEME', false),
35
+
36
+	/*
37
+	|--------------------------------------------------------------------------
38
+	| Enable data collection, when Clockwork is disabled
39
+	|--------------------------------------------------------------------------
40
+	|
41
+	| This setting controls, whether data about application requests will be
42
+	| recorded even when Clockwork is disabled (useful for later analysis).
43
+	| Default: false
44
+	|
45
+	*/
46
+
47
+	'collect_data_always' => env('CLOCKWORK_COLLECT_DATA_ALWAYS', false),
48
+
49
+	/*
50
+	|--------------------------------------------------------------------------
51
+	| Metadata storage
52
+	|--------------------------------------------------------------------------
53
+	|
54
+	| You can configure how are the metadata collected by Clockwork stored.
55
+	| Valid options are: files or sql.
56
+	| Files storage stores the metadata in one-per-request files in a specified
57
+	| directory.
58
+	| Sql storage stores the metadata as rows in a sql database. You can specify
59
+	| the database by name if defined in database.php or by path to Sqlite
60
+	| database. Database table will be automatically created.
61
+	| Sql storage requires PDO.
62
+	|
63
+	*/
64
+
65
+	'storage' => env('CLOCKWORK_STORAGE', 'files'),
66
+
67
+	'storage_files_path' => env('CLOCKWORK_STORAGE_FILES_PATH', storage_path('clockwork')),
68
+
69
+	'storage_sql_database' => env('CLOCKWORK_STORAGE_SQL_DATABASE', storage_path('clockwork.sqlite')),
70
+	'storage_sql_table'    => env('CLOCKWORK_STORAGE_SQL_TABLE', 'clockwork'),
71
+
72
+	/*
73
+	|--------------------------------------------------------------------------
74
+	| Metadata expiration
75
+	|--------------------------------------------------------------------------
76
+	|
77
+	| Maximum lifetime of the metadata in minutes, metadata for older requests
78
+	| will automatically be deleted when storing new requests.
79
+	| When set to false, metadata will never be deleted.
80
+	| Default: 1 week
81
+	|
82
+	*/
83
+
84
+	'storage_expiration' => env('CLOCKWORK_STORAGE_EXPIRATION', 60 * 24 * 7),
85
+
86
+	/*
87
+	|--------------------------------------------------------------------------
88
+	| Authentication
89
+	|--------------------------------------------------------------------------
90
+	|
91
+	| Clockwork can be configured to require authentication before allowing
92
+	/ access to the collected data. This is recommended when the application
93
+	/ is publicly accessible, as the metadata might contain sensitive information.
94
+	/ Setting to "true" enables authentication with a single password set below,
95
+	/ "false" disables authentication.
96
+	/ You can also pass a class name of a custom authentication implementation.
97
+	/ Default: false
98
+	|
99
+	*/
100
+
101
+	'authentication' => env('CLOCKWORK_AUTHENTICATION', false),
102
+
103
+	'authentication_password' => env('CLOCKWORK_AUTHENTICATION_PASSWORD', 'VerySecretPassword'),
104
+
105
+	/*
106
+	|--------------------------------------------------------------------------
107
+	| Filter collected data
108
+	|--------------------------------------------------------------------------
109
+	|
110
+	| You can filter collected data by specifying what you don't want to collect
111
+	| here.
112
+	|
113
+	*/
114
+
115
+	'filter' => [
116
+		'cacheQueries', // collecting cache queries in cache-heavy might have a negative performance impact and use a lot of disk space
117
+		'routes', // collecting routes data on every request might use a lot of disk space
118
+		'viewsData', // collecting views data, including all variables passed to the view on every request might use a lot of disk space
119
+	],
120
+
121
+	/*
122
+	|--------------------------------------------------------------------------
123
+	| Disable data collection for certain URIs
124
+	|--------------------------------------------------------------------------
125
+	|
126
+	| You can disable data collection for specific URIs by adding matching
127
+	| regular expressions here.
128
+	|
129
+	*/
130
+
131
+	'filter_uris' => [
132
+		'/__clockwork/.*', // disable collecting data for clockwork-web assets
133
+		'/horizon/.*', // disable collecting data for Laravel Horizon requests
134
+	],
135
+
136
+	/*
137
+	|--------------------------------------------------------------------------
138
+	| Enable collecting of stack traces
139
+	|--------------------------------------------------------------------------
140
+	|
141
+	| This setting controls, whether log messages and certain data sources, like
142
+	/ the database or cache data sources, should collect stack traces.
143
+	/ You might want to disable this if you are collecting 100s of queries or
144
+	/ log messages, as the stack traces can considerably increase the metadata size.
145
+	/ You can force collecting of stack trace for a single log call by passing
146
+	/ [ 'trace' => true ] as $context.
147
+	| Default: true
148
+	|
149
+	*/
150
+
151
+	'collect_stack_traces' => env('CLOCKWORK_COLLECT_STACK_TRACES', true),
152
+
153
+	/*
154
+	|--------------------------------------------------------------------------
155
+	| Ignored events
156
+	|--------------------------------------------------------------------------
157
+	|
158
+	| Array of event names that will be ignored when collecting data for the "events" tab.
159
+	| By default all framework-specific events are also ignored, set to false to log
160
+	| all possible fired events.
161
+	|
162
+	*/
163
+
164
+	'ignored_events' => [
165
+	],
166
+
167
+	/*
168
+	|--------------------------------------------------------------------------
169
+	| Register helpers
170
+	|--------------------------------------------------------------------------
171
+	|
172
+	| This setting controls whether the "clock" helper function will be registered. You can use the "clock" function to
173
+	| quickly log something to Clockwork or access the Clockwork instance.
174
+	|
175
+	*/
176
+
177
+	'register_helpers' => env('CLOCKWORK_REGISTER_HELPERS', true),
178
+
179
+	/*
180
+	|--------------------------------------------------------------------------
181
+	| Send Headers for AJAX request
182
+	|--------------------------------------------------------------------------
183
+	|
184
+	| When trying to collect data the AJAX method can sometimes fail if it is
185
+	| missing required headers. For example, an API might require a version
186
+	| number using Accept headers to route the HTTP request to the correct
187
+	| codebase.
188
+	|
189
+	*/
190
+
191
+	'headers' => [
192
+		// 'Accept' => 'application/vnd.com.whatever.v1+json',
193
+	],
194
+
195
+	/*
196
+	|--------------------------------------------------------------------------
197
+	| Server-Timing
198
+	|--------------------------------------------------------------------------
199
+	|
200
+	| Clockwork supports the W3C Server Timing specification, which allows for
201
+	/ collecting a simple performance metrics in a cross-browser way. Eg. in
202
+	/ Chrome, your app, database and timeline event timings will be shown
203
+	/ in the Dev Tools network tab.
204
+	/ This setting specifies the max number of timeline events that will be sent.
205
+	| When set to false, Server-Timing headers will not be set.
206
+	| Default: 10
207
+	|
208
+	*/
209
+
210
+	'server_timing' => env('CLOCKWORK_SERVER_TIMING', 10)
97 211
 
98 212
 ];

+ 1
- 0
storage/.gitignore View File

@@ -1 +1,2 @@
1
+clockwork.sqlite
1 2
 laravel.log

Loading…
Cancel
Save