Created
May 19, 2014 11:53
-
-
Save oscherler/6849e3bba7032086b4f1 to your computer and use it in GitHub Desktop.
Sample code trying to show whether Zend Barcode depends on Zend Validator and/or Zend Service Manager.
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
{ | |
"require": { | |
"zendframework/zend-barcode": "@stable" | |
} | |
} |
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
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
use Zend\Barcode\Barcode; | |
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK'); | |
$rendererOptions = array(); | |
$renderer = Barcode::factory( | |
'code39', 'image', $barcodeOptions, $rendererOptions | |
)->render(); | |
# PHP Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found | |
# in /home/olivier/tests/zend-barcode/vendor/zendframework/zend-barcode/Zend/Barcode/ObjectPluginManager.php | |
# on line 22 |
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
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
use Zend\Barcode\Barcode; | |
# In order not to require zend-servicemanager, we can instantiate the barcode and renderer | |
# directly. I called it convoluted in the issue, but it’s not, just different than the | |
# examples in the docs. | |
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK'); | |
$barcode = new Zend\Barcode\Object\Code39( $barcodeOptions ); | |
$rendererOptions = array(); | |
$renderer = new Zend\Barcode\Renderer\Image( $rendererOptions ); | |
$renderer->setBarcode( $barcode )->render(); | |
# PHP Fatal error: Class 'Zend\Validator\Barcode' not found | |
# in /home/olivier/tests/zend-barcode/vendor/zendframework/zend-barcode/Zend/Barcode/Object/AbstractObject.php | |
# on line 1200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment