We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I may have asked this before, but how can someone install a MODX package programmatically? It's easy enough to get the package zip file into place, but then what? It'd be really handy to get that streamlined so new installs could come online with all the packages needed -- WordPress just came out with a "Favorite Plugin" feed thing that streamlines this in the manager... kinda slick.

    I'm eyeballing the modTransportPackage class and the processors/workspace/packages/install.class.php... but that's a slow burn. Anyone have any pointers?
      • 3749
      • 24,544 Posts
      The latest version of MyComponent has code to do this.

      The best way to see it is to use the Example extra that comes with it. Put a package or two in the assets\mycomponents\example\_build\subpackages\ directory and run Build. Then look at the code in the package resolvers in the assets\mycomponents\example\_build\resolvers\packages directory.

      I'm working on an extra that actually downloads the packages from the MODX repo to the core/packages directory, but it will be a while before it sees the light of day.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting