Merge branch 'm24_MDL-36360_Missing_cachestore_file_config_get_configuration_array' of git://github.com/scara/moodle

This commit is contained in:
Dan Poltawski 2012-11-06 09:59:16 +08:00
commit 70cb1b995b

View File

@ -456,6 +456,28 @@ class cachestore_file implements cache_store, cache_is_key_aware {
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->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.
*