src/xPDO/Transport/xPDOTransport.php
public static function parseSignature($signature) {
        $exploded = explode('-', $signature);
        $name = current($exploded);
        $version = '';
        $part = next($exploded);
        while ($part !== false) {
            $dotPos = strpos($part, '.');
            if ($dotPos > 0 && is_numeric(substr($part, 0, $dotPos))) {
                $version = $part;
                while (($part = next($exploded)) !== false) {
                    $version .= '-' . $part;
                }
                break;
            } else {
                $name .= '-' . $part;
                $part = next($exploded);
            }
        }
        return array(
            $name,
            $version
        );
    }
public static function parseSignature($signature) {
        $exploded = explode('-', $signature);
        $name = current($exploded);
        $version = '';
        $part = next($exploded);
        while ($part !== false) {
            $dotPos = strpos($part, '.');
            if ($dotPos > 0 && is_numeric(substr($part, 0, $dotPos))) {
                $version = $part;
                while (($part = next($exploded)) !== false) {
                    $version .= '-' . $part;
                }
                break;
            } else {
                $name .= '-' . $part;
                $part = next($exploded);
            }
        }
        return array(
            $name,
            $version
        );
    }
public static function parseSignature ( $ signature ) { $ exploded = explode ( '-' , $ signature ) ; $ name = current ( $ exploded ) ; $ version = '' ; $ part = next ( $ exploded ) ; while ( $ part !== false ) { $ dotPos = strpos ( $ part , '.' ) ; if ( $ dotPos > 0 && is_numeric ( substr ( $ part , 0 , $ dotPos ) ) ) { $ version = $ part ; while ( ( $ part = next ( $ exploded ) ) !== false ) { $ version .= '-' . $ part ; } break ; } else { $ name .= '-' . $ part ; $ part = next ( $ exploded ) ; } } return array ( $ name , $ version ) ; }
Parse the name and version from a package signature.

@static
@param string $signature The package signature to parse.
@return array An array with two elements containing the name and version respectively.
Parse the name and version from a package signature .