Commit bf606d5
authored
refactor: restructure upgrade keys (#37)
This pull request refactors how upgrade state is tracked in the
configuration, consolidating upgrade keys under a single `upgrades`
array and improving configuration key management. The changes also add
helper methods for manipulating nested configuration keys using
Laravel's array helpers.
Configuration management improvements:
* Added `removeKey` method in `Configuration.php` to remove nested
configuration values using Laravel's `Arr::forget` helper, allowing for
dot notation.
* Changed `updateKey` method in `Configuration.php` to use Laravel's
`Arr::set` helper, allowing for dot notation and more flexible
configuration updates.
Upgrade state tracking refactor:
* Consolidated upgrade keys (such as `symlinks_upgraded` and
`php_port_overrides_upgraded`) under a new `upgrades` array in the
configuration, with new names `symlinks` and
`nginx_site_php_port_overrides`.
* Added new helper methods `isUpgraded` and `markAsUpgraded` to access
the new `upgrades` config format and improve upgrade tracking
consistency.
* Added a migration method (`migrateSymlinksUpgradeKey`) to move the
legacy `symlinks_upgraded` key to the new `upgrades.symlinks` key and
clean up the old key, ensuring backward compatibility and config
cleanliness. This prevents the breaking change from being a _breaking
change_.
**Note**: The `symlinks_upgraded` is the only legacy key that needs to
be migrated. The `php_port_overrides_upgraded` key wasn't released in a
stable version, so it doesn't need migrating.
* Replaced the `shouldUpgradeNginxSitePhpPortOverrides` and
`shouldUpgradeSymbolicLinks` method calls with a direct call to
`isUpgraded` method.
* Removed the now unused `shouldUpgradeNginxSitePhpPortOverrides` and
`shouldUpgradeSymbolicLinks` methods.
These changes make the upgrade process more robust and future proof and
the configuration file easier to maintain.2 files changed
Lines changed: 75 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
448 | 454 | | |
449 | 455 | | |
450 | 456 | | |
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
455 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
456 | 480 | | |
457 | 481 | | |
458 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 91 | | |
111 | 92 | | |
112 | 93 | | |
| |||
226 | 207 | | |
227 | 208 | | |
228 | 209 | | |
229 | | - | |
| 210 | + | |
230 | 211 | | |
231 | 212 | | |
232 | 213 | | |
| |||
256 | 237 | | |
257 | 238 | | |
258 | 239 | | |
259 | | - | |
| 240 | + | |
260 | 241 | | |
261 | 242 | | |
262 | 243 | | |
263 | 244 | | |
264 | 245 | | |
265 | 246 | | |
266 | | - | |
| 247 | + | |
267 | 248 | | |
268 | 249 | | |
269 | 250 | | |
| |||
293 | 274 | | |
294 | 275 | | |
295 | 276 | | |
296 | | - | |
| 277 | + | |
297 | 278 | | |
298 | 279 | | |
299 | 280 | | |
300 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
301 | 284 | | |
302 | 285 | | |
303 | 286 | | |
304 | | - | |
305 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
306 | 322 | | |
307 | 323 | | |
0 commit comments