We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Quote from: OpenGeek at Aug 21, 2005, 10:46 PM

    Wouldn’t this be the job of a plugin; dynamically adding the $etomite object, making it available for the parser? I am not suggesting replacing the $modx object what so ever. Just interested in creating new objects with additional API’s to make available to the site resources. To override existing behavior is another subject, and one I’m not familiar enough with the parser to discuss intelligently at this point, though I imagine it would have to be done using the extenders approach. I was suggesting the ability to allow user-defined extenders to allow extensions to the parser, unless it could be solved using a module/plugin.

    The problem is that at this point $modx already exists. So if you then load the alternate API, say, $etomite, which extends our core API $modx, you now have two different objects that don’t point to the same thing.

    Whereas if you can do this via a config setting and do the include prior to the class initialization, you can do something like:
    include "api/document.parser.inc.php";
    include "api/etomite.parser.inc.php"; 
    $etomite =& $modx = new Etomite_Document_Parser;
    


    Now whether you use $modx or the alternate $etomite you point to the same object and are running off one copy.

    Doing this after you have $modx started (and, hence, can run the plugins) means that you have to destroy your current class instance and recreate it.

    Does that explanation make more sense?

      • 32963
      • 1,732 Posts
      I’m not for creating multiple APIs as I can see where this will cause problems in the future.

      User switchs to Etomite 0.6 API which extends the MODx API and overides some MODx functions. Now user installs a MODx app which requires those overwritten API functions. I guess the solution is to run bith of APIs? $modx and $etomite. If so then that’s going to pose a big problem.

      On the issue of memory... I don’t thing the APIs that no existing are the post a problem for memory. It’s the siteCache.idx.php file as we have alread discussed.

      On the issue of too many external file.... I’ve tested and have read where having too many external files can have an impact on the overal performance of the software. The only extender that’s loaded from the front-end is the DBAPI class which was only done to better support DB abstraction. If we where to merge document.parser.inc.php + dbapi.class.inc.php into the index.php file the system would take a lot less time to process the page. Pages that takes longer time to be processed will affect scalability.

      What we need to do is to strike a balance between memory consumption (siteCache) and external includes. But to strip away the existing eto-like APIs in favor of memory I think would be of little (if any) significance.


        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 4673
        • 577 Posts
        What happens down the road when supporting eto becomes more of a problem than a benefit?

        Wouldn’t it be wiser not to follow in the footsteps of M$? Backwards compatibility is great up to point where it starts to bit you in the butt (ie, vista -- longwait -- problems).

        Nothing against the eto group but what about the idea of just porting? Are the snippets and such at eto that important? (I’m sure we’re not looking at something of collection of code such as oscommerce has).

        Wouldn’t the majority not jsut prefer updated, niftier, plugins and such from modx?

        Just throwing out some questions to see if there are other options out there. laugh
          Tangent-Warrior smiley
        • I would tend to agree with Carsten here and keep a more clean API. Porting snippets to MODx is pretty trivial at worst.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 7455
            • 2,204 Posts
            AT this point I would say that Eto has a larger group of people that create snippets for it.
            I used a lot of them myself, I am not realy a great programer and to rewrite a etosnip to work with mod-x takes ages for me. but if the Mod-X team expand and we get a good snipped/module/plugin database than this is no isseu anymore and then there will be losta of people willing to converts some snippets or create a beter one. But at this point the snipet I needed (the one started this treat) is still not working for me in mod-x.

            my 2cents

            Dimmy
              follow me on twitter: @dimmy01
            • I’m still for allowing user-defined extensions to the API, but I believe this can be accomplished through a plugin, and leave our native MODx API clean and sleak.

              Many of the *Nuke forks I worked with had compatibility modules that basically allowed someone to run modules from previous versions. For instance, we could implement a plugin that built a custom etomite object to support the execution of native etomite snippets. And someone interested in that functionality could take responsibility for maintaining it.

              Isolating it from the native MODx API is a step forward, as it isolates customization points and allows users to continue upgrading MODx as we release new features and refactorings, without the extra maintenance involved in migrating customized core code.
                • 34162
                • 1 Posts
                Jason,

                That is an exelent idea!

                Create a virtual Etomite object to run etomite code in. It is like the StarTrek virtual endless loop for the holodesk couples to live their live after their failed attempt to take over the enterprise. grin
                  • 32963
                  • 1,732 Posts
                  As is now you can create a plugin to simulate the Eto environ but that’s not something we would want to focus on. Such can be the goal of a 3rd party.

                  Travis suggested that we split the API into Eto and MODx therefore remove what it considered "eto" functions in an eto class. This could mean that existing MODx code and sites that run eto 0.6 code would have to run in what might be called "Compatibile mode." My take on this is that the core APIs as is now should support MODx codes without forcing existing sites to run in compatible mode. The set of functions that are not used or where not present in the original eto are those of Ralph’s DB engine. Functions such as dbQuery, fetchRow, etc should not be removed from the core API.

                  The other set of functions that can be move are the debuging functions. These can be added to a debug class which would _only_ be include if the site is being run in debug mode

                  Just me 2 cents

                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.