original_string: public static function available_converters($restore=true) {
          global $CFG;
  
          $converters = array();
  
          $plugins    = get_list_of_plugins('backup/converter');
          foreach ($plugins as $name) {
              $filename = $restore ? 'lib.php' : 'backuplib.php';
              $classuf  = $restore ? '_converter' : '_export_converter';
              $classfile = "{$CFG->dirroot}/backup/converter/{$name}/{$filename}";
              $classname = "{$name}{$classuf}";
              $zip_contents      = "{$name}_zip_contents";
              $store_backup_file = "{$name}_store_backup_file";
              $convert           = "{$name}_backup_convert";
  
              if (!file_exists($classfile)) {
                  throw new convert_helper_exception('converter_classfile_not_found', $classfile);
              }
  
              require_once($classfile);
  
              if (!class_exists($classname)) {
                  throw new convert_helper_exception('converter_classname_not_found', $classname);
              }
  
              if (call_user_func($classname .'::is_available')) {
                  if (!$restore) {
                      if (!class_exists($zip_contents)) {
                          throw new convert_helper_exception('converter_classname_not_found', $zip_contents);
                      }
                      if (!class_exists($store_backup_file)) {
                          throw new convert_helper_exception('converter_classname_not_found', $store_backup_file);
                      }
                      if (!class_exists($convert)) {
                          throw new convert_helper_exception('converter_classname_not_found', $convert);
                      }
                  }
  
                  $converters[] = $name;
              }
  
          }
  
          return $converters;
      }
code: public static function available_converters($restore=true) {
          global $CFG;
  
          $converters = array();
  
          $plugins    = get_list_of_plugins('backup/converter');
          foreach ($plugins as $name) {
              $filename = $restore ? 'lib.php' : 'backuplib.php';
              $classuf  = $restore ? '_converter' : '_export_converter';
              $classfile = "{$CFG->dirroot}/backup/converter/{$name}/{$filename}";
              $classname = "{$name}{$classuf}";
              $zip_contents      = "{$name}_zip_contents";
              $store_backup_file = "{$name}_store_backup_file";
              $convert           = "{$name}_backup_convert";
  
              if (!file_exists($classfile)) {
                  throw new convert_helper_exception('converter_classfile_not_found', $classfile);
              }
  
              require_once($classfile);
  
              if (!class_exists($classname)) {
                  throw new convert_helper_exception('converter_classname_not_found', $classname);
              }
  
              if (call_user_func($classname .'::is_available')) {
                  if (!$restore) {
                      if (!class_exists($zip_contents)) {
                          throw new convert_helper_exception('converter_classname_not_found', $zip_contents);
                      }
                      if (!class_exists($store_backup_file)) {
                          throw new convert_helper_exception('converter_classname_not_found', $store_backup_file);
                      }
                      if (!class_exists($convert)) {
                          throw new convert_helper_exception('converter_classname_not_found', $convert);
                      }
                  }
  
                  $converters[] = $name;
              }
  
          }
  
          return $converters;
      }
code_tokens: public static function available_converters ( $ restore = true ) { global $ CFG ; $ converters = array ( ) ; $ plugins = get_list_of_plugins ( 'backup/converter' ) ; foreach ( $ plugins as $ name ) { $ filename = $ restore ? 'lib.php' : 'backuplib.php' ; $ classuf = $ restore ? '_converter' : '_export_converter' ; $ classfile = "{$CFG->dirroot}/backup/converter/{$name}/{$filename}" ; $ classname = "{$name}{$classuf}" ; $ zip_contents = "{$name}_zip_contents" ; $ store_backup_file = "{$name}_store_backup_file" ; $ convert = "{$name}_backup_convert" ; if ( ! file_exists ( $ classfile ) ) { throw new convert_helper_exception ( 'converter_classfile_not_found' , $ classfile ) ; } require_once ( $ classfile ) ; if ( ! class_exists ( $ classname ) ) { throw new convert_helper_exception ( 'converter_classname_not_found' , $ classname ) ; } if ( call_user_func ( $ classname . '::is_available' ) ) { if ( ! $ restore ) { if ( ! class_exists ( $ zip_contents ) ) { throw new convert_helper_exception ( 'converter_classname_not_found' , $ zip_contents ) ; } if ( ! class_exists ( $ store_backup_file ) ) { throw new convert_helper_exception ( 'converter_classname_not_found' , $ store_backup_file ) ; } if ( ! class_exists ( $ convert ) ) { throw new convert_helper_exception ( 'converter_classname_not_found' , $ convert ) ; } } $ converters [ ] = $ name ; } } return $ converters ; }
docstring: Returns the list of all available converters and loads their classes
  
  Converter must be installed as a directory in backup/converter/ and its
  method is_available() must return true to get to the list.
  
  @see base_converter::is_available()
  @return array of strings
docstring_tokens: Returns the list of all available converters and loads their classes