Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

AbsolutePrefix.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\IO\UrlDecorator;
8
9 use eZ\Publish\Core\IO\UrlDecorator;
10
14 class AbsolutePrefix extends Prefix implements UrlDecorator
15 {
21 public function setPrefix($prefix)
22 {
23 if ($prefix != '') {
24 $urlParts = parse_url($prefix);
25
26 // Since PHP 5.4.7 parse_url will return host when url scheme is ommited.
27 // This allows urls like //static.example.com to be used
28 if (isset($urlParts['scheme']) || isset($urlParts['host'])) {
29 $prefix = rtrim($prefix, '/') . '/';
30 } else {
31 $prefix = '/' . trim($prefix, '/') . '/';
32 }
33 }
34
35 $this->prefix = $prefix;
36 }
37 }
eZ\Publish\Core\IO\UrlDecorator\AbsolutePrefix
Prefixes the URI with a string, and makes it absolute.
Definition: AbsolutePrefix.php:15
eZ\Publish\Core\IO\UrlDecorator\AbsolutePrefix\setPrefix
setPrefix($prefix)
Makes the prefix absolute.
Definition: AbsolutePrefix.php:21
eZ\Publish\Core\IO\UrlDecorator\Prefix
Prefixes the URI with a string.
Definition: Prefix.php:16
eZ\Publish\Core\IO\UrlDecorator\Prefix\$prefix
$prefix
Definition: Prefix.php:22
eZ\Publish\Core\IO\UrlDecorator
Modifies, both way, and URI.
Definition: UrlDecorator.php:13
eZ\Publish\Core\IO\UrlDecorator
Definition: AbsolutePrefix.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.