Selectors
A selector is a select form item that is used to control which class files should be in.
Each storage (file) needs to be in a class, but what if the class needs to be changed?
If each storage was associated directly with a class, then any module allowing admins to change the class would need to have code to go into its database tables, find every storage that needs to be changed and change them all in one go.
This is a lot of work for module developers. It also has another problem - changing the class of all the storages could potentially take a long time. Files may need to be uploaded to new services for example.
Selectors make things much easier. Each storage is associated with a selector (which is associated with a class). If the selector is changed to point to a different class, then all storages that use that selector are migrated to the new class without any addition code having to be written. Another advantage is that this migration happens in cron with eventual consistency. Changing the selector may mean that gigabytes of files will have to be moved, but this will happen over time in the background.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion