Open Source Content Management Framework

Removing URL parsing from Midgard2

  1. Removing URL parsing from Midgard2

    Sun October 25 2009 16:55:08 UTC
    Hi,

    We had some discussion about URL handling, and decided that it would
    be best to remove that from Midgard2 completely, and handle it in
    MidCOM3's midgard2 dispatcher.

    Basically this means removing the get_request_config() API.

    Advantages:
    * Cleaner code in midgard2-php
    * URL handling easier to understand by people outside the traditional
    Midgard sphere
    * MidCOM3 can check cache before URL parsing, so if there is a cache
    hit the request will result in 0 DB queries
    * We can make Midgard easily independent of hosts for situations like
    the Runtime

    Disadvantages:
    * Might be a bit slower than URL parsing on C level
    * We need to write a bit of PHP code for this (though not much)

    --
    Henri Bergius
    Motorcycle Adventures and Free Software
    http://bergie.iki.fi/

    Skype: henribergius
    Jabber: henri.bergius@gmail.com
    Microblog: http://www.qaiku.com/home/bergie/

    My Royal Enfield Bullet 500 is for sale, see http://www.nettimoto.com/844397
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
  2. Re: [midgard-dev] Removing URL parsing from Midgard2

    Mon October 26 2009 09:35:19 UTC
    Henri Bergius pisze:
    > Hi,

    Hi!

    > We had some discussion about URL handling, and decided that it would
    > be best to remove that from Midgard2 completely, and handle it in
    > MidCOM3's midgard2 dispatcher.
    >
    > Basically this means removing the get_request_config() API.

    Somehow +1. Core API doesn't seem to be the best place for this.

    > Disadvantages:
    > * Might be a bit slower than URL parsing on C level
    > * We need to write a bit of PHP code for this (though not much)

    There's no special or magic routines in request_config. I think it could
    be just copied to midgard-php extension. At least class and methods.
    Later on you can set page(s), style, argv, whatever on PHP level.
    IMO, there's no need to load yet another class per every request if it can
    be simple loaded once in extension.

    Piotras
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
  3. Re: [midgard-dev] Removing URL parsing from Midgard2

    Mon October 26 2009 09:40:06 UTC
    On 26.10.2009, at 11:32, Piotr Pokora wrote:

    > Henri Bergius pisze:
    >> Hi,
    >
    > Hi!
    >
    >> We had some discussion about URL handling, and decided that it would
    >> be best to remove that from Midgard2 completely, and handle it in
    >> MidCOM3's midgard2 dispatcher.
    >>
    >> Basically this means removing the get_request_config() API.
    >
    > Somehow +1. Core API doesn't seem to be the best place for this.
    >
    >> Disadvantages:
    >> * Might be a bit slower than URL parsing on C level
    >> * We need to write a bit of PHP code for this (though not much)
    >
    > There's no special or magic routines in request_config. I think it
    > could
    > be just copied to midgard-php extension. At least class and methods.
    > Later on you can set page(s), style, argv, whatever on PHP level.
    > IMO, there's no need to load yet another class per every request if
    > it can
    > be simple loaded once in extension.

    Idea is to remove them from midgard-php also.
    Henri wants to implement it in midcom's-code, without single line of C
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
  4. Re: [midgard-dev] Removing URL parsing from Midgard2

    Mon October 26 2009 09:45:06 UTC
    Alexey Zakhlestin pisze:

    Hi!

    > Idea is to remove them from midgard-php also.
    > Henri wants to implement it in midcom's-code, without single line of C

    I understand. And I always say, if we have extension let's benefit.
    Class and methods might be implemented in php extension. Logic of
    setting request variables in plain PHP.

    Piotras
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
Designed by Nemein, hosted by Kafit