-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[LorisInstance] add getModule function #8221
Conversation
463dfa4
to
771bc10
Compare
src/LorisInstance.php
Outdated
$mod = \Module::factory($this, $name); | ||
$modules[] = $mod; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this use getModule() ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this was committed, I think I was just trying to var_dump what got added to debug an exception since the new code is semantically equivalent to the old.. but sure, I can change it to getModule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you planning on replacing the existing instances of module::factory? otherwise it will never be replaced, we would just be adding another way of doing it
Yes, I'm planning on removing completely removing \Module::factory calls in a different PR. I removed the ones that are in standard LORIS endpoints in the latest commit since they all had access to a LorisInstance object. When the code is it's moved, it'll use $loris->getModuleDirs() instead of hardcoded paths. So I left the calls in scripts or ajax endpoints which will break since moduleDirs isn't properly set right now and they just use an empty [] directory stub. I also left the ones that are just using |
LorisInstance already has functions to check if a module exists, get the module directories, etc. This adds a getModule to replace \Module::factory() so that the code dealing with modules can be centralized in one place.
4ea4e2d
to
dbeea31
Compare
LorisInstance already has functions to check if a module exists, get the module directories, etc.
This adds a getModule to replace \Module::factory() so that the code dealing with modules can be centralized in one place.