From d4d2f27c7fe2836d764d153f0a378810544ad72d Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Sun, 4 Nov 2012 19:41:22 +0100 Subject: [PATCH] MDL-36360 Missing of cachestore_file::config_get_configuration_array() --- cache/stores/file/lib.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 3428d92d63e18..a33046f5e6d19 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -456,6 +456,31 @@ public function purge() { return true; } + /** + * Given the data from the add instance form this function creates a configuration array. + * + * @param stdClass $data + * @return array + */ + public static function config_get_configuration_array($data) { + $config = array(); + + if (isset($data->lock)) { + $config['lock'] = $data->lock; + } + if (isset($data->path)) { + $config['path'] = $data->path; + } + if (isset($data->autocreate)) { + $config['autocreate'] = $data->autocreate; + } + if (isset($data->prescan)) { + $config['prescan'] = $data->prescan; + } + + return $config; + } + /** * Checks to make sure that the path for the file cache exists. *