Klein v2.1.2 Release Notes

Release Date: 2017-02-01 // about 7 years ago
  • ๐Ÿ”‹ Features

    • ๐Ÿ‘ป PHP 7 Throwables will now properly be caught and sent up the exception handling chain.
    • ๐Ÿ‘ป Expanded compatibility with other exception types in some method signatures

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘ป Broad exception catch statements will now properly handle PHP 7 Throwable types

    โฌ†๏ธ Upgrading

    Interface Changes

    • ๐Ÿ‘ป The RoutePathCompilationException::createFromRoute() method signature has changed to allow both Exception and Throwable types with dual support for PHP 5 and PHP 7
    • ๐Ÿ‘ The 4th parameter to the callbacks supported by Klein#onError will now be able to receive Throwable types under PHP 7

Previous changes from v2.1.1

  • ๐Ÿ”‹ Features

    • 0๏ธโƒฃ Header keys are now normalized, by default, to their canonical MIME format for consistency
    • Header key normalization is now customizable
    • ๐ŸŽ Internal callback data-structures were moved from arrays to more appropriate SplQueue and SplStack instances, providing performance and memory footprint improvements
    • โšก๏ธ The PHPUnit version used for tests has been updated for HHVM compatibility
    • PHP 7.0 and HHVM compatibility!

    ๐Ÿ› Bug fixes

    • โšก๏ธ A few internal property/attribute names have been updated for consistency
    • โœ… An iteration bug effecting tests run under certain HHVM runtime versions has been fixed
    • โšก๏ธ The README document has been updated to fix a few errors
    • โšก๏ธ The file() method in the Response class has been updated to fix an issue found when run under PHP-FPM
    • The file() method in the Response class will no longer send the Content-Length header when the response has been chunked, to comply with the HTTP requirements defined in RFC 2616
    • โšก๏ธ References to the old https://github.com/chriso/klein.php repository URL have been updated to the new repository URL home of Klein: https://github.com/klein/klein.php
    • โšก๏ธ Tests were updated to pass under an expanded number of PHP runtime versions and configurations
    • ๐Ÿ›  A potential output buffer stack miss-handling in the dispatch process has been fixed

    โฌ†๏ธ Upgrading

    ๐Ÿ—„ Deprecations

    • ๐Ÿ—„ The HeaderDataCollection::normalizeName() method has been deprecated in favor of using new normalization options (via constant switches) and other more specific methods on the same class

    Interface Changes

    • Three of the Klein internal callback attributes have changed both name and data structure. These attributes are protected, so the effect will only be felt by users that have extended and/or overwritten Klein's internal behaviors. The following changes were made:
      • Klein#errorCallbacks was renamed to Klein#error_callbacks and it's array data-structure was changed to use an SplStack
      • Klein#httpErrorCallbacks was renamed to Klein#http_error_callbacks and it's array data-structure was changed to use an SplStack
      • Klein#afterFilterCallbacks was renamed to Klein#after_filter_callbacks and it's array data-structure was changed to use an SplQueue
    • 0๏ธโƒฃ Validator#defaultAdded was renamed to Validator#default_added