public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        if (!isset($xml->CORSRule)) return;
        foreach ($xml->CORSRule as $rule) {
            $corsRule = new CorsRule();
            foreach ($rule as $key => $value) {
                if ($key === self::OSS_CORS_ALLOWED_HEADER) {
                    $corsRule->addAllowedHeader(strval($value));
                } elseif ($key === self::OSS_CORS_ALLOWED_METHOD) {
                    $corsRule->addAllowedMethod(strval($value));
                } elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) {
                    $corsRule->addAllowedOrigin(strval($value));
                } elseif ($key === self::OSS_CORS_EXPOSE_HEADER) {
                    $corsRule->addExposeHeader(strval($value));
                } elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) {
                    $corsRule->setMaxAgeSeconds(strval($value));
                }
            }
            $this->addRule($corsRule);
        }
        return;
    }
public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        if (!isset($xml->CORSRule)) return;
        foreach ($xml->CORSRule as $rule) {
            $corsRule = new CorsRule();
            foreach ($rule as $key => $value) {
                if ($key === self::OSS_CORS_ALLOWED_HEADER) {
                    $corsRule->addAllowedHeader(strval($value));
                } elseif ($key === self::OSS_CORS_ALLOWED_METHOD) {
                    $corsRule->addAllowedMethod(strval($value));
                } elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) {
                    $corsRule->addAllowedOrigin(strval($value));
                } elseif ($key === self::OSS_CORS_EXPOSE_HEADER) {
                    $corsRule->addExposeHeader(strval($value));
                } elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) {
                    $corsRule->setMaxAgeSeconds(strval($value));
                }
            }
            $this->addRule($corsRule);
        }
        return;
    }
public function parseFromXml ( $ strXml ) { $ xml = simplexml_load_string ( $ strXml ) ; if ( ! isset ( $ xml -> CORSRule ) ) return ; foreach ( $ xml -> CORSRule as $ rule ) { $ corsRule = new CorsRule ( ) ; foreach ( $ rule as $ key => $ value ) { if ( $ key === self :: OSS_CORS_ALLOWED_HEADER ) { $ corsRule -> addAllowedHeader ( strval ( $ value ) ) ; } elseif ( $ key === self :: OSS_CORS_ALLOWED_METHOD ) { $ corsRule -> addAllowedMethod ( strval ( $ value ) ) ; } elseif ( $ key === self :: OSS_CORS_ALLOWED_ORIGIN ) { $ corsRule -> addAllowedOrigin ( strval ( $ value ) ) ; } elseif ( $ key === self :: OSS_CORS_EXPOSE_HEADER ) { $ corsRule -> addExposeHeader ( strval ( $ value ) ) ; } elseif ( $ key === self :: OSS_CORS_MAX_AGE_SECONDS ) { $ corsRule -> setMaxAgeSeconds ( strval ( $ value ) ) ; } } $ this -> addRule ( $ corsRule ) ; } return ; }
Parse CorsConfig from the xml.

@param string $strXml
@throws OssException
@return null
Parse CorsConfig from the xml .