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