Insert a new $url and returns its id.

@param string $url The URL to insert in the database

@return string
762800
public function insertUrl($url)
    {
        $time = time();

        $query = $this->connection->createQueryBuilder();

        $query
            ->insert($this->connection->quoteIdentifier(self::URL_TABLE))
            ->values(
                [
                    'created' => ':created',
                    'modified' => ':modified',
                    'original_url_md5' => ':original_url_md5',
                    'url' => ':url',
                ]
            )
            ->setParameter(':created', $time, PDO::PARAM_INT)
            ->setParameter(':modified', $time, PDO::PARAM_INT)
            ->setParameter(':original_url_md5', md5($url))
            ->setParameter(':url', $url)
        ;

        $query->execute();

        return $this->connection->lastInsertId(
            $this->getSequenceName(self::URL_TABLE, 'id')
        );
    }
655240
public static function getPathAndQueryFromUrl($url)
    {
        $parsedUrl = parse_url($url);
        $result = '';
        if (isset($parsedUrl['path'])) {
            if (substr($parsedUrl['path'], 0, 1) == '/') {
                $parsedUrl['path'] = substr($parsedUrl['path'], 1);
            }
            $result .= $parsedUrl['path'];
        }
        if (isset($parsedUrl['query'])) {
            $result .= '?' . $parsedUrl['query'];
        }
        return $result;
    }
392285
public function setDatabaseUrl ($url)
    {
        $parts = parse_url($url);

        $this->database['name'] = trim($parts['path'], '/');
        $this->database['user'] = $parts['user'];
        $this->database['pass'] = $parts['pass'];
        $this->database['host'] = $parts['host'];
        $this->database['port'] = $parts['port'];

        return $this;
    }
65941
protected function getUuidFromUrl(Url $url)
    {
        $segments = $url->getPathSegments();

        if (count($segments) < 1) {
            throw new Exception('Invalid UUID');
        }

        if (count($segments) < 2) {
            return $segments[0];
        }

        return $segments[count($segments) - 2];
    }
1286966
public function url_to_id($url){
    if ( $file = $this->url_to_real($url) ){
      return $this->real_to_id($file);
    }
    return false;
  }
699646
protected function injectParameters($url)
    {
        $urlParts = explode('/', $url);

        foreach ($this->values as $key => $value) {
            $foundKey = array_search($value, $urlParts);
            if ($foundKey !== false) {
                $urlParts[$foundKey] = '{' . ltrim($key, '{}') . '}';
            }
        }
        return implode('/', $urlParts);
    }
166982
public static function getUrl($url = false)
    {
        $url = false !== $url ? $url : self::$_url;
        return $url;
    }
357511
public function internalize($url = '')
    {

        //Are we dealing with an array of parts?
        if (is_array($url)) {
            $url = implode('/', $url);
        }

        //@TODO make sure that this url does not have the scheme
        if (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url))
            return $url;
        //@TODO make sure that this url does not have the host already
        //@TODO make sure we are internalizing a path and nothing else
        //die;
        //Do we have the path info included?
        $sPath = $this->request->getBasePath() . "/";


        if (!empty($url) && $sPath <> "/") {

            $parts = explode("/", $sPath);
            $segments = explode("/", $url);

            //Remove all empty elements
            $segments = array_filter($segments, 'strlen');
            $parts = array_filter($parts, 'strlen');
            //die;
            //This is in case we have a system deep in multiple supdirectories
            array_unshift($parts, null);
            $fragment = implode("/", $parts);

            if (is_array($segments)) {

                array_unshift($segments, null); //Adds the / to the start of the url
                $url = implode("/", $segments);

                //now look for $fragment at the start of $url
                $pos = strpos($url, $fragment);
                if ($pos !== 0 || $pos === FALSE) {
                    $url = $fragment . $url;
                }
            }
        }
        return $url;
    }
863068
public function pushUrl($url)
    {
        $urls = is_array($url) ? $url : func_get_args();

        return $this->request($urls, 'urls', 'CdnUrlPusher');
    }
1235776
public function url($url)
    {
        if (parse_url($url, PHP_URL_SCHEME) == '') {
            $url = wei()->request->getUrlFor($url);
        }

        $this->request['url'] = $url;

        return $this;
    }
502252
protected function parseUrl($url = "")
    {
        $parsed = ($url) ? parse_url($url) : parse_url($this->_env['REQUEST_URI']);
        
        if (preg_match('/[a-zA-Z0-9_]+\.php/i', $parsed['path'], $matches)) {
            $parsed['path'] = preg_replace("/$matches[0]/", '/', $parsed['path']);
        }
        
        return $parsed;
    }
1245361
public function buildUrl($url)
    {
        if (strncmp($url, '/', 1) === 0) {
            return $url;
        }
        $baseUrl = isset($this->grid->controllerUrl) ? $this->grid->controllerUrl : '';

        return $baseUrl ? Url::to($baseUrl . '/' . $url) : Url::to($url);
    }
548823
public static function url($url){

		$url = static::_nullValue($url);
		if(!$url){

			return $url;
		}

		$query = parse_url($url, PHP_URL_QUERY);
		if(!$query){

			return $url;
		}

		parse_str($query, $query_parts);

		// First urldecode to be sure that we do not re-encode the query parts.
		$query_parts = array_map('static::_nested_urldecode', $query_parts);

		// http_build_query will take care of the urlencode.
		return strtok($url, '?') . '?' . http_build_query($query_parts);
	}
1193931
private function buildUrl($url)
    {
        $url = $this->protocol . '://' . $url . '/';

        if ($this->date) {
            $url .= $this->date;
        } else {
            $url .= 'latest';
        }

        $url .= '?base=' . $this->base;

        if ($this->key) {
            $url .= '&access_key=' . $this->key;
        }

        if ($symbols = $this->symbols) {
            $url .= '&symbols=' . implode(',', $symbols);
        }

        return $url;
    }
1346114
public function url(string $url) : RequestBuilder
    {
        $this->url = $url;

        // Also store the query parameters if present
        $queryString = parse_url($this->url, PHP_URL_QUERY);
        parse_str($queryString, $query);
        if ($query) {
            $this->query = $query;
        }

        return $this;
    }
417617
public static function urlContains($url)
    {
        return new static(
            function (WebDriver $driver) use ($url) {
                return mb_strpos($driver->getCurrentURL(), $url) !== false;
            }
        );
    }
300209
public function setUrl($url)
    {
        if (strpos($url, '/') !== 0) {
            $url = '/' . $url;
        }
        $this->url = $url;
        return $this;
    }