Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4a9d546c
Commit
4a9d546c
authored
Oct 25, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'MessageInterface::createAttachment()' renamed to 'MessageInterface::attachContentAsFile()'
parent
c7c32659
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
Message.php
extensions/swiftmailer/yii/swiftmailer/Message.php
+1
-1
BaseMessage.php
framework/yii/mail/BaseMessage.php
+1
-1
MessageInterface.php
framework/yii/mail/MessageInterface.php
+2
-2
MessageTest.php
tests/unit/extensions/swiftmailer/MessageTest.php
+1
-1
BaseMailerTest.php
tests/unit/framework/mail/BaseMailerTest.php
+2
-1
No files found.
extensions/swiftmailer/yii/swiftmailer/Message.php
View file @
4a9d546c
...
@@ -115,7 +115,7 @@ class Message extends BaseMessage
...
@@ -115,7 +115,7 @@ class Message extends BaseMessage
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
createAttachment
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
public
function
attachContentAsFile
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
{
{
if
(
empty
(
$contentType
))
{
if
(
empty
(
$contentType
))
{
$contentType
=
'application/octet-stream'
;
$contentType
=
'application/octet-stream'
;
...
...
framework/yii/mail/BaseMessage.php
View file @
4a9d546c
...
@@ -75,7 +75,7 @@ abstract class BaseMessage extends Object implements MessageInterface
...
@@ -75,7 +75,7 @@ abstract class BaseMessage extends Object implements MessageInterface
$attachFileName
=
basename
(
$fileName
);
$attachFileName
=
basename
(
$fileName
);
}
}
$content
=
file_get_contents
(
$fileName
);
$content
=
file_get_contents
(
$fileName
);
$this
->
createAttachment
(
$content
,
$attachFileName
,
$contentType
);
$this
->
attachContentAsFile
(
$content
,
$attachFileName
,
$contentType
);
}
}
/**
/**
...
...
framework/yii/mail/MessageInterface.php
View file @
4a9d546c
...
@@ -82,12 +82,12 @@ interface MessageInterface
...
@@ -82,12 +82,12 @@ interface MessageInterface
public
function
addHtml
(
$html
);
public
function
addHtml
(
$html
);
/**
/**
*
Create file attachment
for the email message.
*
Attach specified content as file
for the email message.
* @param string $content attachment file content.
* @param string $content attachment file content.
* @param string $fileName attachment file name.
* @param string $fileName attachment file name.
* @param string $contentType MIME type of the attachment file, by default 'application/octet-stream' will be used.
* @param string $contentType MIME type of the attachment file, by default 'application/octet-stream' will be used.
*/
*/
public
function
createAttachment
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
);
public
function
attachContentAsFile
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
);
/**
/**
* Attaches existing file to the email message.
* Attaches existing file to the email message.
...
...
tests/unit/extensions/swiftmailer/MessageTest.php
View file @
4a9d546c
...
@@ -82,7 +82,7 @@ class MessageTest extends VendorTestCase
...
@@ -82,7 +82,7 @@ class MessageTest extends VendorTestCase
$message
->
setFrom
(
'someuser@somedomain.com'
);
$message
->
setFrom
(
'someuser@somedomain.com'
);
$message
->
setSubject
(
'Yii Swift Create Attachment Test'
);
$message
->
setSubject
(
'Yii Swift Create Attachment Test'
);
$message
->
setText
(
'Yii Swift Create Attachment Test body'
);
$message
->
setText
(
'Yii Swift Create Attachment Test body'
);
$message
->
createAttachment
(
'Test attachment content'
,
'test.txt'
);
$message
->
attachContentAsFile
(
'Test attachment content'
,
'test.txt'
);
$this
->
assertTrue
(
$message
->
send
());
$this
->
assertTrue
(
$message
->
send
());
}
}
...
...
tests/unit/framework/mail/BaseMailerTest.php
View file @
4a9d546c
...
@@ -187,5 +187,5 @@ class Message extends BaseMessage
...
@@ -187,5 +187,5 @@ class Message extends BaseMessage
public
function
addHtml
(
$html
)
{}
public
function
addHtml
(
$html
)
{}
public
function
createAttachment
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
{}
public
function
attachContentAsFile
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
{}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment