This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
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
64 parents
c431169
+
b3042ce
+
e57fd9d
+
d07707d
+
60d87e0
+
dea915e
+
4f2f391
+
e61f957
+
a301eb4
+
86ee99c
+
4f18442
+
0560233
+
803be33
+
b3b44b2
+
747588e
+
ff0efd2
+
5651d65
+
a3fbf6b
+
2a0a9d7
+
e987caa
+
f6cf6f8
+
a97175a
+
18ecd64
+
f00b78e
+
18be569
+
af6e96a
+
a62b890
+
369a5ce
+
2f4d803
+
045137d
+
2fdcee4
+
147c99e
+
d95685a
+
9fceeb6
+
4682ed8
+
58e6c7d
+
f9a818b
+
b470c79
+
ce259b2
+
47e8c8b
+
62bd37a
+
f6216bb
+
01cd418
+
1d5008a
+
f7d1866
+
339c91f
+
105863b
+
d697919
+
a07d04f
+
ab69e95
+
a01fec1
+
79aa858
+
e6c1f7b
+
caa3725
+
42e5478
+
2d5d2cd
+
80ddcc5
+
e2d6bae
+
4d230a7
+
eb81fcd
+
d11d08b
+
260e6bd
+
7ad155b
+
5fc070f
commit c78a364
Showing
11 changed files
with
204 additions
and
335 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 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,88 @@ | ||
<?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_Barcode | ||
* @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\Barcode; | ||
|
||
use Zend\ServiceManager\AbstractPluginManager; | ||
|
||
/** | ||
* Plugin manager implementation for barcode parsers. | ||
* | ||
* Enforces that barcode parsers retrieved are instances of | ||
* Object\AbstractObject. Additionally, it registers a number of default | ||
* barcode parsers. | ||
* | ||
* @category Zend | ||
* @package Zend_Barcode | ||
* @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 ObjectPluginManager extends AbstractPluginManager | ||
{ | ||
/** | ||
* Default set of barcode parsers | ||
* | ||
* @var array | ||
*/ | ||
protected $invokableClasses = array( | ||
'codabar' => 'Zend\Barcode\Object\Codabar', | ||
'code128' => 'Zend\Barcode\Object\Code128', | ||
'code25' => 'Zend\Barcode\Object\Code25', | ||
'code25interleaved' => 'Zend\Barcode\Object\Code25interleaved', | ||
'code39' => 'Zend\Barcode\Object\Code39', | ||
'ean13' => 'Zend\Barcode\Object\Ean13', | ||
'ean2' => 'Zend\Barcode\Object\Ean2', | ||
'ean5' => 'Zend\Barcode\Object\Ean5', | ||
'ean8' => 'Zend\Barcode\Object\Ean8', | ||
'error' => 'Zend\Barcode\Object\Error', | ||
'identcode' => 'Zend\Barcode\Object\Identcode', | ||
'itf14' => 'Zend\Barcode\Object\Itf14', | ||
'leitcode' => 'Zend\Barcode\Object\Leitcode', | ||
'planet' => 'Zend\Barcode\Object\Planet', | ||
'postnet' => 'Zend\Barcode\Object\Postnet', | ||
'royalmail' => 'Zend\Barcode\Object\Royalmail', | ||
'upca' => 'Zend\Barcode\Object\Upca', | ||
'upce' => 'Zend\Barcode\Object\Upce', | ||
); | ||
|
||
/** | ||
* Validate the plugin | ||
* | ||
* Checks that the barcode parser loaded is an instance | ||
* of Object\AbstractObject. | ||
* | ||
* @param mixed $plugin | ||
* @return void | ||
* @throws Exception\InvalidArgumentException if invalid | ||
*/ | ||
public function validatePlugin($plugin) | ||
{ | ||
if ($plugin instanceof Object\AbstractObject) { | ||
// we're okay | ||
return; | ||
} | ||
|
||
throw new Exception\InvalidArgumentException(sprintf( | ||
'Plugin of type %s is invalid; must extend %s\Object\AbstractObject', | ||
(is_object($plugin) ? get_class($plugin) : gettype($plugin)), | ||
__NAMESPACE__ | ||
)); | ||
} | ||
} |
Oops, something went wrong.