public static function formatName($name)
    {
        /* Split name and version */
        $parts = [];
        if (preg_match('/([^[0-9]*)([0-9]*)/', $name, $parts) === false) {
            return $name;
        }

        /* Format name */
        $base = $parts[1];
        switch ($base) {
            case 'MySql':
                $base = 'MySQL';
                break;
            case 'MariaDb':
                $base = 'MariaDB';
                break;
        }

        /* Parse version to array */
        $ver_str = $parts[2];
        if (strlen($ver_str) % 2 === 1) {
            $ver_str = '0' . $ver_str;
        }
        $version = array_map('intval', str_split($ver_str, 2));
        /* Remove trailing zero */
        if ($version[count($version) - 1] === 0) {
            $version = array_slice($version, 0, count($version) - 1);
        }
        /* Create name */
        return $base . ' ' . implode('.', $version);
    }
public static function formatName($name)
    {
        /* Split name and version */
        $parts = [];
        if (preg_match('/([^[0-9]*)([0-9]*)/', $name, $parts) === false) {
            return $name;
        }

        /* Format name */
        $base = $parts[1];
        switch ($base) {
            case 'MySql':
                $base = 'MySQL';
                break;
            case 'MariaDb':
                $base = 'MariaDB';
                break;
        }

        /* Parse version to array */
        $ver_str = $parts[2];
        if (strlen($ver_str) % 2 === 1) {
            $ver_str = '0' . $ver_str;
        }
        $version = array_map('intval', str_split($ver_str, 2));
        /* Remove trailing zero */
        if ($version[count($version) - 1] === 0) {
            $version = array_slice($version, 0, count($version) - 1);
        }
        /* Create name */
        return $base . ' ' . implode('.', $version);
    }
public static function formatName ( $ name ) { /* Split name and version */ $ parts = [ ] ; if ( preg_match ( '/([^[0-9]*)([0-9]*)/' , $ name , $ parts ) === false ) { return $ name ; } /* Format name */ $ base = $ parts [ 1 ] ; switch ( $ base ) { case 'MySql' : $ base = 'MySQL' ; break ; case 'MariaDb' : $ base = 'MariaDB' ; break ; } /* Parse version to array */ $ ver_str = $ parts [ 2 ] ; if ( strlen ( $ ver_str ) % 2 === 1 ) { $ ver_str = '0' . $ ver_str ; } $ version = array_map ( 'intval' , str_split ( $ ver_str , 2 ) ) ; /* Remove trailing zero */ if ( $ version [ count ( $ version ) - 1 ] === 0 ) { $ version = array_slice ( $ version , 0 , count ( $ version ) - 1 ) ; } /* Create name */ return $ base . ' ' . implode ( '.' , $ version ) ; }
Formats context name.

@param string $name name to format

@return string
Formats context name .