|
@@ 248-259 (lines=12) @@
|
| 245 |
|
return hash('sha256', $sql.serialize($values)); |
| 246 |
|
} |
| 247 |
|
|
| 248 |
|
public function rawCached(string $sql, string $index = null, bool $assoc = true){ |
| 249 |
|
|
| 250 |
|
$result = $this->cacheGet($sql.$index); |
| 251 |
|
|
| 252 |
|
if(!$result){ |
| 253 |
|
$result = $this->raw($sql, $index, $assoc); |
| 254 |
|
|
| 255 |
|
$this->cacheSet($sql.$index, [], $result); |
| 256 |
|
} |
| 257 |
|
|
| 258 |
|
return $result; |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
public function preparedCached(string $sql, array $values = [], string $index = null, bool $assoc = true){ |
| 262 |
|
$result = $this->cacheGet($sql.$index, $values); |
|
@@ 261-271 (lines=11) @@
|
| 258 |
|
return $result; |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
public function preparedCached(string $sql, array $values = [], string $index = null, bool $assoc = true){ |
| 262 |
|
$result = $this->cacheGet($sql.$index, $values); |
| 263 |
|
|
| 264 |
|
if(!$result){ |
| 265 |
|
$result = $this->prepared($sql, $values, $index, $assoc); |
| 266 |
|
|
| 267 |
|
$this->cacheSet($sql.$index, $values, $result); |
| 268 |
|
} |
| 269 |
|
|
| 270 |
|
return $result; |
| 271 |
|
} |
| 272 |
|
} |
| 273 |
|
|