-
☆ A M B ☆
- 24,524 Posts
1. Yes. It's done with contexts. The addons are still installed in core/components. The Manager always knows where the core is, that's why it has a config.core.php file in the /manager/ directory.
2. Media Sources.
http://rtfm.modx.com/revolution/2.x/administering-your-site/media-sources
1. No is not what I ment. I know how to setup multiple sites in one modx installation, but i'm talking of multiple sites with individual manager interfaces and all of them using same core.
2. Media sources are only the "place" to store files and if I'm not mistaken those files aren't indexed, so if you move a file from one folder to another inside same mediasource all references to that file will be lost.
-
☆ A M B ☆
- 24,524 Posts
Ah. Yes, I've heard of this, one way I heard about involved memcached. I've never done it myself, though.
Ok, at that kind of granularity, no, I don't know of any way to index files.
-
☆ A M B ☆
- 24,524 Posts
Actually that last is not exactly true. I do know someone who has worked out a way of using resources to serve binary data, particularly images, so a standard link to a resource will serve the image. No files to worry about.
[ed. note: sottwell last edited this post 11 years, 7 months ago.]
All files should be indexed and all references stored to database, so when you need any file you just point it to it's ID. Of course there is need for a plugin that updates file paths and names, when someone renames or moves them around + a script which changes ID-s to file path + a script to clear / update cache.
And about shared cores... in "advanced installation rtfm" is written that you need to change "Configuration Key" if you want to run multiple sites with shared core. So i'm guessing that is possible, but I don't know how you deal with extras and if each sites has it's own "manager" or is shared too.
-
☆ A M B ☆
- 24,524 Posts
Such a file indexing system could be done as long as files are only managed using the MODX file manager. It has several events that could be used in a plugin to modify the file's metadata. Another plugin could be used to parse a completed resource and update all image and other file paths.
There has been some discussion of this before.
discuss.answer
I'm talking of multiple sites with individual manager interfaces and all of them using same core.
There's a section in my book showing several different ways to have multiple sites sharing the core and/or the DB, but I don't think there's any coverage of multiple Managers and multiple file systems sharing the same core. I think it's theoretically possible, but I don't think I'd recommend it.
As for the file links, you can make them relative to a media source, so you could move them and change the media source if they still have the same directory structure. Otherwise, I'd recommend putting the files where you want them and leaving them there.
I read your book and built few multiple sites using one modx installation, but I'm wondering if shared core is possible, so you could update the core for multiple sites. For example... if you have 100 sites using modx on one server and you want to update them. What is the easiest and fastest way? copying the core and setup folder to each installation and run setup is very painful.
As for files... I usually put files where I wanted them to be, but clients are problematic. They often change files location in media sources and cause problems. Some CMS systems index files and write path to DB and don't have such problems. Modx is a little behind in this field. Most problematic are big sites with a lot of files, because after 2-3 years they allways want to remove some unused files and arange them to a new location. Currently is impossible to know which files are used and which are absolete.