src/DreamCommerce/ShopAppstoreLib/Http.php
protected function prepareUrl($url, $query = array())
    {
        $processedUrl = $url;

        if ($query) {
            // URL has already query string, merge
            if (strpos($url, '?') !== false) {
                $components = parse_url($url);
                $params = array();
                parse_str($components['query'], $params);
                $params = $params + $query;
                $components['query'] = http_build_query($params);
                $processedUrl = http_build_url($components);
            } else {
                $processedUrl .= '?' . http_build_query($query);
            }
        }

        return $processedUrl;
    }
protected function prepareUrl($url, $query = array())
    {
        $processedUrl = $url;

        if ($query) {
            // URL has already query string, merge
            if (strpos($url, '?') !== false) {
                $components = parse_url($url);
                $params = array();
                parse_str($components['query'], $params);
                $params = $params + $query;
                $components['query'] = http_build_query($params);
                $processedUrl = http_build_url($components);
            } else {
                $processedUrl .= '?' . http_build_query($query);
            }
        }

        return $processedUrl;
    }
protected function prepareUrl ( $ url , $ query = array ( ) ) { $ processedUrl = $ url ; if ( $ query ) { // URL has already query string, merge if ( strpos ( $ url , '?' ) !== false ) { $ components = parse_url ( $ url ) ; $ params = array ( ) ; parse_str ( $ components [ 'query' ] , $ params ) ; $ params = $ params + $ query ; $ components [ 'query' ] = http_build_query ( $ params ) ; $ processedUrl = http_build_url ( $ components ) ; } else { $ processedUrl .= '?' . http_build_query ( $ query ) ; } } return $ processedUrl ; }
return an URL with query string
@param string $url base URL
@param array $query query string contents
@return string
return an URL with query string