Skip to content

Commit

Permalink
Changed the use of import to uses.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 13, 2011
1 parent 50c21cc commit 3c70364
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
17 changes: 10 additions & 7 deletions lib/Cake/Network/CakeEmail.php
Expand Up @@ -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.
Expand Down Expand Up @@ -813,8 +814,10 @@ public function send($content = null) {
$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));
Expand Down Expand Up @@ -1030,9 +1033,9 @@ protected function _render($content) {
$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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Network/Email/SmtpTransport.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/Network/CakeEmailTest.php
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php
Expand Up @@ -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
Expand Down

0 comments on commit 3c70364

Please sign in to comment.