Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/zendframework/zf2

  • Loading branch information...
commit 1f24eba776ddfb2382a3a40a5a175028ddd90797 2 parents f73a3f7 + 1d12f86
Jerry Saravia authored
Showing with 1,651 additions and 302 deletions.
  1. +1 −2  .travis.yml
  2. +2 −1  README.md
  3. +1 −1  library/Zend/Authentication/composer.json
  4. +1 −1  library/Zend/Barcode/composer.json
  5. +1 −1  library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
  6. +1 −1  library/Zend/Cache/composer.json
  7. +1 −1  library/Zend/Captcha/composer.json
  8. +1 −1  library/Zend/Code/composer.json
  9. +1 −1  library/Zend/Config/composer.json
  10. +1 −1  library/Zend/Console/composer.json
  11. +1 −1  library/Zend/Crypt/composer.json
  12. +6 −0 library/Zend/Db/Adapter/AdapterAwareInterface.php
  13. +6 −0 library/Zend/Db/Adapter/AdapterServiceFactory.php
  14. +62 −1 library/Zend/Db/Adapter/Driver/ConnectionInterface.php
  15. +16 −0 library/Zend/Db/Adapter/Driver/DriverInterface.php
  16. +8 −0 library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php
  17. +20 −0 library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php
  18. +9 −3 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
  19. +19 −0 library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php
  20. +21 −2 library/Zend/Db/Adapter/Driver/Mysqli/Result.php
  21. +8 −0 library/Zend/Db/Adapter/Driver/Mysqli/Statement.php
  22. +33 −3 library/Zend/Db/Adapter/Driver/Pdo/Connection.php
  23. +7 −1 library/Zend/Db/Adapter/Driver/Pdo/Pdo.php
  24. +11 −1 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
  25. +24 −0 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
  26. +79 −1 library/Zend/Db/Adapter/Driver/Pgsql/Result.php
  27. +19 −1 library/Zend/Db/Adapter/Driver/Pgsql/Statement.php
  28. +47 −1 library/Zend/Db/Adapter/Driver/ResultInterface.php
  29. +8 −3 library/Zend/Db/Adapter/Driver/StatementInterface.php
  30. +59 −0 library/Zend/Db/Adapter/Platform/PlatformInterface.php
  31. +8 −4 library/Zend/Db/Adapter/StatementContainerInterface.php
  32. +2 −1  library/Zend/Db/Sql/Select.php
  33. +1 −1  library/Zend/Db/composer.json
  34. +1 −1  library/Zend/Debug/composer.json
  35. +3 −0  library/Zend/Di/ServiceLocator/Generator.php
  36. +1 −1  library/Zend/Di/composer.json
  37. +1 −1  library/Zend/Dom/composer.json
  38. +1 −1  library/Zend/Escaper/composer.json
  39. +1 −1  library/Zend/EventManager/composer.json
  40. +5 −3 library/Zend/Feed/composer.json
  41. +1 −1  library/Zend/File/PhpClassFile.php
  42. +1 −1  library/Zend/File/Transfer/Adapter/AbstractAdapter.php
  43. +1 −1  library/Zend/File/Transfer/Adapter/Http.php
  44. +1 −1  library/Zend/File/composer.json
  45. +1 −1  library/Zend/Filter/composer.json
  46. +2 −0  library/Zend/Form/Element/Collection.php
  47. +15 −1 library/Zend/Form/Element/File.php
  48. +2 −2 library/Zend/Form/Element/MultiCheckbox.php
  49. +14 −1 library/Zend/Form/Element/Password.php
  50. +11 −2 library/Zend/Form/Element/Select.php
  51. +32 −23 library/Zend/Form/Form.php
  52. +2 −1  library/Zend/Form/View/Helper/FormCollection.php
  53. +3 −3 library/Zend/Form/View/Helper/FormRow.php
  54. +1 −1  library/Zend/Form/composer.json
  55. +8 −4 library/Zend/Http/Client/Adapter/Curl.php
  56. +1 −1  library/Zend/Http/Header/SetCookie.php
  57. +1 −1  library/Zend/Http/composer.json
  58. +2 −1  library/Zend/I18n/composer.json
  59. +1 −1  library/Zend/InputFilter/Input.php
  60. +1 −1  library/Zend/InputFilter/composer.json
  61. +1 −1  library/Zend/Json/composer.json
  62. +1 −1  library/Zend/Ldap/composer.json
  63. +6 −4 library/Zend/Loader/AutoloaderFactory.php
  64. +1 −1  library/Zend/Loader/ClassMapAutoloader.php
  65. +10 −10 library/Zend/Loader/ModuleAutoloader.php
  66. +1 −1  library/Zend/Loader/PluginClassLoader.php
  67. +1 −1  library/Zend/Loader/PluginClassLocator.php
  68. +2 −2 library/Zend/Loader/StandardAutoloader.php
  69. +1 −1  library/Zend/Loader/composer.json
  70. +10 −0 library/Zend/Log/Writer/FirePhp.php
  71. +1 −1  library/Zend/Log/composer.json
  72. +1 −1  library/Zend/Mail/composer.json
  73. +1 −1  library/Zend/Math/composer.json
  74. +1 −1  library/Zend/Memory/composer.json
  75. +1 −1  library/Zend/Mime/composer.json
  76. +6 −2 library/Zend/ModuleManager/Listener/ConfigListener.php
  77. +6 −1 library/Zend/ModuleManager/ModuleManager.php
  78. +1 −1  library/Zend/ModuleManager/composer.json
  79. +109 −88 library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
  80. +1 −1  library/Zend/Mvc/composer.json
  81. +1 −1  library/Zend/Navigation/composer.json
  82. +1 −1  library/Zend/Paginator/composer.json
  83. +1 −1  library/Zend/Permissions/Acl/composer.json
  84. +1 −1  library/Zend/ProgressBar/composer.json
  85. +1 −1  library/Zend/Serializer/composer.json
  86. +1 −1  library/Zend/Server/composer.json
  87. +21 −0 library/Zend/ServiceManager/AbstractFactoryInterface.php
  88. +58 −0 library/Zend/ServiceManager/Config.php
  89. +10 −0 library/Zend/ServiceManager/ConfigInterface.php
  90. +2 −0  library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php
  91. +6 −0 library/Zend/ServiceManager/Di/DiInstanceManagerProxy.php
  92. +4 −0 library/Zend/ServiceManager/Di/DiServiceFactory.php
  93. +4 −0 library/Zend/ServiceManager/Di/DiServiceInitializer.php
  94. +2 −1  library/Zend/ServiceManager/Exception/CircularDependencyFoundException.php
  95. +5 −0 library/Zend/ServiceManager/Exception/ExceptionInterface.php
  96. +3 −3 library/Zend/ServiceManager/Exception/InvalidArgumentException.php
  97. +7 −1 library/Zend/ServiceManager/Exception/InvalidServiceNameException.php
  98. +2 −1  library/Zend/ServiceManager/Exception/RuntimeException.php
  99. +2 −1  library/Zend/ServiceManager/Exception/ServiceNotCreatedException.php
  100. +2 −1  library/Zend/ServiceManager/Exception/ServiceNotFoundException.php
  101. +10 −0 library/Zend/ServiceManager/FactoryInterface.php
  102. +11 −0 library/Zend/ServiceManager/InitializerInterface.php
  103. +15 −0 library/Zend/ServiceManager/ServiceLocatorAwareInterface.php
  104. +20 −0 library/Zend/ServiceManager/ServiceLocatorInterface.php
  105. +42 −6 library/Zend/ServiceManager/ServiceManager.php
  106. +9 −0 library/Zend/ServiceManager/ServiceManagerAwareInterface.php
  107. +1 −1  library/Zend/ServiceManager/composer.json
  108. +1 −1  library/Zend/Session/Container.php
  109. +1 −1  library/Zend/Session/composer.json
  110. +1 −1  library/Zend/Soap/composer.json
  111. +11 −0 library/Zend/Stdlib/DispatchableInterface.php
  112. +3 −9 library/Zend/Stdlib/Hydrator/ClassMethods.php
  113. +1 −1  library/Zend/Stdlib/composer.json
  114. +1 −1  library/Zend/Tag/composer.json
  115. +3 −2 library/Zend/Text/composer.json
  116. +1 −1  library/Zend/Uri/composer.json
  117. +5 −1 library/Zend/Validator/Date.php
  118. +1 −1  library/Zend/Validator/ValidatorPluginManager.php
  119. +2 −1  library/Zend/Validator/composer.json
  120. +1 −1  library/Zend/Version/Version.php
  121. +1 −1  library/Zend/Version/composer.json
  122. +6 −6 library/Zend/View/Helper/HeadLink.php
  123. +9 −3 library/Zend/View/Helper/HeadMeta.php
  124. +5 −9 library/Zend/View/Strategy/JsonStrategy.php
  125. +1 −1  library/Zend/View/composer.json
  126. +1 −1  library/Zend/XmlRpc/composer.json
  127. +35 −0 resources/languages/tr/Zend_Captcha.php
  128. +279 −0 resources/languages/tr/Zend_Validate.php
  129. +16 −0 tests/ZendTest/Cache/Storage/Adapter/MemcachedTest.php
  130. +26 −3 tests/ZendTest/Db/Sql/SelectTest.php
  131. +67 −6 tests/ZendTest/Form/FormTest.php
  132. +46 −0 tests/ZendTest/Form/View/Helper/FormRowTest.php
  133. +13 −1 tests/ZendTest/Http/Header/SetCookieTest.php
  134. +25 −0 tests/ZendTest/InputFilter/InputTest.php
  135. +2 −0  tests/ZendTest/Mail/Storage/MboxFolderTest.php
  136. +2 −0  tests/ZendTest/Mail/Storage/MboxTest.php
  137. +11 −0 tests/ZendTest/ServiceManager/ServiceManagerTest.php
  138. +30 −0 tests/ZendTest/ServiceManager/TestAsset/BarAbstractFactory.php
  139. +15 −14 tests/ZendTest/Stdlib/HydratorTest.php
  140. +4 −4 tests/ZendTest/View/Helper/HeadLinkTest.php
  141. +22 −0 tests/ZendTest/View/Strategy/JsonStrategyTest.php
View
3  .travis.yml
@@ -7,8 +7,7 @@ php:
before_install:
- cp tests/TestConfiguration.php.travis tests/TestConfiguration.php
- - curl -s https://getcomposer.org/installer | php -- --quiet
- - php composer.phar install --dev
+ - composer install --dev
- wget http://cs.sensiolabs.org/get/php-cs-fixer.phar
script:
View
3  README.md
@@ -1,6 +1,7 @@
### Welcome to the *Zend Framework 2.0* Release!
Master: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2)
+Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2)
## RELEASE INFORMATION
@@ -12,7 +13,7 @@ XX YYY 2012
### UPDATES IN 2.0.3
-Please see [CHANGELOG.md](CHANGELOG.md).
+Please see CHANGELOG.md.
### SYSTEM REQUIREMENTS
View
2  library/Zend/Authentication/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Authentication": ""
+ "Zend\\Authentication\\": ""
}
},
"target-dir": "Zend/Authentication",
View
2  library/Zend/Barcode/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Barcode": ""
+ "Zend\\Barcode\\": ""
}
},
"target-dir": "Zend/Barcode",
View
2  library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
@@ -139,7 +139,7 @@ public function setLibOptions(array $libOptions)
}
$this->triggerOptionEvent('lib_options', $normalizedOptions);
- $this->libOptions = array_merge($this->libOptions, $normalizedOptions);
+ $this->libOptions = array_diff_key($this->libOptions, $normalizedOptions) + $normalizedOptions;
return $this;
}
View
2  library/Zend/Cache/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Cache": ""
+ "Zend\\Cache\\": ""
}
},
"target-dir": "Zend/Cache",
View
2  library/Zend/Captcha/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Captcha": ""
+ "Zend\\Captcha\\": ""
}
},
"target-dir": "Zend/Captcha",
View
2  library/Zend/Code/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Code": ""
+ "Zend\\Code\\": ""
}
},
"target-dir": "Zend/Code",
View
2  library/Zend/Config/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Config": ""
+ "Zend\\Config\\": ""
}
},
"target-dir": "Zend/Config",
View
2  library/Zend/Console/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Console": ""
+ "Zend\\Console\\": ""
}
},
"target-dir": "Zend/Console",
View
2  library/Zend/Crypt/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Crypt": ""
+ "Zend\\Crypt\\": ""
}
},
"target-dir": "Zend/Crypt",
View
6 library/Zend/Db/Adapter/AdapterAwareInterface.php
@@ -17,5 +17,11 @@
*/
interface AdapterAwareInterface
{
+ /**
+ * Set db adapter
+ *
+ * @param Adapter $adapter
+ * @return AdapterAwareInterface
+ */
public function setDbAdapter(Adapter $adapter);
}
View
6 library/Zend/Db/Adapter/AdapterServiceFactory.php
@@ -20,6 +20,12 @@
*/
class AdapterServiceFactory implements FactoryInterface
{
+ /**
+ * Create db adapter service
+ *
+ * @param ServiceLocatorInterface $serviceLocator
+ * @return Adapter
+ */
public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Configuration');
View
63 library/Zend/Db/Adapter/Driver/ConnectionInterface.php
@@ -17,14 +17,75 @@
*/
interface ConnectionInterface
{
+ /**
+ * Get current schema
+ *
+ * @return string
+ */
public function getCurrentSchema();
+
+ /**
+ * Get resource
+ *
+ * @return mixed
+ */
public function getResource();
+
+ /**
+ * Connect
+ *
+ * @return ConnectionInterface
+ */
public function connect();
+
+ /**
+ * Is connected
+ *
+ * @return bool
+ */
public function isConnected();
+
+ /**
+ * Disconnect
+ *
+ * @return ConnectionInterface
+ */
public function disconnect();
+
+ /**
+ * Begin transaction
+ *
+ * @return ConnectionInterface
+ */
public function beginTransaction();
+
+ /**
+ * Commit
+ *
+ * @return ConnectionInterface
+ */
public function commit();
+
+ /**
+ * Rollback
+ *
+ * @return ConnectionInterface
+ */
public function rollback();
- public function execute($sql); // return result set
+
+ /**
+ * Execute
+ *
+ * @param string $sql
+ * @return ResultInterface
+ */
+ public function execute($sql);
+
+ /**
+ * Get last generated id
+ *
+ * @param null $name Ignored
+ * @return integer
+ */
public function getLastGeneratedValue($name = null);
}
View
16 library/Zend/Db/Adapter/Driver/DriverInterface.php
@@ -23,39 +23,53 @@
const NAME_FORMAT_NATURAL = 'natural';
/**
+ * Get database platform name
+ *
* @param string $nameFormat
* @return string
*/
public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE);
/**
+ * Check environment
+ *
* @return bool
*/
public function checkEnvironment();
/**
+ * Get connection
+ *
* @return ConnectionInterface
*/
public function getConnection();
/**
+ * Create statement
+ *
* @param string|resource $sqlOrResource
* @return StatementInterface
*/
public function createStatement($sqlOrResource = null);
/**
+ * Create result
+ *
* @param resource $resource
* @return ResultInterface
*/
public function createResult($resource);
/**
+ * Get prepare type
+ *
* @return array
*/
public function getPrepareType();
/**
+ * Format parameter name
+ *
* @param string $name
* @param mixed $type
* @return string
@@ -63,6 +77,8 @@ public function getPrepareType();
public function formatParameterName($name, $type = null);
/**
+ * Get last generated value
+ *
* @return mixed
*/
public function getLastGeneratedValue();
View
8 library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php
@@ -26,13 +26,21 @@
protected $driver = null;
/**
+ * Set driver
+ *
* @param DriverInterface $driver
+ * @return void
*/
public function setDriver(DriverInterface $driver)
{
$this->driver = $driver;
}
+ /**
+ * Get name
+ *
+ * @return string
+ */
abstract public function getName();
}
View
20 library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php
@@ -17,7 +17,27 @@
*/
interface DriverFeatureInterface
{
+ /**
+ * Setup the default features for Pdo
+ *
+ * @return DriverFeatureInterface
+ */
public function setupDefaultFeatures();
+
+ /**
+ * Add feature
+ *
+ * @param string $name
+ * @param mixed $feature
+ * @return DriverFeatureInterface
+ */
public function addFeature($name, $feature);
+
+ /**
+ * Get feature
+ *
+ * @param $name
+ * @return mixed|false
+ */
public function getFeature($name);
}
View
12 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
@@ -138,7 +138,7 @@ public function getResource()
* Connect
*
* @throws Exception\RuntimeException
- * @return null
+ * @return void
*/
public function connect()
{
@@ -156,7 +156,7 @@ public function connect()
return $p[$name];
}
}
- return null;
+ return;
};
$hostname = $findParameterValue(array('hostname', 'host'));
@@ -185,7 +185,7 @@ public function connect()
/**
* Is connected
*
- * @return boolean
+ * @return bool
*/
public function isConnected()
{
@@ -194,6 +194,8 @@ public function isConnected()
/**
* Disconnect
+ *
+ * @return void
*/
public function disconnect()
{
@@ -205,6 +207,8 @@ public function disconnect()
/**
* Begin transaction
+ *
+ * @return void
*/
public function beginTransaction()
{
@@ -218,6 +222,8 @@ public function beginTransaction()
/**
* Commit
+ *
+ * @return void
*/
public function commit()
{
View
19 library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php
@@ -45,6 +45,8 @@ class Mysqli implements DriverInterface
);
/**
+ * Constructor
+ *
* @param array|Connection|\mysqli $connection
* @param null|Statement $statementPrototype
* @param null|Result $resultPrototype
@@ -88,6 +90,8 @@ public function registerStatementPrototype(Statement $statementPrototype)
}
/**
+ * Get statement prototype
+ *
* @return null|Statement
*/
public function getStatementPrototype()
@@ -130,6 +134,9 @@ public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCAS
/**
* Check environment
+ *
+ * @throws Exception\RuntimeException
+ * @return void
*/
public function checkEnvironment()
{
@@ -139,6 +146,8 @@ public function checkEnvironment()
}
/**
+ * Get connection
+ *
* @return Connection
*/
public function getConnection()
@@ -147,6 +156,8 @@ public function getConnection()
}
/**
+ * Create statement
+ *
* @param string $sqlOrResource
* @return Statement
*/
@@ -175,6 +186,8 @@ public function createStatement($sqlOrResource = null)
}
/**
+ * Create result
+ *
* @param resource $resource
* @param null|bool $isBuffered
* @return Result
@@ -187,6 +200,8 @@ public function createResult($resource, $isBuffered = null)
}
/**
+ * Get prepare type
+ *
* @return array
*/
public function getPrepareType()
@@ -195,6 +210,8 @@ public function getPrepareType()
}
/**
+ * Format parameter name
+ *
* @param string $name
* @param mixed $type
* @return string
@@ -205,6 +222,8 @@ public function formatParameterName($name, $type = null)
}
/**
+ * Get last generated value
+ *
* @return mixed
*/
public function getLastGeneratedValue()
View
23 library/Zend/Db/Adapter/Driver/Mysqli/Result.php
@@ -10,6 +10,7 @@
namespace Zend\Db\Adapter\Driver\Mysqli;
+use Iterator;
use Zend\Db\Adapter\Driver\ResultInterface;
use Zend\Db\Adapter\Exception;
@@ -18,7 +19,9 @@
* @package Zend_Db
* @subpackage Adapter
*/
-class Result implements \Iterator, ResultInterface
+class Result implements
+ Iterator,
+ ResultInterface
{
/**
@@ -101,6 +104,7 @@ public function initialize($resource, $generatedValue, $isBuffered = null)
/**
* Force buffering
+ *
* @throws Exception\RuntimeException
*/
public function buffer()
@@ -115,6 +119,8 @@ public function buffer()
}
/**
+ * Check if is buffered
+ *
* @return bool|null
*/
public function isBuffered()
@@ -124,6 +130,7 @@ public function isBuffered()
/**
* Return the resource
+ *
* @return mixed
*/
public function getResource()
@@ -143,6 +150,7 @@ public function isQueryResult()
/**
* Get affected rows
+ *
* @return integer
*/
public function getAffectedRows()
@@ -156,6 +164,7 @@ public function getAffectedRows()
/**
* Current
+ *
* @return mixed
*/
public function current()
@@ -243,6 +252,8 @@ protected function loadFromMysqliResult()
/**
* Next
+ *
+ * @return void
*/
public function next()
{
@@ -257,6 +268,7 @@ public function next()
/**
* Key
+ *
* @return mixed
*/
public function key()
@@ -266,6 +278,8 @@ public function key()
/**
* Rewind
+ *
+ * @return void
*/
public function rewind()
{
@@ -281,6 +295,7 @@ public function rewind()
/**
* Valid
+ *
* @return boolean
*/
public function valid()
@@ -311,7 +326,9 @@ public function count()
}
/**
- * @return int
+ * Get field count
+ *
+ * @return integer
*/
public function getFieldCount()
{
@@ -319,6 +336,8 @@ public function getFieldCount()
}
/**
+ * Get generated value
+ *
* @return mixed|null
*/
public function getGeneratedValue()
View
8 library/Zend/Db/Adapter/Driver/Mysqli/Statement.php
@@ -151,6 +151,8 @@ public function getSql()
}
/**
+ * Get parameter count
+ *
* @return ParameterContainer
*/
public function getParameterContainer()
@@ -159,6 +161,8 @@ public function getParameterContainer()
}
/**
+ * Is prepared
+ *
* @return bool
*/
public function isPrepared()
@@ -167,6 +171,8 @@ public function isPrepared()
}
/**
+ * Prepare
+ *
* @param string $sql
* @throws Exception\InvalidQueryException
* @throws Exception\RuntimeException
@@ -243,6 +249,8 @@ public function execute($parameters = null)
/**
* Bind parameters from container
+ *
+ * @return void
*/
protected function bindParametersFromContainer()
{
View
36 library/Zend/Db/Adapter/Driver/Pdo/Connection.php
@@ -47,8 +47,10 @@ class Connection implements ConnectionInterface
protected $inTransaction = false;
/**
+ * Constructor
+ *
* @param array|\PDO|null $connectionParameters
- * @throws \Zend\Db\Adapter\Exception\InvalidArgumentException
+ * @throws Exception\InvalidArgumentException
*/
public function __construct($connectionParameters = null)
{
@@ -62,6 +64,8 @@ public function __construct($connectionParameters = null)
}
/**
+ * Set driver
+ *
* @param Pdo $driver
* @return Connection
*/
@@ -72,6 +76,8 @@ public function setDriver(Pdo $driver)
}
/**
+ * Get driver name
+ *
* @return null|string
*/
public function getDriverName()
@@ -80,7 +86,10 @@ public function getDriverName()
}
/**
+ * Set connection parameters
+ *
* @param array $connectionParameters
+ * @return void
*/
public function setConnectionParameters(array $connectionParameters)
{
@@ -100,6 +109,8 @@ public function setConnectionParameters(array $connectionParameters)
}
/**
+ * Get connection parameters
+ *
* @return array
*/
public function getConnectionParameters()
@@ -152,6 +163,8 @@ public function setResource(\PDO $resource)
}
/**
+ * Get resource
+ *
* @return \PDO
*/
public function getResource()
@@ -160,8 +173,11 @@ public function getResource()
}
/**
+ * Connect
+ *
* @return Connection
- * @throws \Exception
+ * @throws Exception\InvalidConnectionParametersException
+ * @throws Exception\RuntimeException
*/
public function connect()
{
@@ -247,6 +263,8 @@ public function connect()
}
/**
+ * Is connected
+ *
* @return bool
*/
public function isConnected()
@@ -255,6 +273,8 @@ public function isConnected()
}
/**
+ * Disconnect
+ *
* @return Connection
*/
public function disconnect()
@@ -266,6 +286,8 @@ public function disconnect()
}
/**
+ * Begin transaction
+ *
* @return Connection
*/
public function beginTransaction()
@@ -279,6 +301,8 @@ public function beginTransaction()
}
/**
+ * Commit
+ *
* @return Connection
*/
public function commit()
@@ -293,6 +317,8 @@ public function commit()
}
/**
+ * Rollback
+ *
* @return Connection
* @throws Exception\RuntimeException
*/
@@ -311,9 +337,11 @@ public function rollback()
}
/**
+ * Execute
+ *
* @param $sql
* @return Result
- * @throws \Zend\Db\Adapter\Exception\InvalidQueryException
+ * @throws Exception\InvalidQueryException
*/
public function execute($sql)
{
@@ -334,6 +362,8 @@ public function execute($sql)
}
/**
+ * Prepare
+ *
* @param string $sql
* @return Statement
*/
View
8 library/Zend/Db/Adapter/Driver/Pdo/Pdo.php
@@ -109,6 +109,8 @@ public function registerResultPrototype(Result $resultPrototype)
}
/**
+ * Add feature
+ *
* @param string $name
* @param AbstractFeature $feature
* @return Pdo
@@ -124,7 +126,9 @@ public function addFeature($name, $feature)
}
/**
- * setup the default features for Pdo
+ * Setup the default features for Pdo
+ *
+ * @return Pdo
*/
public function setupDefaultFeatures()
{
@@ -135,6 +139,8 @@ public function setupDefaultFeatures()
}
/**
+ * Get feature
+ *
* @param $name
* @return AbstractFeature|false
*/
View
12 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
@@ -60,6 +60,8 @@ public function __construct($connectionInfo = null)
}
/**
+ * Set connection parameters
+ *
* @param array $connectionParameters
* @return Connection
*/
@@ -70,6 +72,8 @@ public function setConnectionParameters(array $connectionParameters)
}
/**
+ * Set driver
+ *
* @param Pgsql $driver
* @return Connection
*/
@@ -80,6 +84,8 @@ public function setDriver(Pgsql $driver)
}
/**
+ * Set resource
+ *
* @param resource $resource
* @return Connection
*/
@@ -90,7 +96,9 @@ public function setResource($resource)
}
/**
- * @return null
+ * Get current schema
+ *
+ * @return null|string
*/
public function getCurrentSchema()
{
@@ -106,6 +114,8 @@ public function getCurrentSchema()
}
/**
+ * Get resource
+ *
* @return resource
*/
public function getResource()
View
24 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
@@ -43,6 +43,8 @@ class Pgsql implements DriverInterface
);
/**
+ * Constructor
+ *
* @param array|Connection|resource $connection
* @param null|Statement $statementPrototype
* @param null|Result $resultPrototype
@@ -60,6 +62,8 @@ public function __construct($connection, Statement $statementPrototype = null, R
}
/**
+ * Register connection
+ *
* @param Connection $connection
* @return Pgsql
*/
@@ -71,6 +75,8 @@ public function registerConnection(Connection $connection)
}
/**
+ * Register statement prototype
+ *
* @param Statement $statement
* @return Pgsql
*/
@@ -82,6 +88,8 @@ public function registerStatementPrototype(Statement $statement)
}
/**
+ * Register result prototype
+ *
* @param Result $result
* @return Pgsql
*/
@@ -92,6 +100,8 @@ public function registerResultPrototype(Result $result)
}
/**
+ * Get database platform name
+ *
* @param string $nameFormat
* @return string
*/
@@ -105,6 +115,8 @@ public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCAS
}
/**
+ * Check environment
+ *
* @throws Exception\RuntimeException
* @return bool
*/
@@ -116,6 +128,8 @@ public function checkEnvironment()
}
/**
+ * Get connection
+ *
* @return Connection
*/
public function getConnection()
@@ -124,6 +138,8 @@ public function getConnection()
}
/**
+ * Create statement
+ *
* @param string|null $sqlOrResource
* @return Statement
*/
@@ -150,6 +166,8 @@ public function createStatement($sqlOrResource = null)
}
/**
+ * Create result
+ *
* @param resource $resource
* @return Result
*/
@@ -161,6 +179,8 @@ public function createResult($resource)
}
/**
+ * Get prepare Type
+ *
* @return array
*/
public function getPrepareType()
@@ -169,6 +189,8 @@ public function getPrepareType()
}
/**
+ * Format parameter name
+ *
* @param string $name
* @param mixed $type
* @return string
@@ -179,6 +201,8 @@ public function formatParameterName($name, $type = null)
}
/**
+ * Get last generated value
+ *
* @return mixed
*/
public function getLastGeneratedValue()
View
80 library/Zend/Db/Adapter/Driver/Pgsql/Result.php
@@ -11,6 +11,7 @@
namespace Zend\Db\Adapter\Driver\Pgsql;
use Zend\Db\Adapter\Driver\ResultInterface;
+use Zend\Db\Adapter\Exception;
/**
* @category Zend
@@ -25,16 +26,33 @@ class Result implements ResultInterface
*/
protected $resource = null;
+ /**
+ * @var int
+ */
protected $position = 0;
+ /**
+ * @var int
+ */
protected $count = 0;
+ /**
+ * @var null|mixed
+ */
protected $generatedValue = null;
+ /**
+ * Initialize
+ *
+ * @param $resource
+ * @param $generatedValue
+ * @return void
+ * @throws Exception\InvalidArgumentException
+ */
public function initialize($resource, $generatedValue)
{
if (!is_resource($resource) || get_resource_type($resource) != 'pgsql result') {
- throw new \Exception('Resource not of the correct type.');
+ throw new Exception\InvalidArgumentException('Resource not of the correct type.');
}
$this->resource = $resource;
@@ -42,6 +60,11 @@ public function initialize($resource, $generatedValue)
$this->generatedValue = $generatedValue;
}
+ /**
+ * Current
+ *
+ * @return array|bool|mixed
+ */
public function current()
{
if ($this->count === 0) {
@@ -50,57 +73,107 @@ public function current()
return pg_fetch_assoc($this->resource, $this->position);
}
+ /**
+ * Next
+ *
+ * @return void
+ */
public function next()
{
$this->position++;
}
+ /**
+ * Key
+ *
+ * @return int|mixed
+ */
public function key()
{
return $this->position;
}
+ /**
+ * Valid
+ *
+ * @return bool
+ */
public function valid()
{
return ($this->position < $this->count);
}
+ /**
+ * Rewind
+ *
+ * @return void
+ */
public function rewind()
{
$this->position = 0;
}
+ /**
+ * Buffer
+ *
+ * @return null
+ */
public function buffer()
{
return null;
}
+ /**
+ * Is buffered
+ *
+ * @return false
+ */
public function isBuffered()
{
return false;
}
+ /**
+ * Is query result
+ *
+ * @return bool
+ */
public function isQueryResult()
{
return (pg_num_fields($this->resource) > 0);
}
+ /**
+ * Get affected rows
+ *
+ * @return int
+ */
public function getAffectedRows()
{
return pg_affected_rows($this->resource);
}
+ /**
+ * Get generated value
+ *
+ * @return mixed|null
+ */
public function getGeneratedValue()
{
return $this->generatedValue;
}
+ /**
+ * Get resource
+ */
public function getResource()
{
// TODO: Implement getResource() method.
}
/**
+ * Count
+ *
* (PHP 5 &gt;= 5.1.0)<br/>
* Count elements of an object
* @link http://php.net/manual/en/countable.count.php
@@ -114,6 +187,11 @@ public function count()
return $this->count;
}
+ /**
+ * Get field count
+ *
+ * @return int
+ */
public function getFieldCount()
{
return pg_num_fields($this->resource);
View
20 library/Zend/Db/Adapter/Driver/Pgsql/Statement.php
@@ -67,6 +67,8 @@ public function setDriver(Pgsql $driver)
}
/**
+ * Initialize
+ *
* @param resource $pgsql
* @return void
* @throws Exception\RuntimeException for invalid or missing postgresql connection
@@ -84,6 +86,8 @@ public function initialize($pgsql)
}
/**
+ * Get resource
+ *
* @return resource
*/
public function getResource()
@@ -92,6 +96,8 @@ public function getResource()
}
/**
+ * Set sql
+ *
* @param string $sql
* @return Statement
*/
@@ -102,6 +108,8 @@ public function setSql($sql)
}
/**
+ * Get sql
+ *
* @return string
*/
public function getSql()
@@ -110,6 +118,8 @@ public function getSql()
}
/**
+ * Set parameter container
+ *
* @param ParameterContainer $parameterContainer
* @return Statement
*/
@@ -120,6 +130,8 @@ public function setParameterContainer(ParameterContainer $parameterContainer)
}
/**
+ * Get parameter container
+ *
* @return ParameterContainer
*/
public function getParameterContainer()
@@ -128,6 +140,8 @@ public function getParameterContainer()
}
/**
+ * Prepare
+ *
* @param string $sql
*/
public function prepare($sql = null)
@@ -148,6 +162,8 @@ public function prepare($sql = null)
}
/**
+ * Is prepared
+ *
* @return bool
*/
public function isPrepared()
@@ -156,7 +172,9 @@ public function isPrepared()
}
/**
- * @param null $parameters
+ * Execute
+ *
+ * @param ParameterContainer|null $parameters
* @throws Exception\InvalidQueryException
* @return Result
*/
View
48 library/Zend/Db/Adapter/Driver/ResultInterface.php
@@ -10,18 +10,64 @@
namespace Zend\Db\Adapter\Driver;
+use Countable;
+use Iterator;
+
/**
* @category Zend
* @package Zend_Db
* @subpackage Adapter
*/
-interface ResultInterface extends \Countable, \Iterator
+interface ResultInterface extends
+ Countable,
+ Iterator
{
+ /**
+ * Force buffering
+ *
+ * @return void
+ */
public function buffer();
+
+ /**
+ * Check if is buffered
+ *
+ * @return bool|null
+ */
public function isBuffered();
+
+ /**
+ * Is query result?
+ *
+ * @return bool
+ */
public function isQueryResult();
+
+ /**
+ * Get affected rows
+ *
+ * @return integer
+ */
public function getAffectedRows();
+
+ /**
+ * Get generated value
+ *
+ * @return mixed|null
+ */
public function getGeneratedValue();
+
+ /**
+ * Get the resource
+ *
+ * @return mixed
+ */
public function getResource();
+
+ /**
+ * Get field count
+ *
+ * @return integer
+ */
public function getFieldCount();
}
View
11 library/Zend/Db/Adapter/Driver/StatementInterface.php
@@ -22,24 +22,29 @@
{
/**
+ * Get resource
+ *
* @return resource
*/
public function getResource();
/**
- * @abstract
+ * Prepare sql
+ *
* @param string $sql
*/
public function prepare($sql = null);
/**
- * @abstract
+ * Check if is prepared
+ *
* @return bool
*/
public function isPrepared();
/**
- * @abstract
+ * Execute
+ *
* @param null $parameters
* @return ResultInterface
*/
View
59 library/Zend/Db/Adapter/Platform/PlatformInterface.php
@@ -17,13 +17,72 @@
*/
interface PlatformInterface
{
+ /**
+ * Get name
+ *
+ * @return string
+ */
public function getName();
+
+ /**
+ * Get quote identifier symbol
+ *
+ * @return string
+ */
public function getQuoteIdentifierSymbol();
+
+ /**
+ * Quote identifier
+ *
+ * @param string $identifier
+ * @return string
+ */
public function quoteIdentifier($identifier);
+
+ /**
+ * Quote identifier chain
+ *
+ * @param string|string[] $identifierChain
+ * @return string
+ */
public function quoteIdentifierChain($identifierChain);
+
+ /**
+ * Get quote value symbol
+ *
+ * @return string
+ */
public function getQuoteValueSymbol();
+
+ /**
+ * Quote value
+ *
+ * @param string $value
+ * @return string
+ */
public function quoteValue($value);
+
+ /**
+ * Quote value list
+ *
+ * @param string|string[] $valueList
+ * @return string
+ */
public function quoteValueList($valueList);
+
+ /**
+ * Get identifier separator
+ *
+ * @return string
+ */
public function getIdentifierSeparator();
+
+ /**
+ * Quote identifier in fragment
+ *
+ * @param string $identifier
+ * @param array $safeWords
+ * @return string
+ */
public function quoteIdentifierInFragment($identifier, array $additionalSafeWords = array());
}
View
12 library/Zend/Db/Adapter/StatementContainerInterface.php
@@ -18,27 +18,31 @@
interface StatementContainerInterface
{
/**
- * @abstract
+ * Set sql
+ *
* @param $sql
* @return mixed
*/
public function setSql($sql);
/**
- * @abstract
+ * Get sql
+ *
* @return mixed
*/
public function getSql();
/**
- * @abstract
+ * Set parameter container
+ *
* @param ParameterContainer $parameterContainer
* @return mixed
*/
public function setParameterContainer(ParameterContainer $parameterContainer);
/**
- * @abstract
+ * Get parameter container
+ *
* @return mixed
*/
public function getParameterContainer();
View
3  library/Zend/Db/Sql/Select.php
@@ -619,8 +619,9 @@ protected function processJoins(PlatformInterface $platform, Adapter $adapter =
? $platform->quoteIdentifier(current($join['name'])) . ' AS ' . $platform->quoteIdentifier(key($join['name']))
: $platform->quoteIdentifier($join['name']);
// on expression
+ // note: for Expression objects, pass them to processExpression with a prefix specific to each join (used for named parameters)
$joinSpecArgArray[$j][] = ($join['on'] instanceof ExpressionInterface)
- ? $this->processExpression($join['on'], $platform, $adapter, $this->processInfo['paramPrefix'] . 'join')
+ ? $this->processExpression($join['on'], $platform, $adapter, $this->processInfo['paramPrefix'] . 'join' . ($j+1) . 'part')
: $platform->quoteIdentifierInFragment($join['on'], array('=', 'AND', 'OR', '(', ')', 'BETWEEN')); // on
if ($joinSpecArgArray[$j][2] instanceof StatementContainerInterface) {
if ($parameterContainer) {
View
2  library/Zend/Db/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Db": ""
+ "Zend\\Db\\": ""
}
},
"target-dir": "Zend/Db",
View
2  library/Zend/Debug/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Debug": ""
+ "Zend\\Debug\\": ""
}
},
"target-dir": "Zend/Debug",
View
3  library/Zend/Di/ServiceLocator/Generator.php
@@ -31,6 +31,9 @@ class Generator
/** @var DependencyInjectorProxy */
protected $injector;
+ /**
+ * @var null|string
+ */
protected $namespace;
/**
View
2  library/Zend/Di/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Di": ""
+ "Zend\\Di\\": ""
}
},
"target-dir": "Zend/Di",
View
2  library/Zend/Dom/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Dom": ""
+ "Zend\\Dom\\": ""
}
},
"target-dir": "Zend/Dom",
View
2  library/Zend/Escaper/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Escaper": ""
+ "Zend\\Escaper\\": ""
}
},
"target-dir": "Zend/Escaper",
View
2  library/Zend/EventManager/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\EventManager": ""
+ "Zend\\EventManager\\": ""
}
},
"target-dir": "Zend/EventManager",
View
8 library/Zend/Feed/composer.json
@@ -8,17 +8,19 @@
],
"autoload": {
"psr-0": {
- "Zend\\Feed": ""
+ "Zend\\Feed\\": ""
}
},
"target-dir": "Zend/Feed",
"require": {
"php": ">=5.3.3",
"zendframework/zend-escaper": "self.version",
- "zendframework/zend-stdlib": "self.version"
+ "zendframework/zend-stdlib": "self.version",
+ "zendframework/zend-servicemanager": "self.version",
+ "zendframework/zend-uri": "self.version",
+ "zendframework/zend-version": "self.version"
},
"suggest": {
- "zendframework/zend-uri": "Zend\\Uri component",
"zendframework/zend-validator": "Zend\\Validator component"
}
}
View
2  library/Zend/File/PhpClassFile.php
@@ -38,7 +38,7 @@ public function getClasses()
/**
* Add class
*
- * @param string $class
+ * @param string $class
* @return PhpClassFile
*/
public function addClass($class)
View
2  library/Zend/File/Transfer/Adapter/AbstractAdapter.php
@@ -182,7 +182,7 @@
/**
* Has the file been filtered ?
*
- * @param array|string|null $files
+ * @param array|string|null $files
* @return bool
*/
abstract public function isFiltered($files = null);
View
2  library/Zend/File/Transfer/Adapter/Http.php
@@ -29,7 +29,7 @@ class Http extends AbstractAdapter
/**
* Constructor for Http File Transfers
*
- * @param array $options OPTIONAL Options to set
+ * @param array $options OPTIONAL Options to set
* @throws Exception\PhpEnvironmentException if file uploads are not allowed
*/
public function __construct($options = array())
View
2  library/Zend/File/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\File": ""
+ "Zend\\File\\": ""
}
},
"target-dir": "Zend/File",
View
2  library/Zend/Filter/composer.json
@@ -8,7 +8,7 @@
],
"autoload": {
"psr-0": {
- "Zend\\Filter": ""
+ "Zend\\Filter\\": ""
}
},
"target-dir": "Zend/Filter",
View
2  library/Zend/Form/Element/Collection.php
@@ -157,6 +157,8 @@ public function setObject($object)
}
$this->object = $object;
+ $this->count = count($object);
+
return $this;
}
View
16 library/Zend/Form/Element/File.php
@@ -22,6 +22,8 @@
namespace Zend\Form\Element;
use Zend\Form\Element;
+use Zend\Form\ElementPrepareAwareInterface;
+use Zend\Form\Form;
/**
* @category Zend
@@ -30,7 +32,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
-class File extends Element
+class File extends Element implements ElementPrepareAwareInterface
{
/**
* Seed attributes
@@ -40,4 +42,16 @@ class File extends Element
protected $attributes = array(
'type' => 'file',
);
+
+ /**
+ * Prepare the form element (mostly used for rendering purposes)
+ *
+ * @param Form $form
+ * @return mixed
+ */
+ public function prepareElement(Form $form)
+ {
+ // Ensure the form is using correct enctype
+ $form->setAttribute('enctype', 'multipart/form-data');
+ }
}
View
4 library/Zend/Form/Element/MultiCheckbox.php
@@ -63,8 +63,8 @@ public function setValueOptions(array $options)
{
$this->valueOptions = $options;
- // Update InArray validator haystack
- if (!is_null($this->validator)) {
+ // Update Explode validator haystack
+ if ($this->validator instanceof ExplodeValidator) {
$validator = $this->validator->getValidator();
$validator->setHaystack($this->getValueOptionsValues());
}
View
15 library/Zend/Form/Element/Password.php
@@ -21,7 +21,9 @@
namespace Zend\Form\Element;
+use Zend\Form\Form;
use Zend\Form\Element;
+use Zend\Form\ElementPrepareAwareInterface;
/**
* @category Zend
@@ -30,7 +32,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
-class Password extends Element
+class Password extends Element implements ElementPrepareAwareInterface
{
/**
* Seed attributes
@@ -40,4 +42,15 @@ class Password extends Element
protected $attributes = array(
'type' => 'password',
);
+
+ /**
+ * Remove the password before rendering if the form fails in order to avoid any security issue
+ *
+ * @param Form $form
+ * @return mixed
+ */
+ public function prepareElement(Form $form)
+ {
+ $this->setValue('');
+ }
}