Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Mail / Protocol / SmtpPluginManager.php
blob0aad2a5b9590e7fd4d1f16a800871ad1b138e324
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Mail\Protocol;
12 use Zend\ServiceManager\AbstractPluginManager;
14 /**
15 * Plugin manager implementation for SMTP extensions.
17 * Enforces that SMTP extensions retrieved are instances of Smtp. Additionally,
18 * it registers a number of default extensions available.
20 class SmtpPluginManager extends AbstractPluginManager
22 /**
23 * Default set of extensions
25 * @var array
27 protected $invokableClasses = array(
28 'crammd5' => 'Zend\Mail\Protocol\Smtp\Auth\Crammd5',
29 'login' => 'Zend\Mail\Protocol\Smtp\Auth\Login',
30 'plain' => 'Zend\Mail\Protocol\Smtp\Auth\Plain',
31 'smtp' => 'Zend\Mail\Protocol\Smtp',
34 /**
35 * Validate the plugin
37 * Checks that the extension loaded is an instance of Smtp.
39 * @param mixed $plugin
40 * @return void
41 * @throws Exception\InvalidArgumentException if invalid
43 public function validatePlugin($plugin)
45 if ($plugin instanceof Smtp) {
46 // we're okay
47 return;
50 throw new Exception\InvalidArgumentException(sprintf(
51 'Plugin of type %s is invalid; must extend %s\Smtp',
52 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
53 __NAMESPACE__
54 ));