private static function addParams($url, array $params = array())
    {
        $cParams = count($params);

        if ($cParams > 0) {
            $url .= '?';
            $idx = 1;
            foreach ($params as $key => $value) {
                $url .= $key.'='.$value;
                if ($idx < $cParams) {
                    $url .= '&';
                }
                ++$idx;
            }
        }

        return $url;
    }