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 3.3.4

Published by skipperbent about 7 years ago

  • Fixed wrong url matching on some paths (issue: #253 - thanks @alejoloe007jb)
simple-php-router - Version 3.3.3

Published by skipperbent about 7 years ago

  • Fixed mismatched routes: /testing matching /test/{anything} (issue: #248 - thanks @jatubio).
  • Moved "Custom regex for matching parameters" to "Route parameters" in documentation (based on issue #249).
  • Fixed spelling errors in documentation.
simple-php-router - Version 3.3.2

Published by skipperbent over 7 years ago

  • Fixed PHP 5.5 compatibility (issue: #244 - thanks @thexeos).
  • Updated composer.json tags.
simple-php-router - Version 3.3.1

Published by skipperbent over 7 years ago

  • Changed router so it supports both string and object as exception handlers.
  • Added Router::error($callback) method to Router class (issue #238).
  • Fixed issues calling getController and getMethod when callback is an object (issue #239).
  • Added addExceptionHandler to IGroupRoute interface and RouteGroup class.
  • Changed message-text thrown in NotFoundHttpException to show redirected routes (issue: #240 )
  • Removed temporary RouterException class.
  • Added object-types to parameters in CallbackExceptionHandler and SimpleRouter classes.
  • Router now renders groups even if callback is null.
  • Added addMiddleware in Route class and IRoute interface.
  • setMiddleware in Route class now marked as deprecated and will be removed in upcoming releases.
  • addMiddleware now accept both object and class strings in Route class.
  • addExceptionHandler now accept both object and class strings in RouteGroup class.
  • Added unit-test for rewrite-exception message change: testRewriteExceptionMessage in RouterRewriteTest.
  • Fixed typo: renamed testSimularUrls to testSimilarUrls in RouterUrlTest.
  • Renamed XSRF-TOKEN constant to CSRF-TOKEN in CsrfToken class.
  • Updated documentation to reflect new changes.
  • Optimized .gitignore.
  • Other minor bugfixes and optimisations.

Release notes

Please read this section carefully, as it contains changes that might impact the way the application works in your projects.

- setMiddleware in Route class now marked as deprecated and will be removed in upcoming releases.

The setMiddleware method is now deprecated and will be removed in the near future. Please change all references in your project to use the addMiddleware method instead.

- Renamed XSRF-TOKEN constant to CSRF-TOKEN in CsrfToken class.

XSRF-TOKEN constant has been renamed to CSRF-TOKEN. This might temporarily make postbacks invalid upon updating until users begin to use the changed value.

Contributors

Many thanks to the people that contributed with ideas, bugs etc.

  • @jatubio
  • @zaingithub
  • Also many thanks to YOU for using this project.
simple-php-router - Version 3.3.0

Published by skipperbent over 7 years ago

  • Fixed global regex match not working properly.
  • Feature: added option to change regular expression used for parameters on routes.
  • Added unit-tests for custom parameter regular expression.
  • Updated documentation to reflect new features.

For information on new features, please refer to the documentation here:
https://github.com/skipperbent/simple-php-router#custom-default-regex-for-matching-parameters

simple-php-router - Version 3.2.3

Published by skipperbent over 7 years ago

  • Added check in CsrfToken class to ensure that IV generation is strong and secure.
  • Added .htaccess example to documentation (issue #232)
  • Minor optimisations mostly related to PHPDocs and PHPStorm code-inspection.
simple-php-router - Version 3.2.2

Published by skipperbent over 7 years ago

  • Fixed: RouteController not matching on certain urls.
  • Made RouteResource more strict in url-matching.
  • Added PHPUnit RouterControllerTest class.
  • Fixed merged testSimularUrls method in RouterUrlTest.
  • Added more PHPUnit tests.
simple-php-router - Version 3.2.1

Published by skipperbent over 7 years ago

  • Fixed issue #227 causing custom resource-routes not to be loaded after latest update.
  • Optimized RouteResource class.
  • Renamed IRestController to IResourceController.
  • Added unit-tests for RouterResource.
  • Simplified unit-tests with the TestRouter custom router class.

Release notes

The IRestController interface has been renamed to IResourceController.

simple-php-router - Version 3.2.0

Published by skipperbent over 7 years ago

  • Fixed: namespace being prepended on RouterController routes with absolute namespaces.
  • Fixed: match domain on RouteController and RouteResource.
  • Fixed: strict url-matching on RouteController. Fix should provide better url-matching.
  • Fixed #224: RouterResource always matching first url when having similar urls (ex: /funny-cat and /funny-dog) - thanks to: @AybimYazilim for reporting this issue.
  • Added loadRoutes method to Router class so routes now can be loaded without routing the request (useful when running in Cli etc).
  • Removed Router::getInstance method. Please use SimpleRouter::router() for singleton usage instead.
  • Added getRemoteAddr alias-method for getIp in Request class.
  • Added getValue to IInputItem interface.
  • Updated documentation with note on absolute/relative namespaces.
  • Other minor optimizations.

Release notes

  • Before updating ensure to replace all references from Router::getInstance() to SimpleRouter::router().
simple-php-router - Version 3.1.1

Published by skipperbent over 7 years ago

  • Fixed: only set default namespace on relative callbacks.
  • Fixed: default-namespace not being set when calling SimpleRouter::resource.
  • Minor optimisations.
simple-php-router - Version 3.1.0

Published by skipperbent over 7 years ago

  • Using $request->setRewriteRoute($route); rewrite-callback now renders any added middlewares on the route.
  • Rewrite callbacks now sets default-namespace on route, if defined.
  • Minor optimisations.
simple-php-router - Version 3.0.1

Published by skipperbent over 7 years ago

  • Fixed: replace empty parameter-values with null value.
simple-php-router - Version 2.6.6

Published by skipperbent over 7 years ago

  • Fixed: replace empty parameter-values with null value.
simple-php-router - Version 3.0.0

Published by skipperbent over 7 years ago

Changelog

  • Better rewrite management.
  • Minor optimisations.
  • Updated documentation.

Release notes

simple-php-router - Version 2.6.5

Published by skipperbent over 7 years ago

  • Fixed getExtension method in InputFile always returning empty value.
simple-php-router - Version 2.6.4

Published by skipperbent almost 8 years ago

  • Fixed where method in Route class calling itself instead of setWhere causing infinite loop.
  • Added unit-tests for regex parameters.
simple-php-router - Version 2.6.3

Published by skipperbent almost 8 years ago

  • getUrl will now use default-parameter value if specifically set to null when using url().
simple-php-router - Version 2.6.2

Published by skipperbent almost 8 years ago

  • Optimised route-match behavior
simple-php-router - Version 2.6.1

Published by skipperbent almost 8 years ago

  • Fixed parameters not merged with default values.
simple-php-router - Version 2.6.0

Published by skipperbent almost 8 years ago

  • Newly rewritten, simplified url-match behavior.
  • Moved match/regex functionality from Route to RouteLoadable where it belongs.
  • Moved loadClass to Route.
  • It's now possible to chose if nullable parameters should be passed on to the Controller by overwriting the $filterEmptyParams property.
  • Improved parameter-handling.
  • Added global reg-ex match to all routes (no longer only RouteUrl).
  • Moved renderRoute to Route - no need in written the same code everywhere.
  • Simplified PARAMETERS_REGEX_MATCH-regex in Route class.
  • Bug fixes and general improvements.