Permalink
Browse files

MDL-36360 Missing of cachestore_file::config_get_configuration_array()

  • Loading branch information...
1 parent 6109f21 commit d4d2f27c7fe2836d764d153f0a378810544ad72d @scara scara committed Nov 4, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 cache/stores/file/lib.php
View
@@ -457,6 +457,31 @@ public function purge() {
}
/**
+ * 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.
*
* @return bool

0 comments on commit d4d2f27

Please sign in to comment.