Lines Matching full:url

28  * Class Url
30 * There is no URL class in php
32 * https://www.php.net/manual/en/ref.url.php
34 class Url extends PathAbs class
46 * In HTML, Browser will do the translation for you if you give an URL
49 * This URL encoding is mandatory for the {@link ml} function
67 const CANONICAL = "url";
69 * The schemes that are relative (normallu only URL ? ie http, https)
81 * @var string - original url string
83 private $url; variable in ComboStrap\\Web\\Url
86 * @var bool - does the URL rewrite occurs
96 public function __construct(string $url = null) argument
99 $this->url = $url;
101 if ($this->url !== null) {
106 * Note: Url validation is hard with regexp
109 … does not pass return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
110 * of preg_match('/^https?:\/\//',$url) ? from redirect plugin
115 $urlComponents = parse_url($url);
117 throw new ExceptionBadSyntax("The url ($url) is not valid");
133 …throw new ExceptionBadArgument("The port ($port) in ($url) is not an integer. Error: {$e->getMessa…
147 * * relative url
148 * * first party url
152 // relative url
155 // first party url
168 * A text to an encoded url
181 public static function createEmpty(): Url
183 return new Url();
189 public static function createFromGetOrPostGlobalVariable(): Url
193 * Url::createFromString($_SERVER['REQUEST_URI']);
197 * * $_GET: the URL parameters (aka. query string)
204 $url = Url::createEmpty();
211 …rning("The key ($key) is an array of an array and was not taken into account in the request url.");
218 $url->addQueryParameter($key, $subkey);
221 $url->addQueryParameter($key, $subval);
226 * Bad URL format test
227 * In the `src` attribute of `script`, the url should not be encoded
228 * with {@link Url::AMPERSAND_URL_ENCODED_FOR_HTML}
237 …$message = "The url in src has a bad encoding (the attribute ($key) has a amp; prefix. Infinite ca…
241 LogUtility::warning($message, "url");
251 $url->addQueryParameter($key, $value);
254 return $url;
258 * Utility class to transform windows separator to url path separator
303 public static function createFromString(string $url): Url argument
305 return new Url($url);
325 public function setPath(string $path): Url
357 public function addQueryParameter(string $key, ?string $value = null): Url
396 * @return Url - add the scheme and the host based on the request if not present
398 public function toAbsoluteUrl(): Url
402 * If not, this is a local url (ie #id)
431 …* @return string - utility function that call {@link Url::toAbsoluteUrl()} absolute and {@link Url
495 public function equals(Url $expectedUrl)
537 throw new ExceptionNotEquals("The expected url does not have the $key property");
545 throw new ExceptionNotEquals("The expected URL has an extra property ($key=$value)");
567 public function setScheme(string $scheme): Url
573 public function setHost($host): Url
584 public function setFragment(string $fragment): Url
593 public function getQueryString($ampersand = Url::AMPERSAND_CHARACTER): string
615 … * The url may also be used elsewhere where & is unknown or not wanted such as css ...
617 * In test, we may ask the url HTML encoded
678 …LogUtility::internalError("Build error from a Media Fetch URL. We were unable to get the mime. Err…
701 function getParent(): Url
721 function toAbsolutePath(): Url
726 function resolve(string $name): Url
730 if ($this->path[strlen($path) - 1] === URL::PATH_SEP) {
733 $this->path .= URL::PATH_SEP . $name;
747 public function toString(string $ampersand = Url::AMPERSAND_CHARACTER): string
807 * Url Rewrite
876 * @return Url
878 public function addQueryParameterIfNotActualSameValue(string $key, string $value): Url
893 function getUrl(): Url
900 return $this->toString(Url::AMPERSAND_URL_ENCODED_FOR_HTML);
925 * @return Url
927 public function setQueryParameter(string $key, string $value): Url
940 * @return string - An url in the DOM use the ampersand character
956 * @return bool - if the url points to the same website than the host
961 // We set the path, otherwise it's seen as a local url
962 $localHost = Url::createEmpty()->setPath("/")->toAbsoluteUrl()->getHost();
965 // no host meaning that the url is relative and then local
971 * In a url, in a case, the path should be absolute
992 return new Url($uri);
995 public function deleteQueryProperties(): Url
1001 public function withoutRewrite(): Url
1008 * Dokuwiki utility to check if the URL is local