diff --git a/module/VuFind/src/VuFind/Controller/AbstractBase.php b/module/VuFind/src/VuFind/Controller/AbstractBase.php index 672473a3df9e9bd25844ada523c03730f38399c5..4cdfe87efb219f4abfdb510fcb31f67d7f785fac 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractBase.php +++ b/module/VuFind/src/VuFind/Controller/AbstractBase.php @@ -224,11 +224,6 @@ class AbstractBase extends AbstractActionController $params['action'] = $action; // Dispatch the requested controller/action: - $this->forward()->dispatch($controller, $params); - - // Always return false. If we return the output of dispatch(), the - // framework will attach duplicate objects to the response and templates - // will get processed multiple times unnecessarily! - return false; + return $this->forward()->dispatch($controller, $params); } } \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Translator/Translator.php b/module/VuFind/src/VuFind/Translator/Translator.php index f0966980fe4e723529135b21d76c46f5744f4702..52ca3b5e95d4f379235d8c31bbf9f806a3c5c218 100644 --- a/module/VuFind/src/VuFind/Translator/Translator.php +++ b/module/VuFind/src/VuFind/Translator/Translator.php @@ -93,11 +93,9 @@ class Translator $pluginManager = $translator->getPluginManager(); $pluginManager->setService('extendedini', new ExtendedIniLoader()); - /* TODO -- uncomment this when Zend translator bug is fixed (RC5?): // Set up language caching for better performance: $translator ->setCache(CacheManager::getInstance()->getCache('language')); - */ // Store the translator object in the VuFind Translator wrapper: self::setTranslator($translator); diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php b/vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php index 42cc5d71d1cfce703163e8fabaf65401890b128b..332fce8c0337a2116959951200c1ff2a1890b431 100644 --- a/vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php +++ b/vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php @@ -11,6 +11,7 @@ namespace Zend\Authentication\Adapter; use Zend\Authentication\Result as AuthenticationResult; +use Zend\Stdlib\ErrorHandler; /** * @category Zend @@ -169,8 +170,11 @@ class Digest implements AdapterInterface } } - if (false === ($fileHandle = @fopen($this->filename, 'r'))) { - throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading"); + ErrorHandler::start(E_WARNING); + $fileHandle = fopen($this->filename, 'r'); + $error = ErrorHandler::stop(); + if (false === $fileHandle) { + throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading", 0, $error); } $id = "$this->username:$this->realm"; diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php b/vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php index 45b0a079e5eed4b4e3dbd0d7acfed795806d2990..9abaa5a0956048af9004c3446f8d343ad35b84b5 100644 --- a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php +++ b/vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php @@ -10,6 +10,8 @@ namespace Zend\Authentication\Adapter\Http; +use Zend\Stdlib\ErrorHandler; + /** * HTTP Authentication File Resolver * @@ -102,9 +104,11 @@ class FileResolver implements ResolverInterface } // Open file, read through looking for matching credentials - $fp = @fopen($this->file, 'r'); + ErrorHandler::start(E_WARNING); + $fp = fopen($this->file, 'r'); + $error = ErrorHandler::stop(); if (!$fp) { - throw new Exception\RuntimeException('Unable to open password file: ' . $this->file); + throw new Exception\RuntimeException('Unable to open password file: ' . $this->file, 0, $error); } // No real validation is done on the contents of the password file. The diff --git a/vendor/ZF2/library/Zend/Authentication/composer.json b/vendor/ZF2/library/Zend/Authentication/composer.json index 500cc6c763c35667e834613e22a26ceb48917ec5..8aa6f490c18dcb4b74604cf37a7466177aa548e4 100644 --- a/vendor/ZF2/library/Zend/Authentication/composer.json +++ b/vendor/ZF2/library/Zend/Authentication/composer.json @@ -13,11 +13,12 @@ }, "target-dir": "Zend/Authentication", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" }, "suggest": { "zendframework/zend-db": "Zend\\Db component", "zendframework/zend-uri": "Zend\\Uri component", "zendframework/zend-session": "Zend\\Session component" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php b/vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php index ffb8775a23c978cba197f0cd1a6ee1532b88a2de..e5fe0b0fdb364b450e331a7a65ca161ba26b62e0 100644 --- a/vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php +++ b/vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php @@ -12,6 +12,7 @@ namespace Zend\Cache\Pattern; use Zend\Cache\Exception; use Zend\Cache\StorageFactory; +use Zend\Stdlib\ErrorHandler; /** * @category Zend @@ -145,19 +146,22 @@ class CallbackCache extends AbstractPattern $object = $callback[0]; } if (isset($object)) { + ErrorHandler::start(); try { - $serializedObject = @serialize($object); + $serializedObject = serialize($object); } catch (\Exception $e) { + ErrorHandler::stop(); throw new Exception\RuntimeException( "Can't serialize callback: see previous exception", 0, $e ); } + $error = ErrorHandler::stop(); if (!$serializedObject) { - $lastErr = error_get_last(); - throw new Exception\RuntimeException( - "Can't serialize callback: " . $lastErr['message'] - ); + throw new Exception\RuntimeException(sprintf( + 'Cannot serialize callback%s', + ($error ? ': ' . $error->getMessage() : '') + ), 0, $error); } $callbackKey.= $serializedObject; } @@ -178,19 +182,22 @@ class CallbackCache extends AbstractPattern return ''; } + ErrorHandler::start(); try { - $serializedArgs = @serialize(array_values($args)); + $serializedArgs = serialize(array_values($args)); } catch (\Exception $e) { + ErrorHandler::stop(); throw new Exception\RuntimeException( "Can't serialize arguments: see previous exception" , 0, $e); } + $error = ErrorHandler::stop(); if (!$serializedArgs) { - $lastErr = error_get_last(); - throw new Exception\RuntimeException( - "Can't serialize arguments: " . $lastErr['message'] - ); + throw new Exception\RuntimeException(sprintf( + 'Cannot serialize arguments%s', + ($error ? ': ' . $error->getMessage() : '') + ), 0, $error); } return md5($serializedArgs); diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php b/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php index 3492ad23114339790627c892bd3067d9635a2afb..70adb9d5b1e36b286977f66ea47851545a242698 100644 --- a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php +++ b/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php @@ -96,10 +96,13 @@ class AdapterOptions extends AbstractOptions if ($keyPattern !== '') { ErrorHandler::start(E_WARNING); $result = preg_match($keyPattern, ''); - ErrorHandler::stop(); + $error = ErrorHandler::stop(); if ($result === false) { - $err = error_get_last(); - throw new Exception\InvalidArgumentException("Invalid pattern '{$keyPattern}': {$err['message']}"); + throw new Exception\InvalidArgumentException(sprintf( + 'Invalid pattern "%s"%s', + $keyPattern, + ($error ? ': ' . $error->getMessage() : '') + ), 0, $error); } } diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php b/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php index fef12f0be94b7a9baaac1347d0c4064d037bb7bb..9ca1b41dcaa81222153236d96c048566579573cd 100644 --- a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php +++ b/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php @@ -213,13 +213,16 @@ class PluginOptions extends AbstractOptions */ public function getSerializer() { - if (is_string($this->serializer)) { - $options = $this->getSerializerOptions(); - $this->setSerializer(SerializerFactory::factory($this->serializer, $options)); - } elseif (null === $this->serializer) { - $this->setSerializer(SerializerFactory::getDefaultAdapter()); + if (!$this->serializer instanceof SerializerAdapter) { + // use default serializer + if (!$this->serializer) { + $this->setSerializer(SerializerFactory::getDefaultAdapter()); + // instantiate by class name + serializer_options + } else { + $options = $this->getSerializerOptions(); + $this->setSerializer(SerializerFactory::factory($this->serializer, $options)); + } } - return $this->serializer; } diff --git a/vendor/ZF2/library/Zend/Console/Console.php b/vendor/ZF2/library/Zend/Console/Console.php index 604f91f05258172c27e76f6b754c07f36a7173b9..e4eddf77066830737e24761473800a95b2a5cb9e 100644 --- a/vendor/ZF2/library/Zend/Console/Console.php +++ b/vendor/ZF2/library/Zend/Console/Console.php @@ -109,7 +109,7 @@ abstract class Console return ( defined('PHP_OS') && ( substr_compare(PHP_OS,'win',0,3,true) === 0) ) || (getenv('OS') != false && substr_compare(getenv('OS'),'windows',0,7,true)) - ; + ; } /** diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Adapter.php b/vendor/ZF2/library/Zend/Db/Adapter/Adapter.php index a25a6afdc9afae41941a796d2e455c54e4534061..334997d759aeebb1ef2ee1bb2aeaf0cb5409a638 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Adapter.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Adapter.php @@ -68,7 +68,7 @@ class Adapter /** * @param Driver\DriverInterface|array $driver * @param Platform\PlatformInterface $platform - * @param ResultSet\ResultSet $queryResultPrototype + * @param ResultSet\ResultSetInterface $queryResultPrototype */ public function __construct($driver, Platform\PlatformInterface $platform = null, ResultSet\ResultSetInterface $queryResultPrototype = null) { @@ -94,7 +94,7 @@ class Adapter /** * getDriver() * - * @throws Exception + * @throws Exception\RuntimeException * @return Driver\DriverInterface */ public function getDriver() diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php index a5b5a8d97923ad617a9fd16337d60dae55c6bd4d..c99ef8d920821f00c99fc4faa881bd5aaaa4ec68 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php @@ -39,11 +39,13 @@ interface DriverInterface public function getConnection(); /** + * @param string|resource $sqlOrResource * @return StatementInterface */ public function createStatement($sqlOrResource = null); /** + * @param resource $resource * @return ResultInterface */ public function createResult($resource); @@ -54,7 +56,8 @@ interface DriverInterface public function getPrepareType(); /** - * @param $name + * @param string $name + * @param mixed $type * @return string */ public function formatParameterName($name, $type = null); diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php index cd142216ab16aa7834718fa059bae9e7ecc45956..9ec00ffc318c274d67578b89460760f3acd107af 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php @@ -26,7 +26,7 @@ abstract class AbstractFeature protected $driver = null; /** - * @param DriverInterface $pdoDriver + * @param DriverInterface $driver */ public function setDriver(DriverInterface $driver) { diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php index 40104bebec0c66113a8827980080c023e6b4200d..28b4c58e2f3e2543ea3104112e767e5b53573afa 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php @@ -10,6 +10,7 @@ namespace Zend\Db\Adapter\Driver\Mysqli; +use mysqli_stmt; use Zend\Db\Adapter\Driver\DriverInterface; use Zend\Db\Adapter\Exception; @@ -47,8 +48,9 @@ class Mysqli implements DriverInterface * @param array|Connection|\mysqli $connection * @param null|Statement $statementPrototype * @param null|Result $resultPrototype + * @param array $options */ - public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $options = array()) + public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, array $options = array()) { if (!$connection instanceof Connection) { $connection = new Connection($connection); @@ -145,26 +147,35 @@ class Mysqli implements DriverInterface } /** - * @param string $sql + * @param string $sqlOrResource * @return Statement */ public function createStatement($sqlOrResource = null) { + /** + * @todo Resource tracking if (is_resource($sqlOrResource) && !in_array($sqlOrResource, $this->resources, true)) { $this->resources[] = $sqlOrResource; } + */ $statement = clone $this->statementPrototype; - if (is_string($sqlOrResource)) { - $statement->setSql($sqlOrResource); - } elseif ($sqlOrResource instanceof \mysqli_stmt) { + if ($sqlOrResource instanceof mysqli_stmt) { $statement->setResource($sqlOrResource); + } else { + if (is_string($sqlOrResource)) { + $statement->setSql($sqlOrResource); + } + if (!$this->connection->isConnected()) { + $this->connection->connect(); + } + $statement->initialize($this->connection->getResource()); } - $statement->initialize($this->connection->getResource()); return $statement; } /** + * @param resource $resource * @return Result */ public function createResult($resource, $isBuffered = null) @@ -183,7 +194,8 @@ class Mysqli implements DriverInterface } /** - * @param $name + * @param string $name + * @param mixed $type * @return string */ public function formatParameterName($name, $type = null) diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php index 5e4a7f662aa01d2de63711ddce4e5a70a3df3525..60282ec6f0825dee6c0b6333cc2f4434bd89f380 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php @@ -109,10 +109,12 @@ class Statement implements StatementInterface * Set Parameter container * * @param ParameterContainer $parameterContainer + * @return Statement */ public function setParameterContainer(ParameterContainer $parameterContainer) { $this->parameterContainer = $parameterContainer; + return $this; } /** @@ -166,6 +168,7 @@ class Statement implements StatementInterface /** * @param string $sql + * @return Statement */ public function prepare($sql = null) { @@ -185,6 +188,7 @@ class Statement implements StatementInterface } $this->isPrepared = true; + return $this; } /** @@ -236,8 +240,6 @@ class Statement implements StatementInterface /** * Bind parameters from container - * - * @param ParameterContainer $pContainer */ protected function bindParametersFromContainer() { diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php index 055dab5008e6eeb2205ab70a7a3623790782050d..6539ff04fad9530607a8a37264767c4ae10bbd8e 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php @@ -156,9 +156,6 @@ class Connection implements ConnectionInterface */ public function getResource() { - if ($this->resource == null) { - $this->connect(); - } return $this->resource; } @@ -353,7 +350,8 @@ class Connection implements ConnectionInterface /** * Get last generated id * - * @return integer + * @param string $name + * @return integer|null|false */ public function getLastGeneratedValue($name = null) { diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php index 5453490fcb8ca88384416cc6db2389e8361ec576..c6761210bb224526ebf77a7ce03577681a1bfb86 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php @@ -10,6 +10,7 @@ namespace Zend\Db\Adapter\Driver\Pdo; +use PDOStatement; use Zend\Db\Adapter\Driver\DriverInterface; use Zend\Db\Adapter\Driver\Feature\AbstractFeature; use Zend\Db\Adapter\Driver\Feature\DriverFeatureInterface; @@ -51,6 +52,7 @@ class Pdo implements DriverInterface, DriverFeatureInterface * @param array|Connection|\PDO $connection * @param null|Statement $statementPrototype * @param null|Result $resultPrototype + * @param string $features */ public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $features = self::FEATURES_DEFAULT) { @@ -107,8 +109,8 @@ class Pdo implements DriverInterface, DriverFeatureInterface } /** - * @param string|AbstractFeature $nameOrFeature - * @param mixed $value + * @param string $name + * @param AbstractFeature $feature * @return Pdo */ public function addFeature($name, $feature) @@ -193,18 +195,23 @@ class Pdo implements DriverInterface, DriverFeatureInterface } /** - * @param string $sql + * @param string|PDOStatement $sqlOrResource * @return Statement */ public function createStatement($sqlOrResource = null) { $statement = clone $this->statementPrototype; - if (is_string($sqlOrResource)) { - $statement->setSql($sqlOrResource); - } elseif ($sqlOrResource instanceof \PDOStatement) { + if ($sqlOrResource instanceof PDOStatement) { $statement->setResource($sqlOrResource); + } else { + if (is_string($sqlOrResource)) { + $statement->setSql($sqlOrResource); + } + if (!$this->connection->isConnected()) { + $this->connection->connect(); + } + $statement->initialize($this->connection->getResource()); } - $statement->initialize($this->connection->getResource()); return $statement; } diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php index 2bb210cd06e818891a8d0f4e9e95ac19e677445e..170746758743722007b0ce9da582e64af0d5a8ea 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php @@ -75,6 +75,8 @@ class Result implements Iterator, ResultInterface * Initialize * * @param PDOStatement $resource + * @param $generatedValue + * @param int $rowCount * @return Result */ public function initialize(PDOStatement $resource, $generatedValue, $rowCount = null) diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php index e90e9cd26a768edcebc4f83ef8703f9c25ab8b26..08877e898ba0ade643a92b83f80c35d4e633e517 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php @@ -224,8 +224,6 @@ class Statement implements StatementInterface /** * Bind parameters from container - * - * @param ParameterContainer $container */ protected function bindParametersFromContainer() { diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php index 48301578f20f05a16eb741354ea427f95e44362e..cfd93100d7d1c9cbd14e2cad0efb474cf86536c8 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php @@ -10,6 +10,7 @@ namespace Zend\Db\Adapter\Driver\Pgsql; +use mysqli; use Zend\Db\Adapter\Driver\ConnectionInterface; use Zend\Db\Adapter\Exception; @@ -47,13 +48,13 @@ class Connection implements ConnectionInterface /** * Constructor * - * @param mysqli $connectionInfo + * @param mysqli|array|null $connectionInfo */ public function __construct($connectionInfo = null) { if (is_array($connectionInfo)) { $this->setConnectionParameters($connectionInfo); - } elseif ($connectionInfo instanceof \mysqli) { + } elseif ($connectionInfo instanceof mysqli) { $this->setResource($connectionInfo); } } diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php index 939b66c79829283a9529de0cdce6b27c1f99d700..7b74746be9a3fcc7838f3054131b249a8ac68d92 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php @@ -46,6 +46,7 @@ class Pgsql implements DriverInterface * @param array|Connection|resource $connection * @param null|Statement $statementPrototype * @param null|Result $resultPrototype + * @param array $options */ public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $options = null) { @@ -122,7 +123,8 @@ class Pgsql implements DriverInterface } /** - * @return StatementInterface + * @param string|null $sqlOrResource + * @return Statement */ public function createStatement($sqlOrResource = null) { @@ -147,7 +149,7 @@ class Pgsql implements DriverInterface } /** - * @return ResultInterface + * @return Result */ public function createResult($resource) { @@ -165,7 +167,8 @@ class Pgsql implements DriverInterface } /** - * @param $name + * @param string $name + * @param mixed $type * @return string */ public function formatParameterName($name, $type = null) diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php index da9798549a35a0039320a92da5c19f374d3e1cae..8a8f9e95175e5e77904ef2ceb6a7c6b7491725f7 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php @@ -153,7 +153,7 @@ class Statement implements StatementInterface /** * @param null $parameters - * @return ResultInterface + * @return Result */ public function execute($parameters = null) { diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php index 13c5ff55d942bba18ed87a24574849f3cccbdc95..e092f13639463b335415eb19c627a3ef14d22ae7 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php @@ -182,6 +182,7 @@ class Connection implements ConnectionInterface ); } + return $this; } /** @@ -263,6 +264,10 @@ class Connection implements ConnectionInterface $this->connect(); } + if (!$this->driver instanceof Sqlsrv) { + throw new Exception\RuntimeException('Connection is missing an instance of Sqlsrv'); + } + $returnValue = sqlsrv_query($this->resource, $sql); // if the returnValue is something other than a Sqlsrv_result, bypass wrapping it @@ -301,10 +306,14 @@ class Connection implements ConnectionInterface /** * Get last generated id * + * @param string $name * @return mixed */ public function getLastGeneratedValue($name = null) { + if (!$this->resource) { + $this->connect(); + } $sql = 'SELECT @@IDENTITY as Current_Identity'; $result = sqlsrv_query($this->resource, $sql); $row = sqlsrv_fetch_array($result); diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php index 292d27886fdd18795378107de879c42d2edb4828..ccbdaa66ad5184dee47891c7d4ddb35917447e3d 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php @@ -51,6 +51,7 @@ class Result implements \Iterator, ResultInterface * Initialize * * @param resource $resource + * @param mixed $generatedValue * @return Result */ public function initialize($resource, $generatedValue = null) @@ -107,7 +108,7 @@ class Result implements \Iterator, ResultInterface /** * Load * - * @param string $row + * @param int $row * @return mixed */ protected function load($row = SQLSRV_SCROLL_NEXT) @@ -115,7 +116,7 @@ class Result implements \Iterator, ResultInterface $this->currentData = sqlsrv_fetch_array($this->resource, SQLSRV_FETCH_ASSOC, $row); $this->currentComplete = true; $this->position++; - return ($this->currentData); + return $this->currentData; } /** diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php index 73653739623a1064ec919c505fa1eb9dcf10aee2..0b39b7db06425d976142f463cd8e62e04fe6cc6f 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php @@ -69,21 +69,25 @@ class Sqlsrv implements DriverInterface * Register statement prototype * * @param Statement $statementPrototype + * @return Sqlsrv */ public function registerStatementPrototype(Statement $statementPrototype) { $this->statementPrototype = $statementPrototype; $this->statementPrototype->setDriver($this); + return $this; } /** * Register result prototype * * @param Result $resultPrototype + * @return Sqlsrv */ public function registerResultPrototype(Result $resultPrototype) { $this->resultPrototype = $resultPrototype; + return $this; } /** @@ -103,6 +107,7 @@ class Sqlsrv implements DriverInterface /** * Check environment + * @return void */ public function checkEnvironment() { @@ -128,15 +133,18 @@ class Sqlsrv implements DriverInterface $statement = clone $this->statementPrototype; if (is_string($sqlOrResource)) { $statement->setSql($sqlOrResource); - } elseif ($sqlOrResource instanceof \PDOStatement) { + if (!$this->connection->isConnected()) { + $this->connection->connect(); + } + $statement->initialize($this->connection->getResource()); + } elseif (is_resource($sqlOrResource)) { $statement->setResource($sqlOrResource); } - $statement->initialize($this->connection->getResource()); return $statement; } /** - * @param resource $result + * @param resource $resource * @return Result */ public function createResult($resource) @@ -155,7 +163,8 @@ class Sqlsrv implements DriverInterface } /** - * @param $name + * @param string $name + * @param mixed $type * @return string */ public function formatParameterName($name, $type = null) diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php index 0e71c40f654fbb7382b9411b5723ca4f55d632a6..a813f2890a9831ae0ce681714ff90bdb03a52d90 100644 --- a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php +++ b/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php @@ -83,20 +83,29 @@ class Statement implements StatementInterface * (there will need to already be a bound param set if it applies to this query) * * @param resource + * @return Statement */ public function initialize($resource) { + $resourceType = get_resource_type($resource); + if ($resourceType != 'SQL Server Connection' && $resourceType != 'SQL Server Statement') { + throw new Exception\InvalidArgumentException('Invalid resource provided to ' . __CLASS__); + } + $this->sqlsrv = $resource; + return $this; } /** * Set parameter container * * @param ParameterContainer $parameterContainer + * @return Statement */ public function setParameterContainer(ParameterContainer $parameterContainer) { $this->parameterContainer = $parameterContainer; + return $this; } /** @@ -107,6 +116,16 @@ class Statement implements StatementInterface return $this->parameterContainer; } + /** + * @param $resource + * @return Statement + */ + public function setResource($resource) + { + $this->resource = $resource; + return $this; + } + /** * Get resource * @@ -119,10 +138,12 @@ class Statement implements StatementInterface /** * @param string $sql + * @return Statement */ public function setSql($sql) { $this->sql = $sql; + return $this; } /** @@ -137,6 +158,7 @@ class Statement implements StatementInterface /** * @param string $sql + * @return Statement */ public function prepare($sql = null) { @@ -153,6 +175,7 @@ class Statement implements StatementInterface $this->resource = sqlsrv_prepare($this->sqlsrv, $sql, $pRef); $this->isPrepared = true; + return $this; } /** @@ -167,7 +190,7 @@ class Statement implements StatementInterface * Execute * * @param array|ParameterContainer $parameters - * @return type + * @return Result */ public function execute($parameters = null) { diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Display/TextUi.php b/vendor/ZF2/library/Zend/Db/Metadata/Display/TextUi.php deleted file mode 100644 index 428d948520a9ac7a44be5af14b7716fb173fde59..0000000000000000000000000000000000000000 --- a/vendor/ZF2/library/Zend/Db/Metadata/Display/TextUi.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php -/** - * Zend Framework (http://framework.zend.com/) - * - * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @package Zend_Db - */ - -namespace Zend\Db\Metadata\Display; - -/** - * @category Zend - * @package Zend_Db - * @subpackage Metadata - */ -class TextUi -{ - - /** - * - * @var - */ - protected $camelCaseFilter = null; - - /** - * Render - * - * @param \Zend\Db\Metadata\Metadata $metadata - * @return string - */ - public function render(\Zend\Db\Metadata\Metadata $metadata) - { - $output = ''; - $output .= $this->renderTables($metadata->getTables()); - return $output; - } - - /** - * Render tables - * - * @param array $tables - * @return string - */ - public function renderTables(array $tables) - { - $output = ''; - foreach ($tables as $table) { - $output .= $this->renderTable($table); - } - return $output; - } - - /** - * Render table - * - * @param \Zend\Db\Metadata\Table $table - * @return string - */ - public function renderTable(\Zend\Db\Metadata\Table $table) - { - $output = ''; - $output .= 'The \'' . $table->getName() . "' Table\n"; - $output .= $this->renderColumns($table->getColumnCollection()) . "\n"; - $output .= $this->renderConstraints($table->getConstraintCollection()) . "\n\n"; - return $output; - } - - /** - * Render columns - * - * @param \Zend\Db\Metadata\ColumnCollection $columnCollection - * @return string - */ - public function renderColumns(\Zend\Db\Metadata\ColumnCollection $columnCollection) - { - $columnAttributes = array( - array('name', 'Name', 12), - array('ordinalPosition', "Ordinal\nPosition", 10), - array('columnDefault', "Column\nDefault", 8), - array('isNullable', "Is\nNullable", 9), - array('dataType', "Data\nType", 8), - array('characterMaximumLength', "Chr. Max\nLength", 10), - array('characterOctetLength', "Chr. Octet\nLength", 11), - array('numericPrecision', "Num\nPrecision", 10), - array('numericScale', "Num\nScale", 6), - array('characterSetName', "Charset\nName", 8), - array('collationName', "Collation\nName", 12), - ); - - $rows = $rowWidths = array(); - // make header - foreach ($columnAttributes as $cAttrIndex => $cAttrData) { - list($cAttrName, $cAttrDisplayName, $cAttrDefaultLength) = $cAttrData; - $row[$cAttrIndex] = $cAttrDisplayName; - $rowWidths[$cAttrIndex] = $cAttrDefaultLength; // default width - } - - $rows[] = $row; - - foreach ($columnCollection as $columnMetadata) { - $row = array(); - foreach ($columnAttributes as $cAttrIndex => $cAttrData) { - list($cAttrName, $cAttrDisplayName, $cAttrDefaultLength) = $cAttrData; - $value = $columnMetadata->{'get' . $cAttrName}(); - if (strlen($value) > $rowWidths[$cAttrIndex]) { - $rowWidths[$cAttrIndex] = strlen($value); - } - $row[$cAttrIndex] = (string) $value; - } - $rows[] = $row; - } - - $table = new \Zend\Text\Table\Table(array( - 'columnWidths' => $rowWidths, - 'decorator' => 'ascii' - )); - foreach ($rows as $row) { - $table->appendRow($row); - } - - return 'Columns' . PHP_EOL . $table->render(); - } - - /** - * Render constraints - * - * @param \Zend\Db\Metadata\ConstraintCollection $constraints - * @return string - */ - public function renderConstraints(\Zend\Db\Metadata\ConstraintCollection $constraints) - { - $rows = array(); - foreach ($constraints as $constraint) { - $row = array(); - $row[] = $constraint->getName(); - $row[] = $constraint->getType(); - $rows[] = $row; - } - - $table = new \Zend\Text\Table\Table(array( - 'columnWidths' => array(25, 25), - 'decorator' => 'ascii' - )); - foreach ($rows as $row) { - $table->appendRow($row); - } - - return 'Constraints: ' . PHP_EOL . $table->render(); - } - -} diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Metadata.php b/vendor/ZF2/library/Zend/Db/Metadata/Metadata.php index 488f469a7b041c7536d4bbff47126f6555c31e03..1ef4808a41cc8ba2c8571013c1e9fdb14fb404e0 100644 --- a/vendor/ZF2/library/Zend/Db/Metadata/Metadata.php +++ b/vendor/ZF2/library/Zend/Db/Metadata/Metadata.php @@ -71,6 +71,7 @@ class Metadata implements MetadataInterface * Get base tables and views * * @param string $schema + * @param bool $includeViews * @return Object\TableObject[] */ public function getTables($schema = null, $includeViews = false) @@ -93,7 +94,6 @@ class Metadata implements MetadataInterface * Get triggers * * @param string $schema - * @param string $database * @return array */ public function getTriggers($schema = null) @@ -106,7 +106,6 @@ class Metadata implements MetadataInterface * * @param string $table * @param string $schema - * @param string $database * @return array */ public function getConstraints($table, $schema = null) @@ -119,7 +118,6 @@ class Metadata implements MetadataInterface * * @param string $table * @param string $schema - * @param string $database * @return array */ public function getColumns($table, $schema = null) @@ -133,7 +131,6 @@ class Metadata implements MetadataInterface * @param string $constraint * @param string $table * @param string $schema - * @param string $database * @return array */ public function getConstraintKeys($constraint, $table, $schema = null) @@ -147,7 +144,6 @@ class Metadata implements MetadataInterface * @param string $constraintName * @param string $table * @param string $schema - * @param string $database * @return Object\ConstraintObject */ public function getConstraint($constraintName, $table, $schema = null) @@ -167,7 +163,7 @@ class Metadata implements MetadataInterface * Get table names * * @param string $schema - * @param string $database + * @param bool $includeViews * @return array */ public function getTableNames($schema = null, $includeViews = false) @@ -180,7 +176,6 @@ class Metadata implements MetadataInterface * * @param string $tableName * @param string $schema - * @param string $database * @return Object\TableObject */ public function getTable($tableName, $schema = null) diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php b/vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php index e206c65320cb8fa60d8a39c6fdf6577ea1988ba5..607325046a2e18c72ccb7df9e974f816d2778396 100644 --- a/vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php +++ b/vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php @@ -182,7 +182,7 @@ class ColumnObject /** * @param int $ordinalPosition to set - * @return Column + * @return ColumnObject */ public function setOrdinalPosition($ordinalPosition) { @@ -191,7 +191,7 @@ class ColumnObject } /** - * @return the $columnDefault + * @return null|string the $columnDefault */ public function getColumnDefault() { @@ -235,7 +235,7 @@ class ColumnObject } /** - * @return the $dataType + * @return null|string the $dataType */ public function getDataType() { @@ -253,7 +253,7 @@ class ColumnObject } /** - * @return the $characterMaximumLength + * @return int|null the $characterMaximumLength */ public function getCharacterMaximumLength() { @@ -271,7 +271,7 @@ class ColumnObject } /** - * @return the $characterOctetLength + * @return int|null the $characterOctetLength */ public function getCharacterOctetLength() { @@ -351,7 +351,7 @@ class ColumnObject } /** - * @return the $errata + * @return array the $errata */ public function getErratas() { @@ -359,7 +359,8 @@ class ColumnObject } /** - * @return the $errata + * @param array $erratas + * @return ColumnObject */ public function setErratas(array $erratas) { @@ -371,7 +372,7 @@ class ColumnObject /** * @param string $errataName - * @return ColumnMetadata + * @return mixed */ public function getErrata($errataName) { @@ -384,7 +385,7 @@ class ColumnObject /** * @param string $errataName * @param mixed $errataValue - * @return ColumnMetadata + * @return ColumnObject */ public function setErrata($errataName, $errataValue) { diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php b/vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php index 2ec0a0ee6df318c5f8e52ebe317182683b0b2529..53954ac14e1c1c697ec69c7ecc9055ead3ad4355 100644 --- a/vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php +++ b/vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php @@ -102,7 +102,7 @@ class ConstraintObject * Constructor * * @param string $name - * @param string $table + * @param string $tableName * @param string $schemaName */ public function __construct($name, $tableName, $schemaName = null) @@ -177,7 +177,7 @@ class ConstraintObject /** * Set type * - * @param type $constraintType + * @param string $type */ public function setType($type) { diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php b/vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php index f2457e52c5486c7d98691f5fccff702ffc113c34..4c48e47df572857cd59b4426b59677c940272ba9 100644 --- a/vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php +++ b/vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php @@ -67,6 +67,7 @@ abstract class AbstractSource implements MetadataInterface * Get table names * * @param string $schema + * @param bool $includeViews * @return string[] */ public function getTableNames($schema = null, $includeViews = false) @@ -95,6 +96,7 @@ abstract class AbstractSource implements MetadataInterface * Get tables * * @param string $schema + * @param bool $includeViews * @return Object\TableObject[] */ public function getTables($schema = null, $includeViews = false) diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php b/vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php index 8e1aa819e0c35e884d2098c70129a47e90b4d51e..23718f9e7c5f2eb709a3d8d6d4e63352ea36f74a 100644 --- a/vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php +++ b/vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php @@ -47,7 +47,8 @@ class ResultSet extends AbstractResultSet /** * Constructor * - * @param null|ArrayObject $arrayObjectPrototype + * @param string $returnType + * @param null|ArrayObject $arrayObjectPrototype */ public function __construct($returnType = self::TYPE_ARRAYOBJECT, $arrayObjectPrototype = null) { diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php b/vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php index 788570cc11f8f1e2f246ea04893e3c51ba34d021..dcab6e24bebd46a11a1220857a11e5912104f000 100644 --- a/vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php +++ b/vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php @@ -97,8 +97,9 @@ abstract class AbstractRowGateway implements ArrayAccess, Countable, RowGatewayI /** * Populate Data * - * @param array $currentData - * @return RowGateway + * @param array $rowData + * @param bool $rowExistsInDatabase + * @return AbstractRowGateway */ public function populate(array $rowData, $rowExistsInDatabase = false) { @@ -253,7 +254,7 @@ abstract class AbstractRowGateway implements ArrayAccess, Countable, RowGatewayI * Offset unset * * @param string $offset - * @return RowGateway + * @return AbstractRowGateway */ public function offsetUnset($offset) { diff --git a/vendor/ZF2/library/Zend/Db/Sql/Delete.php b/vendor/ZF2/library/Zend/Db/Sql/Delete.php index 3a7683b1371d4620ff8bb3adf7c97a82d7a68277..abf4bcba2fb3ae06f70b9f6e207a1baeffcd52f3 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Delete.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Delete.php @@ -64,7 +64,6 @@ class Delete extends AbstractSql implements SqlInterface, PreparableSqlInterface * Constructor * * @param null|string $table - * @param null|string $schema */ public function __construct($table = null) { @@ -78,7 +77,6 @@ class Delete extends AbstractSql implements SqlInterface, PreparableSqlInterface * Create from statement * * @param string $table - * @param null|string $schema * @return Delete */ public function from($table) @@ -112,16 +110,39 @@ class Delete extends AbstractSql implements SqlInterface, PreparableSqlInterface } elseif ($predicate instanceof \Closure) { $predicate($this->where); } else { + if (is_string($predicate)) { + // String $predicate should be passed as an expression $predicate = new Predicate\Expression($predicate); $this->where->addPredicate($predicate, $combination); } elseif (is_array($predicate)) { + foreach ($predicate as $pkey => $pvalue) { + // loop through predicates + if (is_string($pkey) && strpos($pkey, '?') !== false) { + // First, process strings that the abstraction replacement character ? + // as an Expression predicate $predicate = new Predicate\Expression($pkey, $pvalue); + } elseif (is_string($pkey)) { - $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + // Otherwise, if still a string, do something intelligent with the PHP type provided + + if (is_null($pvalue)) { + // map PHP null to SQL IS NULL expression + $predicate = new Predicate\IsNull($pkey, $pvalue); + } elseif (is_array($pvalue)) { + // if the value is an array, assume IN() is desired + $predicate = new Predicate\In($pkey, $pvalue); + } else { + // otherwise assume that array('foo' => 'bar') means "foo" = 'bar' + $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + } + } elseif ($pvalue instanceof Predicate\PredicateInterface) { + // Predicate type is ok + $predicate = $pvalue; } else { + // must be an array of expressions (with int-indexed array) $predicate = new Predicate\Expression($pvalue); } $this->where->addPredicate($predicate, $combination); diff --git a/vendor/ZF2/library/Zend/Db/Sql/Insert.php b/vendor/ZF2/library/Zend/Db/Sql/Insert.php index d64f1aa0837ce7f4ee62d09e6c676ea4b0acb1e9..e308956ccdbdfa574009b636b23df3108c1f5b89 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Insert.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Insert.php @@ -55,7 +55,6 @@ class Insert extends AbstractSql implements SqlInterface, PreparableSqlInterface * Constructor * * @param null|string $table - * @param null|string $schema */ public function __construct($table = null) { @@ -68,7 +67,6 @@ class Insert extends AbstractSql implements SqlInterface, PreparableSqlInterface * Crete INTO clause * * @param string $table - * @param null|string $databaseOrSchema * @return Insert */ public function into($table) @@ -195,6 +193,8 @@ class Insert extends AbstractSql implements SqlInterface, PreparableSqlInterface if ($value instanceof Expression) { $exprData = $this->processExpression($value, $adapterPlatform); $values[] = $exprData->getSql(); + } elseif (is_null($value)) { + $values[] = 'NULL'; } else { $values[] = $adapterPlatform->quoteValue($value); } diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php index 5056681b0b05197081899fb5f3147a6ef0a5e554..89e7da9ed32dc7b93384148326eb8673f881acc9 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php @@ -26,8 +26,8 @@ class Between implements PredicateInterface * Constructor * * @param string $identifier - * @param string $minValue - * @param string $maxValue + * @param int|float|string $minValue + * @param int|float|string $maxValue */ public function __construct($identifier = null, $minValue = null, $maxValue = null) { diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php index 0acf0ffa04143fa5d983cfccb07844b0c3fd060c..89c9d094a6a1ca0eec5ec973bed3c2fccb8fd9b2 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php @@ -24,7 +24,7 @@ class Expression extends BaseExpression implements PredicateInterface * Constructor * * @param string $expression - * @param mixed $valueParameter + * @param int|float|bool|string|array $valueParameter */ public function __construct($expression = null, $valueParameter = null /*[, $valueParameter, ... ]*/) { diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php index 99dd200bc8b072aefc632a307b71d911c1ffa52c..dc02399b2637b6b5c41055438e47815d737c0fb9 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php @@ -49,11 +49,11 @@ class Operator implements PredicateInterface /** * Constructor * - * @param mixed $left + * @param int|float|bool|string $left * @param string $operator - * @param mixed $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} */ public function __construct($left = null, $operator = self::OPERATOR_EQUAL_TO, $right = null, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) { @@ -81,7 +81,7 @@ class Operator implements PredicateInterface /** * Set left side of operator * - * @param scalar $left + * @param int|float|bool|string $left * @return Operator */ public function setLeft($left) @@ -93,7 +93,7 @@ class Operator implements PredicateInterface /** * Get left side of operator * - * @return scalar + * @return int|float|bool|string */ public function getLeft() { @@ -103,7 +103,7 @@ class Operator implements PredicateInterface /** * Set parameter type for left side of operator * - * @param TYPE_IDENTIFIER|TYPE_VALUE $type + * @param string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes} * @return Operator */ public function setLeftType($type) @@ -155,7 +155,7 @@ class Operator implements PredicateInterface /** * Set right side of operator * - * @param scalar $value + * @param int|float|bool|string $value * @return Operator */ public function setRight($value) @@ -167,7 +167,7 @@ class Operator implements PredicateInterface /** * Get right side of operator * - * @return scalar + * @return int|float|bool|string */ public function getRight() { @@ -177,7 +177,7 @@ class Operator implements PredicateInterface /** * Set parameter type for right side of operator * - * @param TYPE_IDENTIFIER|TYPE_VALUE $type + * @param string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes} * @return Operator */ public function setRightType($type) diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php index 01ef34d18a8099b2cc51b863c7f9e830f6c4ce2f..38bf27dfbf184eacacc4bc399813cabee8b4fcb8 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php @@ -29,7 +29,7 @@ class Predicate extends PredicateSet /** * Begin nesting predicates * - * @return PredicateSet + * @return Predicate */ public function nest() { @@ -72,10 +72,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function equalTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -94,10 +94,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function notEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -116,10 +116,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function lessThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -138,10 +138,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function greaterThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -160,10 +160,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function lessThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -182,10 +182,10 @@ class Predicate extends PredicateSet * * Utilizes Operator predicate * - * @param scalar $left - * @param scalar $right - * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType - * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType + * @param int|float|bool|string $left + * @param int|float|bool|string $right + * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes} + * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes} * @return Predicate */ public function greaterThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE) @@ -225,7 +225,7 @@ class Predicate extends PredicateSet * Utilizes Like predicate * * @param string $literal - * @param scalar|array $parameter + * @param int|float|bool|string|array $parameter * @return Predicate */ public function literal($literal, $parameter) @@ -303,8 +303,8 @@ class Predicate extends PredicateSet * Utilizes Between predicate * * @param string $identifier - * @param scalar $minValue - * @param scalar $maxValue + * @param int|float|string $minValue + * @param int|float|string $maxValue * @return Predicate */ public function between($identifier, $minValue, $maxValue) diff --git a/vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php b/vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php index 8adf2ce5034e612a1f9a9cae3057a256a98caaf8..892f776f60c6f4d841d098816fa0498006a7f98b 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php +++ b/vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php @@ -22,9 +22,9 @@ interface PreparableSqlInterface { /** - * @abstract * @param Adapter $adapter - * @return StatementContainerInterface + * @param StatementContainerInterface + * @return void */ public function prepareStatement(Adapter $adapter, StatementContainerInterface $statementContainer); } diff --git a/vendor/ZF2/library/Zend/Db/Sql/Select.php b/vendor/ZF2/library/Zend/Db/Sql/Select.php index aae0a5cdde7851df6c1aa8484a00169d33f17ab0..e9fff972a369b6f6aa2673b052e1d31d6d872fdf 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Select.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Select.php @@ -154,7 +154,6 @@ class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface * Create from clause * * @param string|array|TableIdentifier $table - * @param null|string $schema * @return Select */ public function from($table) @@ -190,6 +189,7 @@ class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface * value can be string or Expression objects * * @param array $columns + * @param bool $prefixColumnsWithTable * @return Select */ public function columns(array $columns, $prefixColumnsWithTable = true) @@ -240,15 +240,37 @@ class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface $predicate($this->where); } else { if (is_string($predicate)) { + // String $predicate should be passed as an expression $predicate = new Predicate\Expression($predicate); $this->where->addPredicate($predicate, $combination); } elseif (is_array($predicate)) { + foreach ($predicate as $pkey => $pvalue) { + // loop through predicates + if (is_string($pkey) && strpos($pkey, '?') !== false) { + // First, process strings that the abstraction replacement character ? + // as an Expression predicate $predicate = new Predicate\Expression($pkey, $pvalue); + } elseif (is_string($pkey)) { - $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + // Otherwise, if still a string, do something intelligent with the PHP type provided + + if (is_null($pvalue)) { + // map PHP null to SQL IS NULL expression + $predicate = new Predicate\IsNull($pkey, $pvalue); + } elseif (is_array($pvalue)) { + // if the value is an array, assume IN() is desired + $predicate = new Predicate\In($pkey, $pvalue); + } else { + // otherwise assume that array('foo' => 'bar') means "foo" = 'bar' + $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + } + } elseif ($pvalue instanceof Predicate\PredicateInterface) { + // Predicate type is ok + $predicate = $pvalue; } else { + // must be an array of expressions (with int-indexed array) $predicate = new Predicate\Expression($pvalue); } $this->where->addPredicate($predicate, $combination); diff --git a/vendor/ZF2/library/Zend/Db/Sql/Update.php b/vendor/ZF2/library/Zend/Db/Sql/Update.php index 14dd319a2b20afd0fa14de1321e34d760583ba2b..240e48b361ee5f71dbd1aa7f4c3a63d2c232512d 100644 --- a/vendor/ZF2/library/Zend/Db/Sql/Update.php +++ b/vendor/ZF2/library/Zend/Db/Sql/Update.php @@ -64,7 +64,6 @@ class Update extends AbstractSql implements SqlInterface, PreparableSqlInterface * Constructor * * @param null|string $table - * @param null|string $schema */ public function __construct($table = null) { @@ -78,7 +77,6 @@ class Update extends AbstractSql implements SqlInterface, PreparableSqlInterface * Specify table for statement * * @param string $table - * @param null|string $schema * @return Update */ public function table($table) @@ -133,15 +131,37 @@ class Update extends AbstractSql implements SqlInterface, PreparableSqlInterface $predicate($this->where); } else { if (is_string($predicate)) { + // String $predicate should be passed as an expression $predicate = new Predicate\Expression($predicate); $this->where->addPredicate($predicate, $combination); } elseif (is_array($predicate)) { + foreach ($predicate as $pkey => $pvalue) { + // loop through predicates + if (is_string($pkey) && strpos($pkey, '?') !== false) { + // First, process strings that the abstraction replacement character ? + // as an Expression predicate $predicate = new Predicate\Expression($pkey, $pvalue); + } elseif (is_string($pkey)) { - $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + // Otherwise, if still a string, do something intelligent with the PHP type provided + + if (is_null($pvalue)) { + // map PHP null to SQL IS NULL expression + $predicate = new Predicate\IsNull($pkey, $pvalue); + } elseif (is_array($pvalue)) { + // if the value is an array, assume IN() is desired + $predicate = new Predicate\In($pkey, $pvalue); + } else { + // otherwise assume that array('foo' => 'bar') means "foo" = 'bar' + $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue); + } + } elseif ($pvalue instanceof Predicate\PredicateInterface) { + // Predicate type is ok + $predicate = $pvalue; } else { + // must be an array of expressions (with int-indexed array) $predicate = new Predicate\Expression($pvalue); } $this->where->addPredicate($predicate, $combination); @@ -227,6 +247,8 @@ class Update extends AbstractSql implements SqlInterface, PreparableSqlInterface if ($value instanceof Expression) { $exprData = $this->processExpression($value, $adapterPlatform); $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $exprData->getSql(); + } elseif (is_null($value)) { + $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = NULL'; } else { $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $adapterPlatform->quoteValue($value); } diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php b/vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php index 95fe6ea8f9b7883283bb0b6347d2d1009784a71f..0fa99c10961c0afd7158b33d91cdf849ebf9617e 100644 --- a/vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php +++ b/vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php @@ -447,7 +447,8 @@ abstract class AbstractTableGateway implements TableGatewayInterface } /** - * @param $property + * @param string $property + * @param mixed $value * @return mixed * @throws Exception\InvalidArgumentException */ diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php index e1783a6e09fb0771106ee2f87f46216aea834247..d56cf13dfca1f663d290dd9897ae29e0e23ff1cf 100644 --- a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php +++ b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php @@ -12,7 +12,7 @@ namespace Zend\Db\TableGateway\Feature; use Zend\Db\Adapter\Driver\ResultInterface; use Zend\Db\Adapter\Driver\StatementInterface; -use Zend\Db\ResultSet\ResultSet; +use Zend\Db\ResultSet\ResultSetInterface; use Zend\Db\Sql\Delete; use Zend\Db\Sql\Insert; use Zend\Db\Sql\Select; diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php index ba17eda811b2fff1b2115a6f3904bfa1ebd00678..d6dacbe0e855680102bb3265898473960744ee35 100644 --- a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php +++ b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php @@ -33,7 +33,7 @@ class TableGatewayEvent implements EventInterface protected $name = null; /** - * @var array + * @var array|\ArrayAccess */ protected $params = array(); @@ -60,7 +60,7 @@ class TableGatewayEvent implements EventInterface /** * Get parameters passed to the event * - * @return array|ArrayAccess + * @return array|\ArrayAccess */ public function getParams() { @@ -132,7 +132,7 @@ class TableGatewayEvent implements EventInterface */ public function stopPropagation($flag = true) { - return false; + return; } /** diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php index 5da053f177e643038af3e2ddee44b320c3ef427c..7107ec249d1ac075770968ec964d1d4a5d6d8b57 100644 --- a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php +++ b/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php @@ -30,7 +30,7 @@ class MetadataFeature extends AbstractFeature /** * Constructor * - * @param Adapter $slaveAdapter + * @param MetadataInterface $metadata */ public function __construct(MetadataInterface $metadata = null) { diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php b/vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php index eee3e539296eb5df0384fb20cddc0db8a11cdd1c..0716ee1596fd523ac520b7f11d034ae68093b0be 100644 --- a/vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php +++ b/vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php @@ -30,8 +30,8 @@ class TableGateway extends AbstractTableGateway * @param string $table * @param Adapter $adapter * @param Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features - * @param ResultSetInterface $selectResultPrototype - * @param Sql $selectResultPrototype + * @param ResultSetInterface $resultSetPrototype + * @param Sql $sql */ public function __construct($table, Adapter $adapter, $features = null, ResultSetInterface $resultSetPrototype = null, Sql $sql = null) { diff --git a/vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php b/vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php index 5c7689482df07b93f1bbfeb897d7fbcd64b3cd73..1961b9e0d66d2b37ac7902bdeda35276c9b7b035 100644 --- a/vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php +++ b/vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php @@ -10,12 +10,14 @@ namespace Zend\File\Transfer\Adapter; +use ErrorException; use Zend\File\Transfer; use Zend\File\Transfer\Exception; use Zend\Filter; use Zend\Filter\Exception as FilterException; use Zend\I18n\Translator\Translator; use Zend\I18n\Translator\TranslatorAwareInterface; +use Zend\Stdlib\ErrorHandler; use Zend\Validator; /** @@ -1161,14 +1163,21 @@ abstract class AbstractAdapter implements TranslatorAwareInterface protected function detectFileSize($value) { if (file_exists($value['name'])) { - $result = sprintf("%u", @filesize($value['name'])); + $filename = $value['name']; } elseif (file_exists($value['tmp_name'])) { - $result = sprintf("%u", @filesize($value['tmp_name'])); + $filename = $value['tmp_name']; } else { return null; } - return $result; + ErrorHandler::start(); + $filesize = filesize($filename); + $return = ErrorHandler::stop(); + if ($return instanceof ErrorException) { + $filesize = 0; + } + + return sprintf("%u", $filesize); } /** @@ -1219,11 +1228,15 @@ abstract class AbstractAdapter implements TranslatorAwareInterface if (class_exists('finfo', false)) { $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; if (!empty($value['options']['magicFile'])) { - $mime = @finfo_open($const, $value['options']['magicFile']); + ErrorHandler::start(); + $mime = finfo_open($const, $value['options']['magicFile']); + ErrorHandler::stop(); } if (empty($mime)) { - $mime = @finfo_open($const); + ErrorHandler::start(); + $mime = finfo_open($const); + ErrorHandler::stop(); } if (!empty($mime)) { @@ -1357,13 +1370,17 @@ abstract class AbstractAdapter implements TranslatorAwareInterface $tempFile = rtrim($path, "/\\"); $tempFile .= '/' . 'test.1'; - $result = @file_put_contents($tempFile, 'TEST'); + ErrorHandler::start(); + $result = file_put_contents($tempFile, 'TEST'); + ErrorHandler::stop(); if ($result == false) { return false; } - $result = @unlink($tempFile); + ErrorHandler::start(); + $result = unlink($tempFile); + ErrorHandler::stop(); if ($result == false) { return false; diff --git a/vendor/ZF2/library/Zend/File/composer.json b/vendor/ZF2/library/Zend/File/composer.json index 8365dc5128295ac1b28f7a3d6da93a91b3c4aa9e..e8c1a7d53239a343a08db124fb1fa2455f97daf0 100644 --- a/vendor/ZF2/library/Zend/File/composer.json +++ b/vendor/ZF2/library/Zend/File/composer.json @@ -13,7 +13,8 @@ }, "target-dir": "Zend/File", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" }, "suggest": { "zendframework/zend-filter": "Zend\\Filter component", @@ -21,4 +22,4 @@ "zendframework/zend-i18n": "Zend\\I18n component", "zendframework/zend-validator": "Zend\\Validator component" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Filter/AbstractFilter.php b/vendor/ZF2/library/Zend/Filter/AbstractFilter.php index 808635e33fb19e12a9b8f8b53bc6f1c75ab4bf90..9aece4810dcc2e50355acb6da297a85c58f150d4 100644 --- a/vendor/ZF2/library/Zend/Filter/AbstractFilter.php +++ b/vendor/ZF2/library/Zend/Filter/AbstractFilter.php @@ -12,6 +12,7 @@ namespace Zend\Filter; use Traversable; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; /** * @category Zend @@ -39,11 +40,12 @@ abstract class AbstractFilter implements FilterInterface public static function hasPcreUnicodeSupport() { if (static::$hasPcreUnicodeSupport === null) { - if (defined('PREG_BAD_UTF8_OFFSET_ERROR') || @preg_match('/\pL/u', 'a') == 1) { + static::$hasPcreUnicodeSupport = false; + ErrorHandler::start(); + if (defined('PREG_BAD_UTF8_OFFSET_ERROR') || preg_match('/\pL/u', 'a') == 1) { static::$hasPcreUnicodeSupport = true; - } else { - static::$hasPcreUnicodeSupport = false; } + ErrorHandler::stop(); } return static::$hasPcreUnicodeSupport; } diff --git a/vendor/ZF2/library/Zend/Filter/RealPath.php b/vendor/ZF2/library/Zend/Filter/RealPath.php index b6f9bc67bb325e5e602424cff28f51d1a852faa6..4dc78bd98dcfacd09f2d9216e8b536ac857943f2 100644 --- a/vendor/ZF2/library/Zend/Filter/RealPath.php +++ b/vendor/ZF2/library/Zend/Filter/RealPath.php @@ -10,6 +10,8 @@ namespace Zend\Filter; +use Zend\Stdlib\ErrorHandler; + /** * @category Zend * @package Zend_Filter @@ -78,7 +80,9 @@ class RealPath extends AbstractFilter return realpath($path); } - $realpath = @realpath($path); + ErrorHandler::start(); + $realpath = realpath($path); + ErrorHandler::stop(); if ($realpath) { return $realpath; } diff --git a/vendor/ZF2/library/Zend/Form/Element/Checkbox.php b/vendor/ZF2/library/Zend/Form/Element/Checkbox.php index 36f8642a3e76dbdf5daf90a54dbc23f62f960d5f..795173800a50567449786b55657ee2c9f274005c 100644 --- a/vendor/ZF2/library/Zend/Form/Element/Checkbox.php +++ b/vendor/ZF2/library/Zend/Form/Element/Checkbox.php @@ -195,4 +195,42 @@ class Checkbox extends Element implements InputProviderInterface return $spec; } + + /** + * Checks if this checkbox is checked. + * + * @return bool + */ + public function isChecked() + { + return (bool)$this->value; + } + + /** + * Checks or unchecks the checkbox. + * + * @param bool $value The flag to set. + * @return Checkbox + */ + public function setChecked($value) + { + $this->value = (bool)$value; + return $this; + } + + /** + * Checks or unchecks the checkbox. + * + * @param mixed $value A boolean flag or string that is checked against the "checked value". + * @return Element + */ + public function setValue($value) + { + if (is_bool($value)) { + $this->value = $value; + } else { + $this->value = $value === $this->getCheckedValue(); + } + return $this; + } } diff --git a/vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php b/vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php index e3343b35ea4a2cd38775ed09f0972e018962007d..bb148965769ce6fe7deaa58a8c19f5babe868400 100644 --- a/vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php +++ b/vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php @@ -69,4 +69,16 @@ class MultiCheckbox extends Checkbox } return $values; } + + /** + * Sets the value that should be selected. + * + * @param mixed $value The value to set. + * @return Element + */ + public function setValue($value) + { + $this->value = $value; + return $this; + } } diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php b/vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php index 43b8afdbbf9d731cbda781143276d0c416290543..100a91361021aaceb3142a64f0dd81180de21d4d 100644 --- a/vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php +++ b/vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php @@ -116,19 +116,22 @@ class FormButton extends FormInput public function render(ElementInterface $element, $buttonContent = null) { $openTag = $this->openTag($element); - $content = false; + if (null === $buttonContent) { - $content = $element->getAttribute('label'); - if (null === $content) { + $buttonContent = $element->getLabel(); + if (null === $buttonContent) { throw new Exception\DomainException(sprintf( - '%s expects either button content as the second argument, or that the element provided has a label attribute; neither found', + '%s expects either button content as the second argument, ' . + 'or that the element provided has a label value; neither found', __METHOD__ )); } - } - if ($content && null === $buttonContent) { - $buttonContent = $content; + if (null !== ($translator = $this->getTranslator())) { + $buttonContent = $translator->translate( + $buttonContent, $this->getTranslatorTextDomain() + ); + } } $escape = $this->getEscapeHtmlHelper(); diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php b/vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php index 976ae860c038d7aa9d298618caf354a1fb647e81..26b9d0795bc0cf022c9a4049511d725c0e88f78c 100644 --- a/vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php +++ b/vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php @@ -31,7 +31,7 @@ class FormCheckbox extends FormInput */ public function render(ElementInterface $element) { - if (! $element instanceof CheckboxElement) { + if (!$element instanceof CheckboxElement) { throw new Exception\InvalidArgumentException(sprintf( '%s requires that the element is of type Zend\Form\Element\Checkbox', __METHOD__ @@ -46,32 +46,26 @@ class FormCheckbox extends FormInput )); } - $checkedValue = $element->getCheckedValue(); - $uncheckedValue = $element->getUncheckedValue(); - $useHiddenElement = $element->useHiddenElement(); - $attributes = $element->getAttributes(); $attributes['name'] = $name; - $attributes['checked'] = ''; $attributes['type'] = $this->getInputType(); + $attributes['value'] = $element->getCheckedValue(); $closingBracket = $this->getInlineClosingBracket(); - $value = $element->getValue(); - if ($value === $checkedValue) { + if ($element->isChecked()) { $attributes['checked'] = 'checked'; } - $attributes['value'] = $checkedValue; - + $rendered = sprintf( '<input %s%s', $this->createAttributesString($attributes), $closingBracket ); - if ($useHiddenElement) { + if ($element->useHiddenElement()) { $hiddenAttributes = array( 'name' => $attributes['name'], - 'value' => $uncheckedValue + 'value' => $element->getUncheckedValue(), ); $rendered = sprintf( diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php b/vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php index 3597f22ee50abb3d14b3af3a8f9a3d66b0644a9a..ef7a462a86e38b4bd386b4430b987e5f17c440e0 100644 --- a/vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php +++ b/vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php @@ -38,6 +38,11 @@ class FormElement extends BaseAbstractHelper return ''; } + if ($element instanceof Element\Button) { + $helper = $renderer->plugin('form_button'); + return $helper($element); + } + if ($element instanceof Element\Captcha) { $helper = $renderer->plugin('form_captcha'); return $helper($element); diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php b/vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php index 0c293b57d125a4489243ab613d8a1504a0a44487..08975cfce3d4c6f23245c9380ee188241f8250b4 100644 --- a/vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php +++ b/vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php @@ -297,7 +297,7 @@ class FormMultiCheckbox extends FormInput $inputAttributes = array_merge($inputAttributes, $optionSpec['attributes']); } - if (in_array($value, $selectedOptions, true)) { + if (in_array($value, $selectedOptions)) { $selected = true; } diff --git a/vendor/ZF2/library/Zend/Http/Client.php b/vendor/ZF2/library/Zend/Http/Client.php index 41bee79f69353a99f09b00dde0f943cdf2618ae2..1881aa089dcda73b5766a8863c001ca6b4be01d4 100644 --- a/vendor/ZF2/library/Zend/Http/Client.php +++ b/vendor/ZF2/library/Zend/Http/Client.php @@ -14,6 +14,7 @@ use ArrayIterator; use Traversable; use Zend\Stdlib; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; use Zend\Uri\Http; /** @@ -598,11 +599,14 @@ class Client implements Stdlib\DispatchableInterface ); } - if (false === ($fp = @fopen($this->streamName, "w+b"))) { + ErrorHandler::start(); + $fp = fopen($this->streamName, "w+b"); + $error = ErrorHandler::stop(); + if (false === $fp) { if ($this->adapter instanceof Client\Adapter\AdapterInterface) { $this->adapter->close(); } - throw new Exception\RuntimeException("Could not open temp file {$this->streamName}"); + throw new Exception\RuntimeException("Could not open temp file {$this->streamName}", 0, $error); } return $fp; @@ -926,8 +930,11 @@ class Client implements Stdlib\DispatchableInterface public function setFileUpload($filename, $formname, $data = null, $ctype = null) { if ($data === null) { - if (($data = @file_get_contents($filename)) === false) { - throw new Exception\RuntimeException("Unable to read file '{$filename}' for upload"); + ErrorHandler::start(); + $data = file_get_contents($filename); + $error = ErrorHandler::stop(); + if ($data === false) { + throw new Exception\RuntimeException("Unable to read file '{$filename}' for upload", 0, $error); } if (!$ctype) { $ctype = $this->detectFileMimeType($filename); @@ -1156,7 +1163,9 @@ class Client implements Stdlib\DispatchableInterface // First try with fileinfo functions if (function_exists('finfo_open')) { if (self::$fileInfoDb === null) { - self::$fileInfoDb = @finfo_open(FILEINFO_MIME); + ErrorHandler::start(); + self::$fileInfoDb = finfo_open(FILEINFO_MIME); + ErrorHandler::stop(); } if (self::$fileInfoDb) { diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php b/vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php index 753285395c86993da3ade12e13b514d519da680a..de82c642fe6efdd9f4cfcc1abc969d3c73f09ec0 100644 --- a/vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php +++ b/vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php @@ -12,6 +12,8 @@ namespace Zend\Http\Client\Adapter; use Zend\Http\Client; use Zend\Http\Client\Adapter\Exception as AdapterException; +use Zend\Http\Response; +use Zend\Stdlib\ErrorHandler; /** * HTTP Proxy-supporting Zend_Http_Client adapter class, based on the default @@ -38,6 +40,7 @@ class Proxy extends Socket 'sslcert' => null, 'sslpassphrase' => null, 'sslverifypeer' => true, + 'sslcapath' => null, 'sslallowselfsigned' => false, 'sslusecontext' => false, 'proxy_host' => '', @@ -153,8 +156,11 @@ class Proxy extends Socket } // Send the request - if (! @fwrite($this->socket, $request)) { - throw new AdapterException\RuntimeException("Error writing request to proxy server"); + ErrorHandler::start(); + $test = fwrite($this->socket, $request); + $error = ErrorHandler::stop(); + if (!$test) { + throw new AdapterException\RuntimeException("Error writing request to proxy server", 0, $error); } if (is_resource($body)) { @@ -194,23 +200,28 @@ class Proxy extends Socket $request .= "\r\n"; // Send the request - if (! @fwrite($this->socket, $request)) { - throw new AdapterException\RuntimeException("Error writing request to proxy server"); + ErrorHandler::start(); + $test = fwrite($this->socket, $request); + $error = ErrorHandler::stop(); + if (!$test) { + throw new AdapterException\RuntimeException("Error writing request to proxy server", 0, $error); } // Read response headers only $response = ''; $gotStatus = false; - while ($line = @fgets($this->socket)) { + ErrorHandler::start(); + while ($line = fgets($this->socket)) { $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false); if ($gotStatus) { $response .= $line; if (!rtrim($line)) break; } } + ErrorHandler::stop(); // Check that the response from the proxy is 200 - if (\Zend\Http\Response::extractCode($response) != 200) { + if (Response::extractCode($response) != 200) { throw new AdapterException\RuntimeException("Unable to connect to HTTPS proxy. Server response: " . $response); } diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php b/vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php index d925b335702ddda33b1d2aa215171cee98a77648..20d9d37de6d677af802844c4be72073edaf1acc5 100644 --- a/vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php +++ b/vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php @@ -15,6 +15,7 @@ use Zend\Http\Client\Adapter\AdapterInterface as HttpAdapter; use Zend\Http\Client\Adapter\Exception as AdapterException; use Zend\Http\Response; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; /** * A sockets based (stream\socket\client) adapter class for Zend\Http\Client. Can be used @@ -26,6 +27,18 @@ use Zend\Stdlib\ArrayUtils; */ class Socket implements HttpAdapter, StreamInterface { + /** + * Map SSL transport wrappers to stream crypto method constants + * + * @var array + */ + protected static $sslCryptoTypes = array( + 'ssl' => STREAM_CRYPTO_METHOD_SSLv23_CLIENT, + 'sslv2' => STREAM_CRYPTO_METHOD_SSLv2_CLIENT, + 'sslv3' => STREAM_CRYPTO_METHOD_SSLv3_CLIENT, + 'tls' => STREAM_CRYPTO_METHOD_TLS_CLIENT + ); + /** * The socket for server connection * @@ -58,6 +71,7 @@ class Socket implements HttpAdapter, StreamInterface 'sslcert' => null, 'sslpassphrase' => null, 'sslverifypeer' => true, + 'sslcapath' => null, 'sslallowselfsigned' => false, 'sslusecontext' => false ); @@ -172,67 +186,125 @@ class Socket implements HttpAdapter, StreamInterface */ public function connect($host, $port = 80, $secure = false) { - // If the URI should be accessed via SSL, prepend the Hostname with ssl:// - $host = ($secure ? $this->config['ssltransport'] : 'tcp') . '://' . $host; - // If we are connected to the wrong host, disconnect first if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) { - if (is_resource($this->socket)) $this->close(); + if (is_resource($this->socket)) { + $this->close(); + } } // Now, if we are not connected, connect - if (! is_resource($this->socket) || ! $this->config['keepalive']) { + if (!is_resource($this->socket) || ! $this->config['keepalive']) { $context = $this->getStreamContext(); + if ($secure || $this->config['sslusecontext']) { if ($this->config['sslverifypeer'] !== null) { - if (! stream_context_set_option($context, 'ssl', 'verify_peer', - $this->config['sslverifypeer'])) { + if (!stream_context_set_option($context, 'ssl', 'verify_peer', $this->config['sslverifypeer'])) { throw new AdapterException\RuntimeException('Unable to set sslverifypeer option'); } - if ($this->config['sslallowselfsigned'] !== null) { - if (! stream_context_set_option($context, 'ssl', 'allow_self_signed', - $this->config['sslallowselfsigned'])) { - throw new AdapterException\RuntimeException('Unable to set sslallowselfsigned option'); - } + } + + if ($this->config['sslcapath']) { + if (!stream_context_set_option($context, 'ssl', 'capath', $this->config['sslcapath'])) { + throw new AdapterException\RuntimeException('Unable to set sslcapath option'); + } + } + + if ($this->config['sslallowselfsigned'] !== null) { + if (!stream_context_set_option($context, 'ssl', 'allow_self_signed', $this->config['sslallowselfsigned'])) { + throw new AdapterException\RuntimeException('Unable to set sslallowselfsigned option'); } } + if ($this->config['sslcert'] !== null) { - if (! stream_context_set_option($context, 'ssl', 'local_cert', - $this->config['sslcert'])) { + if (!stream_context_set_option($context, 'ssl', 'local_cert', $this->config['sslcert'])) { throw new AdapterException\RuntimeException('Unable to set sslcert option'); } } + if ($this->config['sslpassphrase'] !== null) { - if (! stream_context_set_option($context, 'ssl', 'passphrase', - $this->config['sslpassphrase'])) { + if (!stream_context_set_option($context, 'ssl', 'passphrase', $this->config['sslpassphrase'])) { throw new AdapterException\RuntimeException('Unable to set sslpassphrase option'); } } } $flags = STREAM_CLIENT_CONNECT; - if ($this->config['persistent']) $flags |= STREAM_CLIENT_PERSISTENT; - - $errno = null; - $errstr = ''; - $this->socket = @stream_socket_client($host . ':' . $port, - $errno, - $errstr, - (int) $this->config['timeout'], - $flags, - $context); - - if (! $this->socket) { + if ($this->config['persistent']) { + $flags |= STREAM_CLIENT_PERSISTENT; + } + + ErrorHandler::start(); + $this->socket = stream_socket_client( + $host . ':' . $port, + $errno, + $errstr, + (int) $this->config['timeout'], + $flags, + $context + ); + $error = ErrorHandler::stop(); + + if (!$this->socket) { $this->close(); throw new AdapterException\RuntimeException( - 'Unable to Connect to ' . $host . ':' . $port . '. Error #' . $errno . ': ' . $errstr); + sprintf( + 'Unable to connect to %s:%d%s', + $host, + $port, + ($error ? '. Error #' . $error->getCode() . ': ' . $error->getMessage() : '') + ), + 0, + $error + ); } // Set the stream timeout - if (! stream_set_timeout($this->socket, (int) $this->config['timeout'])) { + if (!stream_set_timeout($this->socket, (int) $this->config['timeout'])) { throw new AdapterException\RuntimeException('Unable to set the connection timeout'); } + if ($secure || $this->config['sslusecontext']) { + if ($this->config['ssltransport'] && isset(self::$sslCryptoTypes[$this->config['ssltransport']])) { + $sslCryptoMethod = self::$sslCryptoTypes[$this->config['ssltransport']]; + } else { + $sslCryptoMethod = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; + } + + ErrorHandler::start(); + $test = stream_socket_enable_crypto($this->socket, true, $sslCryptoMethod); + $error = ErrorHandler::stop(); + if (!$test || $error) { + // Error handling is kind of difficult when it comes to SSL + $errorString = ''; + while (($sslError = openssl_error_string()) != false) { + $errorString .= "; SSL error: $sslError"; + } + $this->close(); + + if ((! $errorString) && $this->config['sslverifypeer']) { + // There's good chance our error is due to sslcapath not being properly set + if (! ($this->config['sslcapath'] && is_dir($this->config['sslcapath']))) { + $errorString = 'make sure the "sslcapath" option points to a valid SSL certificate directory'; + } + } + + if ($errorString) { + $errorString = ": $errorString"; + } + + throw new AdapterException\RuntimeException(sprintf( + 'Unable to enable crypto on TCP connection %s%s', + $host, + $errorString + ), 0, $error); + } + + $host = $this->config['ssltransport'] . "://" . $host; + } else { + $host = 'tcp://' . $host; + } + // Update connected_to $this->connected_to = array($host, $port); } @@ -282,8 +354,11 @@ class Socket implements HttpAdapter, StreamInterface } // Send the request - if (! @fwrite($this->socket, $request)) { - throw new AdapterException\RuntimeException('Error writing request to server'); + ErrorHandler::start(); + $test = fwrite($this->socket, $request); + $error = ErrorHandler::stop(); + if (!$test) { + throw new AdapterException\RuntimeException('Error writing request to server', 0, $error); } if (is_resource($body)) { @@ -387,7 +462,9 @@ class Socket implements HttpAdapter, StreamInterface } } while (! feof($this->socket)); - $chunk .= @fgets($this->socket); + ErrorHandler::start(); + $chunk .= fgets($this->socket); + ErrorHandler::stop(); $this->_checkSocketReadTimeout(); if (!$this->out_stream) { @@ -480,7 +557,11 @@ class Socket implements HttpAdapter, StreamInterface */ public function close() { - if (is_resource($this->socket)) @fclose($this->socket); + if (is_resource($this->socket)) { + ErrorHandler::start(); + fclose($this->socket); + ErrorHandler::stop(); + } $this->socket = null; $this->connected_to = array(null, null); } diff --git a/vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php b/vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php index 687138b143e6d9977cae46f35b9405d574543b2c..87620c4d102736953bfdbc2d02be2827f76d5533 100644 --- a/vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php +++ b/vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php @@ -474,9 +474,12 @@ class Request extends HttpRequest // Backtrack up the SCRIPT_FILENAME to find the portion // matching PHP_SELF. + $baseUrl = '/'; $basename = basename($filename); - $path = ($phpSelf ? trim($phpSelf, '/') : ''); - $baseUrl = '/'. substr($path, 0, strpos($path, $basename)) . $basename; + if ($basename) { + $path = ($phpSelf ? trim($phpSelf, '/') : ''); + $baseUrl .= substr($path, 0, strpos($path, $basename)) . $basename; + } } // Does the base URL have anything in common with the request URI? diff --git a/vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php b/vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php index 48b40ed570655b619d2e75bc65249c7b8ad40b98..fc26ece31926eca1c9891b2b4a540c16c54e7b55 100644 --- a/vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php +++ b/vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php @@ -13,6 +13,7 @@ namespace Zend\I18n\Filter; use NumberFormatter; use Traversable; use Zend\I18n\Exception; +use Zend\Stdlib\ErrorHandler; class NumberFormat extends AbstractLocale { @@ -143,10 +144,14 @@ class NumberFormat extends AbstractLocale $type = $this->getType(); if (is_int($value) || is_float($value)) { - $result = @numfmt_format($formatter, $value, $type); + ErrorHandler::start(); + $result = $formatter->format($value, $type); + ErrorHandler::stop(); } else { $value = str_replace(array("\xC2\xA0", ' '), '', $value); - $result = @numfmt_parse($formatter, $value, $type); + ErrorHandler::start(); + $result = $formatter->parse($value, $type); + ErrorHandler::stop(); } if ($result === false) { diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php b/vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php index c1c3cf9da9f85ddc05a67cea63bf71da17007500..61b0f05a010b3f748c015c8725b61a8bf29c1706 100644 --- a/vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php +++ b/vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php @@ -13,6 +13,7 @@ namespace Zend\I18n\Translator\Loader; use Zend\I18n\Exception; use Zend\I18n\Translator\Plural\Rule as PluralRule; use Zend\I18n\Translator\TextDomain; +use Zend\Stdlib\ErrorHandler; /** * Gettext loader. @@ -57,7 +58,15 @@ class Gettext implements LoaderInterface $textDomain = new TextDomain(); - $this->file = @fopen($filename, 'rb'); + ErrorHandler::start(); + $this->file = fopen($filename, 'rb'); + $error = ErrorHandler::stop(); + if (false === $this->file) { + throw new Exception\InvalidArgumentException(sprintf( + 'Could not open file %s for reading', + $filename + ), 0, $error); + } // Verify magic number $magic = fread($this->file, 4); diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Translator.php b/vendor/ZF2/library/Zend/I18n/Translator/Translator.php index f300f3733077927642e1fc71def3879bdc062d37..b0fd77bd87b6b3ef46be81d7937053df671b9477 100644 --- a/vendor/ZF2/library/Zend/I18n/Translator/Translator.php +++ b/vendor/ZF2/library/Zend/I18n/Translator/Translator.php @@ -446,7 +446,7 @@ class Translator if (null !== ($cache = $this->getCache())) { $cacheId = 'Zend_I18n_Translator_Messages_' . md5($textDomain . $locale); - if (false !== ($result = $cache->getItem($cacheId))) { + if (null !== ($result = $cache->getItem($cacheId))) { $this->messages[$textDomain][$locale] = $result; return; } diff --git a/vendor/ZF2/library/Zend/I18n/composer.json b/vendor/ZF2/library/Zend/I18n/composer.json index 1429767b773e0732c614b9decd9d5ed48580ce61..c93238275c7dcabbe5b70c1c04c9d1c082e5ae86 100644 --- a/vendor/ZF2/library/Zend/I18n/composer.json +++ b/vendor/ZF2/library/Zend/I18n/composer.json @@ -14,6 +14,7 @@ "target-dir": "Zend/I18n", "require": { "php": ">=5.3.3", - "ext-intl": "*" + "ext-intl": "*", + "zendframework/zend-stdlib": "self.version" } } diff --git a/vendor/ZF2/library/Zend/InputFilter/Input.php b/vendor/ZF2/library/Zend/InputFilter/Input.php index 611fcc568cd71a40c486c8f32d18941187be5458..85312c6c9f677ad38e245de6330eab126fc29258 100644 --- a/vendor/ZF2/library/Zend/InputFilter/Input.php +++ b/vendor/ZF2/library/Zend/InputFilter/Input.php @@ -12,6 +12,7 @@ namespace Zend\InputFilter; use Zend\Filter\FilterChain; use Zend\Validator\ValidatorChain; +use Zend\Validator\NotEmpty; /** * @category Zend @@ -19,14 +20,49 @@ use Zend\Validator\ValidatorChain; */ class Input implements InputInterface { + /** + * @var boolean + */ protected $allowEmpty = false; + + /** + * @var boolean + */ protected $breakOnFailure = false; + + /** + * @var string|null + */ protected $errorMessage; + + /** + * @var FilterChain + */ protected $filterChain; + + /** + * @var string + */ protected $name; + + /** + * @var boolean + */ protected $notEmptyValidator = false; + + /** + * @var boolean + */ protected $required = true; + + /** + * @var ValidatorChain + */ protected $validatorChain; + + /** + * @var mixed + */ protected $value; public function __construct($name = null) @@ -34,18 +70,30 @@ class Input implements InputInterface $this->name = $name; } + /** + * @param boolean $allowEmpty + * @return Input + */ public function setAllowEmpty($allowEmpty) { $this->allowEmpty = (bool) $allowEmpty; return $this; } + /** + * @param boolean $breakOnFailure + * @return Input + */ public function setBreakOnFailure($breakOnFailure) { $this->breakOnFailure = (bool) $breakOnFailure; return $this; } + /** + * @param string|null $errorMessage + * @return Input + */ public function setErrorMessage($errorMessage) { $errorMessage = (null === $errorMessage) ? null : (string) $errorMessage; @@ -53,51 +101,83 @@ class Input implements InputInterface return $this; } + /** + * @param FilterChain $filterChain + * @return Input + */ public function setFilterChain(FilterChain $filterChain) { $this->filterChain = $filterChain; return $this; } + /** + * @param string $name + * @return Input + */ public function setName($name) { $this->name = (string) $name; return $this; } + /** + * @param boolean $required + * @return Input + */ public function setRequired($required) { $this->required = (bool) $required; return $this; } + /** + * @param ValidatorChain $validatorChain + * @return Input + */ public function setValidatorChain(ValidatorChain $validatorChain) { $this->validatorChain = $validatorChain; return $this; } + /** + * @param mixed $value + * @return Input + */ public function setValue($value) { $this->value = $value; return $this; } + /** + * @return boolean + */ public function allowEmpty() { return $this->allowEmpty; } + /** + * @return boolean + */ public function breakOnFailure() { return $this->breakOnFailure; } + /** + * @return string|null + */ public function getErrorMessage() { return $this->errorMessage; } + /** + * @return FilterChain + */ public function getFilterChain() { if (!$this->filterChain) { @@ -106,21 +186,33 @@ class Input implements InputInterface return $this->filterChain; } + /** + * @return string + */ public function getName() { return $this->name; } + /** + * @return mixed + */ public function getRawValue() { return $this->value; } + /** + * @return boolean + */ public function isRequired() { return $this->required; } + /** + * @return ValidatorChain + */ public function getValidatorChain() { if (!$this->validatorChain) { @@ -129,12 +221,19 @@ class Input implements InputInterface return $this->validatorChain; } + /** + * @return mixed + */ public function getValue() { $filter = $this->getFilterChain(); return $filter->filter($this->value); } + /** + * @param InputInterface $input + * @return Input + */ public function merge(InputInterface $input) { $this->setAllowEmpty($input->allowEmpty()); @@ -149,8 +248,13 @@ class Input implements InputInterface $validatorChain = $input->getValidatorChain(); $this->getValidatorChain()->merge($validatorChain); + return $this; } + /** + * @param mixed $context Extra "context" to provide the validator + * @return boolean + */ public function isValid($context = null) { $this->injectNotEmptyValidator(); @@ -159,6 +263,9 @@ class Input implements InputInterface return $validator->isValid($value, $context); } + /** + * @return array + */ public function getMessages() { if (null !== $this->errorMessage) { @@ -171,10 +278,20 @@ class Input implements InputInterface protected function injectNotEmptyValidator() { - if (!$this->isRequired() && $this->allowEmpty() && !$this->notEmptyValidator) { + if ((!$this->isRequired() && $this->allowEmpty()) || $this->notEmptyValidator) { return; } $chain = $this->getValidatorChain(); + + // Check if NotEmpty validator is already first in chain + $validators = $chain->getValidators(); + if (isset($validators[0]['instance']) + && $validators[0]['instance'] instanceof NotEmpty + ) { + $this->notEmptyValidator = true; + return; + } + $chain->prependByName('NotEmpty', array(), true); $this->notEmptyValidator = true; } diff --git a/vendor/ZF2/library/Zend/Json/Server/Cache.php b/vendor/ZF2/library/Zend/Json/Server/Cache.php index cd7f4d0d327df9506eba3c50fbbc7cc13ea55f19..eb254d81298e764793c67e64c92e8de2e18c423d 100644 --- a/vendor/ZF2/library/Zend/Json/Server/Cache.php +++ b/vendor/ZF2/library/Zend/Json/Server/Cache.php @@ -11,6 +11,7 @@ namespace Zend\Json\Server; use Zend\Server\Cache as ServerCache; +use Zend\Stdlib\ErrorHandler; /** * Zend_Json_Server_Cache: cache Zend_Json_Server server definition and SMD @@ -38,7 +39,11 @@ class Cache extends ServerCache return false; } - if (0 === @file_put_contents($filename, $server->getServiceMap()->toJson())) { + ErrorHandler::start(); + $test = file_put_contents($filename, $server->getServiceMap()->toJson()); + ErrorHandler::stop(); + + if (0 === $test) { return false; } @@ -63,8 +68,11 @@ class Cache extends ServerCache return false; } + ErrorHandler::start(); + $smd = file_get_contents($filename); + ErrorHandler::stop(); - if (false === ($smd = @file_get_contents($filename))) { + if (false === $smd) { return false; } diff --git a/vendor/ZF2/library/Zend/Json/composer.json b/vendor/ZF2/library/Zend/Json/composer.json index f154a6a838d3885bb3b8d8eb05007e800e7bda1d..daf00e0ae825f07348c6bb2d8473415804d92955 100644 --- a/vendor/ZF2/library/Zend/Json/composer.json +++ b/vendor/ZF2/library/Zend/Json/composer.json @@ -13,9 +13,10 @@ }, "target-dir": "Zend/Json", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" }, "suggest": { "zendframework/zend-server": "Zend\\Server component" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php b/vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php index 837a18be810c26785142f4f13698296e1f5523c1..3d94aa6ada98edf604708142bc9f3dc30e639872 100644 --- a/vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php +++ b/vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php @@ -12,6 +12,7 @@ namespace Zend\Ldap\Collection; use Zend\Ldap; use Zend\Ldap\Exception; +use Zend\Stdlib\ErrorHandler; /** * Zend\Ldap\Collection\DefaultIterator is the default collection iterator implementation @@ -73,7 +74,10 @@ class DefaultIterator implements \Iterator, \Countable { $this->ldap = $ldap; $this->resultId = $resultId; - $this->itemCount = @ldap_count_entries($ldap->getResource(), $resultId); + + ErrorHandler::start(); + $this->itemCount = ldap_count_entries($ldap->getResource(), $resultId); + ErrorHandler::stop(); if ($this->itemCount === false) { throw new Exception\LdapException($this->ldap, 'counting entries'); } @@ -93,7 +97,10 @@ class DefaultIterator implements \Iterator, \Countable { $isClosed = false; if (is_resource($this->resultId)) { - $isClosed = @ldap_free_result($this->resultId); + ErrorHandler::start(); + $isClosed = ldap_free_result($this->resultId); + ErrorHandler::stop(); + $this->resultId = null; $this->current = null; } @@ -191,13 +198,26 @@ class DefaultIterator implements \Iterator, \Countable $entry = array('dn' => $this->key()); $ber_identifier = null; - $name = @ldap_first_attribute( + + ErrorHandler::start(); + $name = ldap_first_attribute( $this->ldap->getResource(), $this->current, $ber_identifier ); + ErrorHandler::stop(); + while ($name) { - $data = @ldap_get_values_len($this->ldap->getResource(), $this->current, $name); - unset($data['count']); + ErrorHandler::start(); + $data = ldap_get_values_len($this->ldap->getResource(), $this->current, $name); + ErrorHandler::stop(); + + if (!$data) { + $data = array(); + } + + if (isset($data['count'])) { + unset($data['count']); + } switch ($this->attributeNameTreatment) { case self::ATTRIBUTE_TO_LOWER: @@ -214,10 +234,13 @@ class DefaultIterator implements \Iterator, \Countable break; } $entry[$attrName] = $data; - $name = @ldap_next_attribute( + + ErrorHandler::start(); + $name = ldap_next_attribute( $this->ldap->getResource(), $this->current, $ber_identifier ); + ErrorHandler::stop(); } ksort($entry, SORT_LOCALE_STRING); return $entry; @@ -236,7 +259,10 @@ class DefaultIterator implements \Iterator, \Countable $this->rewind(); } if (is_resource($this->current)) { - $currentDn = @ldap_get_dn($this->ldap->getResource(), $this->current); + ErrorHandler::start(); + $currentDn = ldap_get_dn($this->ldap->getResource(), $this->current); + ErrorHandler::stop(); + if ($currentDn === false) { throw new Exception\LdapException($this->ldap, 'getting dn'); } @@ -259,7 +285,9 @@ class DefaultIterator implements \Iterator, \Countable $code = 0; if (is_resource($this->current) && $this->itemCount > 0) { - $this->current = @ldap_next_entry($this->ldap->getResource(), $this->current); + ErrorHandler::start(); + $this->current = ldap_next_entry($this->ldap->getResource(), $this->current); + ErrorHandler::stop(); if ($this->current === false) { $msg = $this->ldap->getLastError($code); if ($code === Exception\LdapException::LDAP_SIZELIMIT_EXCEEDED) { @@ -284,7 +312,9 @@ class DefaultIterator implements \Iterator, \Countable public function rewind() { if (is_resource($this->resultId)) { - $this->current = @ldap_first_entry($this->ldap->getResource(), $this->resultId); + ErrorHandler::start(); + $this->current = ldap_first_entry($this->ldap->getResource(), $this->resultId); + ErrorHandler::stop(); if ($this->current === false && $this->ldap->getLastErrorCode() > Exception\LdapException::LDAP_SUCCESS ) { diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Converter.php b/vendor/ZF2/library/Zend/Ldap/Converter/Converter.php index 75f4474b5c247d6c2b422e20a264b1bb3463bafe..30441c810c66955fe3e59ee69af0b2336efc4547 100644 --- a/vendor/ZF2/library/Zend/Ldap/Converter/Converter.php +++ b/vendor/ZF2/library/Zend/Ldap/Converter/Converter.php @@ -12,6 +12,7 @@ namespace Zend\Ldap\Converter; use DateTime; use DateTimeZone; +use Zend\Stdlib\ErrorHandler; /** * Zend\Ldap\Converter is a collection of useful LDAP related conversion functions. @@ -382,7 +383,10 @@ class Converter */ public static function fromLdapUnserialize($value) { - $v = @unserialize($value); + ErrorHandler::start(E_NOTICE); + $v = unserialize($value); + ErrorHandler::stop(); + if (false === $v && $value != 'b:0;') { throw new Exception\UnexpectedValueException('The given value could not be unserialized'); } diff --git a/vendor/ZF2/library/Zend/Ldap/Ldap.php b/vendor/ZF2/library/Zend/Ldap/Ldap.php index 0d43c955b3f1b38cc94bba557cc1efe583713226..c9dd7ef926f8ca8a6a70b612210f63928237d3fc 100644 --- a/vendor/ZF2/library/Zend/Ldap/Ldap.php +++ b/vendor/ZF2/library/Zend/Ldap/Ldap.php @@ -722,7 +722,9 @@ class Ldap /* Only OpenLDAP 2.2 + supports URLs so if SSL is not requested, just * use the old form. */ - $resource = ($useUri) ? @ldap_connect($this->connectString) : @ldap_connect($host, $port); + ErrorHandler::start(); + $resource = ($useUri) ? ldap_connect($this->connectString) : ldap_connect($host, $port); + ErrorHandler::stop(); if (is_resource($resource) === true) { $this->resource = $resource; @@ -736,7 +738,7 @@ class Ldap if ($networkTimeout) { ldap_set_option($resource, LDAP_OPT_NETWORK_TIMEOUT, $networkTimeout); } - if ($useSsl || !$useStartTls || @ldap_start_tls($resource)) { + if ($useSsl || !$useStartTls || ldap_start_tls($resource)) { ErrorHandler::stop(); return $this; } diff --git a/vendor/ZF2/library/Zend/Log/Filter/Regex.php b/vendor/ZF2/library/Zend/Log/Filter/Regex.php index 5aa8e4dcdbc6e87ecfe9445a74091efd48b2a5ab..b699480dcc61eca09e0ef1438f6c990c947ac9ba 100644 --- a/vendor/ZF2/library/Zend/Log/Filter/Regex.php +++ b/vendor/ZF2/library/Zend/Log/Filter/Regex.php @@ -45,12 +45,12 @@ class Regex implements FilterInterface } ErrorHandler::start(E_WARNING); $result = preg_match($regex, ''); - ErrorHandler::stop(); + $error = ErrorHandler::stop(); if ($result === false) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid regular expression "%s"', $regex - )); + ), 0, $error); } $this->regex = $regex; } diff --git a/vendor/ZF2/library/Zend/Log/Formatter/Db.php b/vendor/ZF2/library/Zend/Log/Formatter/Db.php new file mode 100644 index 0000000000000000000000000000000000000000..6f8a45d2fad685abffc7580f6d2f7a3f4fbd4aff --- /dev/null +++ b/vendor/ZF2/library/Zend/Log/Formatter/Db.php @@ -0,0 +1,78 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Log + */ + +namespace Zend\Log\Formatter; + +use DateTime; +use Zend\Log\Exception; + +/** + * @category Zend + * @package Zend_Log + * @subpackage Formatter + */ +class Db implements FormatterInterface +{ + /** + * Format specifier for DateTime objects in event data (default: ISO 8601) + * + * @see http://php.net/manual/en/function.date.php + * @var string + */ + protected $dateTimeFormat = self::DEFAULT_DATETIME_FORMAT; + + /** + * Class constructor + * + * @see http://php.net/manual/en/function.date.php + * @param null|string $dateTimeFormat Format specifier for DateTime objects in event data + */ + public function __construct($dateTimeFormat = null) + { + if (null !== $dateTimeFormat) { + $this->setDateTimeFormat($dateTimeFormat); + } + } + + /** + * Formats data to be written by the writer. + * + * @param array $event event data + * @return array + */ + public function format($event) + { + $format = $this->getDateTimeFormat(); + array_walk_recursive($event, function (&$value) use ($format) { + if ($value instanceof DateTime) { + $value = $value->format($format); + } + }); + + return $event; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeFormat() + { + return $this->dateTimeFormat; + } + + /** + * {@inheritDoc} + */ + public function setDateTimeFormat($dateTimeFormat) + { + $this->dateTimeFormat = (string) $dateTimeFormat; + return $this; + } +} diff --git a/vendor/ZF2/library/Zend/Log/Logger.php b/vendor/ZF2/library/Zend/Log/Logger.php index 259018f166ed9123023b2d8155637c11e6c85c44..e6b54814050bec7a28fe9b4cc9731a3f63e76829 100644 --- a/vendor/ZF2/library/Zend/Log/Logger.php +++ b/vendor/ZF2/library/Zend/Log/Logger.php @@ -172,7 +172,6 @@ class Logger implements LoggerInterface is_object($writer) ? get_class($writer) : gettype($writer) )); } - $this->writers->insert($writer, $priority); return $this; diff --git a/vendor/ZF2/library/Zend/Log/Writer/Db.php b/vendor/ZF2/library/Zend/Log/Writer/Db.php index 99e141b024aab209f6bfc4f92f150fea7fb1d645..0d35606e46588c66767a433058377cbac3199691 100644 --- a/vendor/ZF2/library/Zend/Log/Writer/Db.php +++ b/vendor/ZF2/library/Zend/Log/Writer/Db.php @@ -14,6 +14,7 @@ use Traversable; use Zend\Db\Adapter\Adapter; use Zend\Log\Exception; use Zend\Log\Formatter; +use Zend\Log\Formatter\Db as DbFormatter; /** * @category Zend @@ -62,7 +63,7 @@ class Db extends AbstractWriter * @return Db * @throw Exception\InvalidArgumentException */ - public function __construct($db, $tableName, array $columnMap = null, $separator = null) + public function __construct($db, $tableName = null, array $columnMap = null, $separator = null) { if ($db instanceof Traversable) { $db = iterator_to_array($db); @@ -79,6 +80,11 @@ class Db extends AbstractWriter throw new Exception\InvalidArgumentException('You must pass a valid Zend\Db\Adapter\Adapter'); } + $tableName = (string) $tableName; + if ('' === $tableName){ + throw new Exception\InvalidArgumentException('You must specify a table name. Either directly in the constructor, or via options'); + } + $this->db = $db; $this->tableName = $tableName; $this->columnMap = $columnMap; @@ -86,18 +92,8 @@ class Db extends AbstractWriter if (!empty($separator)) { $this->separator = $separator; } - } - /** - * Formatting is not possible on this writer - * - * @param Formatter\FormatterInterface $formatter - * @return void - * @throws Exception\InvalidArgumentException - */ - public function setFormatter(Formatter\FormatterInterface $formatter) - { - throw new Exception\InvalidArgumentException(get_class() . ' does not support formatting'); + $this->setFormatter(new DbFormatter()); } /** @@ -123,6 +119,8 @@ class Db extends AbstractWriter throw new Exception\RuntimeException('Database adapter is null'); } + $event = $this->formatter->format($event); + // Transform the event array into fields if (null === $this->columnMap) { $dataToInsert = $this->eventIntoColumn($event); diff --git a/vendor/ZF2/library/Zend/Log/Writer/Stream.php b/vendor/ZF2/library/Zend/Log/Writer/Stream.php index dd5e18b32c5fce75f1b5d60f544732702f35ba2a..c5db6d1acc8fc9c70aae1297d306cb3debd8f275 100644 --- a/vendor/ZF2/library/Zend/Log/Writer/Stream.php +++ b/vendor/ZF2/library/Zend/Log/Writer/Stream.php @@ -80,12 +80,15 @@ class Stream extends AbstractWriter $this->stream = $streamOrUrl; } else { - if (!$this->stream = @fopen($streamOrUrl, $mode, false)) { + ErrorHandler::start(); + $this->stream = fopen($streamOrUrl, $mode, false); + $error = ErrorHandler::stop(); + if (!$this->stream) { throw new Exception\RuntimeException(sprintf( '"%s" cannot be opened with mode "%s"', $streamOrUrl, $mode - )); + ), 0, $error); } } @@ -109,9 +112,9 @@ class Stream extends AbstractWriter ErrorHandler::start(E_WARNING); $result = fwrite($this->stream, $line); - ErrorHandler::stop(); + $error = ErrorHandler::stop(); if (false === $result) { - throw new Exception\RuntimeException("Unable to write to stream"); + throw new Exception\RuntimeException("Unable to write to stream", 0, $error); } } diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Imap.php b/vendor/ZF2/library/Zend/Mail/Protocol/Imap.php index 5947b4441a1a788f24894e42d27e4d6504f428ec..23caa519d58aab3e7e495baa57ffc6afc6213508 100644 --- a/vendor/ZF2/library/Zend/Mail/Protocol/Imap.php +++ b/vendor/ZF2/library/Zend/Mail/Protocol/Imap.php @@ -10,6 +10,8 @@ namespace Zend\Mail\Protocol; +use Zend\Stdlib\ErrorHandler; + /** * @category Zend * @package Zend_Mail @@ -76,12 +78,14 @@ class Imap $port = $ssl === 'SSL' ? 993 : 143; } - $errno = 0; - $errstr = ''; - $this->socket = @fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + ErrorHandler::start(); + $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + $error = ErrorHandler::stop(); if (!$this->socket) { - throw new Exception\RuntimeException('cannot connect to host; error = ' . $errstr . - ' (errno = ' . $errno . ' )'); + throw new Exception\RuntimeException(sprintf( + 'cannot connect to host%s', + ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '') + ), 0, $error); } if (!$this->_assumedNextLine('* OK')) { diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php b/vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php index 22e1cd804fc4fcfdad945c3aedabfedcf7714345..92e4116989e48ef9a1729b5ece2d429bd049e50b 100644 --- a/vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php +++ b/vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php @@ -10,6 +10,8 @@ namespace Zend\Mail\Protocol; +use Zend\Stdlib\ErrorHandler; + /** * @category Zend * @package Zend_Mail @@ -84,12 +86,14 @@ class Pop3 $port = $ssl == 'SSL' ? 995 : 110; } - $errno = 0; - $errstr = ''; - $this->socket = @fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + ErrorHandler::start(); + $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + $error = ErrorHandler::stop(); if (!$this->socket) { - throw new Exception\RuntimeException('cannot connect to host; error = ' . $errstr - . ' (errno = ' . $errno . ' )'); + throw new Exception\RuntimeException(sprintf( + 'cannot connect to host%s', + ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '') + ), 0, $error); } $welcome = $this->readResponse(); @@ -122,9 +126,11 @@ class Pop3 */ public function sendRequest($request) { - $result = @fputs($this->socket, $request . "\r\n"); + ErrorHandler::start(); + $result = fputs($this->socket, $request . "\r\n"); + $error = ErrorHandler::stop(); if (!$result) { - throw new Exception\RuntimeException('send failed - connection closed?'); + throw new Exception\RuntimeException('send failed - connection closed?', 0, $error); } } @@ -138,9 +144,11 @@ class Pop3 */ public function readResponse($multiline = false) { - $result = @fgets($this->socket); + ErrorHandler::start(); + $result = fgets($this->socket); + $error = ErrorHandler::stop(); if (!is_string($result)) { - throw new Exception\RuntimeException('read failed - connection closed?'); + throw new Exception\RuntimeException('read failed - connection closed?', 0, $error); } $result = trim($result); diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php b/vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php index d5d9656050d4a765266d328890db27165554bdc0..7155bd3360bffa5feaf9b618ebadedcd0bf85c63 100644 --- a/vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php +++ b/vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php @@ -89,10 +89,10 @@ class Maildir extends Storage\Maildir implements FolderInterface $this->rootFolder->INBOX = new Storage\Folder('INBOX', 'INBOX', true); ErrorHandler::start(E_WARNING); - $dh = opendir($this->rootdir); - ErrorHandler::stop(); + $dh = opendir($this->rootdir); + $error = ErrorHandler::stop(); if (!$dh) { - throw new Exception\RuntimeException("can't read folders in maildir"); + throw new Exception\RuntimeException("can't read folders in maildir", 0, $error); } $dirs = array(); diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Maildir.php b/vendor/ZF2/library/Zend/Mail/Storage/Maildir.php index efc56bd1980532fa1de0d6243f81f93c82e05150..8c569c0c90568cf066b16f55cfcf629f177f880c 100644 --- a/vendor/ZF2/library/Zend/Mail/Storage/Maildir.php +++ b/vendor/ZF2/library/Zend/Mail/Storage/Maildir.php @@ -267,22 +267,22 @@ class Maildir extends AbstractStorage } ErrorHandler::start(E_WARNING); - $dh = opendir($dirname . '/cur/'); - ErrorHandler::stop(); + $dh = opendir($dirname . '/cur/'); + $error = ErrorHandler::stop(); if (!$dh) { - throw new Exception\RuntimeException('cannot open maildir'); + throw new Exception\RuntimeException('cannot open maildir', 0, $error); } $this->_getMaildirFiles($dh, $dirname . '/cur/'); closedir($dh); ErrorHandler::start(E_WARNING); - $dh = opendir($dirname . '/new/'); - ErrorHandler::stop(); + $dh = opendir($dirname . '/new/'); + $error = ErrorHandler::stop(); if ($dh) { $this->_getMaildirFiles($dh, $dirname . '/new/', array(Mail\Storage::FLAG_RECENT)); closedir($dh); } elseif (file_exists($dirname . '/new/')) { - throw new Exception\RuntimeException('cannot read recent mails in maildir'); + throw new Exception\RuntimeException('cannot read recent mails in maildir', 0, $error); } } diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Mbox.php b/vendor/ZF2/library/Zend/Mail/Storage/Mbox.php index cbdd1bdc8e3f9dfe0a2108ae9f76ff0c928e2f34..196da7c4891afe326bfcaa366c37f56f09b4570c 100644 --- a/vendor/ZF2/library/Zend/Mail/Storage/Mbox.php +++ b/vendor/ZF2/library/Zend/Mail/Storage/Mbox.php @@ -246,9 +246,11 @@ class Mbox extends AbstractStorage $this->close(); } - $this->fh = @fopen($filename, 'r'); + ErrorHandler::start(); + $this->fh = fopen($filename, 'r'); + $error = ErrorHandler::stop(); if (!$this->fh) { - throw new Exception\RuntimeException('cannot open mbox file'); + throw new Exception\RuntimeException('cannot open mbox file', 0, $error); } $this->filename = $filename; $this->filemtime = filemtime($this->filename); @@ -256,8 +258,8 @@ class Mbox extends AbstractStorage if (!$this->isMboxFile($this->fh, false)) { ErrorHandler::start(E_WARNING); fclose($this->fh); - ErrorHandler::stop(); - throw new Exception\InvalidArgumentException('file is not a valid mbox format'); + $error = ErrorHandler::stop(); + throw new Exception\InvalidArgumentException('file is not a valid mbox format', 0, $error); } $messagePos = array('start' => ftell($this->fh), 'separator' => 0, 'end' => 0); @@ -380,13 +382,18 @@ class Mbox extends AbstractStorage */ public function __wakeup() { - if ($this->filemtime != @filemtime($this->filename)) { + ErrorHandler::start(); + $filemtime = filemtime($this->filename); + ErrorHandler::stop(); + if ($this->filemtime != $filemtime) { $this->close(); $this->openMboxFile($this->filename); } else { - $this->fh = @fopen($this->filename, 'r'); + ErrorHandler::start(); + $this->fh = fopen($this->filename, 'r'); + $error = ErrorHandler::stop(); if (!$this->fh) { - throw new Exception\RuntimeException('cannot open mbox file'); + throw new Exception\RuntimeException('cannot open mbox file', 0, $error); } } } diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Message.php b/vendor/ZF2/library/Zend/Mail/Storage/Message.php index b86d92a36aa9ce19af816c5a845b652126f59987..85a747b68fec4383dbd571eb1af895765dbaac2f 100644 --- a/vendor/ZF2/library/Zend/Mail/Storage/Message.php +++ b/vendor/ZF2/library/Zend/Mail/Storage/Message.php @@ -10,6 +10,8 @@ namespace Zend\Mail\Storage; +use Zend\Stdlib\ErrorHandler; + /** * @category Zend * @package Zend_Mail @@ -36,9 +38,11 @@ class Message extends Part implements Message\MessageInterface { if (isset($params['file'])) { if (!is_resource($params['file'])) { - $params['raw'] = @file_get_contents($params['file']); + ErrorHandler::start(); + $params['raw'] = file_get_contents($params['file']); + $error = ErrorHandler::stop(); if ($params['raw'] === false) { - throw new Exception\RuntimeException('could not open file'); + throw new Exception\RuntimeException('could not open file', 0, $error); } } else { $params['raw'] = stream_get_contents($params['file']); diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php b/vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php index b0d683d640f6e4cb30bcaf77a5e71310c68fa535..a4b4c373223d91721569fdef0895c24e3731bc4b 100644 --- a/vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php +++ b/vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php @@ -48,23 +48,29 @@ class Maildir extends Folder\Maildir implements WritableInterface throw new StorageException\InvalidArgumentException('maildir must be a directory if already exists'); } } else { - if (!mkdir($dir)) { + ErrorHandler::start(); + $test = mkdir($dir); + $error = ErrorHandler::stop(); + if (!$test) { $dir = dirname($dir); if (!file_exists($dir)) { - throw new StorageException\InvalidArgumentException("parent $dir not found"); + throw new StorageException\InvalidArgumentException("parent $dir not found", 0, $error); } elseif (!is_dir($dir)) { - throw new StorageException\InvalidArgumentException("parent $dir not a directory"); + throw new StorageException\InvalidArgumentException("parent $dir not a directory", 0, $error); } else { - throw new StorageException\RuntimeException('cannot create maildir'); + throw new StorageException\RuntimeException('cannot create maildir', 0, $error); } } } foreach (array('cur', 'tmp', 'new') as $subdir) { - if (!@mkdir($dir . DIRECTORY_SEPARATOR . $subdir)) { + ErrorHandler::start(); + $test = mkdir($dir . DIRECTORY_SEPARATOR . $subdir); + $error = ErrorHandler::stop(); + if (!$test) { // ignore if dir exists (i.e. was already valid maildir or two processes try to create one) if (!file_exists($dir . DIRECTORY_SEPARATOR . $subdir)) { - throw new StorageException\RuntimeException('could not create subdir ' . $subdir); + throw new StorageException\RuntimeException('could not create subdir ' . $subdir, 0, $error); } } } @@ -155,9 +161,12 @@ class Maildir extends Folder\Maildir implements WritableInterface } } - if (!@mkdir($fulldir) || !@mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) { - throw new StorageException\RuntimeException('error while creating new folder, may be created incompletely'); + ErrorHandler::start(); + if (!mkdir($fulldir) || !mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) { + $error = ErrorHandler::stop(); + throw new StorageException\RuntimeException('error while creating new folder, may be created incompletely', 0, $error); } + ErrorHandler::stop(); mkdir($fulldir . DIRECTORY_SEPARATOR . 'new'); mkdir($fulldir . DIRECTORY_SEPARATOR . 'tmp'); @@ -639,8 +648,11 @@ class Maildir extends Folder\Maildir implements WritableInterface // NOTE: double dirname to make sure we always move to cur. if recent flag has been set (message is in new) it will be moved to cur. $new_filename = dirname(dirname($filedata['filename'])) . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . "$filedata[uniq]$info"; - if (!@rename($filedata['filename'], $new_filename)) { - throw new StorageException\RuntimeException('cannot rename file'); + ErrorHandler::start(); + $test = rename($filedata['filename'], $new_filename); + $error = ErrorHandler::stop(); + if (!$test) { + throw new StorageException\RuntimeException('cannot rename file', 0, $error); } $filedata['flags'] = $flags; @@ -664,8 +676,11 @@ class Maildir extends Folder\Maildir implements WritableInterface $size = filesize($filename); } - if (!@unlink($filename)) { - throw new StorageException\RuntimeException('cannot remove message'); + ErrorHandler::start(); + $test = unlink($filename); + $error = ErrorHandler::stop(); + if (!$test) { + throw new StorageException\RuntimeException('cannot remove message', 0, $error); } unset($this->files[$id - 1]); // remove the gap @@ -702,10 +717,10 @@ class Maildir extends Folder\Maildir implements WritableInterface { if ($fromStorage) { ErrorHandler::start(E_WARNING); - $fh = fopen($this->rootdir . 'maildirsize', 'r'); - ErrorHandler::stop(); + $fh = fopen($this->rootdir . 'maildirsize', 'r'); + $error = ErrorHandler::stop(); if (!$fh) { - throw new StorageException\RuntimeException('cannot open maildirsize'); + throw new StorageException\RuntimeException('cannot open maildirsize', 0, $error); } $definition = fgets($fh); fclose($fh); diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php b/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php index b7b5042f03cdf7a3c94b29754d7ca319fe781e33..ca2ac3545a0097d91a474a3e1399d9bbcae919f6 100644 --- a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php +++ b/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php @@ -10,6 +10,7 @@ namespace Zend\Mvc\Controller\Plugin; +use Zend\EventManager\SharedEventManagerInterface as SharedEvents; use Zend\Mvc\Exception; use Zend\Mvc\InjectApplicationEventInterface; use Zend\Mvc\MvcEvent; @@ -45,6 +46,11 @@ class Forward extends AbstractPlugin */ protected $numNestedForwards = 0; + /** + * @var array + */ + protected $listenersToDetach = null; + /** * Set maximum number of nested forwards allowed * @@ -57,6 +63,44 @@ class Forward extends AbstractPlugin return $this; } + /** + * Get information on listeners that need to be detached before dispatching. + * + * Each entry in the array contains three keys: + * + * id (identifier for event-emitting component), + * event (the hooked event) + * and class (the class of listener that should be detached). + * + * @return array + */ + public function getListenersToDetach() + { + // If a blacklist has not been explicitly set, return the default: + if (null === $this->listenersToDetach) { + // We need to detach the InjectViewModelListener to prevent templates + // from getting attached to the ViewModel twice when a calling action + // returns the output generated by a forwarded action. + $this->listenersToDetach = array(array( + 'id' => 'Zend\Stdlib\DispatchableInterface', + 'event' => MvcEvent::EVENT_DISPATCH, + 'class' => 'Zend\Mvc\View\Http\InjectViewModelListener', + )); + } + return $this->listenersToDetach; + } + + /** + * Set information on listeners that need to be detached before dispatching. + * + * @param array $listeners Listener information; see getListenersToDetach() for details on format. + * @return void + */ + public function setListenersToDetach($listeners) + { + $this->listenersToDetach = $listeners; + } + /** * Dispatch another controller * @@ -101,13 +145,85 @@ class Forward extends AbstractPlugin } $this->numNestedForwards++; + // Detach listeners that may cause problems during dispatch: + $sharedEvents = $event->getApplication()->getEventManager()->getSharedManager(); + $listeners = $this->detachProblemListeners($sharedEvents); + $return = $controller->dispatch($event->getRequest(), $event->getResponse()); + // If we detached any listeners, reattach them now: + $this->reattachProblemListeners($sharedEvents, $listeners); + $this->numNestedForwards--; return $return; } + /** + * Detach problem listeners specified by getListenersToDetach() and return an array of information that will + * allow them to be reattached. + * + * @param SharedEvents $sharedEvents Shared event manager + * @return array + */ + protected function detachProblemListeners(SharedEvents $sharedEvents) + { + // Convert the problem list from two-dimensional array to more convenient id => event => class format: + $formattedProblems = array(); + foreach ($this->getListenersToDetach() as $current) { + if (!isset($formattedProblems[$current['id']])) { + $formattedProblems[$current['id']] = array(); + } + if (!isset($formattedProblems[$current['id']][$current['event']])) { + $formattedProblems[$current['id']][$current['event']] = array(); + } + $formattedProblems[$current['id']][$current['event']][] = $current['class']; + } + + // Loop through the class blacklist, detaching problem events and remembering their CallbackHandlers + // for future reference: + $results = array(); + foreach ($formattedProblems as $id => $eventArray) { + $results[$id] = array(); + foreach ($eventArray as $eventName => $classArray) { + $results[$id][$eventName] = array(); + $events = $sharedEvents->getListeners($id, $eventName); + foreach ($events as $currentEvent) { + $currentCallback = $currentEvent->getCallback(); + if (!isset($currentCallback[0])) { + continue; + } + foreach ($classArray as $class) { + if (is_a($currentCallback[0], $class)) { + $sharedEvents->detach($id, $currentEvent); + $results[$id][$eventName][] = $currentEvent; + } + } + } + } + } + + return $results; + } + + /** + * Reattach all problem listeners detached by detachProblemListeners(), if any. + * + * @param SharedEvents $sharedEvents Shared event manager + * @param array $listeners Output of detachProblemListeners() + * @return void + */ + protected function reattachProblemListeners(SharedEvents $sharedEvents, array $listeners) + { + foreach ($listeners as $id => $eventArray) { + foreach ($eventArray as $eventName => $callbacks) { + foreach ($callbacks as $current) { + $sharedEvents->attach($id, $eventName, $current->getCallback(), $current->getMetadatum('priority')); + } + } + } + } + /** * Get the locator * diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php b/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php index 67f183a8567fcfbc12bde13455a9ca1e4ef26d60..9757fd7af00383f78bf7c7b9a818c1cf442ee474 100644 --- a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php +++ b/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php @@ -13,6 +13,7 @@ namespace Zend\Mvc\Controller\Plugin; use Zend\EventManager\EventInterface; use Zend\Mvc\Exception; use Zend\Mvc\InjectApplicationEventInterface; +use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; use Zend\Mvc\Router\RouteStackInterface; @@ -28,29 +29,60 @@ class Url extends AbstractPlugin * * @param string $route RouteInterface name * @param array $params Parameters to use in url generation, if any - * @param array $options RouteInterface-specific options to use in url generation, if any + * @param array|bool $options RouteInterface-specific options to use in url generation, if any. If boolean, and no fourth argument, used as $reuseMatchedParams + * @param boolean $reuseMatchedParams Whether to reuse matched parameters * @return string * @throws Exception\DomainException if composed controller does not implement InjectApplicationEventInterface, or * router cannot be found in controller event */ - public function fromRoute($route, array $params = array(), array $options = array()) + public function fromRoute($route = null, array $params = array(), $options = array(), $reuseMatchedParams = false) { $controller = $this->getController(); if (!$controller instanceof InjectApplicationEventInterface) { throw new Exception\DomainException('Url plugin requires a controller that implements InjectApplicationEventInterface'); } - $event = $controller->getEvent(); - $router = null; + $event = $controller->getEvent(); + $router = null; + $matches =null; if ($event instanceof MvcEvent) { - $router = $event->getRouter(); + $router = $event->getRouter(); + $matches = $event->getRouteMatch(); } elseif ($event instanceof EventInterface) { - $router = $event->getParam('router', false); + $router = $event->getParam('router', false); + $matches = $event->getParam('route-match', false); } if (!$router instanceof RouteStackInterface) { throw new Exception\DomainException('Url plugin requires that controller event compose a router; none found'); } + if (3 == func_num_args() && is_bool($options)) { + $reuseMatchedParams = $options; + $options = array(); + } + + if ($route === null) { + if (!$matches) { + throw new Exception\RuntimeException('No RouteMatch instance present'); + } + + $route = $matches->getMatchedRouteName(); + + if ($route === null) { + throw new Exception\RuntimeException('RouteMatch does not contain a matched route name'); + } + } + + if ($reuseMatchedParams && $matches) { + $routeMatchParams = $matches->getParams(); + + if (isset($routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER])) { + $routeMatchParams['controller'] = $routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER]; + } + + $params = array_merge($routeMatchParams, $params); + } + $options['name'] = $route; return $router->assemble($params, $options); } diff --git a/vendor/ZF2/library/Zend/Navigation/AbstractContainer.php b/vendor/ZF2/library/Zend/Navigation/AbstractContainer.php index 91260d5467424143102ab6d2e24ed43e32270375..964c838525e5a2a54597498dc6a99a3caed42d4a 100644 --- a/vendor/ZF2/library/Zend/Navigation/AbstractContainer.php +++ b/vendor/ZF2/library/Zend/Navigation/AbstractContainer.php @@ -351,18 +351,16 @@ abstract class AbstractContainer implements Countable, RecursiveIterator { ErrorHandler::start(E_WARNING); $result = preg_match('/(find(?:One|All)?By)(.+)/', $method, $match); - ErrorHandler::stop(); - if ($result) { - return $this->{$match[1]}($match[2], $arguments[0]); - } - - throw new Exception\BadMethodCallException( - sprintf( + $error = ErrorHandler::stop(); + if (!$result) { + throw new Exception\BadMethodCallException(sprintf( 'Bad method call: Unknown method %s::%s', get_called_class(), $method - ) - ); + ), 0, $error); + } + return $this->{$match[1]}($match[2], $arguments[0]); + } /** diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php b/vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php index e535ff89ddb491c259b48ea0a13a65b53396cf82..6b834ad92c69e2afb06ef9031053b169aaf0a61e 100644 --- a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php +++ b/vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php @@ -11,6 +11,7 @@ namespace Zend\ProgressBar\Adapter; use Zend\ProgressBar\Adapter\Exception; +use Zend\Stdlib\ErrorHandler; /** * Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console @@ -169,17 +170,19 @@ class Console extends AbstractAdapter */ public function setOutputStream($resource) { - $stream = @fopen($resource, 'w'); + ErrorHandler::start(); + $stream = fopen($resource, 'w'); + $error = ErrorHandler::stop(); - if ($stream === false) { - throw new Exception\RuntimeException('Unable to open stream'); - } + if ($stream === false) { + throw new Exception\RuntimeException('Unable to open stream', 0, $error); + } - if ($this->outputStream !== null) { - fclose($this->outputStream); - } + if ($this->outputStream !== null) { + fclose($this->outputStream); + } - $this->outputStream = $stream; + $this->outputStream = $stream; } /** @@ -220,11 +223,13 @@ class Console extends AbstractAdapter $this->width = 80; // Try to determine the width through stty - if (preg_match('#\d+ (\d+)#', @shell_exec('stty size'), $match) === 1) { + ErrorHandler::start(); + if (preg_match('#\d+ (\d+)#', shell_exec('stty size'), $match) === 1) { $this->width = (int) $match[1]; - } elseif (preg_match('#columns = (\d+);#', @shell_exec('stty'), $match) === 1) { + } elseif (preg_match('#columns = (\d+);#', shell_exec('stty'), $match) === 1) { $this->width = (int) $match[1]; } + ErrorHandler::stop(); } } else { $this->width = (int) $width; diff --git a/vendor/ZF2/library/Zend/ProgressBar/composer.json b/vendor/ZF2/library/Zend/ProgressBar/composer.json index 64fe787a2b3b9f1ed4abdf79618779e080d4387d..eb205c20e172652394a8898e549e4c016aa72611 100644 --- a/vendor/ZF2/library/Zend/ProgressBar/composer.json +++ b/vendor/ZF2/library/Zend/ProgressBar/composer.json @@ -13,6 +13,7 @@ }, "target-dir": "Zend/ProgressBar", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php b/vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php index 7e764777a22d93e816c8ea050efcd8680308c595..dff47c87b07e24ffd2e136913bea932393fe1efc 100644 --- a/vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php +++ b/vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php @@ -44,6 +44,8 @@ class PhpCode extends AbstractAdapter { ErrorHandler::start(E_ALL); $ret = null; + // This suppression is due to the fact that the ErrorHandler cannot + // catch syntax errors, and is intentionally left in place. $eval = @eval('$ret=' . $code . ';'); $err = ErrorHandler::stop(); @@ -62,4 +64,4 @@ class PhpCode extends AbstractAdapter return $ret; } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Server/Cache.php b/vendor/ZF2/library/Zend/Server/Cache.php index dcbba3f5383d6e7c6a44d84764254cf012766351..34cfdd6584e4edc4c1c07078bd81b26b7c836b88 100644 --- a/vendor/ZF2/library/Zend/Server/Cache.php +++ b/vendor/ZF2/library/Zend/Server/Cache.php @@ -10,6 +10,8 @@ namespace Zend\Server; +use Zend\Stdlib\ErrorHandler; + /** * \Zend\Server\Cache: cache server definitions * @@ -57,7 +59,10 @@ class Cache $methods = $definition; } - if (0 === @file_put_contents($filename, serialize($methods))) { + ErrorHandler::start(); + $test = file_put_contents($filename, serialize($methods)); + ErrorHandler::stop(); + if (0 === $test) { return false; } @@ -104,12 +109,17 @@ class Cache return false; } - - if (false === ($dispatch = @file_get_contents($filename))) { + ErrorHandler::start(); + $dispatch = file_get_contents($filename); + ErrorHandler::stop(); + if (false === $dispatch) { return false; } - if (false === ($dispatchArray = @unserialize($dispatch))) { + ErrorHandler::start(E_NOTICE); + $dispatchArray = unserialize($dispatch); + ErrorHandler::stop(); + if (false === $dispatchArray) { return false; } diff --git a/vendor/ZF2/library/Zend/Server/composer.json b/vendor/ZF2/library/Zend/Server/composer.json index ceef1dfaf2d74d86d9e93e10550904bcefe55cdf..69400a24eb786e2a9af0184ffb368be5cd469ecc 100644 --- a/vendor/ZF2/library/Zend/Server/composer.json +++ b/vendor/ZF2/library/Zend/Server/composer.json @@ -13,6 +13,7 @@ }, "target-dir": "Zend/Server", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php b/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php index 83b9d200b1ae74771061f197933b1b03c9fb6da6..fea0e16f41d7bb1ce9d0564518348be1efb0215a 100644 --- a/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php +++ b/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php @@ -212,15 +212,18 @@ class ServiceManager implements ServiceLocatorInterface $cName = $this->canonicalizeName($name); $rName = $name; - if ($this->allowOverride === false && $this->has(array($cName, $rName), false)) { - throw new Exception\InvalidServiceNameException(sprintf( - 'A service by the name or alias "%s" already exists and cannot be overridden; please use an alternate name', - $cName - )); + if ($this->has(array($cName, $rName), false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + 'A service by the name or alias "%s" already exists and cannot be overridden; please use an alternate name', + $cName + )); + } + $this->unregisterService($cName); } $this->invokableClasses[$cName] = $invokableClass; - $this->shared[$cName] = (bool) $shared; + $this->shared[$cName] = (bool) $shared; return $this; } @@ -243,11 +246,14 @@ class ServiceManager implements ServiceLocatorInterface ); } - if ($this->allowOverride === false && $this->has(array($cName, $rName), false)) { - throw new Exception\InvalidServiceNameException(sprintf( - 'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name', - $cName - )); + if ($this->has(array($cName, $rName), false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + 'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name', + $cName + )); + } + $this->unregisterService($cName); } $this->factories[$cName] = $factory; @@ -328,18 +334,17 @@ class ServiceManager implements ServiceLocatorInterface { $cName = $this->canonicalizeName($name); - if ($this->allowOverride === false && $this->has($cName, false)) { - throw new Exception\InvalidServiceNameException(sprintf( - '%s: A service by the name "%s" or alias already exists and cannot be overridden, please use an alternate name.', - __METHOD__, - $name - )); + if ($this->has($cName, false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + '%s: A service by the name "%s" or alias already exists and cannot be overridden, please use an alternate name.', + __METHOD__, + $name + )); + } + $this->unregisterService($cName); } - /** - * @todo If a service is being overwritten, destroy all previous aliases - */ - $this->instances[$cName] = $service; $this->shared[$cName] = (bool) $shared; return $this; @@ -877,4 +882,33 @@ class ServiceManager implements ServiceLocatorInterface $r = new ReflectionClass($className); return $r->implementsInterface($type); } + + /** + * Unregister a service + * + * Called when $allowOverride is true and we detect that a service being + * added to the instance already exists. This will remove the duplicate + * entry, and also any shared flags previously registered. + * + * @param string $canonical + * @return void + */ + protected function unregisterService($canonical) + { + $types = array('invokableClasses', 'factories', 'aliases'); + foreach ($types as $type) { + if (isset($this->{$type}[$canonical])) { + unset($this->{$type}[$canonical]); + break; + } + } + + if (isset($this->instances[$canonical])) { + unset($this->instances[$canonical]); + } + + if (isset($this->shared[$canonical])) { + unset($this->shared[$canonical]); + } + } } diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Figlet.php b/vendor/ZF2/library/Zend/Text/Figlet/Figlet.php index 15ff9b3dba6e0166d7136ebd84362595f3dd31af..abb4996ed13b55e63dc463cfd2c8ba22e5ec763f 100644 --- a/vendor/ZF2/library/Zend/Text/Figlet/Figlet.php +++ b/vendor/ZF2/library/Zend/Text/Figlet/Figlet.php @@ -12,6 +12,7 @@ namespace Zend\Text\Figlet; use Traversable; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; /** * Zend\Text\Figlet is a PHP implementation of FIGlet @@ -426,10 +427,13 @@ class Figlet $wordBreakMode = 0; $lastCharWasEol = false; - $textLength = @iconv_strlen($text, 'UTF-8'); + + ErrorHandler::start(E_NOTICE); + $textLength = iconv_strlen($text, 'UTF-8'); + $error = ErrorHandler::stop(); if ($textLength === false) { - throw new Exception\UnexpectedValueException('$text is not encoded with ' . $encoding); + throw new Exception\UnexpectedValueException('$text is not encoded with ' . $encoding, 0, $error); } for ($charNum = 0; $charNum < $textLength; $charNum++) { diff --git a/vendor/ZF2/library/Zend/Text/composer.json b/vendor/ZF2/library/Zend/Text/composer.json index ac4232df3f0046272e0bef4a58d147dfa008ea5a..751d3e6fabd3127d996637b94a4b32771b900b82 100644 --- a/vendor/ZF2/library/Zend/Text/composer.json +++ b/vendor/ZF2/library/Zend/Text/composer.json @@ -13,6 +13,7 @@ }, "target-dir": "Zend/Text", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Validator/Csrf.php b/vendor/ZF2/library/Zend/Validator/Csrf.php index a40ca693f40df10be3a08bc9fc8671dd6e1246cf..1f52db6de57e83f0c871c4b19ef99cd2a125f646 100644 --- a/vendor/ZF2/library/Zend/Validator/Csrf.php +++ b/vendor/ZF2/library/Zend/Validator/Csrf.php @@ -235,7 +235,9 @@ class Csrf extends AbstractValidator */ public function getSessionName() { - return str_replace('\\', '_', __CLASS__) . '_' . $this->getSalt() . '_' . $this->getName(); + return str_replace('\\', '_', __CLASS__) . '_' + . $this->getSalt() . '_' + . strtr($this->getName(), array('[' => '_', ']' => '')); } /** diff --git a/vendor/ZF2/library/Zend/Validator/EmailAddress.php b/vendor/ZF2/library/Zend/Validator/EmailAddress.php index 02d1239c6a972a329357e696de216bf2eb4e1e86..67a31d9e7f475cb9d930da9c5d8d76a547332278 100644 --- a/vendor/ZF2/library/Zend/Validator/EmailAddress.php +++ b/vendor/ZF2/library/Zend/Validator/EmailAddress.php @@ -122,13 +122,13 @@ class EmailAddress extends AbstractValidator public function setMessage($messageString, $messageKey = null) { if ($messageKey === null) { - $this->options['hostnameValidator']->setMessage($messageString); + $this->getHostnameValidator()->setMessage($messageString); parent::setMessage($messageString); return $this; } if (!isset($this->messageTemplates[$messageKey])) { - $this->options['hostnameValidator']->setMessage($messageString, $messageKey); + $this->getHostnameValidator()->setMessage($messageString, $messageKey); } else { parent::setMessage($messageString, $messageKey); } @@ -143,6 +143,12 @@ class EmailAddress extends AbstractValidator */ public function getHostnameValidator() { + if (!isset($this->options['hostnameValidator']) + || !$this->options['hostnameValidator'] instanceof Hostname + ) { + $this->setHostnameValidator(); + } + return $this->options['hostnameValidator']; } diff --git a/vendor/ZF2/library/Zend/Validator/File/FilesSize.php b/vendor/ZF2/library/Zend/Validator/File/FilesSize.php index bc4942a066e813f19901104f015abf7e97e2b999..511e466eadcf104b04b0c81ae922cd8da9838c4c 100644 --- a/vendor/ZF2/library/Zend/Validator/File/FilesSize.php +++ b/vendor/ZF2/library/Zend/Validator/File/FilesSize.php @@ -12,6 +12,7 @@ namespace Zend\Validator\File; use Traversable; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; use Zend\Validator\Exception; /** @@ -111,7 +112,9 @@ class FilesSize extends Size } // limited to 2GB files - $size += @filesize($files); + ErrorHandler::start(); + $size += filesize($files); + ErrorHandler::stop(); $this->size = $size; if (($max !== null) && ($max < $size)) { if ($this->getByteString()) { diff --git a/vendor/ZF2/library/Zend/Validator/File/ImageSize.php b/vendor/ZF2/library/Zend/Validator/File/ImageSize.php index 3bc82843604a3e7b691a4c44d9c3cd8aa8f9ce43..70dfdc6b4d10564da4444f1e2f7d8d69420d6ee4 100644 --- a/vendor/ZF2/library/Zend/Validator/File/ImageSize.php +++ b/vendor/ZF2/library/Zend/Validator/File/ImageSize.php @@ -10,6 +10,7 @@ namespace Zend\Validator\File; +use Zend\Stdlib\ErrorHandler; use Zend\Validator\AbstractValidator; use Zend\Validator\Exception; @@ -336,7 +337,9 @@ class ImageSize extends AbstractValidator return $this->throwError($file, self::NOT_READABLE); } - $size = @getimagesize($value); + ErrorHandler::start(); + $size = getimagesize($value); + ErrorHandler::stop(); $this->setValue($file); if (empty($size) or ($size[0] === 0) or ($size[1] === 0)) { diff --git a/vendor/ZF2/library/Zend/Validator/File/MimeType.php b/vendor/ZF2/library/Zend/Validator/File/MimeType.php index 23787363c63c6d25cbb452ae7ae5191d47b62759..cc4ffff6428b473126aabc6ce9dfe4fe9e4df4ac 100644 --- a/vendor/ZF2/library/Zend/Validator/File/MimeType.php +++ b/vendor/ZF2/library/Zend/Validator/File/MimeType.php @@ -12,6 +12,7 @@ namespace Zend\Validator\File; use Traversable; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; use Zend\Validator\AbstractValidator; use Zend\Validator\Exception; @@ -145,7 +146,17 @@ class MimeType extends AbstractValidator $magic = getenv('magic'); if (!empty($magic)) { $this->setMagicFile($magic); - } elseif (!(@ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1)) { + if ($this->options['magicFile'] === null) { + $this->options['magicFile'] = false; + } + return $this->options['magicFile']; + } + + ErrorHandler::start(); + $safeMode = ini_get('safe_mode'); + ErrorHandler::stop(); + + if (!($safeMode == 'On' || $safeMode === 1)) { foreach ($this->magicFiles as $file) { // suppressing errors which are thrown due to openbase_dir restrictions try { @@ -195,16 +206,17 @@ class MimeType extends AbstractValidator )); } else { $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; - $this->finfo = @finfo_open($const, $file); + ErrorHandler::start(E_NOTICE|E_WARNING); + $this->finfo = finfo_open($const, $file); + $error = ErrorHandler::stop(); if (empty($this->finfo)) { $this->finfo = null; throw new Exception\InvalidMagicMimeFileException(sprintf( 'The given magicfile ("%s") could not be used by ext/finfo', $file - )); - } else { - $this->options['magicFile'] = $file; + ), 0, $error); } + $this->options['magicFile'] = $file; } return $this; @@ -355,11 +367,15 @@ class MimeType extends AbstractValidator if (class_exists('finfo', false)) { $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; if (!$this->isMagicFileDisabled() && (!empty($mimefile) && empty($this->finfo))) { - $this->finfo = @finfo_open($const, $mimefile); + ErrorHandler::start(E_NOTICE|E_WARNING); + $this->finfo = finfo_open($const, $mimefile); + ErrorHandler::stop(); } if (empty($this->finfo)) { - $this->finfo = @finfo_open($const); + ErrorHandler::start(E_NOTICE|E_WARNING); + $this->finfo = finfo_open($const); + ErrorHandler::stop(); } $this->type = null; diff --git a/vendor/ZF2/library/Zend/Validator/File/Size.php b/vendor/ZF2/library/Zend/Validator/File/Size.php index 2b4fd7dc67278442878fb02426b9ec201b2657c0..858876a39a7989fdadd98d766b9032ada10b920e 100644 --- a/vendor/ZF2/library/Zend/Validator/File/Size.php +++ b/vendor/ZF2/library/Zend/Validator/File/Size.php @@ -10,6 +10,7 @@ namespace Zend\Validator\File; +use Zend\Stdlib\ErrorHandler; use Zend\Validator\AbstractValidator; use Zend\Validator\Exception; @@ -247,7 +248,9 @@ class Size extends AbstractValidator } // limited to 4GB files - $size = sprintf("%u", @filesize($value)); + ErrorHandler::start(); + $size = sprintf("%u", filesize($value)); + ErrorHandler::stop(); $this->size = $size; // Check to see if it's smaller than min size diff --git a/vendor/ZF2/library/Zend/Validator/Hostname.php b/vendor/ZF2/library/Zend/Validator/Hostname.php index 8cda7b3c95df1f82b47dc06da29e8be94d79ce69..d780cd51b4bc7dad612a9ba0c604651112b01715 100644 --- a/vendor/ZF2/library/Zend/Validator/Hostname.php +++ b/vendor/ZF2/library/Zend/Validator/Hostname.php @@ -10,6 +10,8 @@ namespace Zend\Validator; +use Zend\Stdlib\ErrorHandler; + /** * Please note there are two standalone test scripts for testing IDN characters due to problems * with file encoding. @@ -545,7 +547,9 @@ class Hostname extends AbstractValidator // Check each domain part $checked = false; foreach ($regexChars as $regexKey => $regexChar) { - $status = @preg_match($regexChar, $domainPart); + ErrorHandler::start(); + $status = preg_match($regexChar, $domainPart); + ErrorHandler::stop(); if ($status > 0) { $length = 63; if (array_key_exists(strtoupper($this->tld), $this->idnLength) @@ -599,8 +603,10 @@ class Hostname extends AbstractValidator } // Check input against local network name schema; last chance to pass validation + ErrorHandler::start(); $regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}[\x2e]{0,1}){1,254}$/'; - $status = @preg_match($regexLocal, $value); + $status = preg_match($regexLocal, $value); + ErrorHandler::stop(); // If the input passes as a local network name, and local network names are allowed, then the // hostname passes validation diff --git a/vendor/ZF2/library/Zend/Validator/Regex.php b/vendor/ZF2/library/Zend/Validator/Regex.php index 010d7a429a15d0561eebe2602d35a6d63e549e54..e4ced1dddf2750ee5cf8d572201af36ee2952534 100644 --- a/vendor/ZF2/library/Zend/Validator/Regex.php +++ b/vendor/ZF2/library/Zend/Validator/Regex.php @@ -12,6 +12,7 @@ namespace Zend\Validator; use Traversable; use Zend\Stdlib\ArrayUtils; +use Zend\Stdlib\ErrorHandler; /** * @category Zend @@ -96,11 +97,13 @@ class Regex extends AbstractValidator */ public function setPattern($pattern) { + ErrorHandler::start(); $this->pattern = (string) $pattern; - $status = @preg_match($this->pattern, "Test"); + $status = preg_match($this->pattern, "Test"); + $error = ErrorHandler::stop(); if (false === $status) { - throw new Exception\InvalidArgumentException("Internal error parsing the pattern '{$this->pattern}'"); + throw new Exception\InvalidArgumentException("Internal error parsing the pattern '{$this->pattern}'", 0, $error); } return $this; @@ -121,7 +124,9 @@ class Regex extends AbstractValidator $this->setValue($value); - $status = @preg_match($this->pattern, $value); + ErrorHandler::start(); + $status = preg_match($this->pattern, $value); + ErrorHandler::stop(); if (false === $status) { $this->error(self::ERROROUS); return false; diff --git a/vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php b/vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php index 4e927e7026167b3ec1a0dcc23031be857b126b0b..8dd46046897400e8e07d23b4fa845430b2daf3cb 100644 --- a/vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php +++ b/vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php @@ -10,6 +10,7 @@ namespace Zend\Validator\Sitemap; +use Zend\Stdlib\ErrorHandler; use Zend\Validator\AbstractValidator; /** @@ -62,7 +63,9 @@ class Lastmod extends AbstractValidator } $this->setValue($value); - $result = @preg_match(self::LASTMOD_REGEX, $value); + ErrorHandler::start(); + $result = preg_match(self::LASTMOD_REGEX, $value); + ErrorHandler::stop(); if ($result != 1) { $this->error(self::NOT_VALID); return false; diff --git a/vendor/ZF2/library/Zend/Validator/Uri.php b/vendor/ZF2/library/Zend/Validator/Uri.php index 86bc9b16aeab94175baaabbe467544f675fa9a0b..136cc5d6913f63f8d0f213e1d583b92f8f8e19cf 100644 --- a/vendor/ZF2/library/Zend/Validator/Uri.php +++ b/vendor/ZF2/library/Zend/Validator/Uri.php @@ -13,6 +13,7 @@ namespace Zend\Validator; use Traversable; use Zend\Uri\Exception\ExceptionInterface as UriException; use Zend\Uri\Uri as UriHandler; +use Zend\Validator\Exception\InvalidArgumentException; /** * @category Zend @@ -89,7 +90,15 @@ class Uri extends AbstractValidator if (null === $this->uriHandler) { // Lazy load the base Uri handler $this->uriHandler = new UriHandler(); + } elseif (is_string($this->uriHandler) && class_exists($this->uriHandler)) { + // Instantiate string Uri handler that references a class + $this->uriHandler = new $this->uriHandler; } + + if (! $this->uriHandler instanceof UriHandler) { + throw new InvalidArgumentException('URI handler is expected to be a Zend\Uri\Uri object'); + } + return $this->uriHandler; } @@ -99,6 +108,10 @@ class Uri extends AbstractValidator */ public function setUriHandler($uriHandler) { + if (! is_subclass_of($uriHandler, 'Zend\Uri\Uri')) { + throw new InvalidArgumentException('Expecting a subclass name or instance of Zend\Uri\Uri as $uriHandler'); + } + $this->uriHandler = $uriHandler; return $this; } diff --git a/vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php b/vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php index 9c9018384b5905a7f8f993a89c6b9e925583da1a..056486d9de31ba267354085714dbe1866bf8ff2b 100644 --- a/vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php +++ b/vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php @@ -105,6 +105,7 @@ class ValidatorPluginManager extends AbstractPluginManager 'sitemappriority' => 'Zend\Validator\Sitemap\Priority', 'stringlength' => 'Zend\Validator\StringLength', 'step' => 'Zend\Validator\Step', + 'uri' => 'Zend\Validator\Uri', ); /** diff --git a/vendor/ZF2/library/Zend/Validator/composer.json b/vendor/ZF2/library/Zend/Validator/composer.json index 5cf37e4a3280282b860ec9f335de0e750d9f57d1..b9636b76b9bcf4a2c8dce04ec2d7af59aa78d4ad 100644 --- a/vendor/ZF2/library/Zend/Validator/composer.json +++ b/vendor/ZF2/library/Zend/Validator/composer.json @@ -13,7 +13,8 @@ }, "target-dir": "Zend/Validator", "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" }, "require-dev": { "zendframework/zend-math": "self.version" @@ -23,4 +24,4 @@ "zendframework/zend-db": "Zend\\Db component", "zendframework/zend-math": "Zend\\Math component" } -} \ No newline at end of file +} diff --git a/vendor/ZF2/library/Zend/Version/Version.php b/vendor/ZF2/library/Zend/Version/Version.php index e8d6a923f1761d21228bfa1bde1effef8caf77f0..da34ea43355f84c1b53748ffd8107cd71db1939f 100644 --- a/vendor/ZF2/library/Zend/Version/Version.php +++ b/vendor/ZF2/library/Zend/Version/Version.php @@ -23,7 +23,7 @@ final class Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '2.0.0rc4'; + const VERSION = '2.0.0rc5'; /** * The latest stable version Zend Framework available diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation.php b/vendor/ZF2/library/Zend/View/Helper/Navigation.php index 2938a568819525390246d5c5ba16bfe6008c76ef..a36f24a6c61f783a46ff9ad76fe757cacda5992c 100644 --- a/vendor/ZF2/library/Zend/View/Helper/Navigation.php +++ b/vendor/ZF2/library/Zend/View/Helper/Navigation.php @@ -171,10 +171,8 @@ class Navigation extends AbstractNavigationHelper * thrown if something goes * wrong. Default is true. * @return \Zend\View\Helper\Navigation\HelperInterface helper instance - * @throws \Zend\Loader\PluginLoader\Exception if $strict is true and + * @throws Exception\RuntimeException if $strict is true and * helper cannot be found - * @throws Exception\InvalidArgumentException if $strict is true and - * helper does not implement the specified interface */ public function findHelper($proxy, $strict = true) { @@ -334,11 +332,8 @@ class Navigation extends AbstractNavigationHelper * render. Default is to * render the container * registered in the helper. - * @return string helper output - * @throws \Zend\Loader\PluginLoader\Exception if helper cannot be found - * @throws \Zend\View\Exception\ExceptionInterface if helper doesn't implement - * the interface specified in - * {@link findHelper()} + * @return string helper output + * @throws Exception\RuntimeException if helper cannot be found */ public function render($container = null) { diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php b/vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php index 24dcd83f4f2754fa6fcd54f1fe54010eaec64083..a4e85a94d5a4654b0d8200d349a40a752461a444 100644 --- a/vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php +++ b/vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php @@ -14,6 +14,7 @@ use DOMDocument; use RecursiveIteratorIterator; use Zend\Navigation\AbstractContainer; use Zend\Navigation\Page\AbstractPage; +use Zend\Stdlib\ErrorHandler; use Zend\Uri; use Zend\View; use Zend\View\Exception; @@ -422,11 +423,14 @@ class Sitemap extends AbstractHelper // validate using schema if specified if ($this->getUseSchemaValidation()) { - if (!@$dom->schemaValidate(self::SITEMAP_XSD)) { + ErrorHandler::start(); + $test = $dom->schemaValidate(self::SITEMAP_XSD); + $error = ErrorHandler::stop(); + if (!$test) { throw new Exception\RuntimeException(sprintf( 'Sitemap is invalid according to XML Schema at "%s"', self::SITEMAP_XSD - )); + ), 0, $error); } } diff --git a/vendor/ZF2/library/Zend/View/Helper/Url.php b/vendor/ZF2/library/Zend/View/Helper/Url.php index 9fbea29d0dfdb3425017d943e0fafaa3ef86602f..1ee7d40ddefc0d1ac04adc0f772d4204813eafab 100644 --- a/vendor/ZF2/library/Zend/View/Helper/Url.php +++ b/vendor/ZF2/library/Zend/View/Helper/Url.php @@ -74,12 +74,17 @@ class Url extends AbstractHelper * @throws Exception\RuntimeException If no RouteMatch was provided * @throws Exception\RuntimeException If RouteMatch didn't contain a matched route name */ - public function __invoke($name = null, array $params = array(), array $options = array(), $reuseMatchedParams = false) + public function __invoke($name = null, array $params = array(), $options = array(), $reuseMatchedParams = false) { if (null === $this->router) { throw new Exception\RuntimeException('No RouteStackInterface instance provided'); } + if (3 == func_num_args() && is_bool($options)) { + $reuseMatchedParams = $options; + $options = array(); + } + if ($name === null) { if ($this->routeMatch === null) { throw new Exception\RuntimeException('No RouteMatch instance provided'); diff --git a/vendor/ZF2/library/Zend/XmlRpc/Request/Http.php b/vendor/ZF2/library/Zend/XmlRpc/Request/Http.php index c26379a0e526a6b851f74349b2f866d24a384b69..462429df86110354111388bff0229c6872314fb3 100644 --- a/vendor/ZF2/library/Zend/XmlRpc/Request/Http.php +++ b/vendor/ZF2/library/Zend/XmlRpc/Request/Http.php @@ -10,6 +10,7 @@ namespace Zend\XmlRpc\Request; +use Zend\Stdlib\ErrorHandler; use Zend\XmlRpc\Fault; use Zend\XmlRpc\Request as XmlRpcRequest; @@ -47,7 +48,9 @@ class Http extends XmlRpcRequest */ public function __construct() { - $xml = @file_get_contents('php://input'); + ErrorHandler::start(); + $xml = file_get_contents('php://input'); + ErrorHandler::stop(); if (!$xml) { $this->fault = new Fault(630); return; diff --git a/vendor/ZF2/library/Zend/XmlRpc/composer.json b/vendor/ZF2/library/Zend/XmlRpc/composer.json index 48577e316df4f2ca556d64f7e272f8a720fd2b09..012e334da0b2e7b21603cc0bde8cddc8dbb8e2c3 100644 --- a/vendor/ZF2/library/Zend/XmlRpc/composer.json +++ b/vendor/ZF2/library/Zend/XmlRpc/composer.json @@ -16,6 +16,7 @@ "php": ">=5.3.3", "zendframework/zend-http": "self.version", "zendframework/zend-math": "self.version", - "zendframework/zend-server": "self.version" + "zendframework/zend-server": "self.version", + "zendframework/zend-stdlib": "self.version" } -} \ No newline at end of file +}