From 5af88044155dd6ea9f2512ca758daa2f98b341cb Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Fri, 11 Mar 2011 10:40:28 -0800 Subject: [PATCH] Moving converters into sub-directories so they can have other files and simpletest directories specific to them --- .../{moodle1.class.php => moodle1/converter.class.php} | 0 backup/util/factories/convert_factory.class.php | 7 +++---- 2 files changed, 3 insertions(+), 4 deletions(-) rename backup/converter/{moodle1.class.php => moodle1/converter.class.php} (100%) diff --git a/backup/converter/moodle1.class.php b/backup/converter/moodle1/converter.class.php similarity index 100% rename from backup/converter/moodle1.class.php rename to backup/converter/moodle1/converter.class.php diff --git a/backup/util/factories/convert_factory.class.php b/backup/util/factories/convert_factory.class.php index a2d2d60850f..9c614fea1b5 100644 --- a/backup/util/factories/convert_factory.class.php +++ b/backup/util/factories/convert_factory.class.php @@ -13,7 +13,7 @@ abstract class convert_factory { $name = clean_param($name, PARAM_SAFEDIR); - $classfile = "$CFG->dirroot/backup/converter/$name.class.php"; + $classfile = "$CFG->dirroot/backup/converter/$name/converter.class.php"; $classname = "{$name}_converter"; if (!file_exists($classfile)) { @@ -36,9 +36,8 @@ abstract class convert_factory { global $CFG; $converters = array(); - $files = get_directory_list($CFG->dirroot.'/backup/converter'); - foreach ($files as $file) { - $name = array_shift(explode('_', $file)); + $plugins = get_list_of_plugins('backup/converter'); + foreach ($plugins as $name) { $converters[$name] = self::converter($name, $tempdir); } return $converters;