for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LeKoala\DebugBar\Aspect;
use LeKoala\DebugBar\Collector\PartialCacheCollector;
use SilverStripe\Core\Injector\AfterCallAspect;
class CacheAfterCallAspect implements AfterCallAspect
{
/**
* Logs all hits/misses after a CacheInterface::get call is made.
*
* {@inheritdoc}
*/
public function afterCall($proxied, $method, $args, $result)
$message = (empty($result)) ? "Missed: {$args[0]}" : "Hit: {$args[0]}";
PartialCacheCollector::addTemplateCache(
$message,
array(
'cache_result' =>
array('result' => trim(str_replace("\n", '', $result)))
)
);
}