Ticket #48 (closed enhancement: worksforme)

Opened 3 years ago

Last modified 2 years ago

Change the way Midgard handles request input

Reported by: tarjei Assigned to: piotras
Priority: major Milestone: 9.03 Vinland
Component: Midgard Apache Version:
Keywords: paged midcom Cc:

Description

To integrate midcom and midgard better we need to change the way requests are handled. Instead of having midgard decide which page should be executed, this should be handled by a combination of midgard and midcom.

Sample code:

// request starts, we ask for /page/somepage

Midgard has already set up the db connection.

Midgard executes some php code in the index.php file of the root dir.

in the index.php file: // I'm not sure about the hostconfig part - if it is needed. $hostconfig = new MidgardHostConfig?; $hostconfig->use_basic_auth(); // require midgard basic auth

$request = new MigardRequest?;

This creates a new object that contains the following: request->argv todays argv request->argc " request->page the page object that is linked to the request request->style = the id of the style defined in the page object.

// midcom starts up.

// midcom creates the correct component to use // midcom sets a different style if needed. (example: if the url requested does not define the correct page ) $request->run()

//midgard starts the normal request handling phase calling code-init ROOT etc.

Change History

07/31/07 12:27:51 changed by piotras

  • status changed from new to assigned.

This is feature which should be implemented on language and application level. Midgard2 Apache module just parses url and maps it to pages ( like designed to be from midgard beginning ). Later on , midgard_request object is available as property of $_MIDGARD_CONNECTION. Application can ignore data provided by midgard_request and implement own way of parsing url. Additionaly own self defined midgard-root.php can be used to build style or pages tree.

If anything else is needed, please comment. If not , I close this issue.

05/28/08 09:52:19 changed by piotras

  • status changed from assigned to closed.
  • resolution set to worksforme.

Current Midgard2 and MidCOM3 implemetation shows this idea is possible.

09/30/08 14:26:52 changed by bergie

  • milestone changed from Midgard 2.0 to 9.03 Vinland.