-
Notifications
You must be signed in to change notification settings - Fork 59
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
NEW: Extension points for FilesystemPublisher. #137
NEW: Extension points for FilesystemPublisher. #137
Conversation
The idea behind the publisher classes is that developers can easily implement their own and add their own logic easily. There shouldn't really be a need for extension hooks with the current implementation. What is the scenario where this is needed? |
@dhensby My team found useful to have the ability to inject some custom behaviour via these extension points. For example we have in-memory cache which needs to be flushed after each call of Also, we found useful to reset some core states such as controller stack something like this: try {
$controllers = [];
// pop all current application's controllers to simulate cold boot
while (Controller::has_curr()) {
$controller = Controller::curr();
$controllers[]= $controller;
$controller->popCurrent();
}
return parent::generatePageResponse($url);
} finally {
// flush all in-memory cached data
foreach (array_reverse($controllers) as $controller) {
// reapply previous controllers
$controller->pushCurrent();
}
} |
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.
Your use case seems sensible to me. Please retarget this PR to the 6
branch and remove the unrelated changes.
d560f65
to
b8f60e3
Compare
I've pushed up changes as per your request @GuySartorelli , please review. |
You swapped the target branch after resetting commits, which means the new CI isn't able to run. Can you please force push so that the CI runs correctly? |
b8f60e3
to
50519cd
Compare
Done @GuySartorelli |
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.
Changes look good to me, will merge when CI goes green.
NEW: Extension points for FilesystemPublisher.
generatePageResponse()
to allow better extensibility