Caching

Generated solutions can be cached if the solution provider in use is cacheable (see \EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Provider\SolutionProvider::isCacheable). For this, a filesystem-based solution cache is implemented. In addition, an exception cache is provided which stores exceptions when solution streaming is active.

class ExceptionsCache
Fully qualified name
\EliasHaeussler\Typo3Solver\Cache\ExceptionsCache

Low-level cache manager for exceptions. This class is only used in combination with solution streaming.

get ( $entryIdentifier)

Get exception by cache identifier. If no cache with the given identifier exists, null is returned.

param string $entryIdentifier

Cache identifier of the exception to look up

returntype

Throwable|null

getIdentifier ( $exception)

Get calculated exception identifier of the given exception.

param Throwable $exception

Exception to calculate a cache identifier

returntype

string

set ( $exception)

Add the given exception to the exceptions cache and return the associated cache identifier.

param Throwable $exception

The exception to be cached

returntype

string

flush ( )

Remove all cached exceptions.

class SolutionsCache
Fully qualified name
\EliasHaeussler\Typo3Solver\Cache\SolutionsCache

Low-level cache manager for solutions. This class is used in combination with \EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Provider\CacheSolutionProvider.

get ( $problem)

Get cached solution for the given problem. If no solution exists in cache, null is returned.

param EliasHaeussler\Typo3Solver\ProblemSolving\Problem\Problem $problem

Problem to get a cached solution for

returntype

EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Solution|null

set ( $problem, $solution)

Add the given solution to the solutions cache and use the given problem to generate the cache identifier.

param EliasHaeussler\Typo3Solver\ProblemSolving\Problem\Problem $problem

The problem of the solution to be cached

param EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Solution $solution

The solution to be cached

flush ( )

Remove all cached solutions.