This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/zendframework/zf2
- Loading branch information
35 parents
9c5fe73
+
7867d92
+
e4be59e
+
4380c1e
+
6d7fec5
+
d34e28a
+
3568aac
+
a037761
+
e52d80a
+
13ef28b
+
d64cb1c
+
42c4029
+
9069765
+
40855ed
+
c1b1a58
+
d43c1be
+
b348348
+
0640226
+
09868c6
+
d3e357b
+
50bd771
+
2595247
+
aec938c
+
5970dba
+
e723fba
+
f647c66
+
e217698
+
f887417
+
15e6fba
+
247b5e3
+
fa5adb5
+
0f90fd8
+
9bce0c4
+
13eb36a
+
d2ae723
commit 9a31aee
Showing
13 changed files
with
143 additions
and
187 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Math | ||
* @subpackage BigInteger | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace Zend\Math\BigInteger; | ||
|
||
use Zend\ServiceManager\AbstractPluginManager; | ||
|
||
/** | ||
* Plugin manager implementation for BigInteger adapters. | ||
* | ||
* Enforces that adapters retrieved are instances of | ||
* Adapter\AdapterInterface. Additionally, it registers a number of default | ||
* adapters available. | ||
* | ||
* @category Zend | ||
* @package Zend_Math | ||
* @subpackage BigInteger | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
class AdapterPluginManager extends AbstractPluginManager | ||
{ | ||
/** | ||
* Default set of adapters | ||
* | ||
* @var array | ||
*/ | ||
protected $invokableClasses = array( | ||
'bcmath' => 'Zend\Math\BigInteger\Adapter\Bcmath', | ||
'gmp' => 'Zend\Math\BigInteger\Adapter\Gmp', | ||
); | ||
|
||
/** | ||
* Validate the plugin | ||
* | ||
* Checks that the adapter loaded is an instance of Adapter\AdapterInterface. | ||
* | ||
* @param mixed $plugin | ||
* @return void | ||
* @throws Exception\RuntimeException if invalid | ||
*/ | ||
public function validatePlugin($plugin) | ||
{ | ||
if ($plugin instanceof Adapter\AdapterInterface) { | ||
// we're okay | ||
return; | ||
} | ||
|
||
throw new Exception\RuntimeException(sprintf( | ||
'Plugin of type %s is invalid; must implement %s\Adapter\AdapterInterface', | ||
(is_object($plugin) ? get_class($plugin) : gettype($plugin)), | ||
__NAMESPACE__ | ||
)); | ||
} | ||
} | ||
|
Oops, something went wrong.