1 | <?php |
||
12 | class CachedQuery extends Query |
||
13 | { |
||
14 | /** |
||
15 | * Checks the cache to see if this query exists and returns it. If it's |
||
16 | * not in the cache then the query is run, stored and then returned. |
||
17 | * |
||
18 | * @return Result The result of the query. |
||
19 | */ |
||
20 | public function execute() |
||
45 | |||
46 | /** |
||
47 | * Gets a hash based on the files in the repo directory. If the contents |
||
48 | * of a file changes, or other files are added/deleted the hash will change. |
||
49 | * Uses filematime() for speed when checking for file changes (rather than |
||
50 | * using crc32 or md5 etc) |
||
51 | * |
||
52 | * @return string A 128bit hash in hexadecimal format. |
||
53 | */ |
||
54 | protected function getFileHash() |
||
68 | |||
69 | /** |
||
70 | * Generates a hash based on the parameters set in the query. |
||
71 | * |
||
72 | * @return string A 128bit hash in hexadecimal format. |
||
73 | */ |
||
74 | protected function getParameterHash() |
||
85 | } |
||
86 |