We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22682
    • 3 Posts
    I’m trying to come up with a good solution for a "shared code base" for MODx installs which doesn’t break a working model of the filesystem. In other words, I’d like to have one spot on the filesystem where all shared code, or code which is re-used (manager, functions, includes, etc.) can exist. Each install of MODx on my server would use that same base of code for its operation. I’ve used this method in the past for other PHP projects that I’ve worked on. This way if you make a change to a critical area of the code (i.e., fix a bug or add a feature) it is applied to all of your installs.

    Has anyone had any luck with an operation of this nature? Perhaps using mod_rewrite in combination with symbolic links is the best way to make this happen?

    Thoughts?
      • 22303 MODX Staff
      • 10,725 Posts
      @parcsomaha:

      There is no easy way to do this at the moment that I know of, as the manager and other paths are pretty tightly embedded into the code and markup. However, this is precisely one of the goals of the 0.9.7 release. The core of MODx (and xPDO, which it is built upon), will serve as libraries, and can be used much like PEAR classes can, from a shared location. In addition, all the default web directory paths (base_path, manager_path, assets_path) will be configurable. We’re working to make a preview release available as soon as possible, so if you have a little more time to wait for this, you can take it for a test drive; I believe it’s precisely what you are looking for.
        • 22682
        • 3 Posts
        Sounds great to me! I look forward to the release.