* * 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:----pSQrL8FFoOey2spHeoKz+5XuN0P+T3PjOgIqqzruGIR+tOgk7yLPr7JaFOayUl2z74w9P44YJWpet4l/eXNtshBBo9ePrmJQ2OscAdrw4d4ZK+xWtVinWPJQ1/Ah73mzXt3aBnkAAxMQ7bhLEf0+O3jouyRLmwsJdPEk1I5TlPM7FWvH2QMvLW4nDHOhgFfjAq/k6g78XdU+bmmScxJ0oRutQhFu345PsJdaaxzTsltOlZOU/J6BV5RcagBrx8kW0dAVMa4+z6GO3VtRqj4AFbhBUJH/aEphuFofuA0HpUYjqxargcBC91SP88HTEMo60iFyqglwyYvYyaBw2EWSXE9tmpqo2RIJ5ZQmqZdpZgmNGZjM+8wP7t0rexPKXwIrGOQRuxaVngGTPjsS52NLioQrHo9WhwGuS/8YChYKty7yoVbq67Sl7dDWxt927eeNnBXbnMfWll4lL17lhiZYvIEI+3KFJGpyy8bpw7rEax1qTqP/27lUMukzLd43l8v96Shq+ACj/wHSae8dQ5ZeFf1VKFPROVScigxnuwPiHSLV6TsuoasoQ69M1kfqsSsYTDPB+6WUjHUyvG2F3/sPaNsyhuUyAEEuiJwYuG4f91EQR+Hnq6LNUgGKPGYULsALmdhA+JKJRHW7kWpC5EzoFbumLMvNLg2Tna6Agwak5Ns=----ATTACHMENT:----MTA0NTU2NzY5ODM5OTU4OSAyMzUyODQ3Mzg4NzgwOTUzIDg4MjE4NzQwOTk4NDQw