38 lines
739 B
PHP
38 lines
739 B
PHP
<?php
|
|
|
|
namespace Picea\Caching;
|
|
|
|
use Picea\Compiler\Context;
|
|
|
|
interface Cache {
|
|
|
|
/**
|
|
* Should return true if a cache instance of given view is found.
|
|
*
|
|
* @param string $viewPath
|
|
* @return bool
|
|
*/
|
|
public function compiled(string $viewPath) : bool;
|
|
|
|
/**
|
|
* Load given view path content based on cache.
|
|
*
|
|
* @param string $viewPath
|
|
* @return string
|
|
*/
|
|
public function load(string $viewPath, ...$arguments) : object;
|
|
|
|
/**
|
|
* Save a given view path with a compiled context
|
|
*
|
|
* @param Context $context
|
|
* @return bool
|
|
*/
|
|
public function save(Context $context) : bool;
|
|
|
|
/**
|
|
* Purge path cache
|
|
*/
|
|
public function purge() : void;
|
|
}
|