Get a secure URL to a controller action.

@param string             $url
@param \DateTime|int|null $expiration Defaults to the config value

@return string
342803
public function sign($url, $expiration = null)
    {
        $expiration = $expiration ? $expiration : config('signed-url.default_expiration_time_in_days');

        return parent::sign($url, $expiration);
    }
548769
public function getRackspaceTemporaryUrl($adapter, $path, $expiration, $options)
    {
        return $adapter->getContainer()->getObject($path)->getTemporaryUrl(
            Carbon::now()->diffInSeconds($expiration),
            $options['method'] ?? 'GET',
            $options['forcePublicUrl'] ?? true
        );
    }
80070
public function url($url = null)
    {
        if ($url === null) {
            return $this->_url;
        }
        $this->_url = $url;

        return $this;
    }
1298867
public function url($url = null)
    {
        if (!is_null($url) && true !== $url) {
            $this->url = $url;
            return $this;
        } elseif (!$this->url) {
            if ($this->isCli()) {
                $this->url = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
            } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
                $this->url = $_SERVER['HTTP_X_REWRITE_URL'];
            } elseif (isset($_SERVER['REQUEST_URI'])) {
                $this->url = $_SERVER['REQUEST_URI'];
            } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
                $this->url = $_SERVER['ORIG_PATH_INFO'] . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
            } else {
                $this->url = '';
            }
        }
        return true === $url ? $this->domain() . $this->url : $this->url;
    }
965629
public function setExpire(\DateTime $expire = null)
    {
        $this->_expire = ($expire) ? $expire : null;

        return $this;
    }
1345170
public function expires($expires = null)
    {
        if (func_num_args() === 0) {
            return (integer) $this->_data['expires'];
        }
        if ($expires === null) {
            return $this->_data['expires'] = null;
        }
        if (static::isValidTimeStamp($expires)) {
            return $this->_data['expires'] = $expires;
        }

        $this->_data['expires'] = strtotime($expires);
        return $this->_data['expires'] = (integer) $this->_data['expires'];
    }
965521
public function Link($action = null)
    {
        $link = Controller::join_links(
            AdminRootController::admin_url(),
            $this->config()->get('url_segment'), // in case we want to change the segment
            '/', // trailing slash needed if $action is null!
            "$action"
        );
        $this->extend('updateLink', $link);
        return $link;
    }
475216
public function generateUrl($url)
    {
        $extern = false;
        if ((0 === strrpos($url, 'http://'))
            || (0 === strrpos($url, 'https://'))) {
            $extern = true;
        }

        $http = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';

        if (!$extern) {
            return ($this->getRoot() == '/')
                ? (($this->getRoot() == $url) ? '' : $url) : $http.$_SERVER['SERVER_NAME'].$this->getRoot().$url;
        } else {
            return $url;
        }
    }
1208438
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
    {
        return $this
            ->filesystemManager
            ->disk($this->media->disk)
            ->temporaryUrl($this->getPath(), $expiration, $options);
    }
168912
public function getSecureUrl()
    {
        $defaultUrl = $this->getTestMode() === false
            ? $this->prodSecureHost
            : $this->testSecureHost;
        return $this->parameters->get('secureUrl', $defaultUrl);
    }
449028
public function setURL($url = '')
    {
        try {
            if (mb_strlen($url) > 0) {
                if (substr($url, 0, 8) == 'https://') {
                    $this->isSSL = TRUE;
                    $this->debug->debug(__FUNCTION__, 'Set SSL: ' . $this->isSSL);
                } elseif (substr($url, 0, 7) == 'http://') {
                    $this->isSSL = TRUE;
                    $this->debug->debug(__FUNCTION__, 'Set SSL: ' . $this->isSSL);
                }
            }
            $this->url = $url;
        }
        catch (Exception $e) {
            $this->url = NULL;
            $message   = "Error: " . __CLASS__ . ": Invalid protocol specified. URL must start with http:// or https:// - " . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
        $this->debug->debug(__FUNCTION__, 'Endpoint URL to Request: ', $this->url);

        return $this;
    }
581289
public function Link($action=null) {
        $link = Controller::join_links(
            $this->stat('url_base', true),
            $this->stat('url_segment', true), // in case we want to change the segment
            '/', // trailing slash needed if $action is null!
            "$action"
        );
        
        $this->extend('updateLink', $link);
        return $link;
    }
1082149
public static function segmentUrl($url = null)
    {
        if (!is_null($url) && !empty($url)) {
            $url = $url;
        } else {
            $url = self::requestInstance()->getRequestUrl();
        }

        return explode('/', trim($url, '/'));
    }
1063192
function swift_get_secure_attachment_url( $post_id, $expires = 900, $size = null ) {
		return $this->swift_get_attachment_url( $post_id, $expires, $size = null );
	}
669431
public function getExtReference($url)
    {
        $path = parse_url($url, PHP_URL_PATH);
        if ($path === false) {
            throw new \InvalidArgumentException(sprintf('URL %s', $url));
        }

        $id = null;
        $collection = null;

        if (!isset($this->resolvingCache[$path])) {
            foreach ($this->router->getRouteCollection()->all() as $route) {
                list($collection, $id) = $this->getDataFromRoute($route, $path);
                if ($collection !== null && $id !== null) {
                    $this->resolvingCache[$path] = $route;
                    return ExtReference::create($collection, $id);
                }
            }
        } else {
            list($collection, $id) = $this->getDataFromRoute($this->resolvingCache[$path], $path);
            return ExtReference::create($collection, $id);
        }

        throw new \InvalidArgumentException(sprintf('Could not read URL %s', $url));
    }
8342
public function temporaryUrl($path, $expiration, array $options = [])
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter = $adapter->getAdapter();
        }

        if (method_exists($adapter, 'getTemporaryUrl')) {
            return $adapter->getTemporaryUrl($path, $expiration, $options);
        } elseif ($adapter instanceof AwsS3Adapter) {
            return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
        } else {
            throw new RuntimeException('This driver does not support creating temporary URLs.');
        }
    }
304042
private function get($url)
    {
        try {
            $result = $this->fileHelper->getContents(
                $url,
                $this->config->get('concrete.marektplace.request_timeout'));
        } catch (TimeoutException $e) {
            // Catch a timeout
            $this->connectionError = self::E_CONNECTION_TIMEOUT;

            return null;
        } catch (Exception $e) {
            $this->connectionError = self::E_GENERAL_CONNECTION_ERROR;

            return null;
        }

        return $result ?: null;
    }