PHP Класс JamesMoss\Flywheel\CachedQuery

A extension of Query that is able to store results in shared memory (via the apc_* functions) so that they can be retieved for future use with minimal performance impact.
Наследование: extends Query
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
execute ( ) : Result Checks the cache to see if this query exists and returns it. If it's not in the cache then the query is run, stored and then returned.

Защищенные методы

Метод Описание
getFileHash ( ) : string Gets a hash based on the files in the repo directory. If the contents of a file changes, or other files are added/deleted the hash will change.
getParameterHash ( ) : string Generates a hash based on the parameters set in the query.

Описание методов

execute() публичный Метод

Checks the cache to see if this query exists and returns it. If it's not in the cache then the query is run, stored and then returned.
public execute ( ) : Result
Результат Result The result of the query.

getFileHash() защищенный Метод

Uses filematime() for speed when checking for file changes (rather than using crc32 or md5 etc)
protected getFileHash ( ) : string
Результат string A 128bit hash in hexadecimal format.

getParameterHash() защищенный Метод

Generates a hash based on the parameters set in the query.
protected getParameterHash ( ) : string
Результат string A 128bit hash in hexadecimal format.