Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.217.117
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
v3.cesa.co.za /
vendor /
symfony /
asset /
Delete
Unzip
Name
Size
Permission
Date
Action
Context
[ DIR ]
drwxrwxr-x
2026-08-17 03:12
Exception
[ DIR ]
drwxrwxr-x
2026-08-17 03:12
VersionStrategy
[ DIR ]
drwxrwxr-x
2026-08-17 03:12
.htaccess
237
B
-r-xr-xr-x
2026-08-17 03:12
CHANGELOG.md
830
B
-rwxrwxr-x
2026-02-07 09:15
LICENSE
1.04
KB
-rwxrwxr-x
2026-02-07 09:15
Package.php
1.62
KB
-rwxrwxr-x
2026-02-07 09:15
PackageInterface.php
630
B
-rwxrwxr-x
2026-02-07 09:15
Packages.php
2.93
KB
-rwxrwxr-x
2026-02-07 09:15
PathPackage.php
1.88
KB
-rwxrwxr-x
2026-02-07 09:15
README.md
552
B
-rwxrwxr-x
2026-02-07 09:15
UrlPackage.php
3.68
KB
-rwxrwxr-x
2026-02-07 09:15
composer.json
987
B
-rwxrwxr-x
2026-02-07 09:15
Save
Rename
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Asset; use Symfony\Component\Asset\Context\ContextInterface; use Symfony\Component\Asset\Exception\InvalidArgumentException; use Symfony\Component\Asset\Exception\LogicException; use Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface; /** * Package that adds a base URL to asset URLs in addition to a version. * * The package allows to use more than one base URLs in which case * it randomly chooses one for each asset; it also guarantees that * any given path will always use the same base URL to be nice with * HTTP caching mechanisms. * * When the request context is available, this package can choose the * best base URL to use based on the current request scheme: * * * For HTTP request, it chooses between all base URLs; * * For HTTPs requests, it chooses between HTTPs base URLs and relative protocol URLs * or falls back to any base URL if no secure ones are available. * * @author Fabien Potencier <fabien@symfony.com> */ class UrlPackage extends Package { private array $baseUrls = []; private ?self $sslPackage = null; /** * @param string|string[] $baseUrls Base asset URLs */ public function __construct(string|array $baseUrls, VersionStrategyInterface $versionStrategy, ?ContextInterface $context = null) { parent::__construct($versionStrategy, $context); if (!\is_array($baseUrls)) { $baseUrls = (array) $baseUrls; } if (!$baseUrls) { throw new LogicException('You must provide at least one base URL.'); } foreach ($baseUrls as $baseUrl) { $this->baseUrls[] = rtrim($baseUrl, '/'); } $sslUrls = $this->getSslUrls($baseUrls); if ($sslUrls && $baseUrls !== $sslUrls) { $this->sslPackage = new self($sslUrls, $versionStrategy); } } public function getUrl(string $path): string { if ($this->isAbsoluteUrl($path)) { return $path; } if (null !== $this->sslPackage && $this->getContext()->isSecure()) { return $this->sslPackage->getUrl($path); } $url = $this->getVersionStrategy()->applyVersion($path); if ($this->isAbsoluteUrl($url)) { return $url; } if ($url && '/' != $url[0]) { $url = '/'.$url; } return $this->getBaseUrl($path).$url; } /** * Returns the base URL for a path. */ public function getBaseUrl(string $path): string { if (1 === \count($this->baseUrls)) { return $this->baseUrls[0]; } return $this->baseUrls[$this->chooseBaseUrl($path)]; } /** * Determines which base URL to use for the given path. * * Override this method to change the default distribution strategy. * This method should always return the same base URL index for a given path. */ protected function chooseBaseUrl(string $path): int { return abs(crc32($path)) % \count($this->baseUrls); } private function getSslUrls(array $urls): array { $sslUrls = []; foreach ($urls as $url) { if (str_starts_with($url, 'https://') || str_starts_with($url, '//') || '' === $url) { $sslUrls[] = $url; } elseif (!parse_url($url, \PHP_URL_SCHEME)) { throw new InvalidArgumentException(\sprintf('"%s" is not a valid URL.', $url)); } } return $sslUrls; } }