diff --git a/lib/Cake/Network/CakeEmail.php b/lib/Cake/Network/CakeEmail.php index 17d7e46e0..c93c74bbe 100644 --- a/lib/Cake/Network/CakeEmail.php +++ b/lib/Cake/Network/CakeEmail.php @@ -16,8 +16,9 @@ * @since CakePHP(tm) v 2.0.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', array('Validation', 'Multibyte')); -App::import('Lib', 'email/AbstractTransport'); +App::uses('Validation', 'Utility'); +App::uses('Multibyte', 'I18n'); +App::uses('AbstractTransport', 'Network/Email'); /** * Cake e-mail class. @@ -813,8 +814,10 @@ class CakeEmail { $this->_message[] = ''; } - $transportClassname = Inflector::camelize($this->_transportName) . 'Transport'; - if (!App::import('Lib', 'email/' . $transportClassname)) { + list($plugin, $transportClassname) = pluginSplit($this->_transportName, true); + $transportClassname .= 'Transport'; + App::uses($transportClassname, $plugin . 'Network/Email'); + if (!class_exists($transportClassname)) { throw new SocketException(__('Class "%s" not found.', $transportClassname)); } elseif (!method_exists($transportClassname, 'send')) { throw new SocketException(__('The "%s" do not have send method.', $transportClassname)); @@ -1030,9 +1033,9 @@ class CakeEmail { $viewClass = $this->_viewRender; if ($viewClass !== 'View') { - list($plugin, $viewClass) = pluginSplit($viewClass); - $viewClass = $viewClass . 'View'; - App::import('View', $this->_viewRender); + list($plugin, $viewClass) = pluginSplit($viewClass, true); + $viewClass .= 'View'; + App::uses($viewClass, $plugin . 'View'); } $View = new $viewClass(null); diff --git a/lib/Cake/Network/Email/SmtpTransport.php b/lib/Cake/Network/Email/SmtpTransport.php index 46498967a..6e3a2e5ac 100644 --- a/lib/Cake/Network/Email/SmtpTransport.php +++ b/lib/Cake/Network/Email/SmtpTransport.php @@ -16,7 +16,7 @@ * @since CakePHP(tm) v 2.0.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', 'CakeSocket'); +App::uses('CakeSocket', 'Network'); /** * SendEmail class diff --git a/lib/Cake/tests/Case/Network/CakeEmailTest.php b/lib/Cake/tests/Case/Network/CakeEmailTest.php index 35bab1301..c20c7b989 100644 --- a/lib/Cake/tests/Case/Network/CakeEmailTest.php +++ b/lib/Cake/tests/Case/Network/CakeEmailTest.php @@ -16,7 +16,7 @@ * @since CakePHP(tm) v 2.0.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', 'CakeEmail'); +App::uses('CakeEmail', 'Network'); /** * Help to test CakeEmail diff --git a/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php index ec8e894d3..a65e3b3cb 100644 --- a/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php @@ -16,7 +16,8 @@ * @since CakePHP(tm) v 2.0.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Lib', array('CakeEmail', 'email/AbstractTransport', 'email/SmtpTransport')); +App::uses('CakeEmail', 'Network'); +App::uses('SmtpTransport', 'Network/Email'); /** * Help to test SmtpTransport