odata/library/ODataProducer/HttpProcessUtility.php
/**
     * Reads Mime type parameter value for a particular parameter in the
     * Content-Type/Accept headers.
     * 
     * @param string $parameterName Name of parameter.
     * @param string $text          Header text.
     * @param int    &$textIndex    Parsing index in $text.
     * 
     * @return string String representing the value of the $parameterName parameter.
     *
     * @throws HttpHeaderFailure
     */
Reads Mime type parameter value for a particular parameter in the
Content-Type/Accept headers.

@param string $parameterName Name of parameter.
@param string $text          Header text.
@param int    &$textIndex    Parsing index in $text.

@return string String representing the value of the $parameterName parameter.


Reads Mime type parameter value for a particular parameter in the Content - Type / Accept headers . @param string $parameterName Name of parameter . @param string $text Header text . @param int &$textIndex Parsing index in $text . @return string String representing the value of the $parameterName parameter .
public static function readQuotedParameterValue($parameterName, $text, 
        &$textIndex
    ) {
        $parameterValue = array();
        $textLen = strlen($text);
        $valueIsQuoted = false;
        if ($textIndex < $textLen) {
            if ($text[$textIndex] == '"') {
                $textIndex++;
                $valueIsQuoted = true;
            }
        }
        while ($textIndex < $textLen) {
            $currentChar = $text[$textIndex];
            if ($currentChar == '\\' || $currentChar == '"') {
                if (!$valueIsQuoted) {
                    throw new HttpHeaderFailure(
                        Messages::httpProcessUtilityEscapeCharWithoutQuotes(
                            $parameterName
                        ), 
                        400
                    );
                }
                $textIndex++;
                if ($currentChar == '"') {
                    $valueIsQuoted = false;
                    break;
                }
                if ($textIndex >= $textLen) {
                    throw new HttpHeaderFailure(
                        Messages::httpProcessUtilityEscapeCharAtEnd($parameterName), 
                        400
                    );
                }
                $currentChar = $text[$textIndex];
            } else if (!self::isHttpTokenChar($currentChar)) {
                break;
            }
            $parameterValue[] = $currentChar;
            $textIndex++;
        }
        if ($valueIsQuoted) {
            throw new HttpHeaderFailure(
                Messages::httpProcessUtilityClosingQuoteNotFound($parameterName), 
                400
            );
        }
        return empty($parameterValue) ? null : implode('', $parameterValue);
    }
public static function readQuotedParameterValue ( $ parameterName , $ text , & $ textIndex ) { $ parameterValue = array ( ) ; $ textLen = strlen ( $ text ) ; $ valueIsQuoted = false ; if ( $ textIndex < $ textLen ) { if ( $ text [ $ textIndex ] == '"' ) { $ textIndex ++ ; $ valueIsQuoted = true ; } } while ( $ textIndex < $ textLen ) { $ currentChar = $ text [ $ textIndex ] ; if ( $ currentChar == '\\' || $ currentChar == '"' ) { if ( ! $ valueIsQuoted ) { throw new HttpHeaderFailure ( Messages :: httpProcessUtilityEscapeCharWithoutQuotes ( $ parameterName ) , 400 ) ; } $ textIndex ++ ; if ( $ currentChar == '"' ) { $ valueIsQuoted = false ; break ; } if ( $ textIndex >= $ textLen ) { throw new HttpHeaderFailure ( Messages :: httpProcessUtilityEscapeCharAtEnd ( $ parameterName ) , 400 ) ; } $ currentChar = $ text [ $ textIndex ] ; } else if ( ! self :: isHttpTokenChar ( $ currentChar ) ) { break ; } $ parameterValue [ ] = $ currentChar ; $ textIndex ++ ; } if ( $ valueIsQuoted ) { throw new HttpHeaderFailure ( Messages :: httpProcessUtilityClosingQuoteNotFound ( $ parameterName ) , 400 ) ; } return empty ( $ parameterValue ) ? null : implode ( '' , $ parameterValue ) ; }
Reads Mime type parameter value for a particular parameter in the
 Content-Type/Accept headers.
Reads Mime type parameter value for a particular parameter in the Content - Type / Accept headers .
// End of quoted parameter value. // If the given character is special, we stop processing.