In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Dependency Graph View Issue ] Relation Graph ] Vertical ]
related to child of duplicate of

Viewing Issue Simple Details
ID Category Type Reproducibility Date Submitted Last Update
0001315 [In-Portal CMS] Front End refactoring N/A 2012-06-11 08:05 2012-10-20 06:23
Reporter alex View Status public  
Assigned To
Priority normal Resolution open  
Status active      
Summary 0001315: Routing Ideas
Description Routing is a way for application decide what content to show based on provided request data:
* url
* headers
* form data

It is implemented in one or another form in all major frameworks, like: Symphony, Zend Framework.


Right now in 5.1.x and 5.2.0-B3 we have rewrite listeners concept. It's a method inside event handler class, that knows how to build/parse urls.

There are several problems that needs to be solved in current implementation:
* small build/parse methods are located in usually big class (event handler) and just to build/parse url you create that class instance and eat lot of memory
* no way to create custom url caching key, since rewrite listeners don't put custom data into caching key
* rewrite listeners always create kModRewriteHelper class instance to use common function for url processing
* if you need to pass some custom parameter to rewrite builder to build a valid link (e.g. filename), then you need to create 2 copies of code
** in event handler: to ensure correct link after executing event on item detail page
** in tag processor: to ensure correct link when printing a list of items

I'm proposing to create base class kRouter with these methods:
1. build(...) - builds an url
2. parse(...) - parses an url
3. getLinkParams($object) - returns extra url parameters, extracted from object, that are required to successfully build a link
4. processParams(&$params) - get parameters, associated with given unit and remove it from global scope (like 5. kModRewriteHelper::getProcessedParams method now)
5. patchCachingKey($caching_key) - get caching key as input and return patched version (allows to put header values into caching key, used to cache parsed url)

Then in unit config you can register router using this code:

'RouterClass' => Array ('class' => 'WidgetRouter', 'file' => 'widget_router.php', 'build_event' => 'OnBuild'),


And class, who right now processes all that stuff called kRewriteProcessor would be renamed to kRoutingManager (maybe not a first) to make it all sound good.
Additional Information



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker