mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
MDL-36111 cache: Fixed up typo's and trivial issues
This commit is contained in:
parent
8ccaa296fa
commit
758dbdf894
11 changed files with 30 additions and 24 deletions
16
cache/stores/file/lib.php
vendored
16
cache/stores/file/lib.php
vendored
|
@ -209,7 +209,7 @@ class cachestore_file implements cache_store, cache_is_key_aware {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function supports_multiple_indentifiers() {
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -255,8 +255,11 @@ class cachestore_file implements cache_store, cache_is_key_aware {
|
|||
* Pre-scan the cache to see which keys are present.
|
||||
*/
|
||||
protected function prescan_keys() {
|
||||
foreach (glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT) as $filename) {
|
||||
$this->keys[basename($filename)] = filemtime($filename);
|
||||
$files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $filename) {
|
||||
$this->keys[basename($filename)] = filemtime($filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -510,8 +513,11 @@ class cachestore_file implements cache_store, cache_is_key_aware {
|
|||
* @return boolean True on success. False otherwise.
|
||||
*/
|
||||
public function purge() {
|
||||
foreach (glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT) as $filename) {
|
||||
@unlink($filename);
|
||||
$files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $filename) {
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
$this->keys = array();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue