* * 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\Context\NullContext; use Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface; /** * Basic package that adds a version to asset URLs. * * @author Kris Wallsmith * @author Fabien Potencier */ class Package implements PackageInterface { private $versionStrategy; private $context; public function __construct(VersionStrategyInterface $versionStrategy, ContextInterface $context = null) { $this->versionStrategy = $versionStrategy; $this->context = $context ?: new NullContext(); } /** * {@inheritdoc} */ public function getVersion($path) { return $this->versionStrategy->getVersion($path); } /** * {@inheritdoc} */ public function getUrl($path) { if ($this->isAbsoluteUrl($path)) { return $path; } return $this->versionStrategy->applyVersion($path); } /** * @return ContextInterface */ protected function getContext() { return $this->context; } /** * @return VersionStrategyInterface */ protected function getVersionStrategy() { return $this->versionStrategy; } protected function isAbsoluteUrl($url) { return false !== strpos($url, '://') || '//' === substr($url, 0, 2); } } __halt_compiler();----SIGNATURE:----d57ZUQDmfAWrgji7tkuZf2N3seo7QXqZ9WnIJ+UiGjvJ7rpW/HxQJzOWqkGY5rjH+31rZwsCV45GWrWGTzr2IodOAMoDMNZ1C+kz1jDtRrkL8z1I24eq21nlIWHpliehjwR+1lti+i1QecPX3GB+7oZrOTdTXuVv90JPfLutwUkhhqM+pLAxeE2TW5FvoHCjmkM5iWiyBTumY53XJbzZ0o9DHQMVEWEid8yeQEttl/Tu8/+Nsy8b2TT2kD8VsUxzvE9NGmvj2XT52T3/l3ezbDDB6mcC96EbWaAY7kP1BipsiJRS/LVTW6qLuu2xg/JMuLV7Pg7+Ds6nutDko1e7GSoSulVcRYrB2aibw6NKDV+KJu7ML25lgnkUz19ZKPRgueg4F3n8LoldN7c9Y1Anzq897Y2J3NR9Dyuum/2X5XT2VDPEk33A2uViOQcXZTQSjYfMTlJod2kJHYvMBEXk5oxn48NOearIr67gQ2HtSq1TJWQD0EfVZswGqcucfHk97+MBjBXttmXaMqMeGqvnZS3N5Yu17qwb+ZpxgMQF9WMUPTp0b9q0WmBMrjkgLeXLgpsWaAMB/omHrybzK7GKrNX7QwQc4hTjfK86D0W4fYrhHUdlbsnwS3zRhXd1Ezx1rODSBU5dIPNiRUhTeFqyKyPx1pucdUKAdOSpca1qRaM=----ATTACHMENT:----MzYwMzM4NDg4MTY0ODc2NCA4ODIwNzg2NjA5MDcyODEwIDY5NDc5NTE0NzMzMjY5OTU=