original_string: protected static final function get_class_name($format) {
          global $CFG;
          static $classnames = array('site' => 'format_site');
          if (!isset($classnames[$format])) {
              $plugins = core_component::get_plugin_list('format');
              $usedformat = self::get_format_or_default($format);
              if (isset($plugins[$usedformat]) && file_exists($plugins[$usedformat].'/lib.php')) {
                  require_once($plugins[$usedformat].'/lib.php');
              }
              $classnames[$format] = 'format_'. $usedformat;
              if (!class_exists($classnames[$format])) {
                  require_once($CFG->dirroot.'/course/format/formatlegacy.php');
                  $classnames[$format] = 'format_legacy';
              }
          }
          return $classnames[$format];
      }
code: protected static final function get_class_name($format) {
          global $CFG;
          static $classnames = array('site' => 'format_site');
          if (!isset($classnames[$format])) {
              $plugins = core_component::get_plugin_list('format');
              $usedformat = self::get_format_or_default($format);
              if (isset($plugins[$usedformat]) && file_exists($plugins[$usedformat].'/lib.php')) {
                  require_once($plugins[$usedformat].'/lib.php');
              }
              $classnames[$format] = 'format_'. $usedformat;
              if (!class_exists($classnames[$format])) {
                  require_once($CFG->dirroot.'/course/format/formatlegacy.php');
                  $classnames[$format] = 'format_legacy';
              }
          }
          return $classnames[$format];
      }
code_tokens: protected static final function get_class_name ( $ format ) { global $ CFG ; static $ classnames = array ( 'site' => 'format_site' ) ; if ( ! isset ( $ classnames [ $ format ] ) ) { $ plugins = core_component :: get_plugin_list ( 'format' ) ; $ usedformat = self :: get_format_or_default ( $ format ) ; if ( isset ( $ plugins [ $ usedformat ] ) && file_exists ( $ plugins [ $ usedformat ] . '/lib.php' ) ) { require_once ( $ plugins [ $ usedformat ] . '/lib.php' ) ; } $ classnames [ $ format ] = 'format_' . $ usedformat ; if ( ! class_exists ( $ classnames [ $ format ] ) ) { require_once ( $ CFG -> dirroot . '/course/format/formatlegacy.php' ) ; $ classnames [ $ format ] = 'format_legacy' ; } } return $ classnames [ $ format ] ; }
docstring: Get class name for the format
  
  If course format xxx does not declare class format_xxx, format_legacy will be returned.
  This function also includes lib.php file from corresponding format plugin
  
  @param string $format
  @return string
docstring_tokens: Get class name for the format