Created
February 15, 2012 12:32
-
-
Save KristianP/1835389 to your computer and use it in GitHub Desktop.
modx clear cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$paths = array( | |
'config.cache.php', | |
'sitePublishing.idx.php', | |
'registry/mgr/workspace/', | |
'lexicon/', | |
); | |
$contexts = $modx->getCollection('modContext'); | |
foreach ($contexts as $context) { | |
$paths[] = $context->get('key') . '/'; | |
} | |
$options = array( | |
'publishing' => 1, | |
'extensions' => array('.cache.php', '.msg.php', '.tpl.php'), | |
); | |
if ($modx->getOption('cache_db')) $options['objects'] = '*'; | |
$results= $modx->cacheManager->clearCache($paths, $options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment