Zend Framework 2.4.0
This is the fourth minor (feature) release for the version 2 series.
31 March 2015
- #4122 and
#6613 deprecate
Zend\EventManager\EventManager::triggerUntil()and alias it totrigger(). AstriggerUntil()now emits a deprecation notice, you may need to update your code; this can be done by changing the method name totrigger(). - #6073
Zend\Mvc\Controller\Plugin\FlashMessenger::addMessage(),hasMessages(),getMessages(),clearMessages(),hasCurrentMessages(),getCurrentMessages(), andclearCurrentMessages()each now take one additional optional argument,$namespace. This will only affect those extending the class and overriding those methods, and the default value retains existing default behavior. - #6108 Enables exception
trace reporting by default in
Zend\Test. - #6154
Zend\InputFilter\BaseInputFilter::isValid()now has one optional argument,$context, allowing passing the context of validation along to the input filter during validation. This allows individual inputs to test against other inputs as part of validation. This change should only affect those overriding theisValid()method in an extension ofBaseInputFilter. - #6151 updates
Zend\Filter\Word\SeparatorToCamelCaseto properly identify non-whitespace characters following the separator. This should not affect most use cases. - #6464 modifies the
autocompleteform attribute to be a string value instead of a boolean value in order to follow the WHATWG HTML 5 specification. If you relied on the "boolean" strings "on" or "off", you may need to update your client-side code. - #6552 modifies the
ModuleManager's config caching to eliminate the "double-dot" (..) that occurs in cache file names if no cache key or an empty cache key is provided. If you use config caching, you will need to remove your cache files before deployment to ensure all works correctly. - #6560 modifies the
Zend\Cache\Storage\Adapter\AbstractAdapter::getItem()method to ensure it always returns null in the case of a cache miss; previously, in some adapters, it would return another value, and, because$success === nullis the check for a cache miss, register a false positive. You may have been mistakenly relying on this previously; test carefully. - #6572 removes
Zend\Mvc\Service\ViewJsonRendererFactoryandZend\Mvc\Service\ViewFeedRendererFactory, as the classes each instantiates have empty constructors and can be referenced asServiceManagerinvokables. This change should not affect anyone. - #6581
Zend\Validator\Betweennow raises an exception during instantiation if either theminormaxoptions are missing in the provided$optionsarray. - #6809 modifies the behavior
of
Zend\Paginator\Paginator::$firstItemCountto equal0if no items are present; previously, it returned1. - #6817 modifies the behavior
of
Zend\Paginator\Paginator::getItems()to ensure it always returns an array. - #7181 removes code that was
checking for cache tags in
Zend\Paginator\Paginator's caching support, as not all cache adapters support tags. This likely will not affect users. - #7242 adds an optional
$hopsparameter toZend\Mvc\Controller\Plugin\FlashMessenger::addMessage(), allowing you to specify the number of hops for the specific message. If you were extending the plugin previously and overriding this method, you will have to update your signature. - #7255 adds the parameter
$datatoZend\Mvc\Controller\AbstractRestfulController::deleteList(). If you were extending this class previously and overriding this method, you will need to update your signature. The$dataparameter provides the deserialized request body content. - #7267 modifies
Zend\Cache\Storage\Adapter\DbaOptions::setHandler()to raise an exception if theinifilehandler is specified, as this handler is (a) not performant for cache purposes, and (b) may or may not work reliably for write operations based on the version of libdb used.
- #6080 Adds
Zend\Authentication\AuthenticationServiceInterfaceto allow substitutions. - #7310 Adds
Zend\Authentication\Adapter\Callback, allowing usage of arbitrary PHP callables for authentication purposes. - #7334 Adds bcrypt support for HTTP Basic authentication.
- #6078 Adds a MongoDB cache adapter.
- #6339 Adds scanning and generator support for PHP traits.
- #6646 Adds a password prompt
to the
Consolecomponent. - #7091 Adds a checkbox prompt
to the
Consolecomponent.
- #6438 Adds
Zend\Crypt\FileCipherfor purposes of encrypting or decrypting a file using a symmetric cipher. - #7141 Adds
Zend\Crypt\Password\BcryptShato allow safely pre-hashing long (> 72 byte) passwords; this functionality is opt-in. - #7334 Adds bcrypt support for Apache password hashing.
Many pull requests that improve code quality by abstracting common code, easing maintenance and tightening security.
- #5142 Implements combine operators in order to allow creation of SQL statements with multiple unions and subselects.
- #5505 Support for nested transactions.
- #6740 Adds the ability to
use aliased tables to
Zend\Db\TableGateway. - #6800 Adds the ability to add native predicates to queries, while respecting combine order.
- #6890 Adds the ability to specify an alternate adapter/platform when generating a SQL statement.
- #6931 Adds constants for
specifying left and right outer joins to
Zend\Db\Sql\Select.
- #7125 adds
Zend\Feed\Reader\ReaderImportInterface, defining the methodsimport(),importRemoteFeed(),importString(), andimportFile()common to the concreteReaderimplementation. - #7254 Adds
Zend\Feed\Reader\StandaloneExtensionManager, which provides aZend\Feed\Reader\ExtensionManagerInterfaceimplementation with no dependencies. This is now used as the default extension manager.
- #6545 Adds
Zend\Filter\UpperCaseWords, which will essentially invokeucwords()on the provided value, or, if an alternate encoding is used, utilizemb_convert_case(). - #6758 Adds the method
getAdapterInstance()toZend\Filter\Encryptto allow retrieving the attached encryption adapter. - #6962 Adds
Zend\Filter\BlacklistandZend\Filter\Whitelist. - #7104 Adds
Zend\Filter\DataUnitFormatter, which will binary and decimal numbers to data units (e.g.,5ki,6G, etc.). - #7277 Adds
Zend\Filter\DateSelect,Zend\Filter\DateTimeSelect, andZend\Filter\MonthSelect, and modifies the correspondingZend\Formelements to use the appropriate filter.
- #6271 Ensures all Form view helpers allow the full spectrum of HTML5 attributes.
- #6656 Adds a
getElements()method to each ofDateSelectandMonthSelectto return a list of each composedSelectelement (as each composes multiple elements). - #6754 Adds a new
preserveDefinedOrderflag forZend\Form\Annotation\AnnotationBuilder; iftrue, elements will be created and listed in the order in which they were defined in the class parsed. #7276 adds support for thepreserve_defined_orderconfiguration flag to theFormAnnotationBuilderFactory. - #6783 Adds
@ContinueIfEmptyas an available form annotation. - #7171 modifies
Zend\Form\Form::prepare()to reset (i.e., clear) password values, ensuring they are not displayed in rendered forms. - #7181 updates
Zend\Form\View\Helper\FormButtonto translate the button content.
- #6571 Adds the ability to
(optionally) pass HTTP client configuration to
Zend\Http\ClientStatic'sget()andpost()methods. - #7121 Adds the ability to
specify the cURL
sslverifypeeroption when using the cURL adapter. - #7181 Adds detection of SSL on reverse proxies.
- #7259 Modifies
Zend\Http\Response::setStatusCode()such that it clears the reason phrase; this is done to ensure the status code and reason phrase are kept in sync. - #7329 Adds support for Digest authentication with cURL adapters.
- #6431 Adds the ability to
merge input filters to
Zend\InputFilter\BaseInputFilter, via a newmerge()method. - #7247 Adds
Zend\InputFilter\InputFilterAbstractServiceFactory, allowing configuration-driven creation of named input filter instances using the top-levelinput_filter_specsconfiguration key.
- #6058 Adds a
Timestamplog filter. - #6138 Adds a
ReferenceIdprocessor. - #7294 Adds
Zend\Log\Writer\Mailfor sending log messages via email.
- #6570 Adds the ability to set a transport envelope on the SMTP transport.
- #6246 Adds a
TranslatorPluginManagerto allow modules to register their own translation plugins. This adds a newtranslator_pluginstop-level configuration key, using the standard service manager configuration scheme. - #6615
Zend\Mvc\Controller\AbstractControllernow also registers any implemented interfaces as identifiers with the composedEventManagerinstance. - #6951 Adds the ability to
override
display_exceptionsanddisplay_not_found_reasonspecifically for the console view manager. - #7240 Adds
Zend\Mvc\HttpMethodListener, which is also now registered by default; you can specify via thehttp_methods_listenertop-level configuration key an array of HTTP methods your application will allow, and this listener will return early if the current method is not present in that list. - #7336 Adds the ability to specify that the controller in the route match should be used instead of the controller class name for purposes of creating the template string.
- #7245 Adds
Zend\Navigation\NavigationAbstractServiceFactory, allowing configuration-driven creation of namedNavigationinstances using thenavigationtop-level configuration key.
- #5518 Allow specifying a
custom query for determining the item count in the
DbSelectadapter. - #7122 Adds
Zend\Paginator\PaginatorIterator, to allow iterating an entire paginated set at once.
- #7327 Adds
Zend\Permissions\Rbac\Assertion\Callback, allowing usage of arbitrary PHP callables for providing RBAC assertions. - #7328 Adds
Zend\Permissions\Acl\Assertion\Callback, allowing usage of arbitrary PHP callables for providing ACL assertions.
- #6175 adds
Zend\ServiceManager\MutableCreationOptionsTraitto simplify implementingMutableCreationOptionsInterface.
- #6091 Adds
Zend\Stdlib\Hydrator\NamingStrategy\MapNamingStrategy, which allows creating a map ofobject property => serialized propertynames. - #6194 Adds
Zend\Stdlib\Hydrator\Strategy\StrategyChain, to allow chaining multiple strategies together to mutate a value during hydration and/or extraction; this is similar to filter chains, only for hydrators. - #6227 Adds
Zend\Stdlib\Hydrator\Strategy\ExplodeStrategy, which can explode a value using a provided delimiter on hydration, and implode with the delimter on extraction. - #6289 Adds
Zend\Stdlib\Hydrator\Strategy\DateTimeFormatterStrategy, which will hydrate a formatted date-time string to aDateTimeinstance, or serialize aDateTimevalue to the given string format. - #6367 Adds
Zend\Stdlib\Hydrator\Strategy\CompositeNamingStrategy, which allows providing a set of naming strategies to compare a key against, with a default naming strategy to use if unmatched. The main purpose is to be able to use a single strategy for multiple properties. - #6523 Adds
Zend\Stdlib\Hydrator\Strategy\BooleanStrategy, providing a way to specify "boolean" strings or integers that can be cast to booleans, and vice versa on extraction. - #6894 Adds
Zend\Stdlib\Hydrator\DelegatingHydrator. This hydrator will attempt to find a hydrator registered in theHydratorPluginManagerusing the name of the class to be hydrated or extracted. - #6899 and
#6903 add the ability to
remove and/or replace keys, respectively, when calling
Zend\Stdlib\ArrayUtils::merge(). - #7315 adds
Zend\Stdlib\ArrayUtils::filter(), which is a shim for supporting PHP'sarray_filter()function, and, specifically, the 3rd$flagargument added in PHP 5.6 for filtering on key or both key and value.
- #6886 Adds the ability to
specify the
user-infofor a URI as a single string, while ensuring that bothuserandpasswordare still accessible.
- #6496 Implements a
PriorityQueueforZend\Validator\ValidatorChain, adding an optional$priorityargument to each ofattach(),addValidator(), andattachByName(). - #6496 Modifies
Zend\Validator\ValidatorChain::attach()to allow accepting a PHP callable as the validator argument, omitting the need to wrap it in aZend\Validator\Callback. - #6678 Adds
Zend\Validator\Timezone.
- #6196 Adds
Zend\View\Resolver\RelativeFallbackResolver, which allows resolving a template based on the location of the template requesting the render. As an example, if you call$this->render('foo');from within a template referenced asfoo-bar/baz-bat/quz, this new resolver can resolve it tofoo-bar/baz-bat/foo. - #6709 Adds
Zend\View\Helper\HtmlTag, for generating the opening and closing<html>tag, along with attributes and namespaces.
- #6903 Adds the ability to
specify extensions to scan when using
bin/templatemap_generator.php. - Updated to PHPUnit 4 and php-cs-fixer 1.
- Updated the framework and all components to specify PSR-4 autoloading rules (instead of PSR-0, which is now deprecated).
- Added PHP 7 nightly as an optional build target; tests currently pass.
Please see CHANGELOG.md.
Zend Framework 2 requires PHP 5.3.23 or later; we recommend using the latest PHP version whenever possible.
Please see INSTALL.md.
If you wish to contribute to Zend Framework, please read both the CONTRIBUTING.md and README-GIT.md file.
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/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 our GitHub issue tracker:
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 fw-announce-subscribe@lists.zend.com.
If you have encountered a potential security vulnerability in Zend Framework, please report it to us at zf-security@zend.com. We will work with you to verify the vulnerability and patch it.
When reporting issues, please provide the following information:
- Component(s) affected
- A description indicating how to reproduce the issue
- A summary of the security vulnerability and impact
We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; this helps protect Zend Framework users and provides them with a chance to upgrade and/or update in order to protect their applications.
For sensitive email communications, please use our PGP key.
The files in this archive are released under the Zend Framework license. You can find a copy of this license in LICENSE.txt.
The Zend Framework team would like to thank all the contributors to the Zend Framework project, our corporate sponsor, and you, the Zend Framework user. Please visit us sometime soon at http://framework.zend.com.
