Change Log
2019
v1.5.3 (2019-05-24)
- Revert to previous Set-Cookie header behavior, allowing multiple cookies to be set during same process.
v1.5.2 (2019-05-20)
- Allow Set-Cookie header to modify/replace itself during finalize.
v1.5.1 (2019-05-04)
- Create
tmp_test_filesdirecotry tree if missing. - Documentation link on demo app is relative or absolute, depending on presence of built docs.
v1.5.0 (2019-04-16)
- Change scope of Skinny contructor to protected, forcing use of getNewInstance().
$bufferLockedflag moved from$app->run()to$app->call()so that middleware can still alter output bufering before the matched route is dispatched.- Add
$app->map()for generic route with multiple request methods. See method comments in Skinny.php for important usage notes. - Add
$app->rtGroup()to provide optional legacy route group behavior. It invokes the route group callable unconditionally. - Allow
group()to use 'class:method' string callable. - Callable string like 'class:method' now returns a callable array instead of a closure. Effectively, there is no difference between 'class:method' and 'class::method' callable string notation; both can invoke either a static method or an instance method.
- Add
resolveCallable()to determine whether string and array callables invoke a static method or an instance method. - Allow route middleware, application middleware, application hooks, and
configureMode()to use the same callable notation as route callables. - Change application mode from container closure to protected property so that each instance can have its own mode, but still only settable on instantiation.
- Add application demo suitable to run with php's built-in server.
- Remove Skinny/Middleware/MethodOverride.php, as it has been embedded in Skinny since version v1.0.2 wihtout having to use middleware.
- Create documentation for Skinny and include docs source in repository.
- Clean up and extend unit tests for 100% code coverage.
- Rename ./run-tests (and variants) to ./unit-test.
- Add ./check-standards to test conding standards against PSR2 of phpcs (PHP_CodeSniffer). Coding standards apply to framework files, tests, and demo code.
v1.4.0 (2019-04-02)
- Add support for Twig v2 custom view.
- Add ./run-tests for unit testing so that test for Twig v2 don't collide with tesing Twig v1.
v1.3.4 (2019-04-01)
- Fix unit test failure in SessionCookieTest due to headers already sent. Skip failing tests if
headers_sent()is true.
v1.3.3 (2019-03-31)>
- New optional tests/view-env.json to configure autoloading for Smarty and Twig in tests/bootstrap.php. This change allows more flexible configuration of custom view extensions, especially when they are installed via composer.
- Successfully tested composer installs of Smarty v3.1.33 and Twig v1.38.4. (Twig v2 fails)
v1.3.2 (2019-03-31)
- Convert repository from Mercurial to git.
- Remove
Skinny::setEncryptedCookie()andSkinny::getEncryptedCookie, which were deprecated. - Update .travis.yml - remove php 5.3, add 7.1, 7.2, and 7.3
- Various unit test enhancements and PSR2 conding standards compliance fixes.
2018
v1.3.1 (2018-11-20)
- Fix abort detection for PUT stream file upload.
- Adjust tests for newer version (v7.4.4) of phpunit.
v1.3.0 (2018-09-20)
- Add support for PUT stream file upload.
v1.2.3 (2018-02-02)
-
Skinny instances are now reusable. This enhancement is especially helpful in unit tests. Instead of creating hundreds of instances,few instances can often meeet the same needs. Depending on usage, this can be a breaking change.
-
All instances are now named and registered, not just the first one. An instance cannot be renamed.
setName()is now private. Naming an instance must be done at the time it is created. A seoncd, optional argument has been added to the constructor for this purpose. Absent an explicit name, 'default' is still the name used. -
IMPORTANT CHANGE: If a new instance is created with the same name as an exiting instance, the existing instance will be either replaceed (
$instance = Skinny($settings, $name)) or reset/re-used ($instance = Skinny::newInstance($settings, $name)). Internal objects, such as$modeand singletons (including user-defined singletons) are unset and re-initialized (except user-defined singletons), allowing the abandoned objects to be freed from memory immediately. This feature can be particularly helpful in unit tests by automatically closing database connections if the database object is an instance singleton with an appropriately written destructor. -
New —
Skinny::newInstance()static method. Accepts same arguments as contructor. Creates a new instance if an instance by the specified name (or 'default') does not already exist. Otherwise, it resets the existing instance so that it is re-usable, as if it came from the contructor. This new method should be the preferred way to create a Skinny instance in unit tests. -
New — resetSingleton method. Resets the static object to null in the nested closure created by the singleton method. No attempt is made to reinitialize it or remove it from memory. This method is not as thorough as the behavior when and instance is replaced or reset.
-
Change —
setName()is now a private method. Use the new$namearg of the constructor or on staticnewInstance()to name an instance something other than 'default'. -
New —
Skinny::unregisterNamedInstance()static method. Dispose of an instance and prepare it to be removed from memory. -
New — __destruct method. Optionally outpus a message to show when an instance is destroyed. Useful in unit tests. New static property
echoOnDestructturns on the output. Set to true or 1 to echo to STDOUT or set a value > 1 to output to STDERR. -
New getProperty method. Allows read-only access to property values in the Skinny class.
2017
v1.1.0 (2017-09-27)
- Replace mcrypt-based encryption with openssl Crypt64 class. This update is a breaking change.
v1.0.2 (2017-09-26)
- Fixed bug in
group()routes.case_sensitive route pattern handling. - Removed loading of MethodOverride middleware - it only worked with old
rt\*request methods. Embedded method override behavior in \Skinny\Skinny constructor so that it works with old and new request methods. - Added
\Skinny\Skinny::unregisterAllInstances()- useful in testing. - Added new setting - 'middleware.pretyExceptions' to be able to enable (default) or disable PrettyExceptions middleware in settings passed to \Skinny\Skinny constructor.
v1.0.1 (2017-09-19)
- Raised minimum php version requirement from 5.3.3 to 5.4.0.
- Enforced php version requirement.
- Brought framework unit testing up to 100% code coverage.
- Added unit tests for Twig and Smarty custom view classes with 100% code coverage.
2016
v1.0 (2016-05-30) — Original fork from Slim 2.6.1
Despite its many benefits, refactoring a large application to utilize
Slim revealed several behaviors that were undesirable.
1. Non-matching group patterns did not prevent descending into the
enclosed code. Ulitmately, group patterns were put into conditional
statements surrounding groups to prevent evaulating routes that
could not possibly match the current path. For the most part, this
behavior resulted into turning a large route tree into an ugly
if-elseif structure.
2. Every evaulated route method added a new route instance to an array
with the end goal of selecting only one route to execute. In a very
large application this behavior generates a large array with
significant overhead just to select one matching route. The only
real benefit of returning a route from methods like get() and post()
was to facilitate chaining - a nice feature, but one that was used
infrequeently, at best.
3. There was insufficient control over always-on, output buffering.
This behavior was unacceptable for streaming large responses, as it
would hit memory limits and fail.
4. Insufficient control over built-in middleware. Without altering the
framework code, there was no way to disable loading Flass middleware
when session flashing didn't play well with an extended native
session handler.
All of these behaviors were addressed in Skinny v1.0.
-
Route evaluation -
group()and request methods (get(),post(),put(), etc) return boolean instead of Route instance. Once a match is found, no group or request method patterns remaining in the execution path are evaluated. Callables are evaluated only for a mathing group or route and then only if a matching route has not yet been found.Group does not invoke its callable unless the current path begins with its accumulated pattern.
These gains come at the expense of breaking the ability to chain functions on group or request methnods. If needed, the original Slim behavior has been retained with
rtGet(),rtPost(),rtPut(),rtPatch(),rtDelete(),rtOptions(), andrtAny(). -
Output buffering can be turned on or off prior to invoking
call()orrun(). Set it with$skinnyInstance->config('output.buffered', $boolVal). -
Core Flash middleware can be disabled if desired with 'middleware.flash' = boolean setting in \Skinny\Skinny constructor.