-
Notifications
You must be signed in to change notification settings - Fork 182
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
[Question] How to hook into an event in Console SiteBuilder command #135
Comments
Presumably you would only want to run this when building for There's no way I can think of doing this out-of-the-box, but I'm definitely open to exploring options for adding support for this. I just want to get a sense of some of the various use cases we can target, so we build something that's flexible and easy for users (such as those described in #120). |
Thanks @damiani, I created a pull request here: #136 Thanks to the great @mattstauffer for inspiring us on his Containers education from his talks and books. We can simply use the existing container in Jigsaw to make any Event/Listener we want. Now, we just need to figure out how to get this more streamlined to add listeners and then update the Docs if you accept these ideas. BTW, your middleware ideas are good. Also, yes, I only want to build the index only for production. Cheers! |
Let's move any further discussion of this feature to the PR #136 |
@damiani so I am trying to build an Algolia indexer that crawls through the markdown files that we use during the build process. I am trying to understand how to hook into the SiteBuilder command. I was reading this: http://symfony.com/doc/current/components/console/events.html but I could not figure out how to pull the EventDispatcher without pulling in the entire symfony/somfony package.
Is there an easy way to add an event listener that listens to
ConsoleEvents::TERMINATE
so that when the build process is completed, I can kick off another class that does the work I need to do. For example, I am going to go through the data from the markdown content in my new class that I want to make.I was trying to figure out how to get the Illumunate\Event to work, but I am struggling to figure out how to build the listener for this when the console event is fired and "TERMINATES".
Thanks!
Adam
The text was updated successfully, but these errors were encountered: