FOUR-12638: Introduce customized optimize:clear#5713
Merged
ryancooley merged 1 commit intodevelopfrom Nov 29, 2023
Merged
Conversation
…kages.php doesnt get flushed unnecessarily
|
SonarQube Quality Gate |
nolanpro
approved these changes
Nov 29, 2023
boliviacoca
approved these changes
Nov 29, 2023
caleeli
reviewed
Nov 29, 2023
Contributor
There was a problem hiding this comment.
Seems something is wrong, steps to reproduce:
- Install customer adoa
- php artisan customer-adoa:install --help // check the package was installed
- php artisan processmaker:license-update {license.json} without adoa
- php artisan customer-adoa:install --help // it fails, command not found
- php artisan optimize:clear
- php artisan customer-adoa:install --help // adoa works again
- open processmaker and executes the adoa package
caleeli
approved these changes
Nov 29, 2023
Contributor
caleeli
left a comment
There was a problem hiding this comment.
Steps to test:
Install customer adoa
php artisan customer-adoa:install --help // check the package was installed
php artisan processmaker:license-update {license.json} without adoa
php artisan customer-adoa:install --help // it fails, does not exists
php artisan optimize:clear
php artisan customer-adoa:install --help // does not exists
Also, About page does not show customer-adoa:

When the license is removed:
php artisan processmaker:license-remove
php artisan optimize:clear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.










Issue
In production, we use the
bootstrap/cache/packages.phpfile as a cached store of licensed packages which we would like to be loaded. In the case that thephp artisan optimize:clearcommand is run, this flushes that file (which is generated with a separate command) and causes the framework to regenerate the file with all packages discovered, regardless of licensing.Reproduction Steps
developphp artisan license:update {pathToLicenseJsonFile}command to generate the package manifest.php artisan optimize:clear/requestspage). Notice the errors/multiple menu items added, etc. This is because there are multiple additionalServiceProvidersfrom the custom packages which are not supposed to be loaded.Solution
optimize:clearcommand to override the framework's and remove the subcommands which alter the cached package manifest.How to Test
Run through the reproduction steps and it should now not flush the package manifest.
Related Tickets & Packages
Code Review Checklist