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

Enable setting of stream context options #8

Closed
wants to merge 5 commits into from

Conversation

slax0rr
Copy link

@slax0rr slax0rr commented Mar 12, 2015

Some situations, namely mine, require to set some stream context options. This PR enables just that. User has to set an option array at initialization with an array that fits requirements of http://php.net/manual/en/function.stream-context-set-option.php

@@ -41,6 +41,9 @@ class SmtpMailer extends Nette\Object implements IMailer
/** @var bool */
private $persistent;

/** @var array */
private $context;
Copy link
Contributor

Choose a reason for hiding this comment

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

should be probably named $streamContext or at least mentioned in doc

/** @var array stream context */
private $context;

Also fix the false indentation, and on unset stream context in the input
options default to NULL.
@dg
Copy link
Member

dg commented Mar 14, 2015

Please add a test.

@@ -122,6 +126,11 @@ protected function connect()
if (!$this->connection) {
throw new SmtpException($error, $errno);
}

if ($this->streamContext) {
stream_context_set_option($this->connection, $this->context);
Copy link
Contributor

Choose a reason for hiding this comment

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

context vs. streamContext.

@slax0rr
Copy link
Author

slax0rr commented Mar 14, 2015

Oh god. This is embarrasing. I'm currently in a lot of work and really little time, I'll redo the whole PR tomorrow or next week.

@dg
Copy link
Member

dg commented Jan 20, 2016

@slax0rr is it relevant after this 3b8ba96?

@dg dg force-pushed the master branch 2 times, most recently from c4f379b to 73946cc Compare April 21, 2016 13:04
@dg dg mentioned this pull request Jun 12, 2016
@dg
Copy link
Member

dg commented Jun 25, 2016

Closed by #30

@dg dg closed this Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants