/var/www/vhosts/nabawater/vendor/codeception/base/src/Codeception/Util
NameSizeModeActions
Shared/-0775rm
ActionSequence.php35250664editdlrm
Annotation.php44040664editdlrm
ArrayContainsComparator.php37640664editdlrm
Autoload.php51230664editdlrm
Debug.php16030664editdlrm
FileSystem.php23630664editdlrm
Fixtures.php8120664editdlrm
HttpCode.php55140664editdlrm
JsonArray.php36330664editdlrm
JsonType.php85480664editdlrm
Locator.php102910664editdlrm
Maybe.php62140664editdlrm
PathResolver.php52620664editdlrm
PropertyAccess.php4290664editdlrm
README.md2550664editdlrm
ReflectionHelper.php14860664editdlrm
Soap.php3660664editdlrm
sq.php8200664editdlrm
Stub.php10300664editdlrm
Template.php19640664editdlrm
Uri.php36280664editdlrm
Xml.php14020664editdlrm
XmlBuilder.php39120664editdlrm
XmlStructure.php23940664editdlrm
Edit: /var/www/vhosts/nabawater/vendor/codeception/base/src/Codeception/Util/Uri.php (3628B)
withHost($parts['host']); $base = $base->withPath(''); $base = $base->withQuery(''); $base = $base->withFragment(''); } if (isset($parts['path'])) { $path = $parts['path']; $basePath = $base->getPath(); if ((strpos($path, '/') !== 0) && !empty($path)) { if ($basePath) { // if it ends with a slash, relative paths are below it if (preg_match('~/$~', $basePath)) { $path = $basePath . $path; } else { // remove double slashes $dir = rtrim(dirname($basePath), '\\/'); $path = $dir . '/' . $path; } } else { $path = '/' . ltrim($path, '/'); } } $base = $base->withPath($path); $base = $base->withQuery(''); $base = $base->withFragment(''); } if (isset($parts['query'])) { $base = $base->withQuery($parts['query']); $base = $base->withFragment(''); } if (isset($parts['fragment'])) { $base = $base->withFragment($parts['fragment']); } return (string) $base; } /** * Retrieve /path?query#fragment part of URL * @param $url * @return string */ public static function retrieveUri($url) { $uri = new Psr7Uri($url); return (string)(new Psr7Uri()) ->withPath($uri->getPath()) ->withQuery($uri->getQuery()) ->withFragment($uri->getFragment()); } public static function retrieveHost($url) { $urlParts = parse_url($url); if (!isset($urlParts['host']) or !isset($urlParts['scheme'])) { throw new \InvalidArgumentException("Wrong URL passes, host and scheme not set"); } $host = $urlParts['scheme'] . '://' . $urlParts['host']; if (isset($urlParts['port'])) { $host .= ':' . $urlParts['port']; } return $host; } public static function appendPath($url, $path) { $uri = new Psr7Uri($url); $cutUrl = (string)$uri->withQuery('')->withFragment(''); if ($path === '' || $path[0] === '#') { return $cutUrl . $path; } return rtrim($cutUrl, '/') . '/' . ltrim($path, '/'); } }