-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[MIME] Towards parsing + rendering #34224
Comments
Thank you for this suggestion. |
After posting this I went ahead and wrote a MIME parser/renderer that uses this principle. It works well and has 100% test coverage, but it's very slow. Perhaps I could publish it as a proof of concept and we could look into the idea more? |
Hi @jchook, do you have that parser publicly available to have a look at? |
@scuben, just pushed it to GitHub here: https://github.com/jchook/mime-php |
That's a great idea! I also have use case for that. |
Thank you for this suggestion. |
Yes I would |
The next question is: Is anyone up to writing this? No matter how cool features are, after 2 years we just need someone to write the actual thing. If there is nobody there to do this (which is totally fine - OSS remains a purely motivational driven process), I'm afraid we have to close this as stalled (meaning we do not close it because we reject the feature, but because it doesn't make sense to have stalled features in our very long issue list). |
I did write it. Though I understand this project is rather entrenched and will likely not adopt a major refactor like this. |
@jchook would it be difficult to implement only a |
Description
Re: symfony/mime.
Code that renders and parses MIME appears to live scattered within the AST, and enforces some unnecessary rigidity as a result. For example, we have a general lack of control over rendering details like the hard-coded boundary prefixes that remain difficult to circumvent, and no plans for general MIME parsing capabilities.
Imagine extracting the outermost rendering and parsing code into
Renderer
andParser
classes.Such a refactor could pave the way towards an unprecedented "full-duplex" PHP MIME parsing + rendering library that could parse a MIME document, examine, modify, and re-render it, (e.g. perhaps with a different transfer encoding), all with OO fine-tuning of parsing and rendering logic.
Example
The text was updated successfully, but these errors were encountered: