Browse files

Merge branch 'master' into CookieRoute

  • Loading branch information...
2 parents 7b0f413 + 1a8cc28 commit 99622be302c010913354fcb3d9c1630154fd77cb Jerry Saravia committed Dec 19, 2012
Showing with 5,129 additions and 1,438 deletions.
  1. +306 −0 CHANGELOG.md
  2. +1 −1 INSTALL.md
  3. +1 −1 README-GIT.md
  4. +3 −3 README.md
  5. +2 −1 composer.json
  6. +16 −18 library/Zend/Barcode/Barcode.php
  7. +4 −4 library/Zend/Barcode/Object/AbstractObject.php
  8. +2 −2 library/Zend/Barcode/Object/Code128.php
  9. +2 −2 library/Zend/Barcode/Object/Code39.php
  10. +1 −1 library/Zend/Barcode/Object/Ean5.php
  11. +1 −1 library/Zend/Cache/Pattern/OutputCache.php
  12. +11 −2 library/Zend/Cache/Storage/Adapter/Filesystem.php
  13. +99 −80 library/Zend/Cache/Storage/Adapter/Memcached.php
  14. +121 −31 library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
  15. +4 −4 library/Zend/Cache/Storage/Adapter/MemoryOptions.php
  16. +4 −4 library/Zend/Cache/Storage/Capabilities.php
  17. +8 −1 library/Zend/Cache/composer.json
  18. +7 −7 library/Zend/Captcha/AbstractWord.php
  19. +66 −79 library/Zend/Code/Generator/ClassGenerator.php
  20. +12 −17 library/Zend/Code/Generator/DocBlock/Tag.php
  21. +51 −30 library/Zend/Code/Generator/DocBlockGenerator.php
  22. +1 −1 library/Zend/Code/Generator/FileGenerator.php
  23. +1 −1 library/Zend/Code/Generator/FileGeneratorRegistry.php
  24. +1 −1 library/Zend/Code/Generator/ParameterGenerator.php
  25. +0 −2 library/Zend/Code/Generator/ValueGenerator.php
  26. +25 −0 library/Zend/Code/Scanner/AggregateDirectoryScanner.php
  27. +81 −0 library/Zend/Code/Scanner/CachingFileScanner.php
  28. +114 −3 library/Zend/Code/Scanner/ClassScanner.php
  29. +837 −0 library/Zend/Code/Scanner/ClassScanner.php~
  30. +96 −0 library/Zend/Code/Scanner/DerivedClassScanner.php
  31. +98 −1 library/Zend/Code/Scanner/DirectoryScanner.php
  32. +16 −0 library/Zend/Code/Scanner/DocBlockScanner.php
  33. +12 −0 library/Zend/Code/Scanner/FileScanner.php
  34. +4 −4 library/Zend/Code/Scanner/MethodScanner.php
  35. +130 −9 library/Zend/Code/Scanner/ParameterScanner.php
  36. +284 −0 library/Zend/Code/Scanner/PropertyScanner.php
  37. +33 −13 library/Zend/Code/Scanner/TokenArrayScanner.php
  38. +9 −0 library/Zend/Code/Scanner/Util.php
  39. +3 −2 library/Zend/Code/composer.json
  40. +7 −7 library/Zend/Config/Factory.php
  41. +25 −4 library/Zend/Config/Reader/Ini.php
  42. +2 −2 library/Zend/Config/Reader/Xml.php
  43. +1 −1 library/Zend/Config/Writer/AbstractWriter.php
  44. +2 −4 library/Zend/Console/Adapter/AbstractAdapter.php
  45. +4 −4 library/Zend/Console/Adapter/Posix.php
  46. +1 −1 library/Zend/Console/Adapter/Windows.php
  47. +7 −1 library/Zend/Console/Getopt.php
  48. +1 −1 library/Zend/Console/Response.php
  49. +5 −5 library/Zend/Crypt/BlockCipher.php
  50. +33 −21 library/Zend/Crypt/Hash.php
  51. +35 −23 library/Zend/Crypt/Hmac.php
  52. +5 −4 library/Zend/Crypt/Key/Derivation/Pbkdf2.php
  53. +3 −3 library/Zend/Crypt/Key/Derivation/SaltedS2k.php
  54. +3 −3 library/Zend/Crypt/PublicKey/DiffieHellman.php
  55. +5 −5 library/Zend/Crypt/Symmetric/Mcrypt.php
  56. +2 −1 library/Zend/Crypt/composer.json
  57. +1 −1 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
  58. +1 −0 library/Zend/Db/Adapter/Driver/Mysqli/Result.php
  59. +1 −1 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
  60. +1 −1 library/Zend/Db/Adapter/Driver/Pgsql/Statement.php
  61. +4 −1 library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php
  62. +7 −2 library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php
  63. +3 −3 library/Zend/Db/Adapter/Platform/Mysql.php
  64. +1 −3 library/Zend/Db/Metadata/Source/AbstractSource.php
  65. +2 −2 library/Zend/Db/Metadata/Source/SqliteMetadata.php
  66. +1 −1 library/Zend/Db/Sql/AbstractSql.php
  67. +15 −12 library/Zend/Db/Sql/Insert.php
  68. +2 −2 library/Zend/Db/Sql/Platform/AbstractPlatform.php
  69. +23 −0 library/Zend/Db/Sql/Platform/Mysql/Mysql.php
  70. +90 −0 library/Zend/Db/Sql/Platform/Mysql/SelectDecorator.php
  71. +4 −0 library/Zend/Db/Sql/Platform/Platform.php
  72. +2 −2 library/Zend/Db/Sql/Predicate/Between.php
  73. +6 −1 library/Zend/Db/Sql/Select.php
  74. +1 −0 library/Zend/Db/TableGateway/AbstractTableGateway.php
  75. +0 −1 library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php
  76. +6 −6 library/Zend/Debug/Debug.php
  77. +4 −2 library/Zend/Di/Definition/Builder/InjectionMethod.php
  78. +6 −0 library/Zend/Di/Definition/BuilderDefinition.php
  79. +6 −2 library/Zend/Di/Definition/ClassDefinition.php
  80. +3 −4 library/Zend/Di/Definition/CompilerDefinition.php
  81. +1 −0 library/Zend/Di/Definition/DefinitionInterface.php
  82. +3 −2 library/Zend/Di/Definition/RuntimeDefinition.php
  83. +1 −1 library/Zend/Di/DefinitionList.php
  84. +5 −8 library/Zend/Di/Di.php
  85. +1 −1 library/Zend/Di/ServiceLocator/Generator.php
  86. +5 −5 library/Zend/Dom/Css2Xpath.php
  87. +6 −15 library/Zend/Dom/NodeList.php
  88. +8 −16 library/Zend/EventManager/EventManager.php
  89. +6 −6 library/Zend/Feed/PubSubHubbub/PubSubHubbub.php
  90. +1 −1 library/Zend/Feed/PubSubHubbub/Subscriber/Callback.php
  91. +16 −16 library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
  92. +20 −20 library/Zend/Feed/Reader/Extension/DublinCore/Feed.php
  93. +3 −1 library/Zend/Feed/Reader/Extension/Syndication/Feed.php
  94. +1 −1 library/Zend/Feed/Reader/FeedSet.php
  95. +43 −43 library/Zend/Feed/Reader/Reader.php
  96. +65 −4 library/Zend/Feed/Writer/AbstractFeed.php
  97. +32 −1 library/Zend/Feed/Writer/Deleted.php
  98. +61 −2 library/Zend/Feed/Writer/Entry.php
  99. +8 −6 library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php
  100. +8 −1 library/Zend/Feed/Writer/Feed.php
  101. +0 −1 library/Zend/Feed/Writer/Source.php
  102. +24 −24 library/Zend/Feed/Writer/Writer.php
  103. +5 −5 library/Zend/File/Transfer/Adapter/AbstractAdapter.php
  104. +8 −8 library/Zend/File/Transfer/Adapter/Http.php
  105. +1 −1 library/Zend/Filter/AbstractFilter.php
  106. +1 −1 library/Zend/Filter/Encrypt.php
  107. +2 −2 library/Zend/Filter/File/Rename.php
  108. +1 −1 library/Zend/Filter/FilterChain.php
  109. +1 −1 library/Zend/Filter/Inflector.php
  110. +3 −3 library/Zend/Filter/StaticFilter.php
  111. +37 −0 library/Zend/Form/Annotation/AllowEmpty.php
  112. +3 −2 library/Zend/Form/Annotation/AnnotationBuilder.php
  113. +2 −3 library/Zend/Form/Element/Checkbox.php
  114. +1 −1 library/Zend/Form/Element/Collection.php
  115. +2 −3 library/Zend/Form/Element/Color.php
  116. +1 −1 library/Zend/Form/Element/Csrf.php
  117. +2 −3 library/Zend/Form/Element/Date.php
  118. +10 −7 library/Zend/Form/Element/DateTime.php
  119. +14 −4 library/Zend/Form/Element/DateTimeLocal.php
  120. +1 −2 library/Zend/Form/Element/Number.php
  121. +1 −2 library/Zend/Form/Element/Radio.php
  122. +1 −2 library/Zend/Form/Element/Range.php
  123. +2 −3 library/Zend/Form/Element/Select.php
  124. +2 −3 library/Zend/Form/Element/Time.php
  125. +2 −3 library/Zend/Form/Element/Url.php
  126. +2 −3 library/Zend/Form/Element/Week.php
  127. +17 −10 library/Zend/Form/Fieldset.php
  128. +2 −1 library/Zend/Form/FieldsetInterface.php
  129. +13 −6 library/Zend/Form/Form.php
  130. +0 −86 library/Zend/Form/TODO.md
  131. +15 −7 library/Zend/Form/View/Helper/Captcha/AbstractWord.php
  132. +6 −1 library/Zend/Form/View/Helper/Captcha/Image.php
  133. +1 −1 library/Zend/Form/View/Helper/FormElementErrors.php
  134. +0 −1 library/Zend/Form/View/Helper/FormLabel.php
  135. +1 −0 library/Zend/Form/View/Helper/FormMultiCheckbox.php
  136. +0 −6 library/Zend/Form/View/Helper/FormSelect.php
  137. +51 −13 library/Zend/Http/Client.php
  138. +1 −1 library/Zend/Http/Client/Adapter/Curl.php
  139. +18 −0 library/Zend/Http/Client/Adapter/Proxy.php
  140. +9 −5 library/Zend/Http/Client/Adapter/Socket.php
  141. +5 −5 library/Zend/Http/ClientStatic.php
  142. +1 −2 library/Zend/Http/Cookies.php
  143. +15 −9 library/Zend/Http/Header/AbstractAccept.php
  144. +28 −0 library/Zend/Http/Header/Accept/FieldValuePart/AbstractFieldValuePart.php
  145. +4 −4 library/Zend/Http/Header/CacheControl.php
  146. +1 −1 library/Zend/Http/Header/Connection.php
  147. +5 −2 library/Zend/Http/Header/SetCookie.php
  148. +170 −0 library/Zend/Http/PhpEnvironment/RemoteAddress.php
  149. +1 −1 library/Zend/Http/PhpEnvironment/Request.php
  150. +37 −0 library/Zend/Http/PhpEnvironment/Response.php
  151. +1 −1 library/Zend/Http/Request.php
  152. +12 −1 library/Zend/Http/Response.php
  153. +1 −1 library/Zend/Http/composer.json
  154. +1 −1 library/Zend/I18n/Exception/ExceptionInterface.php
  155. +1 −1 library/Zend/I18n/Exception/InvalidArgumentException.php
  156. +1 −1 library/Zend/I18n/Exception/OutOfBoundsException.php
  157. +1 −1 library/Zend/I18n/Exception/ParseException.php
  158. +1 −1 library/Zend/I18n/Exception/RangeException.php
  159. +1 −1 library/Zend/I18n/Exception/RuntimeException.php
  160. +2 −1 library/Zend/I18n/Filter/AbstractLocale.php
  161. +2 −1 library/Zend/I18n/Filter/Alnum.php
  162. +2 −1 library/Zend/I18n/Filter/Alpha.php
  163. +5 −0 library/Zend/I18n/Filter/NumberFormat.php
  164. +10 −10 library/Zend/I18n/Translator/Plural/Rule.php
  165. +6 −5 library/Zend/I18n/Validator/Alnum.php
  166. +7 −6 library/Zend/I18n/Validator/Alpha.php
  167. +2 −1 library/Zend/I18n/Validator/Float.php
  168. +143 −0 library/Zend/I18n/Validator/Float.php~
  169. +2 −1 library/Zend/I18n/Validator/Int.php
  170. +4 −3 library/Zend/I18n/Validator/PostCode.php
  171. +2 −2 library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php
  172. +1 −2 library/Zend/InputFilter/Input.php
  173. +1 −1 library/Zend/Json/Decoder.php
  174. +1 −1 library/Zend/Json/Encoder.php
  175. +14 −14 library/Zend/Json/Json.php
  176. +1 −1 library/Zend/Json/Server/Smd.php
  177. +14 −14 library/Zend/Ldap/Attribute.php
  178. +12 −12 library/Zend/Ldap/Converter/Converter.php
  179. +28 −28 library/Zend/Ldap/Dn.php
  180. +2 −2 library/Zend/Ldap/Filter.php
  181. +1 −1 library/Zend/Ldap/Filter/MaskFilter.php
  182. +5 −5 library/Zend/Ldap/Ldap.php
  183. +1 −1 library/Zend/Ldap/Ldif/Encoder.php
  184. +2 −2 library/Zend/Ldap/Node.php
  185. +1 −1 library/Zend/Ldap/Node/AbstractNode.php
  186. +5 −5 library/Zend/Loader/AutoloaderFactory.php
  187. +8 −5 library/Zend/Loader/ClassMapAutoloader.php
  188. +32 −1 library/Zend/Loader/ModuleAutoloader.php
  189. +0 −1 library/Zend/Log/Formatter/Simple.php
  190. +1 −1 library/Zend/Log/Formatter/Xml.php
  191. +8 −8 library/Zend/Log/Logger.php
  192. +4 −3 library/Zend/Log/Writer/MongoDB.php
  193. +4 −4 library/Zend/Log/Writer/Syslog.php
  194. +1 −1 library/Zend/Mail/Header/ContentType.php
  195. +1 −1 library/Zend/Mail/Header/GenericHeader.php
  196. +21 −0 library/Zend/Mail/Message.php
  197. +1 −1 library/Zend/Mail/Protocol/Imap.php
  198. +1 −1 library/Zend/Mail/Protocol/Pop3.php
  199. +3 −3 library/Zend/Mail/Storage/Imap.php
  200. +1 −1 library/Zend/Mail/Storage/Maildir.php
  201. +1 −1 library/Zend/Mail/Transport/FileOptions.php
  202. +0 −1 library/Zend/Mail/Transport/Sendmail.php
  203. +2 −2 library/Zend/Math/BigInteger/BigInteger.php
  204. +1 −2 library/Zend/Math/Rand.php
  205. +2 −3 library/Zend/Memory/MemoryManager.php
  206. +1 −1 library/Zend/Memory/Value.php
  207. +3 −3 library/Zend/Mime/Decode.php
  208. +7 −7 library/Zend/Mime/Mime.php
  209. +4 −4 library/Zend/Mime/Part.php
  210. +27 −0 library/Zend/ModuleManager/Feature/FilterProviderInterface.php
  211. +27 −0 library/Zend/ModuleManager/Feature/ValidatorProviderInterface.php
  212. +0 −11 library/Zend/ModuleManager/Listener/ConfigListener.php
  213. +1 −1 library/Zend/ModuleManager/ModuleManager.php
  214. +4 −3 library/Zend/Mvc/Application.php
  215. +4 −1 library/Zend/Mvc/Controller/AbstractActionController.php
  216. +2 −4 library/Zend/Mvc/Controller/AbstractController.php
  217. +1 −1 library/Zend/Mvc/Controller/ControllerManager.php
  218. +288 −0 library/Zend/Mvc/Controller/Plugin/AcceptableViewModelSelector.php
  219. +6 −2 library/Zend/Mvc/Controller/Plugin/Forward.php
  220. +1 −4 library/Zend/Mvc/Controller/Plugin/Redirect.php
  221. +5 −0 library/Zend/Mvc/Controller/Plugin/Url.php
  222. +8 −7 library/Zend/Mvc/Controller/PluginManager.php
  223. +1 −1 library/Zend/Mvc/Router/Console/Catchall.php
  224. +7 −3 library/Zend/Mvc/Router/Console/Simple.php
  225. +1 −1 library/Zend/Mvc/Router/Http/Hostname.php
  226. +1 −1 library/Zend/Mvc/Router/Http/Literal.php
  227. +2 −2 library/Zend/Mvc/Router/Http/Part.php
  228. +1 −1 library/Zend/Mvc/Router/Http/Query.php
  229. +3 −3 library/Zend/Mvc/Router/Http/Regex.php
  230. +1 −1 library/Zend/Mvc/Router/Http/Scheme.php
  231. +16 −9 library/Zend/Mvc/Router/Http/Segment.php
  232. +29 −27 library/Zend/Mvc/Router/Http/TreeRouteStack.php
  233. +4 −4 library/Zend/Mvc/Router/Http/Wildcard.php
  234. +2 −2 library/Zend/Mvc/Router/RoutePluginManager.php
  235. +3 −3 library/Zend/Mvc/Router/SimpleRouteStack.php
  236. +36 −0 library/Zend/Mvc/Service/FilterManagerFactory.php
  237. +12 −0 library/Zend/Mvc/Service/ModuleManagerFactory.php
  238. +1 −1 library/Zend/Mvc/Service/RequestFactory.php
  239. +2 −2 library/Zend/Mvc/Service/ServiceListenerFactory.php
  240. +36 −0 library/Zend/Mvc/Service/ValidatorManagerFactory.php
  241. +8 −8 library/Zend/Mvc/Service/ViewHelperManagerFactory.php
  242. +0 −1 library/Zend/Mvc/View/Console/DefaultRenderingStrategy.php
  243. +7 −0 library/Zend/Mvc/View/Console/ExceptionStrategy.php
  244. +1 −1 library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
  245. +0 −1 library/Zend/Mvc/View/Console/ViewManager.php
  246. +33 −2 library/Zend/Mvc/View/Http/InjectTemplateListener.php
  247. +3 −3 library/Zend/Mvc/View/Http/InjectViewModelListener.php
  248. +2 −5 library/Zend/Mvc/View/Http/ViewManager.php
  249. +4 −4 library/Zend/Navigation/Page/AbstractPage.php
  250. +5 −3 library/Zend/Navigation/Page/Mvc.php
  251. +1 −1 library/Zend/Navigation/View/HelperConfig.php
  252. +26 −27 library/Zend/Paginator/Paginator.php
  253. +3 −3 library/Zend/Permissions/Acl/Acl.php
  254. +3 −3 library/Zend/Serializer/Adapter/IgBinary.php
  255. +91 −0 library/Zend/Serializer/Adapter/MsgPack.php
  256. +3 −3 library/Zend/Serializer/Adapter/PhpSerialize.php
  257. +18 −18 library/Zend/Serializer/Adapter/PythonPickle.php
  258. +1 −0 library/Zend/Serializer/AdapterPluginManager.php
  259. +15 −15 library/Zend/Serializer/Serializer.php
  260. +1 −1 library/Zend/Server/Cache.php
  261. +38 −0 library/Zend/ServiceManager/AbstractPluginManager.php
  262. +40 −21 library/Zend/ServiceManager/ServiceManager.php
  263. +24 −4 library/Zend/Session/Config/SessionConfig.php
  264. +23 −6 library/Zend/Session/Container.php
  265. +14 −6 library/Zend/Session/SaveHandler/Cache.php
  266. +2 −2 library/Zend/Session/SessionManager.php
  267. +17 −3 library/Zend/Session/Storage/ArrayStorage.php
  268. +1 −1 library/Zend/Session/Storage/SessionStorage.php
  269. +44 −22 library/Zend/Session/Validator/RemoteAddr.php
  270. +0 −1 library/Zend/Soap/AutoDiscover.php
  271. +57 −53 library/Zend/Soap/Client.php
  272. +21 −9 library/Zend/Soap/Server.php
  273. +1 −1 library/Zend/Soap/Server/DocumentLiteralWrapper.php
  274. +0 −2 library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php
  275. +1 −1 library/Zend/Stdlib/AbstractOptions.php
  276. +1 −1 library/Zend/Stdlib/ArrayUtils.php
  277. +10 −10 library/Zend/Stdlib/CallbackHandler.php
  278. +10 −10 library/Zend/Stdlib/Glob.php
  279. +2 −2 library/Zend/Stdlib/Hydrator/ArraySerializable.php
  280. +4 −4 library/Zend/Stdlib/Hydrator/ClassMethods.php
  281. +1 −1 library/Zend/Stdlib/Hydrator/ObjectProperty.php
  282. +3 −3 library/Zend/Stdlib/Hydrator/Reflection.php
  283. +2 −2 library/Zend/Stdlib/PriorityQueue.php
  284. +1 −1 library/Zend/Tag/Cloud.php
  285. +1 −1 library/Zend/Tag/Cloud/DecoratorPluginManager.php
  286. +1 −0 library/Zend/Text/Table/DecoratorManager.php
  287. +5 −5 library/Zend/Text/Table/Table.php
  288. +2 −2 library/Zend/Uri/Http.php
  289. +1 −1 library/Zend/Uri/Uri.php
  290. +8 −8 library/Zend/Validator/AbstractValidator.php
  291. +1 −1 library/Zend/Validator/Barcode.php
  292. +1 −1 library/Zend/Validator/Barcode/AbstractAdapter.php
  293. +1 −1 library/Zend/Validator/Barcode/AdapterInterface.php
  294. +1 −1 library/Zend/Validator/Barcode/Codabar.php
  295. +3 −3 library/Zend/Validator/Barcode/Code128.php
  296. +1 −1 library/Zend/Validator/Barcode/Code25.php
  297. +1 −1 library/Zend/Validator/Barcode/Code25interleaved.php
  298. +1 −1 library/Zend/Validator/Barcode/Code39.php
  299. +1 −1 library/Zend/Validator/Barcode/Code39ext.php
  300. +1 −1 library/Zend/Validator/Barcode/Code93.php
Sorry, we could not display the entire diff because too many files (539) changed.
View
306 CHANGELOG.md
@@ -1,5 +1,311 @@
# CHANGELOG
+## 2.0.5
+
+- 3004: Zend\Db unit tests fail with code coverage enabled
+ (https://github.com/zendframework/zf2/issues/3004)
+- 3039: combine double if into single conditional
+ (https://github.com/zendframework/zf2/issues/3039)
+- 3042: fix typo 'consist of' should be 'consists of' in singular
+ (https://github.com/zendframework/zf2/issues/3042)
+- 3045: Reduced the #calls of rawurlencode() using a cache mechanism
+ (https://github.com/zendframework/zf2/issues/3045)
+- 3048: Applying quickfix for zendframework/zf2#3004
+ (https://github.com/zendframework/zf2/issues/3048)
+- 3095: Process X-Forwarded-For header in correct order
+ (https://github.com/zendframework/zf2/issues/3095)
+
+## 2.0.4
+
+- 2808: Add serializer better inheritance and extension
+ (https://github.com/zendframework/zf2/issues/2808)
+- 2813: Add test on canonical name with the ServiceManager
+ (https://github.com/zendframework/zf2/issues/2813)
+- 2832: bugfix: The helper DateFormat does not cache correctly when a pattern is
+ set. (https://github.com/zendframework/zf2/issues/2832)
+- 2837: Add empty option before empty check
+ (https://github.com/zendframework/zf2/issues/2837)
+- 2843: change self:: with static:: in call-ing static property/method
+ (https://github.com/zendframework/zf2/issues/2843)
+- 2857: Unnecessary path assembly on return in
+ Zend\Mvc\Router\Http\TreeRouteStack->assemble() line 236
+ (https://github.com/zendframework/zf2/issues/2857)
+- 2867: Enable view sub-directories when using ModuleRouteListener
+ (https://github.com/zendframework/zf2/issues/2867)
+- 2872: Resolve naming conflicts in foreach statements
+ (https://github.com/zendframework/zf2/issues/2872)
+- 2878: Fix : change self:: with static:: in call-ing static property/method()
+ in other components ( all ) (https://github.com/zendframework/zf2/issues/2878)
+- 2879: remove unused const in Zend\Barcode\Barcode.php
+ (https://github.com/zendframework/zf2/issues/2879)
+- 2896: Constraints in Zend\Db\Metadata\Source\AbstractSource::getTable not
+ initalised (https://github.com/zendframework/zf2/issues/2896)
+- 2907: Fixed proxy adapter keys being incorrectly set due Zend\Http\Client
+ (https://github.com/zendframework/zf2/issues/2907)
+- 2909: Change format of Form element DateTime and DateTimeLocal
+ (https://github.com/zendframework/zf2/issues/2909)
+- 2921: Added Chinese translations for zf2 validate/captcha resources
+ (https://github.com/zendframework/zf2/issues/2921)
+- 2924: small speed-up of Zend\EventManager\EventManager::triggerListeners()
+ (https://github.com/zendframework/zf2/issues/2924)
+- 2929: SetCookie::getFieldValue() always uses urlencode() for cookie values,
+ even in case they are already encoded
+ (https://github.com/zendframework/zf2/issues/2929)
+- 2930: Add minor test coverage to MvcEvent
+ (https://github.com/zendframework/zf2/issues/2930)
+- 2932: Sessions: SessionConfig does not allow setting non-directory save path
+ (https://github.com/zendframework/zf2/issues/2932)
+- 2937: preserve matched route name within route match instance while
+ forwarding... (https://github.com/zendframework/zf2/issues/2937)
+- 2940: change 'Cloud\Decorator\Tag' to 'Cloud\Decorator\AbstractTag'
+ (https://github.com/zendframework/zf2/issues/2940)
+- 2941: Logical operator fix : 'or' change to '||' and 'and' change to '&&'
+ (https://github.com/zendframework/zf2/issues/2941)
+- 2952: Various Zend\Mvc\Router\Http routers turn + into a space in path
+ segments (https://github.com/zendframework/zf2/issues/2952)
+- 2957: Make Partial proxy to view render function
+ (https://github.com/zendframework/zf2/issues/2957)
+- 2971: Zend\Http\Cookie undefined self::CONTEXT_REQUEST
+ (https://github.com/zendframework/zf2/issues/2971)
+- 2976: Fix for #2541 (https://github.com/zendframework/zf2/issues/2976)
+- 2981: Controller action HttpResponse is not used by SendResponseListener
+ (https://github.com/zendframework/zf2/issues/2981)
+- 2983: replaced all calls to $this->xpath with $this->getXpath() to always
+ have... (https://github.com/zendframework/zf2/issues/2983)
+- 2986: Add class to file missing a class (fixes #2789)
+ (https://github.com/zendframework/zf2/issues/2986)
+- 2987: fixed Zend\Session\Container::exchangeArray
+ (https://github.com/zendframework/zf2/issues/2987)
+- 2994: Fixes #2993 - Add missing asterisk to method docblock
+ (https://github.com/zendframework/zf2/issues/2994)
+- 2997: Fixing abstract factory instantiation time
+ (https://github.com/zendframework/zf2/issues/2997)
+- 2999: Fix for GitHub issue 2579
+ (https://github.com/zendframework/zf2/issues/2999)
+- 3002: update master's resources/ja Zend_Validate.php message
+ (https://github.com/zendframework/zf2/issues/3002)
+- 3003: Adding tests for zendframework/zf2#2593
+ (https://github.com/zendframework/zf2/issues/3003)
+- 3006: Hotfix for #2497 (https://github.com/zendframework/zf2/issues/3006)
+- 3007: Fix for issue 3001 Zend\Db\Sql\Predicate\Between fails with min and max
+ ... (https://github.com/zendframework/zf2/issues/3007)
+- 3008: Hotfix for #2482 (https://github.com/zendframework/zf2/issues/3008)
+- 3009: Hotfix for #2451 (https://github.com/zendframework/zf2/issues/3009)
+- 3013: Solved Issue 2857 (https://github.com/zendframework/zf2/issues/3013)
+- 3025: Removing the separator between the hidden and the visible inputs. As
+ the... (https://github.com/zendframework/zf2/issues/3025)
+- 3027: Reduced #calls of plugin() in PhpRenderer using a cache mechanism
+ (https://github.com/zendframework/zf2/issues/3027)
+- 3029: Fixed the pre-commit script, missed the fix command
+ (https://github.com/zendframework/zf2/issues/3029)
+- 3030: Mark module as loaded before trigginer EVENT_LOAD_MODULE
+ (https://github.com/zendframework/zf2/issues/3030)
+- 3031: Zend\Db\Sql Fix for Insert's Merge and Set capabilities with simlar keys
+ (https://github.com/zendframework/zf2/issues/3031)
+
+
+## 2.0.3:
+
+- 2244: Fix for issue ZF2-503 (https://github.com/zendframework/zf2/issues/2244)
+- 2318: Allow to remove decimals in CurrencyFormat
+ (https://github.com/zendframework/zf2/issues/2318)
+- 2363: Hotfix db features with eventfeature
+ (https://github.com/zendframework/zf2/issues/2363)
+- 2380: ZF2-482 Attempt to fix the buffer. Also added extra unit tests.
+ (https://github.com/zendframework/zf2/issues/2380)
+- 2392: Update library/Zend/Db/Adapter/Platform/Mysql.php
+ (https://github.com/zendframework/zf2/issues/2392)
+- 2395: Fix for http://framework.zend.com/issues/browse/ZF2-571
+ (https://github.com/zendframework/zf2/issues/2395)
+- 2397: Memcached option merge issuse
+ (https://github.com/zendframework/zf2/issues/2397)
+- 2402: Adding missing dependencies
+ (https://github.com/zendframework/zf2/issues/2402)
+- 2404: Fix to comments (https://github.com/zendframework/zf2/issues/2404)
+- 2416: Fix expressionParamIndex for AbstractSql
+ (https://github.com/zendframework/zf2/issues/2416)
+- 2420: Zend\Db\Sql\Select: Fixed issue with join expression named parameters
+ overlapping. (https://github.com/zendframework/zf2/issues/2420)
+- 2421: Update library/Zend/Http/Header/SetCookie.php
+ (https://github.com/zendframework/zf2/issues/2421)
+- 2422: fix add 2 space after @param in Zend\Loader
+ (https://github.com/zendframework/zf2/issues/2422)
+- 2423: ManagerInterface must be interface, remove 'interface' description
+ (https://github.com/zendframework/zf2/issues/2423)
+- 2425: Use built-in Travis composer
+ (https://github.com/zendframework/zf2/issues/2425)
+- 2426: Remove need of setter in ClassMethods hydrator
+ (https://github.com/zendframework/zf2/issues/2426)
+- 2432: Prevent space before end of tag with HTML5 doctype
+ (https://github.com/zendframework/zf2/issues/2432)
+- 2433: fix for setJsonpCallback not called when recieved JsonModel + test
+ (https://github.com/zendframework/zf2/issues/2433)
+- 2434: added phpdoc in Zend\Db
+ (https://github.com/zendframework/zf2/issues/2434)
+- 2437: Hotfix/console 404 reporting
+ (https://github.com/zendframework/zf2/issues/2437)
+- 2438: Improved previous fix for ZF2-558.
+ (https://github.com/zendframework/zf2/issues/2438)
+- 2440: Turkish Translations for Captcha and Validate
+ (https://github.com/zendframework/zf2/issues/2440)
+- 2441: Allow form collection to have any helper
+ (https://github.com/zendframework/zf2/issues/2441)
+- 2516: limit(20) -> generates LIMIT '20' and throws an IllegalQueryException
+ (https://github.com/zendframework/zf2/issues/2516)
+- 2545: getSqlStringForSqlObject() returns an invalid SQL statement with LIMIT
+ and OFFSET clauses (https://github.com/zendframework/zf2/issues/2545)
+- 2595: Pgsql adapater has codes related to MySQL
+ (https://github.com/zendframework/zf2/issues/2595)
+- 2613: Prevent password to be rendered if form validation fails
+ (https://github.com/zendframework/zf2/issues/2613)
+- 2617: Fixed Zend\Validator\Iban class name
+ (https://github.com/zendframework/zf2/issues/2617)
+- 2619: Form enctype fix when File elements are within a collection
+ (https://github.com/zendframework/zf2/issues/2619)
+- 2620: InputFilter/Input when merging was not using raw value
+ (https://github.com/zendframework/zf2/issues/2620)
+- 2622: Added ability to specify port
+ (https://github.com/zendframework/zf2/issues/2622)
+- 2624: Form's default input filters added multiple times
+ (https://github.com/zendframework/zf2/issues/2624)
+- 2630: fix relative link ( remove the relative links ) in README.md
+ (https://github.com/zendframework/zf2/issues/2630)
+- 2631: Update library/Zend/Loader/AutoloaderFactory.php
+ (https://github.com/zendframework/zf2/issues/2631)
+- 2633: fix redundance errors "The input does not appear to be a valid date"
+ show twice (https://github.com/zendframework/zf2/issues/2633)
+- 2635: Fix potential issue with Sitemap test
+ (https://github.com/zendframework/zf2/issues/2635)
+- 2636: add isset checks around timeout and maxredirects
+ (https://github.com/zendframework/zf2/issues/2636)
+- 2641: hotfix : formRow() element error multi-checkbox and radio renderError
+ not shown (https://github.com/zendframework/zf2/issues/2641)
+- 2642: Fix Travis build for CS issue
+ (https://github.com/zendframework/zf2/issues/2642)
+- 2643: fix for setJsonpCallback not called when recieved JsonModel + test
+ (https://github.com/zendframework/zf2/issues/2643)
+- 2644: Add fluidity to the prepare() function for a form
+ (https://github.com/zendframework/zf2/issues/2644)
+- 2652: Zucchi/filter tweaks (https://github.com/zendframework/zf2/issues/2652)
+- 2665: pdftest fix (https://github.com/zendframework/zf2/issues/2665)
+- 2666: fixed url change (https://github.com/zendframework/zf2/issues/2666)
+- 2667: Possible fix for rartests
+ (https://github.com/zendframework/zf2/issues/2667)
+- 2669: skip whem gmp is loaded
+ (https://github.com/zendframework/zf2/issues/2669)
+- 2673: Input fallback value option
+ (https://github.com/zendframework/zf2/issues/2673)
+- 2676: mysqli::close() never called
+ (https://github.com/zendframework/zf2/issues/2676)
+- 2677: added phpdoc to Zend\Stdlib
+ (https://github.com/zendframework/zf2/issues/2677)
+- 2678: Zend\Db\Adapter\Sqlsrv\Sqlsrv never calls Statement\initialize() (fix
+ within) (https://github.com/zendframework/zf2/issues/2678)
+- 2679: Zend/Log/Logger.php using incorrect php errorLevel
+ (https://github.com/zendframework/zf2/issues/2679)
+- 2680: Cache: fixed bug on getTotalSpace of filesystem and dba adapter
+ (https://github.com/zendframework/zf2/issues/2680)
+- 2681: Cache/Dba: fixed notices on tearDown db4 tests
+ (https://github.com/zendframework/zf2/issues/2681)
+- 2682: Replace 'Configuration' with 'Config' when retrieving configuration
+ (https://github.com/zendframework/zf2/issues/2682)
+- 2683: Hotfix: Allow items from Abstract Factories to have setShared() called
+ (https://github.com/zendframework/zf2/issues/2683)
+- 2685: Remove unused Uses (https://github.com/zendframework/zf2/issues/2685)
+- 2686: Adding code to allow EventManager trigger listeners using wildcard
+ identifier (https://github.com/zendframework/zf2/issues/2686)
+- 2687: Hotfix/db sql nested expressions
+ (https://github.com/zendframework/zf2/issues/2687)
+- 2688: Hotfix/tablegateway event feature
+ (https://github.com/zendframework/zf2/issues/2688)
+- 2689: Hotfix/composer phpunit
+ (https://github.com/zendframework/zf2/issues/2689)
+- 2690: Use RFC-3339 full-date format (Y-m-d) in Date element
+ (https://github.com/zendframework/zf2/issues/2690)
+- 2691: join on conditions don't accept alternatives to columns
+ (https://github.com/zendframework/zf2/issues/2691)
+- 2693: Update library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
+ (https://github.com/zendframework/zf2/issues/2693)
+- 2694: Bring fluid interface to Feed Writer
+ (https://github.com/zendframework/zf2/issues/2694)
+- 2698: fix typo in # should be :: in exception
+ (https://github.com/zendframework/zf2/issues/2698)
+- 2699: fix elseif in javascript Upload Demo
+ (https://github.com/zendframework/zf2/issues/2699)
+- 2700: fix cs in casting variable
+ (https://github.com/zendframework/zf2/issues/2700)
+- 2705: Fix french translation
+ (https://github.com/zendframework/zf2/issues/2705)
+- 2707: Improved error message when ServiceManager does not find an invokable
+ class (https://github.com/zendframework/zf2/issues/2707)
+- 2710: #2461 - correcting the url encoding of path segments
+ (https://github.com/zendframework/zf2/issues/2710)
+- 2711: Fix/demos ProgressBar/ZendForm.php : Object of class Zend\Form\Form
+ could not be converted to string
+ (https://github.com/zendframework/zf2/issues/2711)
+- 2712: fix cs casting variable for (array)
+ (https://github.com/zendframework/zf2/issues/2712)
+- 2713: Update library/Zend/Mvc/Service/ViewHelperManagerFactory.php
+ (https://github.com/zendframework/zf2/issues/2713)
+- 2714: Don't add separator if not prefixing columns
+ (https://github.com/zendframework/zf2/issues/2714)
+- 2717: Extends when it can : Validator\DateStep extends Validator\Date to
+ reduce code redundancy (https://github.com/zendframework/zf2/issues/2717)
+- 2719: Fixing the Cache Storage Factory Adapter Factory
+ (https://github.com/zendframework/zf2/issues/2719)
+- 2728: Bad Regex for Content Type header
+ (https://github.com/zendframework/zf2/issues/2728)
+- 2731: Reset the Order part when resetting Select
+ (https://github.com/zendframework/zf2/issues/2731)
+- 2732: Removed references to Mysqli in Zend\Db\Adapter\Driver\Pgsql
+ (https://github.com/zendframework/zf2/issues/2732)
+- 2733: fix @package Zend_Validate should be Zend_Validator
+ (https://github.com/zendframework/zf2/issues/2733)
+- 2734: fix i18n @package and @subpackage value
+ (https://github.com/zendframework/zf2/issues/2734)
+- 2736: fix captcha helper test.
+ (https://github.com/zendframework/zf2/issues/2736)
+- 2737: Issue #2728 - Bad Regex for Content Type header
+ (https://github.com/zendframework/zf2/issues/2737)
+- 2738: fix link 'quickstart' to version 2.0
+ (https://github.com/zendframework/zf2/issues/2738)
+- 2739: remove '@subpackage' because Zend\Math is not in subpackage
+ (https://github.com/zendframework/zf2/issues/2739)
+- 2742: remove () in echo-ing (https://github.com/zendframework/zf2/issues/2742)
+- 2749: Fix for #2678 (Zend\Db's Sqlsrv Driver)
+ (https://github.com/zendframework/zf2/issues/2749)
+- 2750: Adds the ability to instanciate by factory to AbstractPluginManager
+ (https://github.com/zendframework/zf2/issues/2750)
+- 2754: add the support to register module paths over namespace
+ (https://github.com/zendframework/zf2/issues/2754)
+- 2755: remove Zend\Mvc\Controller\PluginBroker from aliases in
+ "$defaultServiceConfig" (https://github.com/zendframework/zf2/issues/2755)
+- 2759: Fix Zend\Code\Scanner\TokenArrayScanner
+ (https://github.com/zendframework/zf2/issues/2759)
+- 2764: Fixed Zend\Math\Rand::getString() to pass the parameter $strong to
+ ::getBytes() (https://github.com/zendframework/zf2/issues/2764)
+- 2765: Csrf: always use dedicated setter
+ (https://github.com/zendframework/zf2/issues/2765)
+- 2766: Session\Storage: always preserve REQUEST_ACCESS_TIME
+ (https://github.com/zendframework/zf2/issues/2766)
+- 2768: Zend\Validator dependency is missed in Zend\Cache composer.json
+ (https://github.com/zendframework/zf2/issues/2768)
+- 2769: change valueToLDAP to valueToLdap and valueFromLDAP to valueFromLdap
+ (https://github.com/zendframework/zf2/issues/2769)
+- 2770: Memcached (https://github.com/zendframework/zf2/issues/2770)
+- 2775: Zend\Db\Sql: Fix for Mysql quoting during limit and offset
+ (https://github.com/zendframework/zf2/issues/2775)
+- 2776: Allow whitespace in Iban
+ (https://github.com/zendframework/zf2/issues/2776)
+- 2777: Fix issue when PREG_BAD_UTF8_OFFSET_ERROR is defined but Unicode support
+ is not enabled on PCRE (https://github.com/zendframework/zf2/issues/2777)
+- 2778: Undefined Index fix in ViewHelperManagerFactory
+ (https://github.com/zendframework/zf2/issues/2778)
+- 2779: Allow forms that have been added as fieldsets to bind values to bound
+ ob... (https://github.com/zendframework/zf2/issues/2779)
+- 2782: Issue 2781 (https://github.com/zendframework/zf2/issues/2782)
+
+
## 2.0.2:
- 2383: Changed unreserved char definition in Zend\Uri (ZF2-533) and added shell
View
2 INSTALL.md
@@ -57,7 +57,7 @@ http://www.php.net/manual/en/configuration.changes.php
A great place to get up-to-speed quickly is the Zend Framework
QuickStart:
-http://framework.zend.com/manual/en/learning.quickstart.html
+http://framework.zend.com/manual/2.0/en/user-guide/overview.html
The QuickStart covers some of the most commonly used components of ZF.
Since Zend Framework is designed with a use-at-will architecture and
View
2 README-GIT.md
@@ -140,7 +140,7 @@ foreach ($output as $file) {
*/
$output = array();
$return = null;
- exec("php-cs-fixer --dry-run --level=psr2 " . escapeshellarg($fileName), $output, $return);
+ exec("php-cs-fixer fix --dry-run --level=psr2 " . escapeshellarg($fileName), $output, $return);
if ($return != 0 || !empty($output)) {
echo "PHP file fails contains CS issues: " . $fileName . ":" . PHP_EOL;
echo implode(PHP_EOL, $output) . PHP_EOL;
View
6 README.md
@@ -5,13 +5,13 @@ Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?bra
## RELEASE INFORMATION
-*Zend Framework 2.0.3dev*
+*Zend Framework 2.0.6*
-This is the third maintenance release for the 2.0 series.
+This is the sixth maintenance release for the 2.0 series.
XX YYY 2012
-### UPDATES IN 2.0.3
+### UPDATES IN 2.0.6
Please see CHANGELOG.md.
View
3 composer.json
@@ -82,7 +82,8 @@
},
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "2.0-dev",
+ "dev-develop": "2.1-dev"
}
}
}
View
34 library/Zend/Barcode/Barcode.php
@@ -22,8 +22,6 @@
*/
class Barcode
{
- const OBJECT = 'OBJECT';
- const RENDERER = 'RENDERER';
/**
* Default barcode TTF font name
*
@@ -56,11 +54,11 @@ class Barcode
*/
public static function getObjectPluginManager()
{
- if (!self::$objectPlugins instanceof ObjectPluginManager) {
- self::$objectPlugins = new ObjectPluginManager();
+ if (!static::$objectPlugins instanceof ObjectPluginManager) {
+ static::$objectPlugins = new ObjectPluginManager();
}
- return self::$objectPlugins;
+ return static::$objectPlugins;
}
/**
@@ -70,11 +68,11 @@ public static function getObjectPluginManager()
*/
public static function getRendererPluginManager()
{
- if (!self::$rendererPlugins instanceof RendererPluginManager) {
- self::$rendererPlugins = new RendererPluginManager();
+ if (!static::$rendererPlugins instanceof RendererPluginManager) {
+ static::$rendererPlugins = new RendererPluginManager();
}
- return self::$rendererPlugins;
+ return static::$rendererPlugins;
}
/**
@@ -131,12 +129,12 @@ public static function factory($barcode,
}
try {
- $barcode = self::makeBarcode($barcode, $barcodeConfig);
- $renderer = self::makeRenderer($renderer, $rendererConfig);
+ $barcode = static::makeBarcode($barcode, $barcodeConfig);
+ $renderer = static::makeRenderer($renderer, $rendererConfig);
} catch (Exception\ExceptionInterface $e) {
if ($automaticRenderError && !($e instanceof Exception\RendererCreationException)) {
- $barcode = self::makeBarcode('error', array( 'text' => $e->getMessage() ));
- $renderer = self::makeRenderer($renderer, array());
+ $barcode = static::makeBarcode('error', array( 'text' => $e->getMessage() ));
+ $renderer = static::makeRenderer($renderer, array());
} else {
throw $e;
}
@@ -197,7 +195,7 @@ public static function makeBarcode($barcode, $barcodeConfig = array())
);
}
- return self::getObjectPluginManager()->get($barcode, $barcodeConfig);
+ return static::getObjectPluginManager()->get($barcode, $barcodeConfig);
}
/**
@@ -249,7 +247,7 @@ public static function makeRenderer($renderer = 'image', $rendererConfig = array
);
}
- return self::getRendererPluginManager()->get($renderer, $rendererConfig);
+ return static::getRendererPluginManager()->get($renderer, $rendererConfig);
}
/**
@@ -265,7 +263,7 @@ public static function render($barcode,
$barcodeConfig = array(),
$rendererConfig = array())
{
- self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->render();
+ static::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->render();
}
/**
@@ -282,7 +280,7 @@ public static function draw($barcode,
$barcodeConfig = array(),
$rendererConfig = array())
{
- return self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->draw();
+ return static::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->draw();
}
/**
@@ -293,7 +291,7 @@ public static function draw($barcode,
*/
public static function setBarcodeFont($font)
{
- self::$staticFont = $font;
+ static::$staticFont = $font;
}
/**
@@ -303,6 +301,6 @@ public static function setBarcodeFont($font)
*/
public static function getBarcodeFont()
{
- return self::$staticFont;
+ return static::$staticFont;
}
}
View
8 library/Zend/Barcode/Object/AbstractObject.php
@@ -576,9 +576,9 @@ public function getTextToDisplay()
{
if ($this->withChecksumInText) {
return $this->getText();
- } else {
- return $this->addLeadingZeros($this->text, true);
}
+
+ return $this->addLeadingZeros($this->text, true);
}
/**
@@ -758,9 +758,9 @@ public function getQuietZone()
{
if ($this->withQuietZones || $this->mandatoryQuietZones) {
return 10 * $this->barThinWidth * $this->factor;
- } else {
- return 0;
}
+
+ return 0;
}
/**
View
4 library/Zend/Barcode/Object/Code128.php
@@ -218,8 +218,8 @@ protected function convertToBarcodeChars($string)
$char = $string[$pos];
$code = null;
- if (self::_isDigit($string, $pos, 4) && $currentCharset != 'C'
- || self::_isDigit($string, $pos, 2) && $currentCharset == 'C') {
+ if (static::_isDigit($string, $pos, 4) && $currentCharset != 'C'
+ || static::_isDigit($string, $pos, 2) && $currentCharset == 'C') {
/**
* Switch to C if the next 4 chars are numeric or stay C if the next 2
* chars are numeric
View
4 library/Zend/Barcode/Object/Code39.php
@@ -119,9 +119,9 @@ public function getTextToDisplay()
$text = parent::getTextToDisplay();
if (substr($text, 0, 1) != '*' && substr($text, -1) != '*') {
return '*' . $text . '*';
- } else {
- return $text;
}
+
+ return $text;
}
/**
View
2 library/Zend/Barcode/Object/Ean5.php
@@ -101,7 +101,7 @@ public function getChecksum($text)
$this->checkText($text);
$checksum = 0;
- for ($i = 0 ; $i < $this->barcodeLength; $i ++) {
+ for ($i = 0; $i < $this->barcodeLength; $i ++) {
$checksum += intval($text{$i}) * ($i % 2 ? 9 : 3);
}
View
2 library/Zend/Cache/Pattern/OutputCache.php
@@ -85,7 +85,7 @@ public function end()
throw new Exception\RuntimeException('Output cache not started');
}
- $output = ob_end_flush();
+ $output = ob_get_flush();
if ($output === false) {
throw new Exception\RuntimeException('Output buffering not active');
}
View
13 library/Zend/Cache/Storage/Adapter/Filesystem.php
@@ -880,9 +880,18 @@ protected function internalSetItem(& $normalizedKey, & $value)
$filespec = $this->getFileSpec($normalizedKey);
$this->prepareDirectoryStructure($filespec);
- $this->putFileContent($filespec . '.dat', $value);
+ // write data in non-blocking mode
+ $wouldblock = null;
+ $this->putFileContent($filespec . '.dat', $value, true, $wouldblock);
+
+ // delete related tag file (if present)
$this->unlink($filespec . '.tag');
+ // Retry writing data in blocking mode if it was blocked before
+ if ($wouldblock) {
+ $this->putFileContent($filespec . '.dat', $value);
+ }
+
return true;
}
@@ -1528,7 +1537,7 @@ protected function putFileContent($file, $data, $nonBlocking = false, & $wouldbl
}
}
- if (!fwrite($fp, $data)) {
+ if (fwrite($fp, $data) === false) {
flock($fp, \LOCK_UN);
fclose($fp);
$err = ErrorHandler::stop();
View
179 library/Zend/Cache/Storage/Adapter/Memcached.php
@@ -16,7 +16,6 @@
use Zend\Cache\Exception;
use Zend\Cache\Storage\AvailableSpaceCapableInterface;
use Zend\Cache\Storage\Capabilities;
-use Zend\Cache\Storage\Event;
use Zend\Cache\Storage\FlushableInterface;
use Zend\Cache\Storage\TotalSpaceCapableInterface;
@@ -38,11 +37,11 @@ class Memcached extends AbstractAdapter implements
protected static $extMemcachedMajorVersion;
/**
- * Memcached instance
+ * The memcached resource
*
* @var MemcachedResource
*/
- protected $memcached;
+ protected $memcachedResource;
/**
* Constructor
@@ -54,61 +53,62 @@ public function __construct($options = null)
{
if (static::$extMemcachedMajorVersion === null) {
$v = (string) phpversion('memcached');
- static::$extMemcachedMajorVersion = ($v !== '') ? (int)$v[0] : 0;
+ static::$extMemcachedMajorVersion = ($v !== '') ? (int) $v[0] : 0;
}
if (static::$extMemcachedMajorVersion < 1) {
throw new Exception\ExtensionNotLoadedException('Need ext/memcached version >= 1.0.0');
}
parent::__construct($options);
+ }
+
+ /**
+ * Initialize the internal memcached resource
+ *
+ * @return MemcachedResource
+ */
+ protected function getMemcachedResource()
+ {
+ if ($this->memcachedResource) {
+ return $this->memcachedResource;
+ }
- // It's ok to init the memcached instance as soon as possible because
- // ext/memcached auto-connects to the server on first use
- $this->memcached = new MemcachedResource();
$options = $this->getOptions();
- // set lib options
+ // use a configured resource or a new one
+ $memcached = $options->getMemcachedResource() ?: new MemcachedResource();
+
+ // init lib options
if (static::$extMemcachedMajorVersion > 1) {
- $this->memcached->setOptions($options->getLibOptions());
+ $memcached->setOptions($options->getLibOptions());
} else {
foreach ($options->getLibOptions() as $k => $v) {
- $this->memcached->setOption($k, $v);
+ $memcached->setOption($k, $v);
}
}
- $this->memcached->setOption(MemcachedResource::OPT_PREFIX_KEY, $options->getNamespace());
-
- $servers = $options->getServers();
- if (!$servers) {
- $options->addServer('127.0.0.1', 11211);
- $servers = $options->getServers();
- }
- $this->memcached->addServers($servers);
-
+ $memcached->setOption(MemcachedResource::OPT_PREFIX_KEY, $options->getNamespace());
-
- // get notified on change options
- $memc = $this->memcached;
- $memcMV = static::$extMemcachedMajorVersion;
- $this->getEventManager()->attach('option', function ($event) use ($memc, $memcMV) {
+ // Allow updating namespace
+ $this->getEventManager()->attach('option', function ($event) use ($memcached) {
$params = $event->getParams();
-
- if (isset($params['lib_options'])) {
- if ($memcMV > 1) {
- $memc->setOptions($params['lib_options']);
- } else {
- foreach ($params['lib_options'] as $k => $v) {
- $memc->setOption($k, $v);
- }
- }
+ if (!isset($params['namespace'])) {
+ // Cannot set lib options after initialization
+ return;
}
+ $memcached->setOption(MemcachedResource::OPT_PREFIX_KEY, $params['namespace']);
+ });
- if (isset($params['namespace'])) {
- $memc->setOption(MemcachedResource::OPT_PREFIX_KEY, $params['namespace']);
- }
+ // init servers
+ $servers = $options->getServers();
+ if ($servers) {
+ $memcached->addServers($servers);
+ }
- // TODO: update on change/add server(s)
- });
+ // use the initialized resource
+ $this->memcachedResource = $memcached;
+
+ return $this->memcachedResource;
}
/* options */
@@ -152,8 +152,9 @@ public function getOptions()
*/
public function flush()
{
- if (!$this->memcached->flush()) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ $memc = $this->getMemcachedResource();
+ if (!$memc->flush()) {
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return true;
}
@@ -167,9 +168,10 @@ public function flush()
*/
public function getTotalSpace()
{
- $stats = $this->memcached->getStats();
+ $memc = $this->getMemcachedResource();
+ $stats = $memc->getStats();
if ($stats === false) {
- throw new Exception\RuntimeException($this->memcached->getResultMessage());
+ throw new Exception\RuntimeException($memc->getResultMessage());
}
$mem = array_pop($stats);
@@ -185,9 +187,10 @@ public function getTotalSpace()
*/
public function getAvailableSpace()
{
- $stats = $this->memcached->getStats();
+ $memc = $this->getMemcachedResource();
+ $stats = $memc->getStats();
if ($stats === false) {
- throw new Exception\RuntimeException($this->memcached->getResultMessage());
+ throw new Exception\RuntimeException($memc->getResultMessage());
}
$mem = array_pop($stats);
@@ -207,15 +210,17 @@ public function getAvailableSpace()
*/
protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null)
{
+ $memc = $this->getMemcachedResource();
+
if (func_num_args() > 2) {
- $result = $this->memcached->get($normalizedKey, null, $casToken);
+ $result = $memc->get($normalizedKey, null, $casToken);
} else {
- $result = $this->memcached->get($normalizedKey);
+ $result = $memc->get($normalizedKey);
}
$success = true;
if ($result === false || $result === null) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
if ($rsCode == MemcachedResource::RES_NOTFOUND) {
$result = null;
$success = false;
@@ -237,9 +242,10 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
*/
protected function internalGetItems(array & $normalizedKeys)
{
- $result = $this->memcached->getMulti($normalizedKeys);
+ $memc = $this->getMemcachedResource();
+ $result = $memc->getMulti($normalizedKeys);
if ($result === false) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return $result;
@@ -254,9 +260,10 @@ protected function internalGetItems(array & $normalizedKeys)
*/
protected function internalHasItem(& $normalizedKey)
{
- $value = $this->memcached->get($normalizedKey);
+ $memc = $this->getMemcachedResource();
+ $value = $memc->get($normalizedKey);
if ($value === false || $value === null) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
if ($rsCode == MemcachedResource::RES_SUCCESS) {
return true;
} elseif ($rsCode == MemcachedResource::RES_NOTFOUND) {
@@ -278,9 +285,10 @@ protected function internalHasItem(& $normalizedKey)
*/
protected function internalHasItems(array & $normalizedKeys)
{
- $result = $this->memcached->getMulti($normalizedKeys);
+ $memc = $this->getMemcachedResource();
+ $result = $memc->getMulti($normalizedKeys);
if ($result === false) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return array_keys($result);
@@ -295,9 +303,10 @@ protected function internalHasItems(array & $normalizedKeys)
*/
protected function internalGetMetadatas(array & $normalizedKeys)
{
- $result = $this->memcached->getMulti($normalizedKeys);
+ $memc = $this->getMemcachedResource();
+ $result = $memc->getMulti($normalizedKeys);
if ($result === false) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
foreach ($result as & $value) {
@@ -319,9 +328,10 @@ protected function internalGetMetadatas(array & $normalizedKeys)
*/
protected function internalSetItem(& $normalizedKey, & $value)
{
+ $memc = $this->getMemcachedResource();
$expiration = $this->expirationTime();
- if (!$this->memcached->set($normalizedKey, $value, $expiration)) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ if (!$memc->set($normalizedKey, $value, $expiration)) {
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return true;
@@ -336,9 +346,10 @@ protected function internalSetItem(& $normalizedKey, & $value)
*/
protected function internalSetItems(array & $normalizedKeyValuePairs)
{
+ $memc = $this->getMemcachedResource();
$expiration = $this->expirationTime();
- if (!$this->memcached->setMulti($normalizedKeyValuePairs, $expiration)) {
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ if (!$memc->setMulti($normalizedKeyValuePairs, $expiration)) {
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return array();
@@ -354,12 +365,13 @@ protected function internalSetItems(array & $normalizedKeyValuePairs)
*/
protected function internalAddItem(& $normalizedKey, & $value)
{
+ $memc = $this->getMemcachedResource();
$expiration = $this->expirationTime();
- if (!$this->memcached->add($normalizedKey, $value, $expiration)) {
- if ($this->memcached->getResultCode() == MemcachedResource::RES_NOTSTORED) {
+ if (!$memc->add($normalizedKey, $value, $expiration)) {
+ if ($memc->getResultCode() == MemcachedResource::RES_NOTSTORED) {
return false;
}
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ throw $this->getExceptionByResultCode($memc->getResultCode());
}
return true;
@@ -375,12 +387,14 @@ protected function internalAddItem(& $normalizedKey, & $value)
*/
protected function internalReplaceItem(& $normalizedKey, & $value)
{
+ $memc = $this->getMemcachedResource();
$expiration = $this->expirationTime();
- if (!$this->memcached->replace($normalizedKey, $value, $expiration)) {
- if ($this->memcached->getResultCode() == MemcachedResource::RES_NOTSTORED) {
+ if (!$memc->replace($normalizedKey, $value, $expiration)) {
+ $rsCode = $memc->getResultCode();
+ if ($rsCode == MemcachedResource::RES_NOTSTORED) {
return false;
}
- throw $this->getExceptionByResultCode($this->memcached->getResultCode());
+ throw $this->getExceptionByResultCode($rsCode);
}
return true;
@@ -399,11 +413,12 @@ protected function internalReplaceItem(& $normalizedKey, & $value)
*/
protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value)
{
+ $memc = $this->getMemcachedResource();
$expiration = $this->expirationTime();
- $result = $this->memcached->cas($token, $normalizedKey, $value, $expiration);
+ $result = $memc->cas($token, $normalizedKey, $value, $expiration);
if ($result === false) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
if ($rsCode !== 0 && $rsCode != MemcachedResource::RES_DATA_EXISTS) {
throw $this->getExceptionByResultCode($rsCode);
}
@@ -422,10 +437,11 @@ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value)
*/
protected function internalRemoveItem(& $normalizedKey)
{
- $result = $this->memcached->delete($normalizedKey);
+ $memc = $this->getMemcachedResource();
+ $result = $memc->delete($normalizedKey);
if ($result === false) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
if ($rsCode == MemcachedResource::RES_NOTFOUND) {
return false;
} elseif ($rsCode != MemcachedResource::RES_SUCCESS) {
@@ -450,7 +466,8 @@ protected function internalRemoveItems(array & $normalizedKeys)
return parent::internalRemoveItems($normalizedKeys);
}
- $rsCodes = $this->memcached->deleteMulti($normalizedKeys);
+ $memc = $this->getMemcachedResource();
+ $rsCodes = $memc->deleteMulti($normalizedKeys);
$missingKeys = array();
foreach ($rsCodes as $key => $rsCode) {
@@ -475,17 +492,18 @@ protected function internalRemoveItems(array & $normalizedKeys)
*/
protected function internalIncrementItem(& $normalizedKey, & $value)
{
+ $memc = $this->getMemcachedResource();
$value = (int) $value;
- $newValue = $this->memcached->increment($normalizedKey, $value);
+ $newValue = $memc->increment($normalizedKey, $value);
if ($newValue === false) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
// initial value
if ($rsCode == MemcachedResource::RES_NOTFOUND) {
$newValue = $value;
- $this->memcached->add($normalizedKey, $newValue, $this->expirationTime());
- $rsCode = $this->memcached->getResultCode();
+ $memc->add($normalizedKey, $newValue, $this->expirationTime());
+ $rsCode = $memc->getResultCode();
}
if ($rsCode) {
@@ -506,17 +524,18 @@ protected function internalIncrementItem(& $normalizedKey, & $value)
*/
protected function internalDecrementItem(& $normalizedKey, & $value)
{
- $value = (int)$value;
- $newValue = $this->memcached->decrement($normalizedKey, $value);
+ $memc = $this->getMemcachedResource();
+ $value = (int) $value;
+ $newValue = $memc->decrement($normalizedKey, $value);
if ($newValue === false) {
- $rsCode = $this->memcached->getResultCode();
+ $rsCode = $memc->getResultCode();
// initial value
if ($rsCode == MemcachedResource::RES_NOTFOUND) {
$newValue = -$value;
- $this->memcached->add($normalizedKey, $newValue, $this->expirationTime());
- $rsCode = $this->memcached->getResultCode();
+ $memc->add($normalizedKey, $newValue, $this->expirationTime());
+ $rsCode = $memc->getResultCode();
}
if ($rsCode) {
@@ -609,7 +628,7 @@ protected function getExceptionByResultCode($code)
);
default:
- return new Exception\RuntimeException($this->memcached->getResultMessage());
+ return new Exception\RuntimeException($this->getMemcachedResource()->getResultMessage());
}
}
}
View
152 library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
@@ -10,8 +10,8 @@
namespace Zend\Cache\Storage\Adapter;
+use Memcached as MemcachedResource;
use Zend\Cache\Exception;
-use Zend\Validator\Hostname;
/**
* These are options specific to the APC adapter
@@ -22,16 +22,28 @@
*/
class MemcachedOptions extends AdapterOptions
{
+ /**
+ * A memcached resource to share
+ *
+ * @var null|MemcachedResource
+ */
+ protected $memcachedResource;
/**
- * Memcached server address
+ * List of memcached servers to add on initialize
*
* @var string
*/
- protected $servers = array();
+ protected $servers = array(
+ array(
+ 'host' => '127.0.0.1',
+ 'port' => 11211,
+ 'weight' => 0,
+ ),
+ );
/**
- * Libmemcached options
+ * List of Libmemcached options to set on initialize
*
* @var array
*/
@@ -61,53 +73,132 @@ public function setNamespace($namespace)
}
/**
- * Add Server
+ * A memcached resource to share
*
- * @param string $host
- * @param int $port
+ * @param null|MemcachedResource $memcachedResource
* @return MemcachedOptions
- * @throws Exception\InvalidArgumentException
*/
- public function addServer($host, $port = 11211)
+ public function setMemcachedResource(MemcachedResource $memcachedResource = null)
{
- $hostNameValidator = new Hostname(array('allow' => Hostname::ALLOW_ALL));
- if (!$hostNameValidator->isValid($host)) {
- throw new Exception\InvalidArgumentException(sprintf(
- '%s expects a valid hostname: %s',
- __METHOD__,
- implode("\n", $hostNameValidator->getMessages())
- ));
+ if ($this->memcachedResource !== $memcachedResource) {
+ $this->triggerOptionEvent('memcached_resource', $memcachedResource);
+ $this->memcachedResource = $memcachedResource;
}
+ return $this;
+ }
- if (!is_numeric($port) || $port <= 0) {
- throw new Exception\InvalidArgumentException(sprintf(
- '%s expects a positive integer', __METHOD__
- ));
+ /**
+ * Get memcached resource to share
+ *
+ * @return null|MemcachedResource
+ */
+ public function getMemcachedResource()
+ {
+ return $this->memcachedResource;
+ }
+
+ /**
+ * Add a server to the list
+ *
+ * @param string $host
+ * @param int $port
+ * @param int $weight
+ * @return MemcachedOptions
+ */
+ public function addServer($host, $port = 11211, $weight = 0)
+ {
+ $new = array(
+ 'host' => $host,
+ 'port' => $port,
+ 'weight' => $weight
+ );
+
+ foreach ($this->servers as $server) {
+ $diff = array_diff($new, $server);
+ if (empty($diff)) {
+ // Done -- server is already present
+ return $this;
+ }
}
- $this->servers[] = array($host, $port);
+ $this->servers[] = $new;
return $this;
}
/**
- * Set Servers
+ * Set a list of memcached servers to add on initialize
*
- * @param array $servers list of servers in [] = array($host, $port)
+ * @param string|array $servers list of servers
* @return MemcachedOptions
* @throws Exception\InvalidArgumentException
*/
- public function setServers(array $servers)
+ public function setServers($servers)
{
+ if (!is_array($servers)) {
+ return $this->setServers(explode(',', $servers));
+ }
+
+ $this->servers = array();
foreach ($servers as $server) {
- if (!isset($server[0])) {
- throw new Exception\InvalidArgumentException('The servers array must contain a host value.');
+ // default values
+ $host = null;
+ $port = 11211;
+ $weight = 1;
+
+ if (!is_array($server) && !is_string($server)) {
+ throw new Exception\InvalidArgumentException('Invalid server specification provided; must be an array or string');
+ }
+
+ // parse a single server from an array
+ if (is_array($server)) {
+ if (!isset($server[0]) && !isset($server['host'])) {
+ throw new Exception\InvalidArgumentException("Invalid list of servers given");
+ }
+
+ // array(array(<host>[, <port>[, <weight>]])[, ...])
+ if (isset($server[0])) {
+ $host = (string) $server[0];
+ $port = isset($server[1]) ? (int) $server[1] : $port;
+ $weight = isset($server[2]) ? (int) $server[2] : $weight;
+ }
+
+ // array(array('host' => <host>[, 'port' => <port>[, 'weight' => <weight>]])[, ...])
+ if (!isset($server[0]) && isset($server['host'])) {
+ $host = (string) $server['host'];
+ $port = isset($server['port']) ? (int) $server['port'] : $port;
+ $weight = isset($server['weight']) ? (int) $server['weight'] : $weight;
+ }
}
- if (!isset($server[1])) {
- $this->addServer($server[0]);
- } else {
- $this->addServer($server[0], $server[1]);
+ // parse a single server from a string
+ if (!is_array($server)) {
+ $server = trim($server);
+ if (strpos($server, '://') === false) {
+ $server = 'tcp://' . $server;
+ }
+
+ $server = parse_url($server);
+ if (!$server) {
+ throw new Exception\InvalidArgumentException("Invalid list of servers given");
+ }
+
+ $host = $server['host'];
+ $port = isset($server['port']) ? (int) $server['port'] : $port;
+
+ if (isset($server['query'])) {
+ $query = null;
+ parse_str($server['query'], $query);
+ if (isset($query['weight'])) {
+ $weight = (int) $query['weight'];
+ }
+ }
}
+
+ if (!$host) {
+ throw new Exception\InvalidArgumentException('The list of servers must contain a host value.');
+ }
+
+ $this->addServer($host, $port, $weight);
}
return $this;
@@ -206,5 +297,4 @@ protected function normalizeLibOptionKey(& $key)
$key = (int) $key;
}
}
-
}
View
8 library/Zend/Cache/Storage/Adapter/MemoryOptions.php
@@ -93,23 +93,23 @@ protected function normalizeMemoryLimit($value)
throw new Exception\InvalidArgumentException("Invalid memory limit '{$value}'");
}
- $value = (int)$matches[1];
+ $value = (int) $matches[1];
if ($value <= 0) {
return 0;
}
switch (strtoupper($matches[2])) {
case 'G':
$value*= 1024;
- // Break intentionally omitted
+ // no break
case 'M':
$value*= 1024;
- // Break intentionally omitted
+ // no break
case 'K':
$value*= 1024;
- // Break intentionally omitted
+ // no break
}
return $value;
View
8 library/Zend/Cache/Storage/Capabilities.php
@@ -353,7 +353,7 @@ public function getStaticTtl()
*/
public function setStaticTtl(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'staticTtl', (bool)$flag);
+ return $this->setCapability($marker, 'staticTtl', (bool) $flag);
}
/**
@@ -402,7 +402,7 @@ public function getUseRequestTime()
*/
public function setUseRequestTime(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'useRequestTime', (bool)$flag);
+ return $this->setCapability($marker, 'useRequestTime', (bool) $flag);
}
/**
@@ -424,7 +424,7 @@ public function getExpiredRead()
*/
public function setExpiredRead(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'expiredRead', (bool)$flag);
+ return $this->setCapability($marker, 'expiredRead', (bool) $flag);
}
/**
@@ -473,7 +473,7 @@ public function getNamespaceIsPrefix()
*/
public function setNamespaceIsPrefix(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'namespaceIsPrefix', (bool)$flag);
+ return $this->setCapability($marker, 'namespaceIsPrefix', (bool) $flag);
}
/**
View
9 library/Zend/Cache/composer.json
@@ -18,7 +18,14 @@
"zendframework/zend-servicemanager": "self.version",
"zendframework/zend-eventmanager": "self.version"
},
+ "require-dev": {
+ "zendframework/zend-serializer": "self.version"
+ },
"suggest": {
- "zendframework/zend-log": "Zend\\Log component"
+ "zendframework/zend-serializer": "Zend\\Serializer component",
+ "ext-apc": "APC >= 3.1.6 to use the APC storage adapter",
+ "ext-dba": "DBA, to use the DBA storage adapter",
+ "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter",
+ "ext-wincache": "WinCache, to use the WinCache storage adapter"
}
}
View
14 library/Zend/Captcha/AbstractWord.php
@@ -311,8 +311,8 @@ protected function generateWord()
{
$word = '';
$wordLen = $this->getWordLen();
- $vowels = $this->useNumbers ? self::$VN : self::$V;
- $consonants = $this->useNumbers ? self::$CN : self::$C;
+ $vowels = $this->useNumbers ? static::$VN : static::$V;
+ $consonants = $this->useNumbers ? static::$CN : static::$C;
for ($i=0; $i < $wordLen; $i = $i + 2) {
// generate word with mix of vowels and consonants
@@ -365,11 +365,11 @@ protected function generateRandomId()
*/
public function isValid($value, $context = null)
{
- if (!is_array($value) && !is_array($context)) {
- $this->error(self::MISSING_VALUE);
- return false;
- }
- if (!is_array($value) && is_array($context)) {
+ if (!is_array($value)) {
+ if (!is_array($context)) {
+ $this->error(self::MISSING_VALUE);
+ return false;
+ }
$value = $context;
}
View
145 library/Zend/Code/Generator/ClassGenerator.php
@@ -68,9 +68,9 @@ class ClassGenerator extends AbstractGenerator
protected $methods = array();
/**
- * fromReflection() - build a Code Generation Php Object from a Class Reflection
+ * Build a Code Generation Php Object from a Class Reflection
*
- * @param ClassReflection $classReflection
+ * @param ClassReflection $classReflection
* @return ClassGenerator
*/
public static function fromReflection(ClassReflection $classReflection)
@@ -141,16 +141,16 @@ public static function fromReflection(ClassReflection $classReflection)
* @configkey properties
* @configkey methods
*
- *
* @throws Exception\InvalidArgumentException
- * @param array $array
+ * @param array $array
* @return ClassGenerator
*/
public static function fromArray(array $array)
{
if (!isset($array['name'])) {
throw new Exception\InvalidArgumentException('Class generator requires that a name is provided for this object');
}
+
$cg = new static($array['name']);
foreach ($array as $name => $value) {
// normalize key
@@ -162,7 +162,8 @@ public static function fromArray(array $array)
$cg->setNamespaceName($value);
break;
case 'docblock':
- $cg->setDocBlock((!$value instanceof DocBlockGenerator) ? : DocBlockGenerator::fromArray($value));
+ $docBlock = ($value instanceof DocBlockGenerator) ? $value : DocBlockGenerator::fromArray($value);
+ $cg->setDocBlock($docBlock);
break;
case 'flags':
$cg->setFlags($value);