mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Updated ZF up to 2.4.13 (#106)
This commit is contained in:
parent
cec9c3ba61
commit
80fe6e12fd
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
90
library/Zend/Authentication/Adapter/Callback.php
Normal file
90
library/Zend/Authentication/Adapter/Callback.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Authentication\Adapter;
|
||||
|
||||
use Exception;
|
||||
use Zend\Authentication\Exception\InvalidArgumentException;
|
||||
use Zend\Authentication\Exception\RuntimeException;
|
||||
use Zend\Authentication\Result;
|
||||
|
||||
/**
|
||||
* Authentication Adapter authenticates using callback function.
|
||||
*
|
||||
* The Callback function must return an identity on authentication success,
|
||||
* and false on authentication failure.
|
||||
*/
|
||||
class Callback extends AbstractAdapter
|
||||
{
|
||||
/**
|
||||
* @var callable
|
||||
*/
|
||||
protected $callback;
|
||||
|
||||
/**
|
||||
* @param callable $callback The authentication callback
|
||||
*/
|
||||
public function __construct($callback = null)
|
||||
{
|
||||
if (null !== $callback) {
|
||||
$this->setCallback($callback);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate using the provided callback
|
||||
*
|
||||
* @return Result The authentication result
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function authenticate()
|
||||
{
|
||||
$callback = $this->getCallback();
|
||||
if (! $callback) {
|
||||
throw new RuntimeException('No callback provided');
|
||||
}
|
||||
|
||||
try {
|
||||
$identity = call_user_func($callback, $this->getIdentity(), $this->getCredential());
|
||||
} catch (Exception $e) {
|
||||
return new Result(Result::FAILURE_UNCATEGORIZED, null, array($e->getMessage()));
|
||||
}
|
||||
|
||||
if (! $identity) {
|
||||
return new Result(Result::FAILURE, null, array('Authentication failure'));
|
||||
}
|
||||
|
||||
return new Result(Result::SUCCESS, $identity, array('Authentication success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of callback.
|
||||
*
|
||||
* @return null|callable
|
||||
*/
|
||||
public function getCallback()
|
||||
{
|
||||
return $this->callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of callback.
|
||||
*
|
||||
* @param callable $callback the callback
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setCallback($callback)
|
||||
{
|
||||
if (! is_callable($callback)) {
|
||||
throw new InvalidArgumentException('Invalid callback provided');
|
||||
}
|
||||
|
||||
$this->callback = $callback;
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -148,7 +148,7 @@ abstract class AbstractAdapter extends BaseAdapter
|
||||
public function setAmbiguityIdentity($flag)
|
||||
{
|
||||
if (is_int($flag)) {
|
||||
$this->ambiguityIdentity = (1 === $flag ? true : false);
|
||||
$this->ambiguityIdentity = (1 === $flag);
|
||||
} elseif (is_bool($flag)) {
|
||||
$this->ambiguityIdentity = $flag;
|
||||
}
|
||||
@ -173,7 +173,7 @@ abstract class AbstractAdapter extends BaseAdapter
|
||||
*/
|
||||
public function getDbSelect()
|
||||
{
|
||||
if ($this->dbSelect == null) {
|
||||
if ($this->dbSelect === null) {
|
||||
$this->dbSelect = new Sql\Select();
|
||||
}
|
||||
return $this->dbSelect;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -125,14 +125,14 @@ class Http implements AdapterInterface
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $imaProxy;
|
||||
protected $imaProxy = false;
|
||||
|
||||
/**
|
||||
* Flag indicating the client is IE and didn't bother to return the opaque string
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $ieNoOpaque;
|
||||
protected $ieNoOpaque = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -149,10 +149,6 @@ class Http implements AdapterInterface
|
||||
*/
|
||||
public function __construct(array $config)
|
||||
{
|
||||
$this->request = null;
|
||||
$this->response = null;
|
||||
$this->ieNoOpaque = false;
|
||||
|
||||
if (empty($config['accept_schemes'])) {
|
||||
throw new Exception\InvalidArgumentException('Config key "accept_schemes" is required');
|
||||
}
|
||||
@ -181,6 +177,9 @@ class Http implements AdapterInterface
|
||||
}
|
||||
|
||||
if (in_array('digest', $this->acceptSchemes)) {
|
||||
$this->useOpaque = true;
|
||||
$this->algo = 'MD5';
|
||||
|
||||
if (empty($config['digest_domains']) ||
|
||||
!ctype_print($config['digest_domains']) ||
|
||||
strpos($config['digest_domains'], '"') !== false) {
|
||||
@ -204,22 +203,16 @@ class Http implements AdapterInterface
|
||||
// We use the opaque value unless explicitly told not to
|
||||
if (isset($config['use_opaque']) && false == (bool) $config['use_opaque']) {
|
||||
$this->useOpaque = false;
|
||||
} else {
|
||||
$this->useOpaque = true;
|
||||
}
|
||||
|
||||
if (isset($config['algorithm']) && in_array($config['algorithm'], $this->supportedAlgos)) {
|
||||
$this->algo = $config['algorithm'];
|
||||
} else {
|
||||
$this->algo = 'MD5';
|
||||
$this->algo = (string) $config['algorithm'];
|
||||
}
|
||||
}
|
||||
|
||||
// Don't be a proxy unless explicitly told to do so
|
||||
if (isset($config['proxy_auth']) && true == (bool) $config['proxy_auth']) {
|
||||
$this->imaProxy = true; // I'm a Proxy
|
||||
} else {
|
||||
$this->imaProxy = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -727,7 +720,7 @@ class Http implements AdapterInterface
|
||||
if (!$ret || empty($temp[1])) {
|
||||
return false;
|
||||
}
|
||||
if (32 != strlen($temp[1]) || !ctype_xdigit($temp[1])) {
|
||||
if (!$this->isValidMd5Hash($temp[1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -778,7 +771,7 @@ class Http implements AdapterInterface
|
||||
|
||||
// This implementation only sends MD5 hex strings in the opaque value
|
||||
if (!$this->ieNoOpaque &&
|
||||
(32 != strlen($temp[1]) || !ctype_xdigit($temp[1]))) {
|
||||
!$this->isValidMd5Hash($temp[1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -811,8 +804,17 @@ class Http implements AdapterInterface
|
||||
}
|
||||
|
||||
$data['nc'] = $temp[1];
|
||||
$temp = null;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* validates if $value is a valid Md5 hash
|
||||
* @param string $value
|
||||
* @return bool
|
||||
*/
|
||||
private function isValidMd5Hash($value)
|
||||
{
|
||||
return 32 == strlen($value) && ctype_xdigit($value);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -144,7 +144,7 @@ class AuthenticationService implements AuthenticationServiceInterface
|
||||
$storage = $this->getStorage();
|
||||
|
||||
if ($storage->isEmpty()) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
return $storage->read();
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -85,7 +85,7 @@ class Result
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
return ($this->code > 0) ? true : false;
|
||||
return ($this->code > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -8,11 +8,10 @@
|
||||
],
|
||||
"homepage": "https://github.com/zendframework/zf2",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"psr-4": {
|
||||
"Zend\\Authentication\\": ""
|
||||
}
|
||||
},
|
||||
"target-dir": "Zend/Authentication",
|
||||
"require": {
|
||||
"php": ">=5.3.23",
|
||||
"zendframework/zend-stdlib": "self.version"
|
||||
@ -37,8 +36,8 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3-dev",
|
||||
"dev-develop": "2.4-dev"
|
||||
"dev-master": "2.4-dev",
|
||||
"dev-develop": "2.5-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,14 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Barcode;
|
||||
|
||||
use Traversable;
|
||||
use Zend\Barcode\Renderer\RendererInterface;
|
||||
use Zend\Stdlib\ArrayUtils;
|
||||
|
||||
/**
|
||||
@ -92,7 +93,7 @@ abstract class Barcode
|
||||
* @param mixed $barcodeConfig OPTIONAL; an array or Traversable object with barcode parameters.
|
||||
* @param mixed $rendererConfig OPTIONAL; an array or Traversable object with renderer parameters.
|
||||
* @param bool $automaticRenderError OPTIONAL; set the automatic rendering of exception
|
||||
* @return Barcode
|
||||
* @return RendererInterface
|
||||
* @throws Exception\ExceptionInterface
|
||||
*/
|
||||
public static function factory(
|
||||
@ -146,7 +147,7 @@ abstract class Barcode
|
||||
* @param mixed $barcode String name of barcode class, or Traversable object, or barcode object.
|
||||
* @param mixed $barcodeConfig OPTIONAL; an array or Traversable object with barcode parameters.
|
||||
* @throws Exception\InvalidArgumentException
|
||||
* @return Object
|
||||
* @return Object\ObjectInterface
|
||||
*/
|
||||
public static function makeBarcode($barcode, $barcodeConfig = array())
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -21,48 +21,56 @@ abstract class AbstractObject implements ObjectInterface
|
||||
{
|
||||
/**
|
||||
* Namespace of the barcode for autoloading
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $barcodeNamespace = 'Zend\Barcode\Object';
|
||||
|
||||
/**
|
||||
* Set of drawing instructions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $instructions = array();
|
||||
|
||||
/**
|
||||
* Barcode type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type = null;
|
||||
|
||||
/**
|
||||
* Height of the object
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $height = null;
|
||||
|
||||
/**
|
||||
* Width of the object
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $width = null;
|
||||
|
||||
/**
|
||||
* Height of the bar
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $barHeight = 50;
|
||||
|
||||
/**
|
||||
* Width of a thin bar
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $barThinWidth = 1;
|
||||
|
||||
/**
|
||||
* Width of a thick bar
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $barThickWidth = 3;
|
||||
@ -70,42 +78,49 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Factor to multiply bar and font measure
|
||||
* (barHeight, barThinWidth, barThickWidth & fontSize)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $factor = 1;
|
||||
|
||||
/**
|
||||
* Font and bars color of the object
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $foreColor = 0x000000;
|
||||
|
||||
/**
|
||||
* Background color of the object
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $backgroundColor = 0xFFFFFF;
|
||||
|
||||
/**
|
||||
* Activate/deactivate border of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $withBorder = false;
|
||||
|
||||
/**
|
||||
* Activate/deactivate drawing of quiet zones
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $withQuietZones = true;
|
||||
|
||||
/**
|
||||
* Force quiet zones even if
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $mandatoryQuietZones = false;
|
||||
|
||||
/**
|
||||
* Orientation of the barcode in degrees
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $orientation = 0;
|
||||
@ -113,6 +128,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Offset from the top the object
|
||||
* (calculated from the orientation)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $offsetTop = null;
|
||||
@ -120,24 +136,28 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Offset from the left the object
|
||||
* (calculated from the orientation)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $offsetLeft = null;
|
||||
|
||||
/**
|
||||
* Text to display
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $text = null;
|
||||
|
||||
/**
|
||||
* Display (or not) human readable text
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $drawText = true;
|
||||
|
||||
/**
|
||||
* Adjust (or not) position of human readable characters with barcode
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $stretchText = false;
|
||||
@ -146,30 +166,35 @@ abstract class AbstractObject implements ObjectInterface
|
||||
* Font resource
|
||||
* - integer (1 to 5): corresponds to GD included fonts
|
||||
* - string: corresponds to path of a TTF font
|
||||
*
|
||||
* @var int|string
|
||||
*/
|
||||
protected $font = null;
|
||||
|
||||
/**
|
||||
* Font size
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $fontSize = 10;
|
||||
|
||||
/**
|
||||
* Drawing of checksum
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $withChecksum = false;
|
||||
|
||||
/**
|
||||
* Drawing of checksum inside text
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $withChecksumInText = false;
|
||||
|
||||
/**
|
||||
* Fix barcode length (numeric or string like 'even')
|
||||
*
|
||||
* @var int | string
|
||||
*/
|
||||
protected $barcodeLength = null;
|
||||
@ -177,6 +202,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Activate automatic addition of leading zeros
|
||||
* if barcode length is fixed
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $addLeadingZeros = true;
|
||||
@ -184,18 +210,21 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Activation of mandatory checksum
|
||||
* to deactivate unauthorized modification
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $mandatoryChecksum = false;
|
||||
|
||||
/**
|
||||
* Character used to substitute checksum character for validation
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $substituteChecksumCharacter = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array|Traversable $options
|
||||
*/
|
||||
public function __construct($options = null)
|
||||
@ -217,7 +246,6 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set default options for particular object
|
||||
* @return void
|
||||
*/
|
||||
protected function getDefaultOptions()
|
||||
{
|
||||
@ -225,6 +253,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set barcode state from options array
|
||||
*
|
||||
* @param array $options
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
@ -263,6 +292,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve type of barcode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
@ -272,6 +302,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set height of the barcode bar
|
||||
*
|
||||
* @param int $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -289,6 +320,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Get height of the barcode bar
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBarHeight()
|
||||
@ -298,6 +330,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set thickness of thin bar
|
||||
*
|
||||
* @param int $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -315,6 +348,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Get thickness of thin bar
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBarThinWidth()
|
||||
@ -324,6 +358,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set thickness of thick bar
|
||||
*
|
||||
* @param int $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -341,6 +376,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Get thickness of thick bar
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBarThickWidth()
|
||||
@ -351,7 +387,8 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Set factor applying to
|
||||
* thinBarWidth - thickBarWidth - barHeight - fontSize
|
||||
* @param float $value
|
||||
*
|
||||
* @param int|float|string|bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
*/
|
||||
@ -369,6 +406,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Get factor applying to
|
||||
* thinBarWidth - thickBarWidth - barHeight - fontSize
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFactor()
|
||||
@ -378,6 +416,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set color of the barcode and text
|
||||
*
|
||||
* @param string $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -398,6 +437,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve color of the barcode and text
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getForeColor()
|
||||
@ -407,6 +447,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set the color of the background
|
||||
*
|
||||
* @param int $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -427,6 +468,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve background color of the image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBackgroundColor()
|
||||
@ -436,6 +478,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Activate/deactivate drawing of the bar
|
||||
*
|
||||
* @param bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
@ -447,6 +490,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve if border are draw or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWithBorder()
|
||||
@ -456,6 +500,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Activate/deactivate drawing of the quiet zones
|
||||
*
|
||||
* @param bool $value
|
||||
* @return AbstractObject
|
||||
*/
|
||||
@ -467,6 +512,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve if quiet zones are draw or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWithQuietZones()
|
||||
@ -476,6 +522,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Allow fast inversion of font/bars color and background color
|
||||
*
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
public function setReverseColor()
|
||||
@ -488,7 +535,8 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set orientation of barcode and text
|
||||
* @param float $value
|
||||
*
|
||||
* @param int|float|string|bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
*/
|
||||
@ -500,6 +548,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve orientation of barcode and text
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getOrientation()
|
||||
@ -509,6 +558,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set text to encode
|
||||
*
|
||||
* @param string $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
@ -520,6 +570,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve text to encode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getText()
|
||||
@ -533,8 +584,9 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Automatically add leading zeros if barcode length is fixed
|
||||
* @param string $text
|
||||
* @param bool $withoutChecksum
|
||||
*
|
||||
* @param string $text
|
||||
* @param bool $withoutChecksum
|
||||
* @return string
|
||||
*/
|
||||
protected function addLeadingZeros($text, $withoutChecksum = false)
|
||||
@ -557,6 +609,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve text to encode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRawText()
|
||||
@ -566,6 +619,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve text to display
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTextToDisplay()
|
||||
@ -579,6 +633,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Activate/deactivate drawing of text to encode
|
||||
*
|
||||
* @param bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
@ -590,6 +645,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve if drawing of text to encode is enabled
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDrawText()
|
||||
@ -600,6 +656,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Activate/deactivate the adjustment of the position
|
||||
* of the characters to the position of the bars
|
||||
*
|
||||
* @param bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -613,6 +670,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Retrieve if the adjustment of the position of the characters
|
||||
* to the position of the bars is enabled
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getStretchText()
|
||||
@ -624,6 +682,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
* Activate/deactivate the automatic generation
|
||||
* of the checksum character
|
||||
* added to the barcode text
|
||||
*
|
||||
* @param bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
*/
|
||||
@ -638,6 +697,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Retrieve if the checksum character is automatically
|
||||
* added to the barcode text
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWithChecksum()
|
||||
@ -649,6 +709,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
* Activate/deactivate the automatic generation
|
||||
* of the checksum character
|
||||
* added to the barcode text
|
||||
*
|
||||
* @param bool $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -664,6 +725,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Retrieve if the checksum character is automatically
|
||||
* added to the barcode text
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWithChecksumInText()
|
||||
@ -675,6 +737,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
* Set the font:
|
||||
* - if integer between 1 and 5, use gd built-in fonts
|
||||
* - if string, $value is assumed to be the path to a TTF font
|
||||
*
|
||||
* @param int|string $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -706,6 +769,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve the font
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getFont()
|
||||
@ -715,6 +779,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Set the size of the font in case of TTF
|
||||
*
|
||||
* @param float $value
|
||||
* @return \Zend\Barcode\Object\ObjectInterface
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
@ -748,6 +813,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Quiet zone before first bar
|
||||
* and after the last bar
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getQuietZone()
|
||||
@ -761,6 +827,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Add an instruction in the array of instructions
|
||||
*
|
||||
* @param array $instruction
|
||||
*/
|
||||
protected function addInstruction(array $instruction)
|
||||
@ -770,6 +837,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Retrieve the set of drawing instructions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getInstructions()
|
||||
@ -779,9 +847,10 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Add a polygon drawing instruction in the set of instructions
|
||||
*
|
||||
* @param array $points
|
||||
* @param int $color
|
||||
* @param bool $filled
|
||||
* @param int $color
|
||||
* @param bool $filled
|
||||
*/
|
||||
protected function addPolygon(array $points, $color = null, $filled = true)
|
||||
{
|
||||
@ -798,13 +867,14 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Add a text drawing instruction in the set of instructions
|
||||
*
|
||||
* @param string $text
|
||||
* @param float $size
|
||||
* @param int[] $position
|
||||
* @param float $size
|
||||
* @param int[] $position
|
||||
* @param string $font
|
||||
* @param int $color
|
||||
* @param int $color
|
||||
* @param string $alignment
|
||||
* @param float $orientation
|
||||
* @param float|int $orientation
|
||||
*/
|
||||
protected function addText(
|
||||
$text,
|
||||
@ -832,6 +902,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Checking of parameters after all settings
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkParams()
|
||||
@ -844,8 +915,8 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Check if a text is really provided to barcode
|
||||
*
|
||||
* @param string|null $value
|
||||
* @return void
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
*/
|
||||
protected function checkText($value = null)
|
||||
@ -863,9 +934,9 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Check the ratio between the thick and the thin bar
|
||||
*
|
||||
* @param int $min
|
||||
* @param int $max
|
||||
* @return void
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
*/
|
||||
protected function checkRatio($min = 2, $max = 3)
|
||||
@ -883,7 +954,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Drawing with an angle is just allow TTF font
|
||||
* @return void
|
||||
*
|
||||
* @throws \Zend\Barcode\Object\Exception\ExceptionInterface
|
||||
*/
|
||||
protected function checkFontAndOrientation()
|
||||
@ -898,6 +969,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Width of the result image
|
||||
* (before any rotation)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function calculateWidth()
|
||||
@ -909,12 +981,14 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Calculate the width of the barcode
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
abstract protected function calculateBarcodeWidth();
|
||||
|
||||
/**
|
||||
* Height of the result object
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function calculateHeight()
|
||||
@ -926,6 +1000,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Height of the barcode
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function calculateBarcodeHeight()
|
||||
@ -941,6 +1016,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Get height of the result object
|
||||
*
|
||||
* @param bool $recalculate
|
||||
* @return int
|
||||
*/
|
||||
@ -956,6 +1032,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Get width of the result object
|
||||
*
|
||||
* @param bool $recalculate
|
||||
* @return int
|
||||
*/
|
||||
@ -972,6 +1049,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Calculate the offset from the left of the object
|
||||
* if an orientation is activated
|
||||
*
|
||||
* @param bool $recalculate
|
||||
* @return float
|
||||
*/
|
||||
@ -993,6 +1071,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Calculate the offset from the top of the object
|
||||
* if an orientation is activated
|
||||
*
|
||||
* @param bool $recalculate
|
||||
* @return float
|
||||
*/
|
||||
@ -1013,9 +1092,10 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Apply rotation on a point in X/Y dimensions
|
||||
* @param float $x1 x-position before rotation
|
||||
* @param float $y1 y-position before rotation
|
||||
* @return int[] Array of two elements corresponding to the new XY point
|
||||
*
|
||||
* @param float $x1 x-position before rotation
|
||||
* @param float $y1 y-position before rotation
|
||||
* @return array Array of two elements corresponding to the new XY point
|
||||
*/
|
||||
protected function rotate($x1, $y1)
|
||||
{
|
||||
@ -1030,6 +1110,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Complete drawing of the barcode
|
||||
*
|
||||
* @return array Table of instructions
|
||||
*/
|
||||
public function draw()
|
||||
@ -1043,7 +1124,6 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Draw the barcode
|
||||
* @return void
|
||||
*/
|
||||
protected function drawBarcode()
|
||||
{
|
||||
@ -1100,7 +1180,6 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Partial function to draw border
|
||||
* @return void
|
||||
*/
|
||||
protected function drawBorder()
|
||||
{
|
||||
@ -1124,7 +1203,6 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Partial function to draw text
|
||||
* @return void
|
||||
*/
|
||||
protected function drawText()
|
||||
{
|
||||
@ -1167,8 +1245,8 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Check for invalid characters
|
||||
* @param string $value Text to be checked
|
||||
* @return void
|
||||
*
|
||||
* @param string $value Text to be checked
|
||||
*/
|
||||
public function validateText($value)
|
||||
{
|
||||
@ -1177,6 +1255,7 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Standard validation for most of barcode objects
|
||||
*
|
||||
* @param string $value
|
||||
* @param array $options
|
||||
*/
|
||||
@ -1222,15 +1301,11 @@ abstract class AbstractObject implements ObjectInterface
|
||||
|
||||
/**
|
||||
* Checking of parameters after all settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
abstract protected function checkSpecificParams();
|
||||
|
||||
/**
|
||||
* Allow each child to draw something else
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function preDrawBarcode()
|
||||
{
|
||||
@ -1239,8 +1314,6 @@ abstract class AbstractObject implements ObjectInterface
|
||||
/**
|
||||
* Allow each child to draw something else
|
||||
* (ex: bearer bars in interleaved 2 of 5 code)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function postDrawBarcode()
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -52,13 +52,13 @@ abstract class AbstractRenderer implements RendererInterface
|
||||
|
||||
/**
|
||||
* Horizontal position of the barcode in the rendering resource
|
||||
* @var int
|
||||
* @var string
|
||||
*/
|
||||
protected $horizontalPosition = 'left';
|
||||
|
||||
/**
|
||||
* Vertical position of the barcode in the rendering resource
|
||||
* @var int
|
||||
* @var string
|
||||
*/
|
||||
protected $verticalPosition = 'top';
|
||||
|
||||
@ -501,7 +501,7 @@ abstract class AbstractRenderer implements RendererInterface
|
||||
* @param string $font
|
||||
* @param int $color
|
||||
* @param string $alignment
|
||||
* @param float $orientation
|
||||
* @param float|int $orientation
|
||||
*/
|
||||
abstract protected function drawText(
|
||||
$text,
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -204,6 +204,11 @@ class Image extends AbstractRenderer
|
||||
$height = $this->userHeight;
|
||||
}
|
||||
|
||||
// Cast width and height to ensure they are correct type for image
|
||||
// operations
|
||||
$width = (int) $width;
|
||||
$height = (int) $height;
|
||||
|
||||
$this->resource = imagecreatetruecolor($width, $height);
|
||||
|
||||
$white = imagecolorallocate($this->resource, 255, 255, 255);
|
||||
@ -238,8 +243,8 @@ class Image extends AbstractRenderer
|
||||
$this->resource,
|
||||
$this->leftOffset,
|
||||
$this->topOffset,
|
||||
$this->leftOffset + $barcodeWidth - 1,
|
||||
$this->topOffset + $barcodeHeight - 1,
|
||||
(int) ($this->leftOffset + $barcodeWidth - 1),
|
||||
(int) ($this->topOffset + $barcodeHeight - 1),
|
||||
$this->imageBackgroundColor
|
||||
);
|
||||
}
|
||||
@ -358,7 +363,7 @@ class Image extends AbstractRenderer
|
||||
* @param string $font
|
||||
* @param int $color
|
||||
* @param string $alignment
|
||||
* @param float $orientation
|
||||
* @param float|int $orientation
|
||||
* @throws Exception\RuntimeException
|
||||
*/
|
||||
protected function drawText($text, $size, $position, $font, $color, $alignment = 'center', $orientation = 0)
|
||||
@ -370,7 +375,7 @@ class Image extends AbstractRenderer
|
||||
$color & 0x0000FF
|
||||
);
|
||||
|
||||
if ($font == null) {
|
||||
if ($font === null) {
|
||||
$font = 3;
|
||||
}
|
||||
$position[0] += $this->leftOffset;
|
||||
@ -382,7 +387,7 @@ class Image extends AbstractRenderer
|
||||
* imagestring() doesn't allow orientation, if orientation
|
||||
* needed: a TTF font is required.
|
||||
* Throwing an exception here, allow to use automaticRenderError
|
||||
* to informe user of the problem instead of simply not drawing
|
||||
* to inform user of the problem instead of simply not drawing
|
||||
* the text
|
||||
*/
|
||||
throw new Exception\RuntimeException(
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -8,11 +8,10 @@
|
||||
],
|
||||
"homepage": "https://github.com/zendframework/zf2",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"psr-4": {
|
||||
"Zend\\Barcode\\": ""
|
||||
}
|
||||
},
|
||||
"target-dir": "Zend/Barcode",
|
||||
"require": {
|
||||
"php": ">=5.3.23",
|
||||
"zendframework/zend-stdlib": "self.version",
|
||||
@ -28,8 +27,8 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3-dev",
|
||||
"dev-develop": "2.4-dev"
|
||||
"dev-master": "2.4-dev",
|
||||
"dev-develop": "2.5-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -59,7 +59,7 @@ class CallbackCache extends AbstractPattern
|
||||
$cacheOutput = $options->getCacheOutput();
|
||||
if ($cacheOutput) {
|
||||
ob_start();
|
||||
ob_implicit_flush(false);
|
||||
ob_implicit_flush(0);
|
||||
}
|
||||
|
||||
// TODO: do not cache on errors using [set|restore]_error_handler
|
||||
@ -137,9 +137,11 @@ class CallbackCache extends AbstractPattern
|
||||
$callbackKey = strtolower($callbackKey);
|
||||
|
||||
// generate a unique key of object callbacks
|
||||
if (is_object($callback)) { // Closures & __invoke
|
||||
if (is_object($callback)) {
|
||||
// Closures & __invoke
|
||||
$object = $callback;
|
||||
} elseif (isset($callback[0])) { // array($object, 'method')
|
||||
} elseif (isset($callback[0])) {
|
||||
// array($object, 'method')
|
||||
$object = $callback[0];
|
||||
}
|
||||
if (isset($object)) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -35,7 +35,7 @@ class CaptureCache extends AbstractPattern
|
||||
return false;
|
||||
});
|
||||
|
||||
ob_implicit_flush(false);
|
||||
ob_implicit_flush(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,14 +301,14 @@ class CaptureCache extends AbstractPattern
|
||||
// build-in mkdir function is enough
|
||||
|
||||
$umask = ($umask !== false) ? umask($umask) : false;
|
||||
$res = mkdir($pathname, ($perm !== false) ? $perm : 0777, true);
|
||||
$res = mkdir($pathname, ($perm !== false) ? $perm : 0775, true);
|
||||
|
||||
if ($umask !== false) {
|
||||
umask($umask);
|
||||
}
|
||||
|
||||
if (!$res) {
|
||||
$oct = ($perm === false) ? '777' : decoct($perm);
|
||||
$oct = ($perm === false) ? '775' : decoct($perm);
|
||||
$err = ErrorHandler::stop();
|
||||
throw new Exception\RuntimeException("mkdir('{$pathname}', 0{$oct}, true) failed", 0, $err);
|
||||
}
|
||||
@ -341,13 +341,13 @@ class CaptureCache extends AbstractPattern
|
||||
|
||||
// create a single directory, set and reset umask immediately
|
||||
$umask = ($umask !== false) ? umask($umask) : false;
|
||||
$res = mkdir($path, ($perm === false) ? 0777 : $perm, false);
|
||||
$res = mkdir($path, ($perm === false) ? 0775 : $perm, false);
|
||||
if ($umask !== false) {
|
||||
umask($umask);
|
||||
}
|
||||
|
||||
if (!$res) {
|
||||
$oct = ($perm === false) ? '777' : decoct($perm);
|
||||
$oct = ($perm === false) ? '775' : decoct($perm);
|
||||
ErrorHandler::stop();
|
||||
throw new Exception\RuntimeException(
|
||||
"mkdir('{$path}', 0{$oct}, false) failed"
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -60,7 +60,7 @@ class OutputCache extends AbstractPattern
|
||||
}
|
||||
|
||||
ob_start();
|
||||
ob_implicit_flush(false);
|
||||
ob_implicit_flush(0);
|
||||
$this->keyStack[] = $key;
|
||||
return false;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user