Hi Bob,
maybe you remember that we were wondering why cachemaster doesn´t work for snippets. I think I found the problem. In the following part of the Code for deleting the cache-file of a single snippet the code deletes only the cached file in folder 'cache/scripts/elements/snippets/' and not in 'cache/includes/elements/snippets/' because it is missing in the part of the code as copied below.
BTW: In our installation it is only necessary to delete the cached file in the 'include-folder'. Therefore it might be enough to only replace in the given path 'scripts' by 'includes' and changing the file-name into '.include.cache.php' and changing 'snippets' into 'modsnippet'. At least this was successful in our settings.
Thanks a lot again for this really excellent add-on ...
case 'OnBeforeSnipFormSave':
$docId = $snippet->get('id');
/* set path to default cache file */
$path = MODX_CORE_PATH . 'cache/scripts/elements/snippets/' . $docId . '.cache.php';
$cKey = $snippet->getScriptCacheKey();
if ($doDebug) {
my_debug('Cache Key: ' . $cKey);
}
$modx->cacheManager->delete($cKey, array(
xPDO::OPT_CACHE_KEY => $modx->getOption('cache_scripts_key', null, 'scripts'),
xPDO::OPT_CACHE_HANDLER => $modx->getOption('cache_scripts_handler', null,
$modx->getOption(xPDO::OPT_CACHE_HANDLER)),
xPDO::OPT_CACHE_FORMAT => (integer)$modx->getOption('cache_scripts_format', null,
$modx->getOption(xPDO::OPT_CACHE_FORMAT, null, xPDOCacheManager::CACHE_PHP))
));
break;