Haven't I too been waiting for this feature for so long?
All my poor contexts/websites get the boot whenever their subling is cache-drained, poor fellows! suffering the punishment due to another.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
This is totally off the top of my head, but I think something like this might do it (I think you'd have to have CacheMaster running as well, to prevent clearing the whole cache).
This would be connected to OnDocFormSave:
/** recursive remove dir function */
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir . "/" . $object) == "dir") {
$this->rrmdir($dir . "/" . $object);
} else {
unlink($dir . "/" . $object);
}
}
}
reset($objects);
rmdir($dir);
}
}
$contextKey = $modx->resource->get('context_key');
rrmdir(MODX_CORE_PATH . 'cache/resource/' . $context_key);
Thanx BobRay,
I will test your plugin.
@ rx2: I stopped using clientconfig and found using the context settings on the contexts it selves much more useful and more versatile.
-
☆ A M B ☆
- 721 Posts
Yes, we use Context Settings as well, though we do find that a bit more dangerous for clients who may fiddle with something they shouldn't.