Skip to content

Releases: Upstatement/routes

Singleton refactor, custom match types, base path support

19 Apr 14:07
d89b8aa

Choose a tag to compare

⚠️ Beta release. APIs may shift before 1.0.0 stable. Please test against your projects and
file issues with feedback.

What's New

  • Custom AltoRouter match types via addMatchTypes() — register your own match type patterns
    (e.g. numeric IDs, slugs, UUIDs) to use in route definitions. See the README for usage examples.
  • Base path support for subdirectory installations — Routes now correctly handles WordPress
    installs mounted in a subdirectory. The router resolves against the relative path instead of the full
    request URI.

Breaking Changes

  • Routes is now a singleton. Direct instantiation patterns are replaced by a single shared
    instance. If you were holding your own new Routes() reference, switch to the singleton accessor —
    see README for the migration path.
  • Several internal method signatures changed to operate on instance context rather than static calls.
    If you were extending or subclassing Routes, review your overrides.

Fixes

  • match_current_request now correctly uses instance context on all call sites
  • Null-check on the router in match_current_request to guard against edge cases where no routes are
    registered
  • Reordered class properties for clarity

Documentation

  • New README section covering addMatchTypes() with examples
  • New README section on base path handling for subdirectory WordPress installs
  • Updated installation instructions
  • Documented 1.0.0 breaking changes

Housekeeping

  • Cleaned up plugin header comments
  • Removed unused autoload checks

Upgrading from 0.10.0

  1. Replace any direct new Routes() usage with the singleton accessor
  2. Review any subclasses for signature changes on instance methods
  3. If you use subdirectory installs, verify your routes still resolve as expected (behavior changed —
    should now Just Work where it previously required manual base-path hacks)

Full Changelog: 0.10.0...1.0.0-beta.1

HEAD method support, PHP 8.2, CI modernization

19 Apr 14:06
55bbfc3

Choose a tag to compare

What's New

  • HEAD method supportRoutes::map() now accepts HEAD as a valid HTTP method (#50)
  • PHP 8.2 required — minimum PHP version bumped from 7.3 to 8.2
  • Mantle framework integration — added mantle-framework/support, contracts, and container as
    dependencies

Improvements

  • Major refactor of Routes.php for readability, structure, and inline documentation
  • Modernized string operations (str_contains, str_starts_with) for clarity and performance
  • Clearer parameter descriptions on load()
  • Template filter callback now receives the current template parameter

Tooling & CI

  • Migrated from Travis CI to GitHub Actions (lint, Rector, PHPUnit)
  • Added Easy Coding Standard (ecs.php) and Rector (rector.php) configs
  • Updated PHPUnit config and test bootstrap
  • Rewrote test suite under tests/RoutesTest.php with expanded coverage

Fixes

  • Corrected "Preceeding" → "Preceding" in test names
  • Reset matches_class_test array between class route assertions
  • Assorted .gitattributes / .gitignore cleanup

Breaking Changes

  • PHP 8.2 is now the minimum supported version. Projects on older PHP must stay on 0.9.2 or
    upgrade their runtime before installing this release.

Full Changelog: 0.9.2...0.10.0

0.9.2

25 Feb 18:08
196a4db

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.9.1...0.9.2

Allow for 1.x composer installers for PHP 5.*

22 Jun 19:54
cac3c84

Choose a tag to compare

What's Changed

  • Allow for 1.x composer installers to support WP.org deployment by @jarednova in #42

Full Changelog: 0.9...0.9.1

Fix for WordPress 6.0

22 Jun 19:29
e4a995a

Choose a tag to compare

What's Changed

  • Use parse_request instead of do_parse_request action to fix compatibility with Wordpress 6 by @idflood in #41

New Contributors

Full Changelog: 0.8.2...0.9

Update of Composer specs

26 Feb 07:15
2fff0d9

Choose a tag to compare

Merge pull request #33 from Upstatement/coveralls

set PHP 7.x version

Update to version 2.0.2 of AltoRouter

16 Oct 00:12

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.8...0.8.1

Update version requirements

17 Aug 13:36
9294660

Choose a tag to compare

Requires PHP 5.6+ in order to be compatible w current version of AltoRouter #25

Remove some non-functional code

18 May 18:18
07057a8

Choose a tag to compare

Removed some non-functional code that could throw an error/warning (thanks @daronspence @szepeviktor)

Fix issue with WPML

23 Oct 13:28
882de20

Choose a tag to compare

  • Corrected double slashes that would sometimes occur from base path #12 #20