-
Notifications
You must be signed in to change notification settings - Fork 673
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
chore(views): refactor views system to store absolute paths #7070
Conversation
Elgg_ViewsService
to store absolute paths
I'm submitting this against 1.x even though this is technically an internal refactor because I am not confident about our test coverage. Main priority here IMO is getting more tests so all behaviors are covered and we can make this change with confidence. |
} | ||
return $this->file_exists_cache[$path]; | ||
private function getTemplateHandler() { | ||
return isset($this->config->template_handler) && |
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.
IMO bad place to use a ternary.
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.
Can change to:
if (!isset($this->config->template_handler) ||
!is_callable($this->config->template_handler)) {
return '';
}
return $this->config->template_handler;
Besides making dependencies explicit and moving view storage out of $CONFIG, does this do anything else big? |
It stores absolute paths to each view instead of just storing the directory where the view can be found. We'll need to update developer tools and possibly simplecache to handle that. |
The latest iteration of this has the following changes:
The
|
6f1eaa7
to
b8a6c72
Compare
Pushed another update that renames |
Elgg_ViewsService
to store absolute pathsb53939e
to
90a0a71
Compare
90a0a71
to
ec7aba2
Compare
Replaced by #8390 |
TODOs:
getViewLocation
\IllegalArgumentException
for invalid viewtypes so we don't need so many null checksTestdox output:
Elgg\Views\Registry
Elgg\Views\View
Elgg\Views\Viewtype
This is a major refactoring of
Elgg_ViewsService
to remove global state and prep for #6844 (and #3737 to a lesser extent). I know for sure that the global functions are broken as a result of this, but we don't have tests for them. Looking for early feedback, especially in regard to what tests we can add.DO NOT MERGE