-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-upgrade constants and SS_Log #7915
Comments
I think I'll do these each of those as individual PRs. They're not really related in any way. |
Updating error logging.Basically, I need to find any reference to SS_Log::log and replace it with a call to
This part should be relatively simple. Extra bit of complexity
|
Note that they are not like for like, as previously discussed, and as mentioned as a bug report again with #8044 |
Squashing old module dir constThere's 4 distinct places where those need to be update:
I'm thinking each one of those cases will need to be a different rule/visitor. Although, I'll probably have a centralised constant/method to give me a list of all available the PATH constant that need to be converted. I suspect this will be more appreciably more complex than the logging upgrade. Extra bits of complexity
Our current doc suggest this change: -$moduleFilePath = FRAMEWORK_DIR . '/MyFile.php';
+$moduleFilePath = ModuleLoader::getModule('silverstripe/framework')->getResource('MyFile.php')->getRelativePath(); I think it would be better to adopt a syntax like that instead: $moduleFilePath = ModuleLoader::resourcePath('silverstripe/framework: MyFile.php'); Results will be the same and it's more readable. |
Moving this back into Icebox, it's getting too complex for the value it provides. |
Added the 3rd bullet point to the ACs based on something I found. |
This has come up in a production incident context:
I’ve confirmed that missing classes won’t cause a fatal until that actual exec path is followed, which is particularly bad for |
This is a somewhat different problem. Basically you can go through the We could try adding some logic to go through the entire codebase of the project and check if there's classes that can not be auto-loaded and throw warnings. You should have gotten a warning when running the inspect command because of this line in framework's |
Follow up work from silverstripe/silverstripe-upgrader#51, intended to rewrite some additional high usage APIs.
SS_Log
: https://docs.silverstripe.org/en/4/changelogs/4.0.0#psr3-loggingFRAMEWORK_PATH
and other constants: https://docs.silverstripe.org/en/4/changelogs/4.0.0#module-pathsInjector::inst()->get(LoggerInterface::class)->log($messsage, 'notice')
)The text was updated successfully, but these errors were encountered: