public static function normalize_component($component) {
        if ($component === 'moodle' or $component === 'core' or $component === '') {
            return array('core', null);
        }

        if (strpos($component, '_') === false) {
            self::init();
            if (array_key_exists($component, self::$subsystems)) {
                $type   = 'core';
                $plugin = $component;
            } else {
                // Everything else without underscore is a module.
                $type   = 'mod';
                $plugin = $component;
            }

        } else {
            list($type, $plugin) = explode('_', $component, 2);
            if ($type === 'moodle') {
                $type = 'core';
            }
            // Any unknown type must be a subplugin.
        }

        return array($type, $plugin);
    }
public static function normalize_component($component) {
        if ($component === 'moodle' or $component === 'core' or $component === '') {
            return array('core', null);
        }

        if (strpos($component, '_') === false) {
            self::init();
            if (array_key_exists($component, self::$subsystems)) {
                $type   = 'core';
                $plugin = $component;
            } else {
                // Everything else without underscore is a module.
                $type   = 'mod';
                $plugin = $component;
            }

        } else {
            list($type, $plugin) = explode('_', $component, 2);
            if ($type === 'moodle') {
                $type = 'core';
            }
            // Any unknown type must be a subplugin.
        }

        return array($type, $plugin);
    }
public static function normalize_component ( $ component ) { if ( $ component === 'moodle' or $ component === 'core' or $ component === '' ) { return array ( 'core' , null ) ; } if ( strpos ( $ component , '_' ) === false ) { self :: init ( ) ; if ( array_key_exists ( $ component , self :: $ subsystems ) ) { $ type = 'core' ; $ plugin = $ component ; } else { // Everything else without underscore is a module. $ type = 'mod' ; $ plugin = $ component ; } } else { list ( $ type , $ plugin ) = explode ( '_' , $ component , 2 ) ; if ( $ type === 'moodle' ) { $ type = 'core' ; } // Any unknown type must be a subplugin. } return array ( $ type , $ plugin ) ; }
Normalize the component name using the "frankenstyle" rules.

Note: this does not verify the validity of plugin or type names.

@param string $component
@return array two-items list of [(string)type, (string|null)name]
Normalize the component name using the frankenstyle rules .