_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q19100
Swift_Mime_Headers_ParameterizedHeader.setParameters
train
public function setParameters(array $parameters) { $this->clearCachedValueIf($this->params
php
{ "resource": "" }
q19101
Swift_Mime_Headers_ParameterizedHeader.getEndOfParameterValue
train
private function getEndOfParameterValue($value, $encoded = false, $firstLine = false) { if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { $value = '"'.$value.'"'; } $prepend = '='; if ($encoded) { $prepend = '*='; if ($firstLine) { ...
php
{ "resource": "" }
q19102
Swift_Transport_Esmtp_Auth_CramMd5Authenticator.getResponse
train
private function getResponse($secret, $challenge) { if (strlen($secret) > 64) { $secret = pack('H32', md5($secret)); } if (strlen($secret) < 64) { $secret = str_pad($secret, 64, chr(0)); } $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64);...
php
{ "resource": "" }
q19103
Swift_CharacterStream_NgCharacterStream.setCharacterSet
train
public function setCharacterSet($charset) { $this->charset = $charset;
php
{ "resource": "" }
q19104
Swift_Transport_Esmtp_AuthHandler.afterEhlo
train
public function afterEhlo(Swift_Transport_SmtpAgent $agent) { if ($this->username) { $count = 0; $errors = []; foreach ($this->getAuthenticatorsForAgent() as $authenticator) { if (in_array(strtolower($authenticator->getAuthKeyword()), array_map('strtolower...
php
{ "resource": "" }
q19105
Swift_Transport_Esmtp_AuthHandler.getAuthenticatorsForAgent
train
protected function getAuthenticatorsForAgent() { if (!$mode = strtolower($this->auth_mode)) { return $this->authenticators; } foreach ($this->authenticators as $authenticator) { if (strtolower($authenticator->getAuthKeyword()) == $mode) {
php
{ "resource": "" }
q19106
Swift_FileSpool.queueMessage
train
public function queueMessage(Swift_Mime_SimpleMessage $message) { $ser = serialize($message); $fileName = $this->path.'/'.$this->getRandomString(10); for ($i = 0; $i < $this->retryLimit; ++$i) { /* We try an exclusive creation of the file. This is an atomic operation, it avoid lo...
php
{ "resource": "" }
q19107
Swift_FileSpool.recover
train
public function recover($timeout = 900) { foreach (new DirectoryIterator($this->path) as $file) { $file = $file->getRealPath(); if ('.message.sending' == substr($file, -16)) { $lockedtime = filectime($file);
php
{ "resource": "" }
q19108
Swift_Mime_Attachment.setDisposition
train
public function setDisposition($disposition) { if (!$this->setHeaderFieldModel('Content-Disposition', $disposition)) {
php
{ "resource": "" }
q19109
Swift_Mime_Attachment.setFile
train
public function setFile(Swift_FileStream $file, $contentType = null) { $this->setFilename(basename($file->getPath())); $this->setBody($file, $contentType); if (!isset($contentType)) {
php
{ "resource": "" }
q19110
Swift_CharacterReaderFactory_SimpleCharacterReaderFactory.getReaderFor
train
public function getReaderFor($charset) { $charset = strtolower(trim($charset)); foreach (self::$map as $pattern => $spec) { $re = '/^'.$pattern.'$/D'; if (preg_match($re, $charset)) { if (!array_key_exists($pattern, self::$loaded)) { $refle...
php
{ "resource": "" }
q19111
Swift_Transport_StreamBuffer.terminate
train
public function terminate() { if (isset($this->stream)) { switch ($this->params['type']) { case self::TYPE_PROCESS: fclose($this->in); fclose($this->out); proc_close($this->stream); break; ...
php
{ "resource": "" }
q19112
Swift_Transport_StreamBuffer.setWriteTranslations
train
public function setWriteTranslations(array $replacements) { foreach ($this->translations as $search => $replace) { if (!isset($replacements[$search])) { $this->removeFilter($search); unset($this->translations[$search]);
php
{ "resource": "" }
q19113
Swift_Transport_StreamBuffer.doCommit
train
protected function doCommit($bytes) { if (isset($this->in)) { $bytesToWrite = strlen($bytes); $totalBytesWritten = 0; while ($totalBytesWritten < $bytesToWrite) { $bytesWritten = fwrite($this->in, substr($bytes, $totalBytesWritten));
php
{ "resource": "" }
q19114
Swift_Transport_StreamBuffer.establishSocketConnection
train
private function establishSocketConnection() { $host = $this->params['host']; if (!empty($this->params['protocol'])) { $host = $this->params['protocol'].'://'.$host; } $timeout = 15; if (!empty($this->params['timeout'])) { $timeout = $this->params['tim...
php
{ "resource": "" }
q19115
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.sendMessage1
train
protected function sendMessage1(Swift_Transport_SmtpAgent $agent) { $message = $this->createMessage1();
php
{ "resource": "" }
q19116
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.readSubBlock
train
protected function readSubBlock($block) { // remove terminatorByte cause it's always the same $block = substr($block, 0, -8); $length = strlen($block); $offset = 0; $data = []; while ($offset < $length) { $blockLength = hexdec(substr(substr($block, $offse...
php
{ "resource": "" }
q19117
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.sendMessage3
train
protected function sendMessage3($response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true) { list($domain, $username) = $this->getDomainAndUsername($username); //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSS...
php
{ "resource": "" }
q19118
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createMessage3
train
protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse) { // Create security buffers $domainSec = $this->createSecurityBuffer($domain, 64); $domainInfo = $this->readSecurityBuffer(bin2hex($domainSec)); $userSec = $this->createSecurityBuffer($us...
php
{ "resource": "" }
q19119
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.getDomainAndUsername
train
protected function getDomainAndUsername($name) { if (false !== strpos($name, '\\')) { return explode('\\', $name); } if (false !== strpos($name, '@')) { list($user, $domain) = explode('@', $name);
php
{ "resource": "" }
q19120
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createLMPassword
train
protected function createLMPassword($password, $challenge) { // FIRST PART $password = $this->createByte(strtoupper($password), 14, false); list($key1, $key2) = str_split($password, 7); $desKey1 = $this->createDesKey($key1); $desKey2 = $this->createDesKey($key2); $c...
php
{ "resource": "" }
q19121
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createNTLMPassword
train
protected function createNTLMPassword($password, $challenge) { // FIRST PART $ntlmHash = $this->createByte($this->md4Encrypt($password), 21, false); list($key1, $key2, $key3) = str_split($ntlmHash, 7);
php
{ "resource": "" }
q19122
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.getCorrectTimestamp
train
protected function getCorrectTimestamp($time) { // Get our timestamp (tricky!) $time = number_format($time, 0, '.', ''); // save microtime to string $time = bcadd($time, '11644473600000', 0); // add epoch time $time = bcmul($time, 10000, 0); // tenths of a microsecond. $bina...
php
{ "resource": "" }
q19123
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createLMv2Password
train
protected function createLMv2Password($password, $username, $domain, $challenge, $client) { $lmPass = '00'; // by default 00 // if $password > 15 than we can't use this method if (strlen($password) <= 15)
php
{ "resource": "" }
q19124
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createNTLMv2Hash
train
protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) { $ntlmHash = $this->md4Encrypt($password); $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); // create blob
php
{ "resource": "" }
q19125
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createSecurityBuffer
train
protected function createSecurityBuffer($value, $offset, $is16 = false) { $length = strlen(bin2hex($value)); $length = $is16 ? $length / 2 : $length; $length =
php
{ "resource": "" }
q19126
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.readSecurityBuffer
train
protected function readSecurityBuffer($value) { $length = floor(hexdec(substr($value, 0,
php
{ "resource": "" }
q19127
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.createByte
train
protected function createByte($input, $bytes = 4, $isHex = true) { if ($isHex) { $byte = hex2bin(str_pad($input, $bytes * 2, '00')); } else {
php
{ "resource": "" }
q19128
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.md5Encrypt
train
protected function md5Encrypt($key, $msg) { $blocksize = 64; if (strlen($key) > $blocksize) { $key = pack('H*', md5($key)); } $key = str_pad($key, $blocksize, "\0"); $ipadk = $key ^ str_repeat("\x36", $blocksize);
php
{ "resource": "" }
q19129
Swift_Transport_Esmtp_Auth_NTLMAuthenticator.md4Encrypt
train
protected function md4Encrypt($input) { $input = $this->convertTo16bit($input);
php
{ "resource": "" }
q19130
Swift_Preferences.setQPDotEscape
train
public function setQPDotEscape($dotEscape) { $dotEscape = !empty($dotEscape); Swift_DependencyContainer::getInstance() ->register('mime.qpcontentencoder') ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder')
php
{ "resource": "" }
q19131
Swift_Plugins_BandwidthMonitorPlugin.write
train
public function write($bytes) { $this->out += strlen($bytes); foreach
php
{ "resource": "" }
q19132
Swift_Message.addPart
train
public function addPart($body, $contentType = null, $charset = null) {
php
{ "resource": "" }
q19133
Swift_Message.attachSigner
train
public function attachSigner(Swift_Signer $signer) { if ($signer instanceof Swift_Signers_HeaderSigner) { $this->headerSigners[] = $signer; } elseif
php
{ "resource": "" }
q19134
Swift_Message.detachSigner
train
public function detachSigner(Swift_Signer $signer) { if ($signer instanceof Swift_Signers_HeaderSigner) { foreach ($this->headerSigners as $k => $headerSigner) { if ($headerSigner === $signer) { unset($this->headerSigners[$k]); return $thi...
php
{ "resource": "" }
q19135
Swift_Message.doSign
train
protected function doSign() { foreach ($this->bodySigners as $signer) { $altered = $signer->getAlteredHeaders(); $this->saveHeaders($altered); $signer->signMessage($this); } foreach ($this->headerSigners as $signer) { $altered = $signer->getAl...
php
{ "resource": "" }
q19136
Swift_Message.saveMessage
train
protected function saveMessage() { $this->savedMessage = ['headers' => []]; $this->savedMessage['body'] = $this->getBody(); $this->savedMessage['children'] = $this->getChildren();
php
{ "resource": "" }
q19137
Swift_Message.saveHeaders
train
protected function saveHeaders(array $altered) { foreach ($altered as $head) { $lc = strtolower($head);
php
{ "resource": "" }
q19138
Swift_Message.restoreHeaders
train
protected function restoreHeaders() { foreach ($this->savedMessage['headers'] as $name => $savedValue) { $headers = $this->getHeaders()->getAll($name); foreach ($headers as $key => $value) {
php
{ "resource": "" }
q19139
Swift_Message.restoreMessage
train
protected function restoreMessage() { $this->setBody($this->savedMessage['body']); $this->setChildren($this->savedMessage['children']);
php
{ "resource": "" }
q19140
Swift_Mime_SimpleHeaderSet.setCharset
train
public function setCharset($charset) { $this->charset = $charset; $this->factory->charsetChanged($charset);
php
{ "resource": "" }
q19141
Swift_Mime_SimpleHeaderSet.addIdHeader
train
public function addIdHeader($name, $ids = null) {
php
{ "resource": "" }
q19142
Swift_Mime_SimpleHeaderSet.set
train
public function set(Swift_Mime_Header $header, $index = 0) {
php
{ "resource": "" }
q19143
Swift_Mime_SimpleHeaderSet.listAll
train
public function listAll() { $headers = $this->headers; if ($this->canSort()) {
php
{ "resource": "" }
q19144
Swift_Mime_SimpleHeaderSet.toString
train
public function toString() { $string = ''; $headers = $this->headers; if ($this->canSort()) { uksort($headers, [$this, 'sortHeaders']); } foreach ($headers as $collection) { foreach ($collection as $header) {
php
{ "resource": "" }
q19145
Swift_Mime_SimpleHeaderSet.storeHeader
train
private function storeHeader($name, Swift_Mime_Header $header, $offset = null) { if (!isset($this->headers[strtolower($name)])) { $this->headers[strtolower($name)] = [];
php
{ "resource": "" }
q19146
Swift_Mime_SimpleHeaderSet.notifyHeadersOfCharset
train
private function notifyHeadersOfCharset($charset) { foreach ($this->headers as $headerGroup) { foreach ($headerGroup as $header) {
php
{ "resource": "" }
q19147
Swift_Mime_SimpleMessage.setSubject
train
public function setSubject($subject) { if (!$this->setHeaderFieldModel('Subject', $subject)) {
php
{ "resource": "" }
q19148
Swift_Mime_SimpleMessage.setDate
train
public function setDate(DateTimeInterface $dateTime) { if (!$this->setHeaderFieldModel('Date', $dateTime)) {
php
{ "resource": "" }
q19149
Swift_Mime_SimpleMessage.detach
train
public function detach(Swift_Mime_SimpleMimeEntity $entity) { $newChildren = []; foreach ($this->getChildren() as $child) { if ($entity !== $child) {
php
{ "resource": "" }
q19150
Swift_Mime_SimpleMessage.becomeMimePart
train
protected function becomeMimePart() { $part = new parent($this->getHeaders()->newInstance(), $this->getEncoder(), $this->getCache(), $this->getIdGenerator(), $this->userCharset ); $part->setContentType($this->userContentType); $part->setBody($this->getBody());
php
{ "resource": "" }
q19151
Swift_Mime_SimpleMessage.getTopNestingLevel
train
private function getTopNestingLevel() { $highestLevel = $this->getNestingLevel(); foreach ($this->getChildren() as $child) {
php
{ "resource": "" }
q19152
Swift_Mime_Headers_PathHeader.setAddress
train
public function setAddress($address) { if (null === $address) { $this->address = null; } elseif ('' == $address) { $this->address = ''; } else {
php
{ "resource": "" }
q19153
Swift_Transport_EsmtpTransport.setTimeout
train
public function setTimeout($timeout) { $this->params['timeout'] = (int) $timeout;
php
{ "resource": "" }
q19154
Swift_Transport_EsmtpTransport.setExtensionHandlers
train
public function setExtensionHandlers(array $handlers) { $assoc = []; foreach ($handlers as $handler) { $assoc[$handler->getHandledKeyword()] = $handler; } uasort($assoc, function ($a, $b) {
php
{ "resource": "" }
q19155
Swift_Transport_EsmtpTransport.doHeloCommand
train
protected function doHeloCommand() { try { $response = $this->executeCommand( sprintf("EHLO %s\r\n", $this->domain), [250] ); } catch (Swift_TransportException $e) { return parent::doHeloCommand(); } if ($this->params['tls']) {...
php
{ "resource": "" }
q19156
Swift_Transport_EsmtpTransport.doMailFromCommand
train
protected function doMailFromCommand($address) { $address = $this->addressEncoder->encodeString($address); $handlers = $this->getActiveHandlers(); $params = []; foreach ($handlers as $handler) { $params = array_merge($params, (array) $handler->getMailParams()); } ...
php
{ "resource": "" }
q19157
Swift_Transport_EsmtpTransport.getCapabilities
train
private function getCapabilities($ehloResponse) { $capabilities = []; $ehloResponse = trim($ehloResponse); $lines = explode("\r\n", $ehloResponse); array_shift($lines); foreach ($lines as $line) { if (preg_match('/^[0-9]{3}[ -]([A-Z0-9-]+)((?:[ =].*)?)$/Di', $line...
php
{ "resource": "" }
q19158
Swift_Transport_EsmtpTransport.setHandlerParams
train
private function setHandlerParams() { foreach ($this->handlers as $keyword => $handler) { if (array_key_exists($keyword, $this->capabilities)) {
php
{ "resource": "" }
q19159
Swift_Transport_EsmtpTransport.getActiveHandlers
train
private function getActiveHandlers() { $handlers = []; foreach ($this->handlers as $keyword => $handler) { if (array_key_exists($keyword, $this->capabilities)) {
php
{ "resource": "" }
q19160
Swift_CharacterStream_ArrayCharacterStream.importByteStream
train
public function importByteStream(Swift_OutputByteStream $os) { if (!isset($this->charReader)) { $this->charReader = $this->charReaderFactory ->getReaderFor($this->charset); } $startLength = $this->charReader->getInitialByteSize(); while (false !== $bytes ...
php
{ "resource": "" }
q19161
Swift_Mime_SimpleMimeEntity.getId
train
public function getId() { $tmp = (array) $this->getHeaderFieldModel($this->getIdField());
php
{ "resource": "" }
q19162
Swift_Mime_SimpleMimeEntity.setId
train
public function setId($id) { if (!$this->setHeaderFieldModel($this->getIdField(), $id))
php
{ "resource": "" }
q19163
Swift_Mime_SimpleMimeEntity.setDescription
train
public function setDescription($description) { if (!$this->setHeaderFieldModel('Content-Description', $description)) {
php
{ "resource": "" }
q19164
Swift_Mime_SimpleMimeEntity.setChildren
train
public function setChildren(array $children, $compoundLevel = null) { // TODO: Try to refactor this logic $compoundLevel = $compoundLevel ?? $this->getCompoundLevel($children); $immediateChildren = []; $grandchildren = []; $newContentType = $this->userContentType; fo...
php
{ "resource": "" }
q19165
Swift_Mime_SimpleMimeEntity.getBody
train
public function getBody() { return $this->body
php
{ "resource": "" }
q19166
Swift_Mime_SimpleMimeEntity.setEncoder
train
public function setEncoder(Swift_Mime_ContentEncoder $encoder) { if ($encoder !== $this->encoder) { $this->clearCache(); }
php
{ "resource": "" }
q19167
Swift_Mime_SimpleMimeEntity.getBoundary
train
public function getBoundary() { if (!isset($this->boundary)) { $this->boundary
php
{ "resource": "" }
q19168
Swift_Mime_SimpleMimeEntity.bodyToString
train
protected function bodyToString() { $string = ''; if (isset($this->body) && empty($this->immediateChildren)) { if ($this->cache->hasKey($this->cacheKey, 'body')) { $body = $this->cache->getString($this->cacheKey, 'body'); } else { $body = "\r\...
php
{ "resource": "" }
q19169
Swift_Mime_SimpleMimeEntity.fixHeaders
train
protected function fixHeaders() { if (count($this->immediateChildren)) { $this->setHeaderParameter('Content-Type', 'boundary', $this->getBoundary() ); $this->headers->remove('Content-Transfer-Encoding');
php
{ "resource": "" }
q19170
Swift_Plugins_PopBeforeSmtpPlugin.connect
train
public function connect() { if (isset($this->connection)) { $this->connection->connect(); } else { if (!isset($this->socket)) { if (!$socket = fsockopen( $this->getHostString(), $this->port, $errno, $errstr, $this->timeout)) { ...
php
{ "resource": "" }
q19171
Swift_Plugins_PopBeforeSmtpPlugin.disconnect
train
public function disconnect() { if (isset($this->connection)) { $this->connection->disconnect(); } else { $this->command("QUIT\r\n"); if (!fclose($this->socket)) { throw new Swift_Plugins_Pop_Pop3Exception(
php
{ "resource": "" }
q19172
Swift_Transport_AbstractSmtpTransport.setLocalDomain
train
public function setLocalDomain($domain) { if ('[' !== substr($domain, 0, 1)) { if (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { $domain = '['.$domain.']'; } elseif (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
php
{ "resource": "" }
q19173
Swift_Transport_AbstractSmtpTransport.start
train
public function start() { if (!$this->started) { if ($evt = $this->eventDispatcher->createTransportChangeEvent($this)) { $this->eventDispatcher->dispatchEvent($evt, 'beforeTransportStarted'); if ($evt->bubbleCancelled()) { return; ...
php
{ "resource": "" }
q19174
Swift_Transport_AbstractSmtpTransport.stop
train
public function stop() { if ($this->started) { if ($evt = $this->eventDispatcher->createTransportChangeEvent($this)) { $this->eventDispatcher->dispatchEvent($evt, 'beforeTransportStopped'); if ($evt->bubbleCancelled()) { return; ...
php
{ "resource": "" }
q19175
Swift_Transport_AbstractSmtpTransport.doMailFromCommand
train
protected function doMailFromCommand($address) { $address = $this->addressEncoder->encodeString($address); $this->executeCommand(
php
{ "resource": "" }
q19176
Swift_Transport_AbstractSmtpTransport.streamMessage
train
protected function streamMessage(Swift_Mime_SimpleMessage $message) { $this->buffer->setWriteTranslations(["\r\n." => "\r\n.."]); try { $message->toByteStream($this->buffer); $this->buffer->flushBuffers(); } catch (Swift_TransportException $e) {
php
{ "resource": "" }
q19177
Swift_Transport_AbstractSmtpTransport.throwException
train
protected function throwException(Swift_TransportException $e) { if ($evt = $this->eventDispatcher->createTransportExceptionEvent($this, $e)) { $this->eventDispatcher->dispatchEvent($evt, 'exceptionThrown');
php
{ "resource": "" }
q19178
Swift_Transport_AbstractSmtpTransport.assertResponseCode
train
protected function assertResponseCode($response, $wanted) { if (!$response) { $this->throwException(new Swift_TransportException('Expected response code '.implode('/', $wanted).' but got an empty response')); } list($code) = sscanf($response, '%3d'); $valid = (empty($wan...
php
{ "resource": "" }
q19179
Swift_Transport_AbstractSmtpTransport.getFullResponse
train
protected function getFullResponse($seq) { $response = ''; try { do { $line = $this->buffer->readLine($seq); $response .= $line; } while (null !== $line && false !== $line && ' ' != $line[3]); } catch (Swift_TransportException $e) { ...
php
{ "resource": "" }
q19180
Swift_Transport_AbstractSmtpTransport.doMailTransaction
train
private function doMailTransaction($message, $reversePath, array $recipients, array &$failedRecipients) { $sent = 0; $this->doMailFromCommand($reversePath); foreach ($recipients as $forwardPath) { try { $this->doRcptToCommand($forwardPath); ++$sent...
php
{ "resource": "" }
q19181
Swift_Mime_SimpleHeaderFactory.createIdHeader
train
public function createIdHeader($name, $ids = null) { $header = new Swift_Mime_Headers_IdentificationHeader($name, $this->emailValidator); if (isset($ids)) {
php
{ "resource": "" }
q19182
Swift_Mime_SimpleHeaderFactory.charsetChanged
train
public function charsetChanged($charset) { $this->charset = $charset; $this->encoder->charsetChanged($charset);
php
{ "resource": "" }
q19183
Swift_Mime_SimpleHeaderFactory.setHeaderCharset
train
private function setHeaderCharset(Swift_Mime_Header $header) { if (isset($this->charset)) {
php
{ "resource": "" }
q19184
Swift_StreamFilters_StringReplacementFilter.shouldBuffer
train
public function shouldBuffer($buffer) { if ('' === $buffer) { return false; } $endOfBuffer = substr($buffer, -1); foreach ((array) $this->search as $needle) {
php
{ "resource": "" }
q19185
Swift_Plugins_RedirectingPlugin.filterHeaderSet
train
private function filterHeaderSet(Swift_Mime_SimpleHeaderSet $headerSet, $type) { foreach ($headerSet->getAll($type) as
php
{ "resource": "" }
q19186
Swift_Plugins_RedirectingPlugin.filterNameAddresses
train
private function filterNameAddresses(array $recipients) { $filtered = []; foreach ($recipients as $address =>
php
{ "resource": "" }
q19187
Swift_Plugins_RedirectingPlugin.isWhitelisted
train
protected function isWhitelisted($recipient) { if (in_array($recipient, (array) $this->recipient)) { return true; } foreach ($this->whitelist as $pattern) { if
php
{ "resource": "" }
q19188
Swift_Signers_SMimeSigner.setSignCertificate
train
public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) { $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); if (null !== $privateKey) { if (is_array($privateKey)) { $this->si...
php
{ "resource": "" }
q19189
Swift_Signers_SMimeSigner.setEncryptCertificate
train
public function setEncryptCertificate($recipientCerts, $cipher = null) { if (is_array($recipientCerts)) { $this->encryptCert = []; foreach ($recipientCerts as $cert) { $this->encryptCert[] = 'file://'.str_replace('\\', '/', realpath($cert)); } } e...
php
{ "resource": "" }
q19190
Swift_Signers_SMimeSigner.signMessage
train
public function signMessage(Swift_Message $message) { if (null === $this->signCertificate && null === $this->encryptCert) { return $this; }
php
{ "resource": "" }
q19191
Swift_Signers_SMimeSigner.smimeSignMessage
train
protected function smimeSignMessage(Swift_Message $message) { // If we don't have a certificate we can't sign the message if (null === $this->signCertificate) { return; } // Work on a clone of the original message $signMessage = clone $message; $signMessa...
php
{ "resource": "" }
q19192
Swift_Signers_SMimeSigner.smimeEncryptMessage
train
protected function smimeEncryptMessage(Swift_Message $message) { // If we don't have a certificate we can't encrypt the message if (null === $this->encryptCert) { return; } // Work on a clone of the original message $encryptMessage = clone $message; $encr...
php
{ "resource": "" }
q19193
Swift_Signers_SMimeSigner.copyHeaders
train
protected function copyHeaders( Swift_Message $fromMessage, Swift_Message $toMessage,
php
{ "resource": "" }
q19194
Swift_Signers_SMimeSigner.copyHeader
train
protected function copyHeader(Swift_Message $fromMessage, Swift_Message $toMessage, $headerName) { $header = $fromMessage->getHeaders()->get($headerName); if (!$header) { return; } $headers = $toMessage->getHeaders(); switch ($header->getFieldType()) { ...
php
{ "resource": "" }
q19195
Swift_Signers_SMimeSigner.clearAllHeaders
train
protected function clearAllHeaders(Swift_Message $message) { $headers = $message->getHeaders(); foreach
php
{ "resource": "" }
q19196
Swift_Signers_SMimeSigner.streamToMime
train
protected function streamToMime(Swift_OutputByteStream $fromStream, Swift_Message $message) { // Parse the stream into headers and body list($headers, $messageStream) = $this->parseStream($fromStream); // Get the original message headers $messageHeaders = $message->getHeaders(); ...
php
{ "resource": "" }
q19197
Swift_Signers_SMimeSigner.parseStream
train
protected function parseStream(Swift_OutputByteStream $emailStream) { $bufferLength = 78; $headerData = ''; $headerBodySeparator = "\r\n\r\n"; $emailStream->setReadPointer(0); // Read out the headers section from the stream to a string while (false !== ($buffer = $e...
php
{ "resource": "" }
q19198
Swift_Mime_MimePart.setCharset
train
public function setCharset($charset) { $this->setHeaderParameter('Content-Type', 'charset', $charset); if ($charset !==
php
{ "resource": "" }
q19199
Swift_Mime_MimePart.setDelSp
train
public function setDelSp($delsp = true) { $this->setHeaderParameter('Content-Type', 'delsp', $delsp ? 'yes' : null);
php
{ "resource": "" }