Source of file CacheableNavigation_Clean.php
Size: 1,144 Bytes - Last Modified: 2021-12-24T06:44:18+00:00
/var/www/docs.ssmods.com/process/src/code/tasks/CacheableNavigation_Clean.php
1234567891011121314151617181920212223242526272829303132333435363738394041 | <?php /** * * This BuildTask clears the f/s or in-memory cache for {@link SiteTree} and * {@link SiteConfig} native SilverStripe objects. * The BuildTask should be run from the command-line as the webserver user * e.g. www-data ala: * * <code> * #> sudo -u www-data ./framework/sake dev/tasks/CacheableNavigation_Clean * <code> * * @author Deviate Ltd 2014-2015 http://www.deviate.net.nz * @package silverstripe-cachable * @see {@link CacheableNavigation_Rebuild}. * @todo Rename task to better suit the module's new name */ class CacheableNavigation_Clean extends BuildTask { /** * * @var string */ protected $description = 'Clears silverstripe-cacheable object cache.'; /** * * @param SS_HTTPRequest $request */ public function run($request) { $newLine = CacheableNavigation_Rebuild::new_line(); SS_Cache::pick_backend(CACHEABLE_STORE_NAME, CACHEABLE_STORE_FOR, CACHEABLE_STORE_WEIGHT); SS_Cache::factory(CACHEABLE_STORE_FOR)->clean('all'); echo 'Cleanup: ' . CACHEABLE_STORE_NAME . " done." . $newLine; } } |