/ClearCache

ClearCache Plugin for Cakephp 2.0

Primary LanguagePHP

This is a port of ceeram's clear_cache for Cakephp 2.0.
Usage:

Run from your console:
"cake clear_cache"
or "cake clear_cache files"
or "cake clear_cache files views"
or "cake clear_cache files models persistent"
or "cake clear_cache engines"
or "cake clear_cache engines default"
or "cake clear_cache engines _cake_core_"
or "cake clear_cache engines default custom"

Run from your app:
<?php
App::import('Libs', 'ClearCache.ClearCache');
$ClearCache = new ClearCache();

$output = $ClearCache->run();

$output = $ClearCache->files();
$output = $ClearCache->files('views');
$output = $ClearCache->files('models', 'persistent');

$output = $ClearCache->engines();
$output = $ClearCache->engines('_cake_core_');
$output = $ClearCache->engines('default', 'custom');
?>

files() returns an associative array of deleted/undeleted files
array(
	'deleted' => array(...),
	'error'   => array(...)
)

engines() returns an associative array of result
array(
	'default' => true,
	'_cake_core_'   => false
)

run() returns an associative array of result
array(
	'files' => array(
		'deleted' => array(...),
		'error'   => array(...)
	),
	'engines' => array(
		'default' => true,
		'_cake_core_'   => false
	)
)