We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28432
    • 372 Posts
    Hi Guys,

    I have change the core folder using the advanced installation of Modx, but i would like to know if it's possible to change the cache folder (core/cache) outside of the core folder ? I've trie to do it manually but i didn't find configuration about it.

    Is it possible to put outside of the www folder the assets folder ?

    Thanks in advance.

    This question has been answered by sottwell. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      No and no. The assets folder can be renamed as long as you edit the core/config/config.inc.php file, but the whole purpose of the directory is to organize items that must be accessed via URL, such as image and js files. Nothing in the core needs to be accessed via URL, they are all included by the index.php file which is a file operation and nothing to do with the web server.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28432
        • 372 Posts
        Quote from: sottwell at Dec 18, 2015, 02:43 AM
        No and no. The assets folder can be renamed as long as you edit the core/config/config.inc.php file, but the whole purpose of the directory is to organize items that must be accessed via URL, such as image and js files. Nothing in the core needs to be accessed via URL, they are all included by the index.php file which is a file operation and nothing to do with the web server.

        Thanks for your quickly reply Susan,

        I understand that the asset folder is for organisation of file like image, css, and js file... and so need to be in the www folder to stay accessed, but i don't understand why there is a sub folder named components in asset. Did components folder (assets/components) need to be accessed via URL ?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          This is for CSS, JS, images and any other URL-accessed resources that a component may need. Many components don't, so they don't have a folder in assets/components.

          The .php files for components do not need to be accessed with a URL (in fact they must not be accessible via a URL) so those go in core/components.

          Occasionally a third-party component will require a .php file for its configuration. Some large Javascript applications like Rich Text editors or gallery applications may need such a file. For example, Ace requires a 'completions.php' file to be accessible to its Javascript via a URL. Other than those, there should never be .php scripts in the assets/ directory.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28432
            • 372 Posts
            Thanks again Susan to replie ;-)

            My idea was to share core installation on top level of a server for many websites (really similar websites except images, text and a bit of CSS).
            If there is no possibility to do that, except using context i will install one Modx per website. But i will lost a lot of time to do the upgrade of these websites when i will have more than 10. And i can't imagine if i got 100 websites...

            I don't think i'm the first person to think about it.
            For me Modx is an incredible CMF (Framework), and Framework mean that is modular.
            This is the first time Modx can't be adaptable for one of my project.

            I will look for Symfony 2, but i still thinking this is possible whith Modx ! I think that I'm not good enougth to find a solution with Modx.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That is exactly what contexts were originally intended for. Why are you hesitant to use them?
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 28432
                • 372 Posts
                Quote from: sottwell at Dec 19, 2015, 08:26 AM
                That is exactly what contexts were originally intended for. Why are you hesitant to use them?

                I have already use it for multilingual and multi website in the sub-domain and domain both way. This is really nice ! I know there is a new way with the excellent Migx for multilingual but i haven't try it yet.
                But i don't like to have only one folder in the server like var/website-all/www/. This mean every files of all the websites are in the same folder and i don't think is really good for the security.

                I need to do something like
                /home/modx/current_version
                and
                /home/modx/futur_version
                like this i can make update modx easily for all website.

                For the cache i need to do something like
                /var/website-1/www/cache
                and
                /var/website-2/www/cache
                like this all cache files for website-1 will go in the right folder for this website.

                I know that if i change the Modx configuration key this will do a new folder in the core/cache/configuration_key and a config file like configuration_key.inc.php.
                So this is close to be similar that i want. But i can't put all the cache for all website in home/modx/current_version/cache/configuration_key/.
                For me all the files are for website-1 have to be only in the var/website-1/www/ to really separate files are not shared.

                I still trying to do it, i think it could be very usefull.
                • discuss.answer
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I posted a link to this discussion on Slack, and this is what Jason (opengeek) had to say


                  opengeek [5:29 PM]
                  his "concerns" are valid... you can't yet share a single core with multiple configurations properly

                  ​[5:29]
                  that's what workspaces were intended to solve, but development of them was never realized

                  ​[5:30]
                  that's also part of the motivation for the decoupled architecture I'm exploring for MODX Next
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    As far as keeping sites upgraded, the Updater dashboard widget is good for notifying of extras to be upgraded, with a link to the Installer. It also notifies if there is a new version of MODX. It can be configured to send email when updates are available.

                    The UpgradeMODX dashboard widget is good for keeping MODX itself upgraded. It notifies if a new version is available, providing an Upgrade button. This downloads, extracts and places the files, then forwards you to the Setup for finishing the upgrade. http://bobsguides.com/upgrade-modx-package.html [ed. note: sottwell last edited this post 10 years, 9 months ago.]
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 22840
                      • 1,572 Posts
                      Quote from: sottwell at Dec 19, 2015, 10:27 AM
                      The UpgradeMODX dashboard widget is good for keeping MODX itself upgraded.

                      from personal use this is the best widget ever, bob has done a great job with it and it makes upgrading sites easy.