summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorMatteo Mattei <matteo.mattei@gmail.com>2012-03-15 12:00:44 +0100
committerMatteo Mattei <matteo.mattei@gmail.com>2012-03-15 12:00:44 +0100
commit5a98a3dda56f6167f8241a7bc7d1c8784d98ccf9 (patch)
treec5b204ebe62f920756c1f0c2090dae14ab96a6bf /system
parent5688d58688318cecaf9decdde014635f3a27760f (diff)
Email class: move string_attach() to attach() and add documentation
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Email.php24
1 files changed, 3 insertions, 21 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index aec4957de..df03eaaf6 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -83,7 +83,6 @@ class CI_Email {
protected $_attach_name = array();
protected $_attach_type = array();
protected $_attach_disp = array();
- protected $_attach_source = array();
protected $_attach_content = array();
protected $_protocols = array('mail', 'sendmail', 'smtp');
protected $_base_charsets = array('us-ascii', 'iso-2022-'); // 7-bit charsets (excluding language suffix)
@@ -173,7 +172,6 @@ class CI_Email {
$this->_attach_name = array();
$this->_attach_type = array();
$this->_attach_disp = array();
- $this->_attach_source = array();
$this->_attach_content = array();
}
@@ -410,27 +408,11 @@ class CI_Email {
* @param string
* @return object
*/
- public function attach($filename, $disposition = '', $newname = NULL)
+ public function attach($filename, $str = '', $mime = '', $disposition = '', $newname = NULL)
{
$this->_attach_name[] = array($filename, $newname);
- $this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
+ $this->_attach_type[] = ($mime === '') ? $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION)) : $mime;
$this->_attach_disp[] = empty($disposition) ? 'attachment' : $disposition; // Can also be 'inline' Not sure if it matters
- $this->_attach_source[] = 'file';
- return $this;
- }
-
- /**
- * Assign string attachments
- *
- * @param string
- * @return object
- */
- public function string_attach($str, $filename, $mime, $disposition = 'attachment')
- {
- $this->_attach_name[] = $filename;
- $this->_attach_type[] = $mime;
- $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
- $this->_attach_source[] = 'string';
$this->_attach_content[] = $str;
return $this;
}
@@ -1071,7 +1053,7 @@ class CI_Email {
$ctype = $this->_attach_type[$i];
$file_content = '';
- if($this->_attach_source[$i] == 'file')
+ if ($this->_attach_content[$i] === '')
{
if ( ! file_exists($filename))
{