We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24253
    • 125 Posts
    I love OOP smiley

    Seriously, if modx uses OOP, then a seperate class (being included or not) for the parser really makes sense.

    And if it needs to include the parser file, don’t be worried about that 0.00001 second of overhead it involves ;-)
    (If there is really any overhead at all. Most people have a php accelerator installed, so it in fact not even parses the included class, but uses the bytecode in the accelerators cache.
    At least, that’s what they told me)

    Oh, and I couldn’t measure any difference being it in file or included smiley
      • 25663 MODX Staff
      • 12,272 Posts
      If there is basically a non-measurable penalty in performance, let’s keep it separated. If we have a good caching system in place, our parser will be used much less than currently!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 32963
        • 1,732 Posts

        On my local PC it did make a difference when compared to eto’s embedded parser.

        I’ll make it into an object ($cms->parser) based on Remons tag.parser class but it will be integrated. if we need to then we can separate it later without the user knowing anything.
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 24253
          • 125 Posts
          Ah, ok. It seems we compared different files ;-)

          The point why I liked to have it into a seperate class file was that member variables are split, which can be hard to accomplish when it’s integrated, making seperation later on a little harder.

          Main point for me to split this code, was having a minimal base only for serving a page, and loading functionality on demand.
          Having only a minimal parser loaded verser a minimal one with the tagparser integrated possibly doesn’t yield much in respect to performance, but the process will use less memory.
          That was the idea behind splitting it into these classes....
            • 32963
            • 1,732 Posts
            Ok,

            Sounds great! I’ve have a look at it. Also have a look at what I’ve done with content.manager.class.php
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.