Skip to content
Permalink
Browse files

Allow readFile() in CakeEmail to be accessed publicly

I needed this method while building a Transport, and saw no reason why it needed to be protected.
  • Loading branch information...
jmillerdesign committed May 16, 2013
1 parent de7535d commit f47609bd61438c5185c396697344e50de9d5633e
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Network/Email/CakeEmail.php
@@ -1359,7 +1359,7 @@ protected function _attachFiles($boundary = null) {
if (!empty($fileInfo['contentId'])) {
continue;
}
$data = $this->_readFile($fileInfo['file']);
$data = $this->readFile($fileInfo['file']);
$msg[] = '--' . $boundary;
$msg[] = 'Content-Type: ' . $fileInfo['mimetype'];
@@ -1383,7 +1383,7 @@ protected function _attachFiles($boundary = null) {
* @param string $file The file to read.
* @return string File contents in base64 encoding
*/
protected function _readFile($file) {
public function readFile($file) {
$handle = fopen($file, 'rb');
$data = fread($handle, filesize($file));
$data = chunk_split(base64_encode($data));
@@ -1407,7 +1407,7 @@ protected function _attachInlineFiles($boundary = null) {
if (empty($fileInfo['contentId'])) {
continue;
}
$data = $this->_readFile($fileInfo['file']);
$data = $this->readFile($fileInfo['file']);
$msg[] = '--' . $boundary;
$msg[] = 'Content-Type: ' . $fileInfo['mimetype'];

0 comments on commit f47609b

Please sign in to comment.
You can’t perform that action at this time.