|
13 | 13 | | |
14 | 14 | */ |
15 | 15 |
|
16 | | - 'enable' => isset($_ENV['CLOCKWORK_ENABLE']) ? $_ENV['CLOCKWORK_ENABLE'] : true, |
| 16 | + 'enable' => getenv('CLOCKWORK_ENABLE') !== false ? getenv('CLOCKWORK_ENABLE') : false, |
17 | 17 |
|
18 | 18 | /* |
19 | 19 | |------------------------------------------------------------------------------------------------------------------ |
|
30 | 30 | // Performance metrics |
31 | 31 | 'performance' => [ |
32 | 32 | // Allow collecting of client metrics. Requires separate clockwork-browser npm package. |
33 | | - 'client_metrics' => isset($_ENV['CLOCKWORK_PERFORMANCE_CLIENT_METRICS']) ? $_ENV['CLOCKWORK_PERFORMANCE_CLIENT_METRICS'] : true |
| 33 | + 'client_metrics' => getenv('CLOCKWORK_PERFORMANCE_CLIENT_METRICS') !== false ? getenv('CLOCKWORK_PERFORMANCE_CLIENT_METRICS') : true |
34 | 34 | ] |
35 | 35 |
|
36 | 36 | ], |
|
45 | 45 | | |
46 | 46 | */ |
47 | 47 |
|
48 | | - 'toolbar' => isset($_ENV['CLOCKWORK_TOOLBAR']) ? $_ENV['CLOCKWORK_TOOLBAR'] : true, |
| 48 | + 'toolbar' => getenv('CLOCKWORK_TOOLBAR') !== false ? getenv('CLOCKWORK_TOOLBAR') : true, |
49 | 49 |
|
50 | 50 | /* |
51 | 51 | |------------------------------------------------------------------------------------------------------------------ |
|
60 | 60 | // With on-demand mode enabled, Clockwork will only profile requests when the browser extension is open or you |
61 | 61 | // manually pass a "clockwork-profile" cookie or get/post data key. |
62 | 62 | // Optionally you can specify a "secret" that has to be passed as the value to enable profiling. |
63 | | - 'on_demand' => isset($_ENV['CLOCKWORK_REQUESTS_ON_DEMAND']) ? $_ENV['CLOCKWORK_REQUESTS_ON_DEMAND'] : false, |
| 63 | + 'on_demand' => getenv('CLOCKWORK_REQUESTS_ON_DEMAND') !== false ? getenv('CLOCKWORK_REQUESTS_ON_DEMAND') : false, |
64 | 64 |
|
65 | 65 | // Collect only errors (requests with HTTP 4xx and 5xx responses) |
66 | | - 'errors_only' => isset($_ENV['CLOCKWORK_REQUESTS_ERRORS_ONLY']) ? $_ENV['CLOCKWORK_REQUESTS_ERRORS_ONLY'] : false, |
| 66 | + 'errors_only' => getenv('CLOCKWORK_REQUESTS_ERRORS_ONLY') !== false ? getenv('CLOCKWORK_REQUESTS_ERRORS_ONLY') : false, |
67 | 67 |
|
68 | 68 | // Response time threshold in milliseconds after which the request will be marked as slow |
69 | | - 'slow_threshold' => isset($_ENV['CLOCKWORK_REQUESTS_SLOW_THRESHOLD']) ? $_ENV['CLOCKWORK_REQUESTS_SLOW_THRESHOLD'] : null, |
| 69 | + 'slow_threshold' => getenv('CLOCKWORK_REQUESTS_SLOW_THRESHOLD') !== false ? getenv('CLOCKWORK_REQUESTS_SLOW_THRESHOLD') : null, |
70 | 70 |
|
71 | 71 | // Collect only slow requests |
72 | | - 'slow_only' => isset($_ENV['CLOCKWORK_REQUESTS_SLOW_ONLY']) ? $_ENV['CLOCKWORK_REQUESTS_SLOW_ONLY'] : false, |
| 72 | + 'slow_only' => getenv('CLOCKWORK_REQUESTS_SLOW_ONLY') !== false ? getenv('CLOCKWORK_REQUESTS_SLOW_ONLY') : false, |
73 | 73 |
|
74 | 74 | // Sample the collected requests (eg. set to 100 to collect only 1 in 100 requests) |
75 | | - 'sample' => isset($_ENV['CLOCKWORK_REQUESTS_SAMPLE']) ? $_ENV['CLOCKWORK_REQUESTS_SAMPLE'] : false, |
| 75 | + 'sample' => getenv('CLOCKWORK_REQUESTS_SAMPLE') !== false ? getenv('CLOCKWORK_REQUESTS_SAMPLE') : false, |
76 | 76 |
|
77 | 77 | // List of URIs that should not be collected |
78 | 78 | 'except' => [ |
|
85 | 85 | ], |
86 | 86 |
|
87 | 87 | // Don't collect OPTIONS requests, mostly used in the CSRF pre-flight requests and are rarely of interest |
88 | | - 'except_preflight' => isset($_ENV['CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT']) ? $_ENV['CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT'] : true |
| 88 | + 'except_preflight' => getenv('CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT') !== false ? getenv('CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT') : true |
89 | 89 | ], |
90 | 90 |
|
91 | 91 | /* |
|
97 | 97 | | |
98 | 98 | */ |
99 | 99 |
|
100 | | - 'collect_data_always' => isset($_ENV['CLOCKWORK_COLLECT_DATA_ALWAYS']) ? $_ENV['CLOCKWORK_COLLECT_DATA_ALWAYS'] : false, |
| 100 | + 'collect_data_always' => getenv('CLOCKWORK_COLLECT_DATA_ALWAYS') !== false ? getenv('CLOCKWORK_COLLECT_DATA_ALWAYS') : false, |
101 | 101 |
|
102 | 102 | /* |
103 | 103 | |------------------------------------------------------------------------------------------------------------------ |
|
109 | 109 | | |
110 | 110 | */ |
111 | 111 |
|
112 | | - 'api' => isset($_ENV['CLOCKWORK_API']) ? $_ENV['CLOCKWORK_API'] : '/__clockwork/', |
| 112 | + 'api' => getenv('CLOCKWORK_API') !== false ? getenv('CLOCKWORK_API') : '/__clockwork/', |
113 | 113 |
|
114 | 114 | /* |
115 | 115 | |------------------------------------------------------------------------------------------------------------------ |
|
125 | 125 |
|
126 | 126 | 'web' => [ |
127 | 127 | // Enable or disable the Web UI, set to the public uri where Clockwork Web UI is accessible |
128 | | - 'enable' => isset($_ENV['CLOCKWORK_WEB_ENABLE']) ? $_ENV['CLOCKWORK_WEB_ENABLE'] : true, |
| 128 | + 'enable' => getenv('CLOCKWORK_WEB_ENABLE') !== false ? getenv('CLOCKWORK_WEB_ENABLE') : true, |
129 | 129 |
|
130 | 130 | // Path where to install the Web UI assets, should be publicly accessible |
131 | | - 'path' => isset($_ENV['CLOCKWORK_WEB_PATH']) ? $_ENV['CLOCKWORK_WEB_PATH'] : __DIR__ . '/../../../../../public/vendor/clockwork', |
| 131 | + 'path' => getenv('CLOCKWORK_WEB_PATH') !== false ? getenv('CLOCKWORK_WEB_PATH') : __DIR__ . '/../../../../../public/vendor/clockwork', |
132 | 132 |
|
133 | 133 | // Public URI where the installed Web UI assets will be accessible |
134 | | - 'uri' => isset($_ENV['CLOCKWORK_WEB_URI']) ? $_ENV['CLOCKWORK_WEB_URI'] : '/vendor/clockwork' |
| 134 | + 'uri' => getenv('CLOCKWORK_WEB_URI') !== false ? getenv('CLOCKWORK_WEB_URI') : '/vendor/clockwork', |
135 | 135 | ], |
136 | 136 |
|
137 | 137 | /* |
|
145 | 145 | | - redis - Stores requests in redis. Requires phpredis. |
146 | 146 | */ |
147 | 147 |
|
148 | | - 'storage' => isset($_ENV['CLOCKWORK_STORAGE']) ? $_ENV['CLOCKWORK_STORAGE'] : 'files', |
| 148 | + 'storage' => getenv('CLOCKWORK_STORAGE') !== false ? getenv('CLOCKWORK_STORAGE') : 'files', |
149 | 149 |
|
150 | 150 | // Path where the Clockwork metadata is stored |
151 | | - 'storage_files_path' => isset($_ENV['CLOCKWORK_STORAGE_FILES_PATH']) ? $_ENV['CLOCKWORK_STORAGE_FILES_PATH'] : __DIR__ . '/../../../../../../clockwork', |
| 151 | + 'storage_files_path' => getenv('CLOCKWORK_STORAGE_FILES_PATH') !== false ? getenv('CLOCKWORK_STORAGE_FILES_PATH') : __DIR__ . '/../../../../../../clockwork', |
152 | 152 |
|
153 | 153 | // Compress the metadata files using gzip, trading a little bit of performance for lower disk usage |
154 | | - 'storage_files_compress' => isset($_ENV['CLOCKWORK_STORAGE_FILES_COMPRESS']) ? $_ENV['CLOCKWORK_STORAGE_FILES_COMPRESS'] : false, |
| 154 | + 'storage_files_compress' => getenv('CLOCKWORK_STORAGE_FILES_COMPRESS') !== false ? getenv('CLOCKWORK_STORAGE_FILES_COMPRESS') : false, |
155 | 155 |
|
156 | 156 | // SQL database to use, can be a PDO connection string or a path to a sqlite file |
157 | | - 'storage_sql_database' => isset($_ENV['CLOCKWORK_STORAGE_SQL_DATABASE']) ? $_ENV['CLOCKWORK_STORAGE_SQL_DATABASE'] : 'sqlite:' . __DIR__ . '/../../../../../clockwork.sqlite', |
158 | | - 'storage_sql_username' => isset($_ENV['CLOCKWORK_STORAGE_SQL_USERNAME']) ? $_ENV['CLOCKWORK_STORAGE_SQL_USERNAME'] : null, |
159 | | - 'storage_sql_password' => isset($_ENV['CLOCKWORK_STORAGE_SQL_PASSWORD']) ? $_ENV['CLOCKWORK_STORAGE_SQL_PASSWORD'] : null, |
| 157 | + 'storage_sql_database' => getenv('CLOCKWORK_STORAGE_SQL_DATABASE') !== false ? getenv('CLOCKWORK_STORAGE_SQL_DATABASE') : 'sqlite:' . __DIR__ . '/../../../../../clockwork.sqlite', |
| 158 | + 'storage_sql_username' => getenv('CLOCKWORK_STORAGE_SQL_USERNAME') !== false ? getenv('CLOCKWORK_STORAGE_SQL_USERNAME') : null, |
| 159 | + 'storage_sql_password' => getenv('CLOCKWORK_STORAGE_SQL_PASSWORD') !== false ? getenv('CLOCKWORK_STORAGE_SQL_PASSWORD') : null, |
160 | 160 |
|
161 | 161 | // SQL table name to use, the table is automatically created and updated when needed |
162 | | - 'storage_sql_table' => isset($_ENV['CLOCKWORK_STORAGE_SQL_TABLE']) ? $_ENV['CLOCKWORK_STORAGE_SQL_TABLE'] : 'clockwork', |
| 162 | + 'storage_sql_table' => getenv('CLOCKWORK_STORAGE_SQL_TABLE') !== false ? getenv('CLOCKWORK_STORAGE_SQL_TABLE') : 'clockwork', |
163 | 163 |
|
164 | 164 | // Configuration for the Redis storage |
165 | 165 | 'storage_redis' => [ |
166 | | - 'host' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_HOST']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_HOST'] : '127.0.0.1', |
167 | | - 'username' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_USERNAME']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_USERNAME'] : null, |
168 | | - 'password' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_PASSWORD']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_PASSWORD'] : null, |
169 | | - 'port' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_PORT']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_PORT'] : 6379, |
170 | | - 'database' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_DB']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_DB'] : 0 |
| 166 | + 'host' => isset('CLOCKWORK_STORAGE_REDIS_HOST') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_HOST') : '127.0.0.1', |
| 167 | + 'username' => isset('CLOCKWORK_STORAGE_REDIS_USERNAME') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_USERNAME') : null, |
| 168 | + 'password' => isset('CLOCKWORK_STORAGE_REDIS_PASSWORD') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_PASSWORD') : null, |
| 169 | + 'port' => isset('CLOCKWORK_STORAGE_REDIS_PORT') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_PORT') : 6379, |
| 170 | + 'database' => isset('CLOCKWORK_STORAGE_REDIS_DB') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_DB') : 0 |
171 | 171 | ], |
172 | 172 |
|
173 | 173 | // Redis prefix for Clockwork keys ("clockwork" if not set) |
174 | | - 'storage_redis_prefix' => isset($_ENV['CLOCKWORK_STORAGE_REDIS_PREFIX']) ? $_ENV['CLOCKWORK_STORAGE_REDIS_PREFIX'] : 'clockwork', |
| 174 | + 'storage_redis_prefix' => getenv('CLOCKWORK_STORAGE_REDIS_PREFIX') !== false ? getenv('CLOCKWORK_STORAGE_REDIS_PREFIX') : 'clockwork', |
175 | 175 |
|
176 | 176 | // Maximum lifetime of collected metadata in minutes, older requests will automatically be deleted, false to disable |
177 | | - 'storage_expiration' => isset($_ENV['CLOCKWORK_STORAGE_EXPIRATION']) ? $_ENV['CLOCKWORK_STORAGE_EXPIRATION'] : 60 * 24 * 7, |
| 177 | + 'storage_expiration' => getenv('CLOCKWORK_STORAGE_EXPIRATION') !== false ? getenv('CLOCKWORK_STORAGE_EXPIRATION') : 60 * 24 * 7, |
178 | 178 |
|
179 | 179 | /* |
180 | 180 | |------------------------------------------------------------------------------------------------------------------ |
|
187 | 187 | | |
188 | 188 | */ |
189 | 189 |
|
190 | | - 'authentication' => isset($_ENV['CLOCKWORK_AUTHENTICATION']) ? $_ENV['CLOCKWORK_AUTHENTICATION'] : false, |
| 190 | + 'authentication' => getenv('CLOCKWORK_AUTHENTICATION') !== false ? getenv('CLOCKWORK_AUTHENTICATION') : false, |
191 | 191 |
|
192 | 192 | // Password for the simple authentication |
193 | | - 'authentication_password' => isset($_ENV['CLOCKWORK_AUTHENTICATION_PASSWORD']) ? $_ENV['CLOCKWORK_AUTHENTICATION_PASSWORD'] : 'VerySecretPassword', |
| 193 | + 'authentication_password' => getenv('CLOCKWORK_AUTHENTICATION_PASSWORD') !== false ? getenv('CLOCKWORK_AUTHENTICATION_PASSWORD') : 'VerySecretPassword', |
194 | 194 |
|
195 | 195 | /* |
196 | 196 | |------------------------------------------------------------------------------------------------------------------ |
|
205 | 205 |
|
206 | 206 | 'stack_traces' => [ |
207 | 207 | // Enable or disable collecting of stack traces |
208 | | - 'enabled' => isset($_ENV['CLOCKWORK_STACK_TRACES_ENABLED']) ? $_ENV['CLOCKWORK_STACK_TRACES_ENABLED'] : true, |
| 208 | + 'enabled' => getenv('CLOCKWORK_STACK_TRACES_ENABLED') !== false ? getenv('CLOCKWORK_STACK_TRACES_ENABLED') : true, |
209 | 209 |
|
210 | 210 | // Limit the number of frames to be collected |
211 | | - 'limit' => isset($_ENV['CLOCKWORK_STACK_TRACES_LIMIT']) ? $_ENV['CLOCKWORK_STACK_TRACES_LIMIT'] : 10, |
| 211 | + 'limit' => getenv('CLOCKWORK_STACK_TRACES_LIMIT') !== false ? getenv('CLOCKWORK_STACK_TRACES_LIMIT') : 10, |
212 | 212 |
|
213 | 213 | // List of vendor names to skip when determining caller, common vendor are automatically added |
214 | 214 | 'skip_vendors' => [ |
|
237 | 237 | */ |
238 | 238 |
|
239 | 239 | // Maximum depth of serialized multi-level arrays and objects |
240 | | - 'serialization_depth' => isset($_ENV['CLOCKWORK_SERIALIZATION_DEPTH']) ? $_ENV['CLOCKWORK_SERIALIZATION_DEPTH'] : 10, |
| 240 | + 'serialization_depth' => getenv('CLOCKWORK_SERIALIZATION_DEPTH') !== false ? getenv('CLOCKWORK_SERIALIZATION_DEPTH') : 10, |
241 | 241 |
|
242 | 242 | // A list of classes that will never be serialized (eg. a common service container class) |
243 | 243 | 'serialization_blackbox' => [ |
|
254 | 254 | | |
255 | 255 | */ |
256 | 256 |
|
257 | | - 'register_helpers' => isset($_ENV['CLOCKWORK_REGISTER_HELPERS']) ? $_ENV['CLOCKWORK_REGISTER_HELPERS'] : false, |
| 257 | + 'register_helpers' => getenv('CLOCKWORK_REGISTER_HELPERS') !== false ? getenv('CLOCKWORK_REGISTER_HELPERS') : false, |
258 | 258 |
|
259 | 259 | /* |
260 | 260 | |------------------------------------------------------------------------------------------------------------------ |
|
281 | 281 | | |
282 | 282 | */ |
283 | 283 |
|
284 | | - 'server_timing' => isset($_ENV['CLOCKWORK_SERVER_TIMING']) ? $_ENV['CLOCKWORK_SERVER_TIMING'] : 10 |
| 284 | + 'server_timing' => getenv('CLOCKWORK_SERVER_TIMING') !== false ? getenv('CLOCKWORK_SERVER_TIMING') : 10 |
285 | 285 |
|
286 | 286 | ]; |
0 commit comments