Skip to content

Commit

Permalink
MDL-36360 Missing of cachestore_file::config_get_configuration_array()
Browse files Browse the repository at this point in the history
  • Loading branch information
scara committed Nov 4, 2012
1 parent 6109f21 commit d4d2f27
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cache/stores/file/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit d4d2f27

Please sign in to comment.