All Versions
10
Latest Version
Avg Release Cycle
208 days
Latest Release
2813 days ago
Changelog History
Changelog History
-
v2.1.2 Changes
February 01, 2017๐ Features
- ๐ป PHP 7
Throwable
s 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 bothException
andThrowable
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 receiveThrowable
types under PHP 7
- ๐ป PHP 7
-
v2.1.1 Changes
November 01, 2016๐ 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 theResponse
class has been updated to fix an issue found when run under PHP-FPM - The
file()
method in theResponse
class will no longer send theContent-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 toKlein#error_callbacks
and it's array data-structure was changed to use anSplStack
Klein#httpErrorCallbacks
was renamed toKlein#http_error_callbacks
and it's array data-structure was changed to use anSplStack
Klein#afterFilterCallbacks
was renamed toKlein#after_filter_callbacks
and it's array data-structure was changed to use anSplQueue
- 0๏ธโฃ
Validator#defaultAdded
was renamed toValidator#default_added
-
v2.1.0 Changes
November 07, 2014๐ Features
- ๐ New exception and helper methods to help control the dispatch flow
- ๐ New
abort()
method to allow stopping the routing process and returning a response code - Routes are now instances of a new
Route
class, instead of just being a set of meta properties and a callback - Routes are now stored in a
RouteCollection
class, which extends theDataCollection
class - ๐ New
keys()
andclear()
methods for theDataCollection
class - โ Added the capability of reverse routing!
- Now allowing for route callbacks to change the response object by returning a new ApiResponse instance
- ๐ New "slug" type for route param matching
- ๐ New
isEmpty()
andcloneEmpty()
methods for theDataCollection
class - The
$matched
route callback parameter is now an instance of aRouteCollection
, instead of just an integer - Route callbacks are now passed the Klein instance for easier closure/class-scope use
- Regular expression routing is now more accurate and will match more special characters in a similar way to Sinatra
- ๐ Routes are now built with a dependency injected
AbstractRouteFactory
instance, allowing the building of routes to be customized more easily - ๐ New
options()
andhead()
alias methods for matching OPTIONS and HEAD requests respectively - The
Response
class has been abstracted into anAbstractResponse
and a separateResponse
class for cleaner 3rd-party extension - ๐ New "after dispatch" callbacks can be registered for firing a series of callbacks after the dispatch loop has completed
- ๐ New
patch()
alias method for matching PATCH requests - ๐ New HTTP error handling via exceptions and callback registration for a more direct (and less magical) API for controlling HTTP errors
- The
escape()
method in theServiceProvider
class now allows for the passing of entity escaping flags - Route regular expressions are now validated and provide helpful errors upon a validation failure
- Routes can now contain an empty string path
- The composer autoloader is now compatible with the PSR-4 standard.
- ๐ Regular expression compilation performance has been improved
- 100% Code Coverage
๐ Bug fixes
- โก๏ธ The README document has been updated to fix a few typos and inconsistencies
- Route params are now properly URL decoded
- 404/405 routes now properly set the appropriate status code automatically
- Silencing the locked response exceptions as the behavior is designed to be transparent/automatic
- ๐ Allow route callables to be an array suitable for
call_user_func()
callable behavior - More proper handling for 404's that also call the 404 error handlers
- ๐ง The
file()
andjson()
methods in theResponse
class no longer override system-configured time processing limits - Now checking if the output buffer is open before attempting to close it
- The methods matched counter (
$methods_matched
) is now much more accurate, not counting methods that shouldn't have been considered matches - ๐ Various PHPdoc inaccuracies and inconsistencies have been fixed
- Regular expressions are now quoted during compilation in a much safer manner
- โก๏ธ The PHPdoc tags have been updated to use the more modern syntax
โฌ๏ธ Upgrading
๐ Deprecations
- ๐ Handling 404 and 405 errors with a specially registered route callback is now deprecated. It's now suggested to use Klein's new
onHttpError()
method instead. - Autoloading the library with Composer no longer utilizes the PSR-0 spec. The composer autoloader now uses PSR-4.
Interface Changes
- Some of the route callback params have changed. This will effect any route definitions with callbacks using the more advanced parameters.
- The old params were (in order):
Request $request
Response $response
Service $service
App $app
int $matched
array $methods_matched
- The new params are (in order):
Request $request
Response $response
Service $service
App $app
Klein $klein
RouteCollection $matched
array $methods_matched
- Non-match routes (routes that are wildcard and shouldn't consider as "matches") will no longer be considered as part of the "methods matched" array, since they aren't supposed to be matches in the first place
- This may have implications for users that have created "match-all" OPTIONS method routes, as the OPTIONS method will no longer be considered a match.
- If you'd like to conserve the old match behavior, you can simply mark the route as one that should be counted as a match with
$route->setCountMatch(true)
-
v2.0.2
June 16, 2013 -
v2.0.1
May 17, 2013 -
v2.0.0
May 17, 2013 -
v1.2.0
June 27, 2013 -
v1.1.0
March 20, 2013 -
v1.0.0
March 16, 2013 -
v0.9.0
March 16, 2013