simple-php-router

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.

Downloads
140.9K
Stars
646
Committers
13
simple-php-router - Version 4.2.0.6

Published by skipperbent almost 6 years ago

  • Fix for __invoke methods (issue: #429)
  • Fixed not being able to parse body of PUT requests.
  • BaseCsrfVerifier expects the field name to be "csrf-token" (issue: #432)
  • Minor optimisations
simple-php-router - Version 4.2.0.5

Published by skipperbent about 6 years ago

  • Settings parameter in group method are no longer optional.
  • Updated README to contain PHP JSON-extension under requirements.
  • Updated composer.json to include php json extension.
  • Minor optimisations.
simple-php-router - Version 4.2.0.4

Published by skipperbent about 6 years ago

  • Fix for issue #421: Incorrectly optional character in route.
simple-php-router - Version 4.2.0.3

Published by skipperbent over 6 years ago

  • Fixed Input::all() returning empty array when posting json- data (issue #415 - thanks @mtaylor456)
simple-php-router - Version 4.2.0.2

Published by skipperbent over 6 years ago

  • Fixed 403 (not allowed or not found) exception is now thrown as NotFoundHttpException.
  • Added REQUEST_TYPE_HEAD to Route class.
  • Minor optimizations.
simple-php-router - Version 4.2.0.1

Published by skipperbent over 6 years ago

  • Fixed missing default parameter for all method in InputHandler.
  • Added methods for adding get, post and file parameters manually.
simple-php-router - Version 4.2.0.0

Published by skipperbent over 6 years ago

  • Added new SimpleRouter::redirect method.
  • Changed method-names in InputHandler for better description.
  • Fixed return-types for InputHandler when retrieving collections.
  • Added unit-tests for InputHandler (get, post).
  • Optimisations and bugfixes.
  • Updated documentation.

Changelog

Methods in InputHandler has changed to provide better support for object-types.

simple-php-router - Version 4.1.0.0

Published by skipperbent over 6 years ago

  • Added new event when adding route.
  • Added prependUrl method to LoadableRoute class.
  • Added unit-test for add-route event.
  • Updated documentation to reflect new changes.
simple-php-router - Version 4.0.0.13

Published by skipperbent over 6 years ago

  • Fixed exists method in InputHandler returning incorrect value.
simple-php-router - Version 4.0.0.12

Published by skipperbent over 6 years ago

  • Fixed hasParam not working returning expected value in Url class.
  • Chained the remaining methods in the Url class.
  • Simplified removeParam method in Url class.
  • Added new removeParams method to Url class for removal of multiple params.
simple-php-router - Version 4.0.0.11

Published by skipperbent over 6 years ago

  • Fixed getName method in LoadableRoute class can contain nullable value.
  • Updated helpers.php.
simple-php-router - Version 4.0.0.10

Published by skipperbent over 6 years ago

  • Fixed getError in InputFile returning string instead of int.
simple-php-router - Version 4.0.0.9

Published by skipperbent over 6 years ago

  • Fixed Url not outputting correct class when used in json_encode.
  • Fixed IInputItem being too strict about strings which may be nullable.
simple-php-router - Version 4.0.0.8

Published by skipperbent over 6 years ago

  • Fixed getting specific input-value by request-method in InputHandler class.
  • Added .idea files
simple-php-router - Version 4.0.0.7

Published by skipperbent over 6 years ago

  • Removed namespace from groups
simple-php-router - Version 4.0.0.6

Published by skipperbent over 6 years ago

  • Fixed rewrite from ExceptionHandler sometimes not working correctly.
  • Fixed default-namespace for Group and partial groups.
simple-php-router - Version 4.0.0.5

Published by skipperbent over 6 years ago

  • Updated input helper function.
  • Update documentation to reflect v4 changes in InputHandler class.
simple-php-router - Version 4.0.0.4

Published by skipperbent over 6 years ago

  • Fixed $methods argument not properly passed in InputHandler class.
  • Updated helpers.php with latest changes.
simple-php-router - Version 4.0.0.3

Published by skipperbent over 6 years ago

  • Fixed issue with wrong defaultValue used in getValue method in InputHandler class.
simple-php-router - Version 4.0.0.2

Published by skipperbent over 6 years ago

Version 4.0.0.0

WARNING: This release is experimental. Upgrade with caution.

  • PHP 7 support. This version of the library requires PHP version 7.1 or higher.
  • request()->getInput() renamed to request()->getInputHandler().
  • \Pecee\Http\Input\Input class renamed to Pecee\Http\Input\InputHandler.
  • Added contains($value) method to Url class.
  • Added indexOf($value) method to Url class.
  • Router now stores all loaded routes if multiple routes has been rendered.
  • Added method for getting all loaded routes by calling SimpleRouter::request()->getLoadedRoutes().
  • Removed setLoadedRoute($route) method from Request class and replaced it with addLoadedRoute($route).
  • Added debug helper: SimpleRouter::startDebug().
  • Added logging to router.
  • Started to implement logging in router.
  • Simplified rewrite handling in Router class.
  • Added debug($message, ...$args), getDebugLog() and setDebugEnabled($bool) methods to Router class.
  • Updated unit-tests.
  • Updated phpDocs.
  • Updated documentation to reflect new changes.
  • Added dependency injection support.
  • Better usage of Url class. When calling url you can now use the methods on the Url class to filter params, get relative/absolute url etc. See documentation for more info.
  • Updated helpers.php and helpers example in documentation.
  • MalformedUrlException is now handled properly by Router to avoid phpStorm syntax highlights in routes.
  • Added getUrlCopy to Request class, used to clone the current route (to keep domain etc.)
  • setUrl in Request are now strict and requires Url object and no longer accepts strings.
  • Renamed hasRewrite property to hasPendingRewrite in Request class.
  • Renamed hasRewrite and setHasRewrite methods to hasPendingRewrite and setHasPendingRewrite in Request class.
  • Renamed get method to getValue in InputHandler class.
  • Renamed getObject to get and removed $defaultValue argument in InputHandler class.
  • Optimized InputHandler class.
  • Fixed issue with $token not being proper string in BaseCsrfVerifier when token is not found.
  • Added php.ini configuration settings to setcookie in CookieTokenProvider for improved security.
  • Added $router parameter to boot method in IRouterBootManager which allows for further manipulation of the router within the bootmanager.
  • Renamed $processingRoute property to $isProcessingRoute in Router class.
  • Fixed reset method not resetting CSRF-verifier in Router class.
  • Moved arrayToParams helper-method from Router to Url class.
  • Began to add Event-functionality to router.
  • Added addEventHandler method to SimpleRouter class.
  • Moved Pecee\SimpleRouter\Handler\CallbackExceptionHandler to Pecee\SimpleRouter\Handlers\CallbackExceptionHandler.
  • Moved Pecee\SimpleRouter\Handler\IExceptionHandler to Pecee\SimpleRouter\Handlers\IExceptionHandler.
  • Added Events section to documentation.
  • Added more information on url-handling in documentation.
  • Added event-arguments data.
  • Added event-arguments to the event list in documentation.
  • Fixed missing exceptions thrown in phpDocs.
  • Added unit-tests for new event functionality.
  • Added unit-tests for dependency injection functionality.
  • Added ClassLoader class and IClassLoader interface.
  • Added php-di composer dependency.
  • Optimisations.
  • Added donate section to documentation.
  • Updated readme.