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 d99397c67987096db055cc94a0430fba49ad2949 2 parents 2f41c1b + 508ed58
Jerry Saravia authored
Showing with 1,060 additions and 475 deletions.
  1. +3 −1 .travis.yml
  2. +4 −4 README.md
  3. +1 −1  demos/Zend/ProgressBar/Upload.php
  4. +31 −14 demos/Zend/ProgressBar/ZendForm.php
  5. +2 −2 library/Zend/Authentication/Adapter/DbTable.php
  6. +1 −1  library/Zend/Authentication/Adapter/Ldap.php
  7. +0 −1  library/Zend/Cache/Pattern/CallbackCache.php
  8. +0 −1  library/Zend/Cache/Pattern/OutputCache.php
  9. +0 −1  library/Zend/Cache/Storage/Adapter/AbstractZendServer.php
  10. +0 −1  library/Zend/Cache/Storage/Adapter/Apc.php
  11. +6 −5 library/Zend/Cache/Storage/Adapter/Dba.php
  12. +3 −4 library/Zend/Cache/Storage/Adapter/Filesystem.php
  13. +1 −2  library/Zend/Cache/Storage/Adapter/Memcached.php
  14. +0 −1  library/Zend/Cache/Storage/Adapter/Memory.php
  15. +2 −2 library/Zend/Cache/Storage/Adapter/MemoryOptions.php
  16. +2 −3 library/Zend/Cache/Storage/Adapter/WinCache.php
  17. +0 −1  library/Zend/Cache/Storage/Adapter/WinCacheOptions.php
  18. +1 −2  library/Zend/Cache/Storage/Adapter/ZendServerDisk.php
  19. +1 −2  library/Zend/Cache/Storage/Adapter/ZendServerShm.php
  20. +0 −2  library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php
  21. +0 −1  library/Zend/Cache/Storage/Plugin/ExceptionHandler.php
  22. +0 −1  library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php
  23. +0 −1  library/Zend/Cache/Storage/Plugin/Serializer.php
  24. +1 −1  library/Zend/Cache/StorageFactory.php
  25. +0 −1  library/Zend/Captcha/ReCaptcha.php
  26. +1 −1  library/Zend/Code/Generator/BodyGenerator.php
  27. +0 −1  library/Zend/Code/Reflection/DocBlockReflection.php
  28. +0 −1  library/Zend/Code/Scanner/ClassScanner.php
  29. +0 −1  library/Zend/Config/Config.php
  30. +3 −3 library/Zend/Console/Adapter/Posix.php
  31. +1 −1  library/Zend/Console/Adapter/Windows.php
  32. +1 −1  library/Zend/Console/Getopt.php
  33. +1 −1  library/Zend/Console/Prompt/Number.php
  34. +1 −2  library/Zend/Crypt/Password/Bcrypt.php
  35. +0 −2  library/Zend/Crypt/PublicKey/RsaOptions.php
  36. +4 −4 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
  37. +0 −1  library/Zend/Db/Adapter/Driver/Pdo/Connection.php
  38. +3 −4 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
  39. +2 −2 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
  40. +0 −1  library/Zend/Db/Adapter/Driver/StatementInterface.php
  41. +0 −1  library/Zend/Db/Metadata/Metadata.php
  42. +0 −1  library/Zend/Db/Metadata/Source/MysqlMetadata.php
  43. +0 −1  library/Zend/Db/Metadata/Source/PostgresqlMetadata.php
  44. +0 −1  library/Zend/Db/Metadata/Source/SqlServerMetadata.php
  45. +0 −1  library/Zend/Db/Metadata/Source/SqliteMetadata.php
  46. +0 −1  library/Zend/Db/RowGateway/AbstractRowGateway.php
  47. +14 −7 library/Zend/Db/Sql/AbstractSql.php
  48. +3 −3 library/Zend/Db/Sql/Expression.php
  49. +4 −0 library/Zend/Db/Sql/ExpressionInterface.php
  50. +0 −3  library/Zend/Db/Sql/Having.php
  51. +1 −1  library/Zend/Db/Sql/Predicate/In.php
  52. +1 −1  library/Zend/Db/Sql/Select.php
  53. +0 −3  library/Zend/Db/Sql/Where.php
  54. +135 −16 library/Zend/Db/TableGateway/Feature/EventFeature.php
  55. +1 −1  library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php
  56. +0 −1  library/Zend/Dom/Query.php
  57. +4 −0 library/Zend/EventManager/EventManager.php
  58. +0 −1  library/Zend/EventManager/EventManagerInterface.php
  59. +0 −1  library/Zend/EventManager/GlobalEventManager.php
  60. +4 −0 library/Zend/EventManager/SharedEventManager.php
  61. +0 −1  library/Zend/EventManager/StaticEventManager.php
  62. +0 −1  library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
  63. +0 −1  library/Zend/Feed/Reader/ExtensionManager.php
  64. +2 −2 library/Zend/Feed/Reader/Reader.php
  65. +1 −1  library/Zend/Feed/Writer/Entry.php
  66. +0 −1  library/Zend/Feed/Writer/ExtensionManager.php
  67. +0 −1  library/Zend/Feed/Writer/Feed.php
  68. +0 −1  library/Zend/Filter/AbstractFilter.php
  69. +0 −1  library/Zend/Filter/Null.php
  70. +0 −1  library/Zend/Filter/PregReplace.php
  71. +0 −1  library/Zend/Filter/StringTrim.php
  72. +0 −1  library/Zend/Form/Annotation/Object.php
  73. +3 −4 library/Zend/Form/Element/Checkbox.php
  74. +3 −4 library/Zend/Form/Element/Collection.php
  75. +0 −1  library/Zend/Form/Element/Date.php
  76. +0 −1  library/Zend/Form/Element/DateTime.php
  77. +0 −1  library/Zend/Form/Element/DateTimeLocal.php
  78. +0 −1  library/Zend/Form/Element/Month.php
  79. +0 −1  library/Zend/Form/Element/Time.php
  80. +0 −1  library/Zend/Form/Element/Week.php
  81. +8 −2 library/Zend/Form/Form.php
  82. +0 −1  library/Zend/Form/FormInterface.php
  83. +0 −1  library/Zend/Form/View/Helper/Captcha/AbstractWord.php
  84. +0 −1  library/Zend/Form/View/Helper/Captcha/ReCaptcha.php
  85. +0 −1  library/Zend/Form/View/Helper/FormCheckbox.php
  86. +1 −1  library/Zend/Form/View/Helper/FormCollection.php
  87. +0 −1  library/Zend/Form/View/Helper/FormMultiCheckbox.php
  88. +0 −1  library/Zend/Form/View/Helper/FormSelect.php
  89. +1 −1  library/Zend/Http/Client/Adapter/Curl.php
  90. +0 −1  library/Zend/Http/Header/Cookie.php
  91. +0 −1  library/Zend/Http/Header/Location.php
  92. +0 −1  library/Zend/I18n/Filter/Alnum.php
  93. +0 −1  library/Zend/I18n/Validator/Alpha.php
  94. +3 −0  library/Zend/InputFilter/Factory.php
  95. +34 −1 library/Zend/InputFilter/Input.php
  96. +1 −1  library/Zend/Ldap/Collection/DefaultIterator.php
  97. +4 −4 library/Zend/Ldap/Dn.php
  98. +8 −8 library/Zend/Ldap/Ldap.php
  99. +1 −1  library/Zend/Ldap/Node/Schema/AttributeType/OpenLdap.php
  100. +0 −1  library/Zend/Log/Filter/SuppressFilter.php
  101. +0 −1  library/Zend/Log/Formatter/Base.php
  102. +0 −1  library/Zend/Log/Formatter/Db.php
  103. +0 −1  library/Zend/Log/Formatter/ErrorHandler.php
  104. +0 −1  library/Zend/Mail/Header/MessageId.php
  105. +9 −9 library/Zend/Mail/Protocol/Imap.php
  106. +4 −4 library/Zend/Mail/Protocol/Pop3.php
  107. +1 −1  library/Zend/Mail/Storage/Folder.php
  108. +2 −2 library/Zend/Mail/Storage/Folder/Maildir.php
  109. +2 −2 library/Zend/Mail/Storage/Folder/Mbox.php
  110. +3 −3 library/Zend/Mail/Storage/Imap.php
  111. +2 −2 library/Zend/Mail/Storage/Maildir.php
  112. +1 −1  library/Zend/Mail/Storage/Mbox.php
  113. +0 −1  library/Zend/Mail/Storage/Part/File.php
  114. +2 −2 library/Zend/Mail/Storage/Pop3.php
  115. +6 −6 library/Zend/Mail/Storage/Writable/Maildir.php
  116. +1 −1  library/Zend/Memory/MemoryManager.php
  117. +1 −1  library/Zend/Memory/Value.php
  118. +0 −1  library/Zend/ModuleManager/Listener/ConfigListener.php
  119. +0 −1  library/Zend/Mvc/Controller/AbstractRestfulController.php
  120. +0 −1  library/Zend/Mvc/Controller/Plugin/Redirect.php
  121. +0 −1  library/Zend/Mvc/DispatchListener.php
  122. +0 −1  library/Zend/Mvc/Router/Console/Catchall.php
  123. +0 −1  library/Zend/Mvc/Router/Console/SimpleRouteStack.php
  124. +58 −2 library/Zend/Mvc/Router/Http/Segment.php
  125. +0 −2  library/Zend/Mvc/Router/SimpleRouteStack.php
  126. +0 −1  library/Zend/Mvc/Service/ViewHelperManagerFactory.php
  127. +1 −1  library/Zend/Mvc/View/Console/ExceptionStrategy.php
  128. +0 −1  library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
  129. +0 −4 library/Zend/Mvc/View/Console/ViewManager.php
  130. +0 −1  library/Zend/Mvc/View/Http/InjectViewModelListener.php
  131. +0 −4 library/Zend/Mvc/View/Http/ViewManager.php
  132. +0 −1  library/Zend/Navigation/AbstractContainer.php
  133. +1 −1  library/Zend/Navigation/Page/AbstractPage.php
  134. +0 −1  library/Zend/Navigation/Page/Mvc.php
  135. +0 −1  library/Zend/Navigation/Service/AbstractNavigationFactory.php
  136. +2 −3 library/Zend/Paginator/Paginator.php
  137. +4 −4 library/Zend/Serializer/Adapter/PythonPickle.php
  138. +0 −1  library/Zend/Serializer/Adapter/WddxOptions.php
  139. +1 −1  library/Zend/ServiceManager/ServiceManager.php
  140. +0 −1  library/Zend/Session/Config/SessionConfig.php
  141. +0 −1  library/Zend/Session/SaveHandler/DbTableGateway.php
  142. +2 −3 library/Zend/Soap/AutoDiscover.php
  143. +1 −1  library/Zend/Soap/Client.php
  144. +0 −1  library/Zend/Soap/Server/DocumentLiteralWrapper.php
  145. +0 −1  library/Zend/Text/Table/DecoratorManager.php
  146. +3 −36 library/Zend/Validator/DateStep.php
  147. +0 −1  library/Zend/Validator/File/Sha1.php
  148. +1 −2  library/Zend/Validator/Ip.php
  149. +0 −1  library/Zend/View/Helper/EscapeCss.php
  150. +0 −1  library/Zend/View/Helper/EscapeHtml.php
  151. +0 −1  library/Zend/View/Helper/EscapeHtmlAttr.php
  152. +0 −1  library/Zend/View/Helper/EscapeJs.php
  153. +0 −1  library/Zend/View/Helper/EscapeUrl.php
  154. +0 −1  library/Zend/View/Helper/Navigation/HelperInterface.php
  155. +0 −2  library/Zend/View/Model/ConsoleModel.php
  156. +0 −1  library/Zend/View/Resolver/AggregateResolver.php
  157. +0 −1  library/Zend/View/Strategy/FeedStrategy.php
  158. +0 −1  library/Zend/View/Strategy/JsonStrategy.php
  159. +0 −2  library/Zend/View/Strategy/PhpRendererStrategy.php
  160. +0 −1  library/Zend/View/View.php
  161. +1 −1  library/Zend/XmlRpc/Server.php
  162. +2 −2 library/Zend/XmlRpc/Value/Boolean.php
  163. +1 −1  library/Zend/XmlRpc/Value/DateTime.php
  164. +3 −3 library/Zend/XmlRpc/Value/Double.php
  165. +1 −1  library/Zend/XmlRpc/Value/Integer.php
  166. +2 −2 library/Zend/XmlRpc/Value/String.php
  167. +7 −7 resources/languages/fr/Zend_Validate.php
  168. +0 −1  tests/ZendTest/Authentication/Adapter/Http/AuthTest.php
  169. +0 −1  tests/ZendTest/Authentication/Adapter/Http/ProxyTest.php
  170. +1 −1  tests/ZendTest/Cache/Storage/Adapter/AbstractDbaTest.php
  171. +0 −1  tests/ZendTest/Cache/Storage/Adapter/AbstractZendServerTest.php
  172. +32 −1 tests/ZendTest/Cache/Storage/Adapter/CommonAdapterTest.php
  173. +0 −1  tests/ZendTest/Cache/Storage/Adapter/MemcachedTest.php
  174. +0 −3  tests/ZendTest/Cache/Storage/Plugin/IgnoreUserAbortTest.php
  175. +0 −1  tests/ZendTest/Captcha/FigletTest.php
  176. +0 −1  tests/ZendTest/Captcha/ImageTest.php
  177. +0 −1  tests/ZendTest/Code/Reflection/DocBlockReflectionTest.php
  178. +1 −0  tests/ZendTest/Code/Reflection/TestAsset/TestSampleClass8.php
  179. +2 −2 tests/ZendTest/Code/Scanner/ClassScannerTest.php
  180. +0 −1  tests/ZendTest/Code/Scanner/DerivedClassScannerTest.php
  181. +2 −2 tests/ZendTest/Code/Scanner/MethodScannerTest.php
  182. +0 −1  tests/ZendTest/Code/TestAsset/BarClass.php
  183. +0 −1  tests/ZendTest/Config/Reader/AbstractReaderTestCase.php
  184. +0 −1  tests/ZendTest/Console/GetoptTest.php
  185. +12 −0 tests/ZendTest/Db/Adapter/AdapterTest.php
  186. +147 −0 tests/ZendTest/Db/Adapter/Driver/Pgsql/PgsqlTest.php
  187. +11 −0 tests/ZendTest/Db/Sql/AbstractSqlTest.php
  188. +1 −1  tests/ZendTest/Db/Sql/ExpressionTest.php
  189. +1 −1  tests/ZendTest/Db/Sql/Predicate/InTest.php
  190. +14 −0 tests/ZendTest/Db/Sql/SelectTest.php
  191. +252 −0 tests/ZendTest/Db/TableGateway/Feature/EventFeatureTest.php
  192. +0 −1  tests/ZendTest/Di/Definition/RuntimeDefinitionTest.php
  193. +0 −1  tests/ZendTest/Di/DefinitionListTest.php
  194. +70 −0 tests/ZendTest/EventManager/StaticEventManagerTest.php
  195. +0 −1  tests/ZendTest/Filter/Compress/TarLoadArchiveTarTest.php
  196. +0 −1  tests/ZendTest/Filter/DecryptTest.php
  197. +0 −1  tests/ZendTest/Filter/EncryptTest.php
  198. +0 −1  tests/ZendTest/Form/Element/CollectionTest.php
  199. +0 −1  tests/ZendTest/Form/Element/ColorTest.php
  200. +0 −2  tests/ZendTest/Form/Element/CsrfTest.php
  201. +0 −1  tests/ZendTest/Form/Element/DateTest.php
  202. +0 −1  tests/ZendTest/Form/Element/DateTimeLocalTest.php
  203. +0 −1  tests/ZendTest/Form/Element/DateTimeTest.php
  204. +0 −2  tests/ZendTest/Form/Element/EmailTest.php
  205. +0 −1  tests/ZendTest/Form/Element/MonthTest.php
  206. +0 −1  tests/ZendTest/Form/Element/MultiCheckboxTest.php
  207. +0 −1  tests/ZendTest/Form/Element/NumberTest.php
  208. +0 −1  tests/ZendTest/Form/Element/RadioTest.php
  209. +0 −1  tests/ZendTest/Form/Element/RangeTest.php
  210. +0 −1  tests/ZendTest/Form/Element/SelectTest.php
  211. +0 −1  tests/ZendTest/Form/Element/TimeTest.php
  212. +0 −1  tests/ZendTest/Form/Element/UrlTest.php
  213. +0 −1  tests/ZendTest/Form/Element/WeekTest.php
  214. +0 −1  tests/ZendTest/Form/ElementTest.php
  215. +0 −1  tests/ZendTest/Form/FactoryTest.php
  216. +38 −0 tests/ZendTest/Form/FormTest.php
  217. +16 −0 tests/ZendTest/Form/TestAsset/Entity/SimplePublicProperty.php
  218. +0 −1  tests/ZendTest/Form/TestAsset/HydratorStrategyEntityB.php
  219. +1 −1  tests/ZendTest/Form/View/Helper/Captcha/ImageTest.php
  220. +0 −1  tests/ZendTest/Form/View/Helper/Captcha/ReCaptchaTest.php
  221. +0 −1  tests/ZendTest/Form/View/Helper/FormButtonTest.php
  222. +0 −1  tests/ZendTest/Form/View/Helper/FormCaptchaTest.php
  223. +0 −1  tests/ZendTest/Form/View/Helper/FormCollectionTest.php
  224. +0 −1  tests/ZendTest/Form/View/Helper/FormLabelTest.php
  225. +0 −1  tests/ZendTest/Form/View/Helper/FormSelectTest.php
  226. +0 −1  tests/ZendTest/Form/View/Helper/FormTest.php
  227. +0 −1  tests/ZendTest/Http/Client/UseCaseTest.php
  228. +0 −1  tests/ZendTest/Http/Header/AcceptTest.php
  229. +0 −1  tests/ZendTest/Http/Header/ContentLocationTest.php
  230. +0 −1  tests/ZendTest/Http/Header/LocationTest.php
  231. +0 −1  tests/ZendTest/Http/Header/RefererTest.php
  232. +0 −3  tests/ZendTest/InputFilter/InputFilterTest.php
  233. +0 −1  tests/ZendTest/Log/Filter/MockTest.php
  234. +0 −1  tests/ZendTest/Log/Filter/PriorityTest.php
  235. +0 −2  tests/ZendTest/Log/Filter/RegexTest.php
  236. +0 −1  tests/ZendTest/Log/Filter/SuppressFilterTest.php
  237. +0 −1  tests/ZendTest/Log/Filter/ValidatorTest.php
  238. +0 −1  tests/ZendTest/Log/Formatter/DbTest.php
  239. +0 −2  tests/ZendTest/Log/Formatter/SimpleTest.php
  240. +0 −1  tests/ZendTest/Log/Writer/DbTest.php
  241. +0 −1  tests/ZendTest/Log/Writer/MailTest.php
  242. +0 −1  tests/ZendTest/Log/Writer/MockTest.php
  243. +0 −1  tests/ZendTest/Log/Writer/MongoDBTest.php
  244. +0 −1  tests/ZendTest/Log/Writer/NullTest.php
  245. +0 −1  tests/ZendTest/Log/Writer/StreamTest.php
  246. +0 −1  tests/ZendTest/Mail/Protocol/SmtpTest.php
  247. +0 −2  tests/ZendTest/Mail/Storage/ImapTest.php
  248. +0 −1  tests/ZendTest/Mail/Storage/MaildirWritableTest.php
  249. +0 −1  tests/ZendTest/Mail/Storage/MboxFolderTest.php
  250. +0 −1  tests/ZendTest/ModuleManager/Listener/AutoloaderListenerTest.php
  251. +0 −2  tests/ZendTest/ModuleManager/Listener/DefaultListenerAggregateTest.php
  252. +0 −1  tests/ZendTest/ModuleManager/Listener/ListenerOptionsTest.php
  253. +0 −3  tests/ZendTest/ModuleManager/Listener/OnBootstrapListenerTest.php
  254. +0 −1  tests/ZendTest/ModuleManager/ModuleManagerTest.php
  255. +0 −1  tests/ZendTest/ModuleManager/TestAsset/LoadOtherModule/Module.php
  256. +0 −1  tests/ZendTest/Mvc/ApplicationTest.php
  257. +0 −1  tests/ZendTest/Mvc/Router/Console/SimpleTest.php
  258. +6 −0 tests/ZendTest/Mvc/Router/Http/SegmentTest.php
  259. +0 −1  tests/ZendTest/Mvc/Router/SimpleRouteStackTest.php
  260. +0 −1  tests/ZendTest/Mvc/Service/DiStrictAbstractServiceFactoryTest.php
  261. +0 −8 tests/ZendTest/Mvc/View/DefaultRendereringStrategyTest.php
  262. +0 −1  tests/ZendTest/Mvc/View/ExceptionStrategyTest.php
  263. +0 −1  tests/ZendTest/Mvc/View/RouteNotFoundStrategyTest.php
  264. +0 −1  tests/ZendTest/Paginator/Adapter/DbSelectTest.php
  265. +0 −1  tests/ZendTest/Paginator/PaginatorTest.php
  266. +0 −1  tests/ZendTest/ServiceManager/Di/DiAbstractServiceFactoryTest.php
  267. +0 −2  tests/ZendTest/ServiceManager/Di/DiServiceFactoryTest.php
  268. +4 −1 tests/ZendTest/ServiceManager/TestAsset/Bar.php
  269. +0 −1  tests/ZendTest/Session/SaveHandler/CacheTest.php
  270. +0 −3  tests/ZendTest/Session/TestAsset/TestManager.php
  271. +0 −1  tests/ZendTest/Soap/AutoDiscoverTest.php
  272. +0 −1  tests/ZendTest/Soap/ServerTest.php
  273. +0 −1  tests/ZendTest/Stdlib/OptionsTest.php
  274. +0 −1  tests/ZendTest/Stdlib/PriorityQueueTest.php
  275. +0 −1  tests/ZendTest/Stdlib/TestAsset/HydratorStrategyEntityB.php
  276. +11 −1 tests/ZendTest/Validator/DateStepTest.php
  277. +0 −3  tests/ZendTest/Validator/TestAsset/SessionManager.php
  278. +0 −1  tests/ZendTest/View/Helper/AbstractTest.php
  279. +0 −1  tests/ZendTest/View/Helper/RenderChildModelTest.php
  280. +0 −3  tests/ZendTest/View/Model/JsonModelTest.php
  281. +0 −1  tests/ZendTest/View/Renderer/FeedRendererTest.php
  282. +0 −1  tests/ZendTest/View/Resolver/AggregateResolverTest.php
  283. +0 −2  tests/ZendTest/View/Strategy/PhpRendererStrategyTest.php
  284. +0 −1  tests/ZendTest/View/TestAsset/Invokable.php
  285. +0 −1  tests/ZendTest/View/TestAsset/Uninvokable.php
  286. +0 −1  tests/ZendTest/XmlRpc/BigIntegerValueTest.php
  287. +0 −1  tests/ZendTest/XmlRpc/ClientTest.php
  288. +0 −1  tests/ZendTest/XmlRpc/ValueTest.php
View
4 .travis.yml
@@ -12,7 +12,9 @@ before_install:
script:
- php ./tests/run-tests.php
- - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 .); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
+ - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
+ - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
+ - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
notifications:
irc: "irc.freenode.org#zftalk.dev"
View
8 README.md
@@ -35,13 +35,13 @@ Online documentation can be found at http://framework.zend.com/manual.
Questions that are not addressed in the manual should be directed to the
appropriate mailing list:
-http://framework.zend.com/wiki/display/ZFDEV/Mailing+Lists
+http://framework.zend.com/archives/subscribe/
If you find code in this release behaving in an unexpected manner or
-contrary to its documented behavior, please create an issue in the Zend
-Framework issue tracker at:
+contrary to its documented behavior, please create an issue in our GitHub
+issue tracker:
-http://framework.zend.com/issues/browse/ZF2
+https://github.com/zendframework/zf2/issues
If you would like to be notified of new releases, you can subscribe to
the fw-announce mailing list by sending a blank message to
View
2  demos/Zend/ProgressBar/Upload.php
@@ -116,7 +116,7 @@ function makeRequest(url)
if (httpRequest.overrideMimeType) {
httpRequest.overrideMimeType('text/xml');
}
- } elseif (window.ActiveXObject) {
+ } else if (window.ActiveXObject) {
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
View
45 demos/Zend/ProgressBar/ZendForm.php
@@ -10,6 +10,8 @@
use Zend\File\Transfer\Adapter\Http;
use Zend\Form\Form;
+use Zend\Form\Element;
+use Zend\Form\View\Helper;
use Zend\Loader\StandardAutoloader;
use Zend\ProgressBar\Adapter\JsPull;
@@ -109,7 +111,7 @@ function makeRequest(url)
if (httpRequest.overrideMimeType) {
httpRequest.overrideMimeType('text/xml');
}
- } elseif (window.ActiveXObject) {
+ } else if (window.ActiveXObject) {
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
@@ -184,21 +186,36 @@ function finish()
</head>
<body>
<?php
-$form = new Form(
- array(
- 'enctype' => 'multipart/form-data',
- 'action' => 'ZendForm.php',
- 'target' => 'uploadTarget',
- 'onsubmit' => 'observeProgress();',
- 'elements' => array(
- 'file' => array('file', array('label' => 'File')),
- 'submit' => array('submit', array('label' => 'Upload!'))
- )
- )
-);
+$file = new Element\File('file');
+$file->setLabel('File');
+
+$progress_key = new Element\Hidden('progress_key');
+$progress_key->setAttribute('id', 'progress_key');
+$progress_key->setValue(md5(uniqid(rand())));
+
+$submit = new Element\Submit('submit');
+$submit->setValue('Upload!');
+
+$form = new Form("ZendForm");
+$form->setAttributes(array(
+ 'enctype' => 'multipart/form-data',
+ 'action' => 'ZendForm.php',
+ 'target' => 'uploadTarget',
+ 'onsubmit' => 'observeProgress();'
+));
+
$form->prepare();
-echo $form;
+$formhelper = new Helper\Form();
+$formfile = new Helper\FormFile();
+$formhidden = new Helper\FormHidden();
+$formsubmit = new Helper\FormSubmit();
+
+echo $formhelper->openTag($form);
+echo $formhidden($progress_key);
+echo $formfile($file);
+echo $formsubmit($submit);
+echo $formhelper->closeTag();
?>
<iframe name="uploadTarget"></iframe>
View
4 library/Zend/Authentication/Adapter/DbTable.php
@@ -278,7 +278,7 @@ public function getResultRowObject($returnColumns = null, $omitColumns = null)
if (null !== $returnColumns) {
$availableColumns = array_keys($this->resultRow);
- foreach ((array)$returnColumns as $returnColumn) {
+ foreach ((array) $returnColumns as $returnColumn) {
if (in_array($returnColumn, $availableColumns)) {
$returnObject->{$returnColumn} = $this->resultRow[$returnColumn];
}
@@ -287,7 +287,7 @@ public function getResultRowObject($returnColumns = null, $omitColumns = null)
} elseif (null !== $omitColumns) {
- $omitColumns = (array)$omitColumns;
+ $omitColumns = (array) $omitColumns;
foreach ($this->resultRow as $resultColumn => $resultValue) {
if (!in_array($resultColumn, $omitColumns)) {
$returnObject->{$resultColumn} = $resultValue;
View
2  library/Zend/Authentication/Adapter/Ldap.php
@@ -386,7 +386,7 @@ protected function prepareOptions(ZendLdap\Ldap $ldap, array $options)
unset($options[$key]);
switch ($key) {
case 'groupScope':
- $value = (int)$value;
+ $value = (int) $value;
if (in_array($value, array(ZendLdap\Ldap::SEARCH_SCOPE_BASE,
ZendLdap\Ldap::SEARCH_SCOPE_ONE, ZendLdap\Ldap::SEARCH_SCOPE_SUB), true)) {
$adapterOptions[$key] = $value;
View
1  library/Zend/Cache/Pattern/CallbackCache.php
@@ -11,7 +11,6 @@
namespace Zend\Cache\Pattern;
use Zend\Cache\Exception;
-use Zend\Cache\StorageFactory;
use Zend\Stdlib\ErrorHandler;
/**
View
1  library/Zend/Cache/Pattern/OutputCache.php
@@ -11,7 +11,6 @@
namespace Zend\Cache\Pattern;
use Zend\Cache\Exception;
-use Zend\Cache\StorageFactory;
/**
* @category Zend
View
1  library/Zend/Cache/Storage/Adapter/AbstractZendServer.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use stdClass;
use Zend\Cache\Exception;
use Zend\Cache\Storage\Capabilities;
View
1  library/Zend/Cache/Storage/Adapter/Apc.php
@@ -11,7 +11,6 @@
namespace Zend\Cache\Storage\Adapter;
use APCIterator as BaseApcIterator;
-use ArrayObject;
use stdClass;
use Traversable;
use Zend\Cache\Exception;
View
11 library/Zend/Cache/Storage/Adapter/Dba.php
@@ -117,7 +117,7 @@ public function getOptions()
*/
public function getTotalSpace()
{
- if ($this->totalSpace !== null) {
+ if ($this->totalSpace === null) {
$pathname = $this->getOptions()->getPathname();
if ($pathname === '') {
@@ -125,11 +125,12 @@ public function getTotalSpace()
}
ErrorHandler::start();
- $total = disk_total_space($pathname);
+ $total = disk_total_space(dirname($pathname));
$error = ErrorHandler::stop();
if ($total === false) {
throw new Exception\RuntimeException("Can't detect total space of '{$pathname}'", 0, $error);
}
+ $this->totalSpace = $total;
// clean total space buffer on change pathname
$events = $this->getEventManager();
@@ -142,7 +143,7 @@ public function getTotalSpace()
$events->detach($handle);
}
};
- $handle = $events->attach($callback);
+ $handle = $events->attach('option', $callback);
}
return $this->totalSpace;
@@ -164,7 +165,7 @@ public function getAvailableSpace()
}
ErrorHandler::start();
- $avail = disk_free_space($pathname);
+ $avail = disk_free_space(dirname($pathname));
$error = ErrorHandler::stop();
if ($avail === false) {
throw new Exception\RuntimeException("Can't detect free space of '{$pathname}'", 0, $error);
@@ -516,7 +517,7 @@ protected function _open()
protected function _close()
{
if ($this->handle) {
- ErrorHandler::start(E_WARNING);
+ ErrorHandler::start(E_NOTICE);
dba_close($this->handle);
ErrorHandler::stop();
$this->handle = null;
View
7 library/Zend/Cache/Storage/Adapter/Filesystem.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use Exception as BaseException;
use GlobIterator;
use stdClass;
@@ -24,7 +23,6 @@
use Zend\Cache\Storage\FlushableInterface;
use Zend\Cache\Storage\IterableInterface;
use Zend\Cache\Storage\OptimizableInterface;
-use Zend\Cache\Storage\StorageInterface;
use Zend\Cache\Storage\TaggableInterface;
use Zend\Cache\Storage\TotalSpaceCapableInterface;
use Zend\Stdlib\ErrorHandler;
@@ -385,7 +383,7 @@ public function optimize()
*/
public function getTotalSpace()
{
- if ($this->totalSpace !== null) {
+ if ($this->totalSpace === null) {
$path = $this->getOptions()->getCacheDir();
ErrorHandler::start();
@@ -394,6 +392,7 @@ public function getTotalSpace()
if ($total === false) {
throw new Exception\RuntimeException("Can't detect total space of '{$path}'", 0, $error);
}
+ $this->totalSpace = $total;
// clean total space buffer on change cache_dir
$events = $this->getEventManager();
@@ -406,7 +405,7 @@ public function getTotalSpace()
$events->detach($handle);
}
};
- $handle = $events->attach($callback);
+ $handle = $events->attach('option', $callback);
}
return $this->totalSpace;
View
3  library/Zend/Cache/Storage/Adapter/Memcached.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use Memcached as MemcachedResource;
use stdClass;
use Traversable;
@@ -476,7 +475,7 @@ protected function internalRemoveItems(array & $normalizedKeys)
*/
protected function internalIncrementItem(& $normalizedKey, & $value)
{
- $value = (int)$value;
+ $value = (int) $value;
$newValue = $this->memcached->increment($normalizedKey, $value);
if ($newValue === false) {
View
1  library/Zend/Cache/Storage/Adapter/Memory.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use stdClass;
use Zend\Cache\Exception;
use Zend\Cache\Storage\AvailableSpaceCapableInterface;
View
4 library/Zend/Cache/Storage/Adapter/MemoryOptions.php
@@ -66,7 +66,7 @@ public function getMemoryLimit()
// By default use half of PHP's memory limit if possible
$memoryLimit = $this->normalizeMemoryLimit(ini_get('memory_limit'));
if ($memoryLimit >= 0) {
- $this->memoryLimit = (int)($memoryLimit / 2);
+ $this->memoryLimit = (int) ($memoryLimit / 2);
} else {
// disable memory limit
$this->memoryLimit = 0;
@@ -86,7 +86,7 @@ public function getMemoryLimit()
protected function normalizeMemoryLimit($value)
{
if (is_numeric($value)) {
- return (int)$value;
+ return (int) $value;
}
if (!preg_match('/(\-?\d+)\s*(\w*)/', ini_get('memory_limit'), $matches)) {
View
5 library/Zend/Cache/Storage/Adapter/WinCache.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use stdClass;
use Traversable;
use Zend\Cache\Exception;
@@ -413,7 +412,7 @@ protected function internalIncrementItem(& $normalizedKey, & $value)
$options = $this->getOptions();
$prefix = $options->getNamespace() . $options->getNamespaceSeparator();
$internalKey = $prefix . $normalizedKey;
- return wincache_ucache_inc($internalKey, (int)$value);
+ return wincache_ucache_inc($internalKey, (int) $value);
}
/**
@@ -429,7 +428,7 @@ protected function internalDecrementItem(& $normalizedKey, & $value)
$options = $this->getOptions();
$prefix = $options->getNamespace() . $options->getNamespaceSeparator();
$internalKey = $prefix . $normalizedKey;
- return wincache_ucache_dec($internalKey, (int)$value);
+ return wincache_ucache_dec($internalKey, (int) $value);
}
/* status */
View
1  library/Zend/Cache/Storage/Adapter/WinCacheOptions.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use Zend\Cache\Exception;
/**
* These are options specific to the APC adapter
View
3  library/Zend/Cache/Storage/Adapter/ZendServerDisk.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use Zend\Cache\Exception;
use Zend\Cache\Storage\AvailableSpaceCapableInterface;
use Zend\Cache\Storage\ClearByNamespaceInterface;
@@ -154,7 +153,7 @@ protected function zdcStore($internalKey, $value, $ttl)
*/
protected function zdcFetch($internalKey)
{
- return zend_disk_cache_fetch((string)$internalKey);
+ return zend_disk_cache_fetch((string) $internalKey);
}
/**
View
3  library/Zend/Cache/Storage/Adapter/ZendServerShm.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Adapter;
-use ArrayObject;
use Zend\Cache\Exception;
use Zend\Cache\Storage\ClearByNamespaceInterface;
use Zend\Cache\Storage\FlushableInterface;
@@ -111,7 +110,7 @@ protected function zdcStore($internalKey, $value, $ttl)
*/
protected function zdcFetch($internalKey)
{
- return zend_shm_cache_fetch((string)$internalKey);
+ return zend_shm_cache_fetch((string) $internalKey);
}
/**
View
2  library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php
@@ -10,11 +10,9 @@
namespace Zend\Cache\Storage\Plugin;
-use Traversable;
use Zend\Cache\Exception;
use Zend\Cache\Storage\ClearExpiredInterface;
use Zend\Cache\Storage\PostEvent;
-use Zend\Cache\Storage\StorageInterface;
use Zend\EventManager\EventManagerInterface;
/**
View
1  library/Zend/Cache/Storage/Plugin/ExceptionHandler.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Plugin;
-use Traversable;
use Zend\Cache\Exception;
use Zend\Cache\Storage\ExceptionEvent;
use Zend\EventManager\EventManagerInterface;
View
1  library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php
@@ -10,7 +10,6 @@
namespace Zend\Cache\Storage\Plugin;
-use Traversable;
use Zend\Cache\Exception;
use Zend\Cache\Storage\OptimizableInterface;
use Zend\Cache\Storage\PostEvent;
View
1  library/Zend/Cache/Storage/Plugin/Serializer.php
@@ -11,7 +11,6 @@
namespace Zend\Cache\Storage\Plugin;
use stdClass;
-use Traversable;
use Zend\Cache\Exception;
use Zend\Cache\Storage\Capabilities;
use Zend\Cache\Storage\Event;
View
2  library/Zend/Cache/StorageFactory.php
@@ -73,7 +73,7 @@ public static function factory($cfg)
$adapterOptions = array_merge($adapterOptions, $cfg['options']);
}
- $adapter = static::adapterFactory((string)$adapterName, $adapterOptions);
+ $adapter = static::adapterFactory((string) $adapterName, $adapterOptions);
// add plugins
if (isset($cfg['plugins'])) {
View
1  library/Zend/Captcha/ReCaptcha.php
@@ -11,7 +11,6 @@
namespace Zend\Captcha;
use Traversable;
-use Zend\Form\Element;
use ZendService\ReCaptcha\ReCaptcha as ReCaptchaService;
/**
View
2  library/Zend/Code/Generator/BodyGenerator.php
@@ -41,7 +41,7 @@ public function setContent($content)
*/
public function getContent()
{
- return (string)$this->content;
+ return (string) $this->content;
}
/**
View
1  library/Zend/Code/Reflection/DocBlockReflection.php
@@ -11,7 +11,6 @@
namespace Zend\Code\Reflection;
use Reflector;
-use Zend\Code\Annotation\AnnotationManager;
use Zend\Code\Scanner\DocBlockScanner;
/**
View
1  library/Zend/Code/Scanner/ClassScanner.php
@@ -10,7 +10,6 @@
namespace Zend\Code\Scanner;
-use Zend\Code\Annotation\AnnotationManager;
use Zend\Code\Exception;
use Zend\Code\NameInformation;
View
1  library/Zend/Config/Config.php
@@ -13,7 +13,6 @@
use ArrayAccess;
use Countable;
use Iterator;
-use Zend\Stdlib\ArrayUtils;
/**
* Provides a property based interface to an array.
View
6 library/Zend/Console/Adapter/Posix.php
@@ -111,7 +111,7 @@ public function getWidth()
* Try to read env variable
*/
if (($result = getenv('COLUMNS')) !== false) {
- return $width = (int)$result;
+ return $width = (int) $result;
}
/**
@@ -119,7 +119,7 @@ public function getWidth()
*/
$result = exec('tput cols', $output, $return);
if (!$return && is_numeric($result)) {
- return $width = (int)$result;
+ return $width = (int) $result;
}
return $width = parent::getWidth();
@@ -145,7 +145,7 @@ public function getHeight()
// Try to read console size from "tput" command
$result = exec('tput lines', $output, $return);
if (!$return && is_numeric($result)) {
- return $height = (int)$result;
+ return $height = (int) $result;
}
return $height = parent::getHeight();
View
2  library/Zend/Console/Adapter/Windows.php
@@ -85,7 +85,7 @@ public function getHeight()
}
if (count($this->probeResult) && (int) $this->probeResult[1]) {
- $height = (int)$this->probeResult[1];
+ $height = (int) $this->probeResult[1];
} else {
$height = parent::getheight();
}
View
2  library/Zend/Console/Getopt.php
@@ -230,7 +230,7 @@ public function __construct($rules, $argv = null, $getoptConfig = array())
$argv = array_slice($_SERVER['argv'], 1);
}
if (isset($argv)) {
- $this->addArguments((array)$argv);
+ $this->addArguments((array) $argv);
}
}
View
2  library/Zend/Console/Prompt/Number.php
@@ -110,7 +110,7 @@ public function show()
* Cast proper type
*/
if ($number !== null) {
- $number = $this->allowFloat ? (double)$number : (int)$number;
+ $number = $this->allowFloat ? (double) $number : (int) $number;
}
return $this->lastResponse = $number;
View
3  library/Zend/Crypt/Password/Bcrypt.php
@@ -11,7 +11,6 @@
namespace Zend\Crypt\Password;
use Traversable;
-use Zend\Math\Exception as MathException;
use Zend\Math\Rand;
use Zend\Stdlib\ArrayUtils;
@@ -125,7 +124,7 @@ public function verify($password, $hash)
public function setCost($cost)
{
if (!empty($cost)) {
- $cost = (int)$cost;
+ $cost = (int) $cost;
if ($cost < 4 || $cost > 31) {
throw new Exception\InvalidArgumentException(
'The cost parameter of bcrypt must be in range 04-31'
View
2  library/Zend/Crypt/PublicKey/RsaOptions.php
@@ -10,10 +10,8 @@
namespace Zend\Crypt\PublicKey;
-use Traversable;
use Zend\Crypt\PublicKey\Rsa\Exception;
use Zend\Stdlib\AbstractOptions;
-use Zend\Stdlib\ArrayUtils;
/**
* RSA instance options
View
8 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
@@ -117,7 +117,7 @@ public function getCurrentSchema()
* @param mysqli $resource
* @return Connection
*/
- public function setResource(mysqli $resource)
+ public function setResource(\mysqli $resource)
{
$this->resource = $resource;
return $this;
@@ -166,7 +166,7 @@ public function connect()
$port = (isset($p['port'])) ? (int) $p['port'] : null;
$socket = (isset($p['socket'])) ? $p['socket'] : null;
- $this->resource = new \Mysqli($hostname, $username, $password, $database, $port, $socket);
+ $this->resource = new \mysqli($hostname, $username, $password, $database, $port, $socket);
if ($this->resource->connect_error) {
throw new Exception\RuntimeException(
@@ -189,7 +189,7 @@ public function connect()
*/
public function isConnected()
{
- return ($this->resource instanceof \Mysqli);
+ return ($this->resource instanceof \mysqli);
}
/**
@@ -199,7 +199,7 @@ public function isConnected()
*/
public function disconnect()
{
- if ($this->resource instanceof \PDO) {
+ if ($this->resource instanceof \mysqli) {
$this->resource->close();
}
unset($this->resource);
View
1  library/Zend/Db/Adapter/Driver/Pdo/Connection.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Adapter\Driver\Pdo;
use Zend\Db\Adapter\Driver\ConnectionInterface;
-use Zend\Db\Adapter\Driver\DriverInterface;
use Zend\Db\Adapter\Exception;
/**
View
7 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
@@ -10,7 +10,6 @@
namespace Zend\Db\Adapter\Driver\Pgsql;
-use mysqli;
use Zend\Db\Adapter\Driver\ConnectionInterface;
use Zend\Db\Adapter\Exception;
@@ -48,13 +47,13 @@ class Connection implements ConnectionInterface
/**
* Constructor
*
- * @param mysqli|array|null $connectionInfo
+ * @param resource|array|null $connectionInfo
*/
public function __construct($connectionInfo = null)
{
if (is_array($connectionInfo)) {
$this->setConnectionParameters($connectionInfo);
- } elseif ($connectionInfo instanceof mysqli) {
+ } elseif (is_resource($connectionInfo)) {
$this->setResource($connectionInfo);
}
}
@@ -224,7 +223,7 @@ public function execute($sql)
//var_dump(pg_result_status($resultResource));
- // if the returnValue is something other than a mysqli_result, bypass wrapping it
+ // if the returnValue is something other than a pg result resource, bypass wrapping it
if ($resultResource === false) {
throw new Exception\InvalidQueryException(pg_errormessage());
}
View
4 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
@@ -122,8 +122,8 @@ public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCAS
*/
public function checkEnvironment()
{
- if (!extension_loaded('mysqli')) {
- throw new Exception\RuntimeException('The Mysqli extension is required for this adapter but the extension is not loaded');
+ if (!extension_loaded('pgsql')) {
+ throw new Exception\RuntimeException('The PostgreSQL (pgsql) extension is required for this adapter but the extension is not loaded');
}
}
View
1  library/Zend/Db/Adapter/Driver/StatementInterface.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Adapter\Driver;
use Zend\Db\Adapter\StatementContainerInterface;
-use Zend\Db\Adapter\ParameterContainer;
/**
* @category Zend
View
1  library/Zend/Db/Metadata/Metadata.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Metadata;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Adapter\Driver;
/**
* @category Zend
View
1  library/Zend/Db/Metadata/Source/MysqlMetadata.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Metadata\Source;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Metadata\Object;
/**
* @category Zend
View
1  library/Zend/Db/Metadata/Source/PostgresqlMetadata.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Metadata\Source;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Metadata\Object;
/**
* @category Zend
View
1  library/Zend/Db/Metadata/Source/SqlServerMetadata.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Metadata\Source;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Metadata\Object;
/**
* @category Zend
View
1  library/Zend/Db/Metadata/Source/SqliteMetadata.php
@@ -11,7 +11,6 @@
namespace Zend\Db\Metadata\Source;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Metadata\Object;
use Zend\Db\ResultSet\ResultSetInterface;
/**
View
1  library/Zend/Db/RowGateway/AbstractRowGateway.php
@@ -12,7 +12,6 @@
use ArrayAccess;
use Countable;
-use Zend\Db\Adapter\Adapter;
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\TableIdentifier;
View
21 library/Zend/Db/Sql/AbstractSql.php
@@ -62,6 +62,20 @@ protected function processExpression(ExpressionInterface $expression, PlatformIn
foreach ($values as $vIndex => $value) {
if (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_IDENTIFIER) {
$values[$vIndex] = $platform->quoteIdentifierInFragment($value);
+ } elseif (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_VALUE && $value instanceof Select) {
+ // process sub-select
+ if ($adapter) {
+ $values[$vIndex] = '(' . $this->processSubSelect($value, $platform, $adapter, $parameterContainer) . ')';
+ } else {
+ $values[$vIndex] = '(' . $this->processSubSelect($value, $platform) . ')';
+ }
+ } elseif (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_VALUE && $value instanceof ExpressionInterface) {
+ // recursive call to satisfy nested expressions
+ $innerStatementContainer = $this->processExpression($value, $platform, $adapter, $namedParameterPrefix . $vIndex . 'subpart');
+ $values[$vIndex] = $innerStatementContainer->getSql();
+ if ($adapter) {
+ $parameterContainer->merge($innerStatementContainer->getParameterContainer());
+ }
} elseif (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_VALUE) {
// if prepareType is set, it means that this particular value must be
@@ -77,13 +91,6 @@ protected function processExpression(ExpressionInterface $expression, PlatformIn
$values[$vIndex] = $platform->quoteValue($value);
} elseif (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_LITERAL) {
$values[$vIndex] = $value;
- } elseif (isset($types[$vIndex]) && $types[$vIndex] == ExpressionInterface::TYPE_SELECT) {
- // process sub-select
- if ($adapter) {
- $values[$vIndex] = '(' . $this->processSubSelect($value, $platform, $adapter, $statementContainer->getParameterContainer()) . ')';
- } else {
- $values[$vIndex] = '(' . $this->processSubSelect($value, $platform) . ')';
- }
}
}
View
6 library/Zend/Db/Sql/Expression.php
@@ -79,8 +79,8 @@ public function getExpression()
*/
public function setParameters($parameters)
{
- if (!is_string($parameters) && !is_array($parameters)) {
- throw new Exception\InvalidArgumentException('Expression parameters must be a string or array.');
+ if (!is_scalar($parameters) && !is_array($parameters)) {
+ throw new Exception\InvalidArgumentException('Expression parameters must be a scalar or array.');
}
$this->parameters = $parameters;
return $this;
@@ -118,7 +118,7 @@ public function getTypes()
*/
public function getExpressionData()
{
- $parameters = (is_string($this->parameters)) ? array($this->parameters) : $this->parameters;
+ $parameters = (is_scalar($this->parameters)) ? array($this->parameters) : $this->parameters;
$types = array();
for ($i = 0; $i < count($parameters); $i++) {
View
4 library/Zend/Db/Sql/ExpressionInterface.php
@@ -15,6 +15,10 @@
const TYPE_IDENTIFIER = 'identifier';
const TYPE_VALUE = 'value';
const TYPE_LITERAL = 'literal';
+
+ /**
+ * @deprecated This will go away in 2.1
+ */
const TYPE_SELECT = 'select';
/**
View
3  library/Zend/Db/Sql/Having.php
@@ -11,9 +11,6 @@
namespace Zend\Db\Sql;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Adapter\Driver\StatementInterface;
-use Zend\Db\Adapter\Platform\PlatformInterface;
-use Zend\Db\Adapter\Platform\Sql92;
/**
* @category Zend
View
2  library/Zend/Db/Sql/Predicate/In.php
@@ -94,7 +94,7 @@ public function getExpressionData()
$values = $this->getValueSet();
if ($values instanceof Select) {
$specification = '%s IN %s';
- $types = array(self::TYPE_SELECT);
+ $types = array(self::TYPE_VALUE);
$values = array($values);
} else {
$specification = '%s IN (' . implode(', ', array_fill(0, count($values), '%s')) . ')';
View
2  library/Zend/Db/Sql/Select.php
@@ -533,7 +533,7 @@ protected function processSelect(PlatformInterface $platform, Adapter $adapter =
$fromTable = ($this->prefixColumnsWithTable) ? $table : '';
}
- $fromTable .= $platform->getIdentifierSeparator();
+ $fromTable .= ($this->prefixColumnsWithTable) ? $platform->getIdentifierSeparator() : '';
// process table columns
$columns = array();
View
3  library/Zend/Db/Sql/Where.php
@@ -11,9 +11,6 @@
namespace Zend\Db\Sql;
use Zend\Db\Adapter\Adapter;
-use Zend\Db\Adapter\Driver\StatementInterface;
-use Zend\Db\Adapter\Platform\PlatformInterface;
-use Zend\Db\Adapter\Platform\Sql92;
/**
* @category Zend
View
151 library/Zend/Db/TableGateway/Feature/EventFeature.php
@@ -17,17 +17,17 @@
use Zend\Db\Sql\Insert;
use Zend\Db\Sql\Select;
use Zend\Db\Sql\Update;
-use Zend\Db\TableGateway\Exception;
+use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerInterface;
+use Zend\EventManager\EventsCapableInterface;
/**
* @category Zend
* @package Zend_Db
* @subpackage TableGateway
*/
-class EventFeature extends AbstractFeature
+class EventFeature extends AbstractFeature implements EventsCapableInterface
{
-
/**
* @var EventManagerInterface
*/
@@ -42,37 +42,103 @@ class EventFeature extends AbstractFeature
* @param EventManagerInterface $eventManager
* @param EventFeature\TableGatewayEvent $tableGatewayEvent
*/
- public function __construct(EventManagerInterface $eventManager, EventFeature\TableGatewayEvent $tableGatewayEvent)
- {
- $this->eventManager = $eventManager;
+ public function __construct(
+ EventManagerInterface $eventManager = null,
+ EventFeature\TableGatewayEvent $tableGatewayEvent = null
+ ) {
+ $this->eventManager = ($eventManager instanceof EventManagerInterface)
+ ? $eventManager
+ : new EventManager;
+
+ $this->eventManager->setIdentifiers(array(
+ 'Zend\Db\TableGateway\TableGateway',
+ ));
+
$this->event = ($tableGatewayEvent) ?: new EventFeature\TableGatewayEvent();
}
+ /**
+ * Retrieve composed event manager instance
+ *
+ * @return EventManagerInterface
+ */
+ public function getEventManager()
+ {
+ return $this->eventManager;
+ }
+
+ /**
+ * Retrieve composed event instance
+ *
+ * @return EventFeature\TableGatewayEvent
+ */
+ public function getEvent()
+ {
+ return $this->event;
+ }
+
+ /**
+ * Initialize feature and trigger "preInitialize" event
+ *
+ * Ensures that the composed TableGateway has identifiers based on the
+ * class name, and that the event target is set to the TableGateway
+ * instance. It then triggers the "preInitialize" event.
+ *
+ * @return void
+ */
public function preInitialize()
{
+ if (get_class($this->tableGateway) != 'Zend\Db\TableGateway\TableGateway') {
+ $this->eventManager->addIdentifiers(get_class($this->tableGateway));
+ }
+
$this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "postInitialize" event
+ *
+ * @return void
+ */
public function postInitialize()
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "preSelect" event
+ *
+ * Triggers the "preSelect" event mapping the following parameters:
+ * - $select as "select"
+ *
+ * @param Select $select
+ * @return void
+ */
public function preSelect(Select $select)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array('select' => $select));
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "postSelect" event
+ *
+ * Triggers the "postSelect" event mapping the following parameters:
+ * - $statement as "statement"
+ * - $result as "result"
+ * - $resultSet as "result_set"
+ *
+ * @param StatementInterface $statement
+ * @param ResultInterface $result
+ * @param ResultSetInterface $resultSet
+ * @return void
+ */
public function postSelect(StatementInterface $statement, ResultInterface $result, ResultSetInterface $resultSet)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array(
'statement' => $statement,
@@ -82,17 +148,35 @@ public function postSelect(StatementInterface $statement, ResultInterface $resul
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "preInsert" event
+ *
+ * Triggers the "preInsert" event mapping the following parameters:
+ * - $insert as "insert"
+ *
+ * @param Insert $insert
+ * @return void
+ */
public function preInsert(Insert $insert)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array('insert' => $insert));
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "postInsert" event
+ *
+ * Triggers the "postInsert" event mapping the following parameters:
+ * - $statement as "statement"
+ * - $result as "result"
+ *
+ * @param StatementInterface $statement
+ * @param ResultInterface $result
+ * @return void
+ */
public function postInsert(StatementInterface $statement, ResultInterface $result)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array(
'statement' => $statement,
@@ -101,17 +185,35 @@ public function postInsert(StatementInterface $statement, ResultInterface $resul
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "preUpdate" event
+ *
+ * Triggers the "preUpdate" event mapping the following parameters:
+ * - $update as "update"
+ *
+ * @param Update $update
+ * @return void
+ */
public function preUpdate(Update $update)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array('update' => $update));
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "postUpdate" event
+ *
+ * Triggers the "postUpdate" event mapping the following parameters:
+ * - $statement as "statement"
+ * - $result as "result"
+ *
+ * @param StatementInterface $statement
+ * @param ResultInterface $result
+ * @return void
+ */
public function postUpdate(StatementInterface $statement, ResultInterface $result)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array(
'statement' => $statement,
@@ -120,17 +222,35 @@ public function postUpdate(StatementInterface $statement, ResultInterface $resul
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "preDelete" event
+ *
+ * Triggers the "preDelete" event mapping the following parameters:
+ * - $delete as "delete"
+ *
+ * @param Delete $delete
+ * @return void
+ */
public function preDelete(Delete $delete)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array('delete' => $delete));
$this->eventManager->trigger($this->event);
}
+ /**
+ * Trigger the "postDelete" event
+ *
+ * Triggers the "postDelete" event mapping the following parameters:
+ * - $statement as "statement"
+ * - $result as "result"
+ *
+ * @param StatementInterface $statement
+ * @param ResultInterface $result
+ * @return void
+ */
public function postDelete(StatementInterface $statement, ResultInterface $result)
{
- $this->event->setTarget($this->tableGateway);
$this->event->setName(__FUNCTION__);
$this->event->setParams(array(
'statement' => $statement,
@@ -138,5 +258,4 @@ public function postDelete(StatementInterface $statement, ResultInterface $resul
));
$this->eventManager->trigger($this->event);
}
-
}
View
2  library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php
@@ -44,7 +44,7 @@ class TableGatewayEvent implements EventInterface
*/
public function getName()
{
- return get_class($this->target) . '.' . $this->name;
+ return $this->name;
}
/**
View
1  library/Zend/Dom/Query.php
@@ -11,7 +11,6 @@
namespace Zend\Dom;
use DOMDocument;
-use DOMNodeList;
use DOMXPath;
/**
View
4 library/Zend/EventManager/EventManager.php
@@ -498,6 +498,10 @@ protected function getSharedListeners($event)
}
$identifiers = $this->getIdentifiers();
+ //Add wildcard id to the search, if not already added
+ if (!in_array('*', $identifiers)) {
+ $identifiers[] = '*';
+ }
$sharedListeners = array();
foreach ($identifiers as $id) {
View
1  library/Zend/EventManager/EventManagerInterface.php
@@ -10,7 +10,6 @@
namespace Zend\EventManager;
-use ArrayObject;
use Traversable;
use Zend\Stdlib\CallbackHandler;
View
1  library/Zend/EventManager/GlobalEventManager.php
@@ -10,7 +10,6 @@
namespace Zend\EventManager;
-use ArrayObject;
use Zend\Stdlib\CallbackHandler;
use Zend\Stdlib\PriorityQueue;
View
4 library/Zend/EventManager/SharedEventManager.php
@@ -101,6 +101,10 @@ public function detach($id, CallbackHandler $listener)
public function getEvents($id)
{
if (!array_key_exists($id, $this->identifiers)) {
+ //Check if there are any id wildcards listeners
+ if ('*' != $id && array_key_exists('*', $this->identifiers)) {
+ return $this->identifiers['*']->getEvents();
+ }
return false;
}
return $this->identifiers[$id]->getEvents();
View
1  library/Zend/EventManager/StaticEventManager.php
@@ -10,7 +10,6 @@
namespace Zend\EventManager;
-use Zend\Stdlib\CallbackHandler;
/**
* Static version of EventManager
View
1  library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
@@ -11,7 +11,6 @@
namespace Zend\Feed\Reader\Extension\DublinCore;
use DateTime;
-use DOMElement;
use Zend\Feed\Reader;
use Zend\Feed\Reader\Collection;
use Zend\Feed\Reader\Extension;
View
1  library/Zend/Feed/Reader/ExtensionManager.php
@@ -11,7 +11,6 @@
namespace Zend\Feed\Reader;
use Zend\ServiceManager\AbstractPluginManager;
-use Zend\ServiceManager\ConfigInterface;
/**
* Plugin manager implementation for feed reader extensions
View
4 library/Zend/Feed/Reader/Reader.php
@@ -242,7 +242,7 @@ public static function import($uri, $etag = null, $lastModified = null)
return self::importString($data);
}
$response = $client->send();
- if ((int)$response->getStatusCode() !== 200) {
+ if ((int) $response->getStatusCode() !== 200) {
throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode());
}
$responseXml = $response->getBody();
@@ -250,7 +250,7 @@ public static function import($uri, $etag = null, $lastModified = null)
return self::importString($responseXml);
} else {
$response = $client->send();
- if ((int)$response->getStatusCode() !== 200) {
+ if ((int) $response->getStatusCode() !== 200) {
throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode());
}
$reader = self::importString($response->getBody());
View
2  library/Zend/Feed/Writer/Entry.php
@@ -250,7 +250,7 @@ public function setLink($link)
*/
public function setCommentCount($count)
{
- if (!is_numeric($count) || (int)$count != $count || (int) $count < 0) {
+ if (!is_numeric($count) || (int) $count != $count || (int) $count < 0) {
throw new Exception\InvalidArgumentException('Invalid parameter: "count" must be a positive integer number or zero');
}
$this->data['commentCount'] = (int) $count;
View
1  library/Zend/Feed/Writer/ExtensionManager.php
@@ -11,7 +11,6 @@
namespace Zend\Feed\Writer;
use Zend\ServiceManager\AbstractPluginManager;
-use Zend\ServiceManager\ConfigInterface;
/**
* Plugin manager implementation for feed writer extensions
View
1  library/Zend/Feed/Writer/Feed.php
@@ -11,7 +11,6 @@
namespace Zend\Feed\Writer;
use Countable;
-use DateTime;
use Iterator;
use Zend\Feed\Writer\Renderer;
View
1  library/Zend/Filter/AbstractFilter.php
@@ -11,7 +11,6 @@
namespace Zend\Filter;
use Traversable;
-use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\ErrorHandler;
/**
View
1  library/Zend/Filter/Null.php
@@ -11,7 +11,6 @@
namespace Zend\Filter;
use Traversable;
-use Zend\Stdlib\ArrayUtils;
/**
* @category Zend
View
1  library/Zend/Filter/PregReplace.php
@@ -11,7 +11,6 @@
namespace Zend\Filter;
use Traversable;
-use Zend\Stdlib\ArrayUtils;
/**
* @category Zend
View
1  library/Zend/Filter/StringTrim.php
@@ -11,7 +11,6 @@
namespace Zend\Filter;
use Traversable;
-use Zend\Stdlib\ArrayUtils;
/**
* @category Zend
View
1  library/Zend/Form/Annotation/Object.php
@@ -21,7 +21,6 @@
namespace Zend\Form\Annotation;
-use Zend\Form\Exception\UnexpectedValueException;
/**
* Object annotation
View
7 library/Zend/Form/Element/Checkbox.php
@@ -23,7 +23,6 @@
use Traversable;
use Zend\Form\Element;
-use Zend\Form\Exception;
use Zend\InputFilter\InputProviderInterface;
use Zend\Validator\InArray as InArrayValidator;
use Zend\Validator\ValidatorInterface;
@@ -102,7 +101,7 @@ public function setOptions($options)
*/
public function setUseHiddenElement($useHiddenElement)
{
- $this->useHiddenElement = (bool)$useHiddenElement;
+ $this->useHiddenElement = (bool) $useHiddenElement;
return $this;
}
@@ -203,7 +202,7 @@ public function getInputSpecification()
*/
public function isChecked()
{
- return (bool)$this->value;
+ return (bool) $this->value;
}
/**
@@ -214,7 +213,7 @@ public function isChecked()
*/
public function setChecked($value)
{
- $this->value = (bool)$value;
+ $this->value = (bool) $value;
return $this;
}
View
7 library/Zend/Form/Element/Collection.php
@@ -18,7 +18,6 @@
use Zend\Form\FieldsetInterface;
use Zend\Form\FieldsetPrepareAwareInterface;
use Zend\Form\Form;
-use Zend\InputFilter\InputFilterProviderInterface;
use Zend\Stdlib\ArrayUtils;
/**
@@ -347,7 +346,7 @@ public function getTargetElement()
*/
public function setAllowAdd($allowAdd)
{
- $this->allowAdd = (bool)$allowAdd;
+ $this->allowAdd = (bool) $allowAdd;
return $this;
}
@@ -367,7 +366,7 @@ public function allowAdd()
*/
public function setAllowRemove($allowRemove)
{
- $this->allowRemove = (bool)$allowRemove;
+ $this->allowRemove = (bool) $allowRemove;
return $this;
}
@@ -387,7 +386,7 @@ public function allowRemove()
*/
public function setShouldCreateTemplate($shouldCreateTemplate)
{
- $this->shouldCreateTemplate = (bool)$shouldCreateTemplate;
+ $this->shouldCreateTemplate = (bool) $shouldCreateTemplate;
return $this;
}
View
1  library/Zend/Form/Element/Date.php