Skip to content
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

Support all IMAP message headers if needed. Remove Doctrine dependency. #29

Closed
wants to merge 3 commits into from

Conversation

xeoncross
Copy link

(Background: I deal with a lot of messages which have custom headers.)

This commit solves two problems:

  1. The Doctrine ArrayCollection object wastes resources in each message object for a simple MIME header array.
  2. I need custom headers not returned by the default imap_header() function.

@ddeboer
Copy link
Owner

ddeboer commented Jan 15, 2014

Your support for imap_fetchheader() looks good.

But is the ArrayCollection overhead noticeable to you?

And can you please update your code to conform to the PSR-2 coding standards? Thanks!

@xeoncross
Copy link
Author

  1. The overhead of ArrayCollection is noticeable in my tests (I don't remember exactly how many kB's per-message it adds). The parameter array isn't very complex so there is no loss of functionality switching (other than needing to do an isset check first) so I think it's a good trade-off in this case.
  2. What part of the code isn't PSR-2 standard?

$headers = \imap_header($this->stream, $this->messageNumber);
$this->headers = new Message\Headers($headers);

if($rawHeaders) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after if

@ddeboer
Copy link
Owner

ddeboer commented Jan 15, 2014

no loss of functionality switching (other than needing to do an isset check first)

All right, let's get rid of the ArrayCollection (even if it means breaking BC for the getParameter method).

What part of the code isn't PSR-2 standard?

Actually only the missing spaces after if, now I look at your code more closely. ;)

@OndraM
Copy link

OndraM commented Jul 22, 2014

👍

{
$this->rawHeaders = $rawHeaders;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this rawHeaders useful? I don’t see a way to access it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, $rawHeaders contains extra MIME headers that $headers does not contain. I honestly don't remember if I was extending this class or just marked this as public or what.

@mean-cj
Copy link

mean-cj commented Sep 7, 2014

@ddeboer +1
Please merge this feature for get raw of all header.
Thank.

@ddeboer ddeboer modified the milestone: 1.0 Jan 23, 2015
@ddeboer ddeboer removed this from the 1.0 milestone Feb 1, 2015
@Slamdunk Slamdunk added this to the 1.0 milestone Sep 27, 2017
Slamdunk added a commit that referenced this pull request Sep 28, 2017
Add imap_fetchheader() functionality
Closes #29 #138 #149
@Slamdunk
Copy link
Collaborator

Implemented in #202 due to heavily refactored code.
Thank you very much for your help

@Slamdunk Slamdunk closed this Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants