router.php

Summary
router.php
RouterURL Router
getReturns the router
clearClear the global singleton instance for this class.
cacheKeyCreate a unique hashkey for the router.
initializeInitialize the router, including basic endpoints, and also fire the appropriate Events

Router

URL Router

Cheap wrapper around Net_URL_Mapper

Summary
getReturns the router
clearClear the global singleton instance for this class.
cacheKeyCreate a unique hashkey for the router.
initializeInitialize the router, including basic endpoints, and also fire the appropriate Events

get

static function get()

Returns the router

clear

static function clear()

Clear the global singleton instance for this class.  Needed to ensure reset when switching site configurations.

cacheKey

static function cacheKey()

Create a unique hashkey for the router.

The router’s url map can change based on the version of the software you’re running and the plugins that are enabled.  To avoid having bad routes get stuck in the cache, the key includes a list of plugins and the software version.

There can still be problems with a) differences in versions of the plugins and b) people running code between official versions, but these tend to be more sophisticated users who can grok what’s going on and clear their caches.

Returns

  • string cache key string that should uniquely identify a router

initialize

function initialize()

Initialize the router, including basic endpoints, and also fire the appropriate Events

static function get()
Returns the router
static function clear()
Clear the global singleton instance for this class.
static function cacheKey()
Create a unique hashkey for the router.
function initialize()
Initialize the router, including basic endpoints, and also fire the appropriate Events