* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Asset\Context; use Symfony\Component\HttpFoundation\RequestStack; /** * Uses a RequestStack to populate the context. * * @author Fabien Potencier */ class RequestStackContext implements ContextInterface { private $requestStack; private $basePath; private $secure; /** * @param RequestStack $requestStack * @param string $basePath * @param bool $secure */ public function __construct(RequestStack $requestStack, $basePath = '', $secure = false) { $this->requestStack = $requestStack; $this->basePath = $basePath; $this->secure = $secure; } /** * {@inheritdoc} */ public function getBasePath() { if (!$request = $this->requestStack->getMasterRequest()) { return $this->basePath; } return $request->getBasePath(); } /** * {@inheritdoc} */ public function isSecure() { if (!$request = $this->requestStack->getMasterRequest()) { return $this->secure; } return $request->isSecure(); } } __halt_compiler();----SIGNATURE:----M6l4zwgiALack6oufOKbX/hbUBrB35IAC2MukpSrzwEHDetXzvz7+OpBKl2JtZRhB8WC+QuamyLOmICRvmOPSDFI7eKBlhlgXLSleUd7yvd+tmkyrEAeHqhrMBKrrZHJjmXoFdk4lxGoU/326DjMiPiG3JaPgAOF47TuFBSLRG4S4SMG1H9luysjxVGc6mp/thpaA42HNJOgyL17NriaTM/dgfUL3ES20SKTxPj8jfyYJG4TRUTU7QdwKrwbPTrrrqWJxZe8w/FpxPBi4ccGBc89pdAsi2gJr8tjXPvygj9p4gJo9LduEdrkmJrAl5ebz/SR+Wz9UMRnKI4eT6GiT14FWLtqfWaufDV9zYKOLt9FPvDM+3lUsPA8BWVTLprjcFP4Lsp3XLmK8Qh33l8Nb3+WF/4Lzq62B/CCEFr8+W4GaIwQYN45eoY6Ei0F4TbCLv2DEIuSxB2+rF2KncvQomIPywMfOuWVmsfXIWwepeFxGESIsIC++98IeDod1oAYOV6OC5JIQ4F+mm8tNy0887VDXiD1sBoXnlyPSsNW717Wr+9swBgUExQfOY9LLWpnEJler1KJxVVY48A/UrsjtCvROkky8/0xjZM9l+YOZme1CTN5Sbtg8W0f4IjOE+mfUJRLNgA4cqYlShcdlAaY91s4heI3XQXPpiSw63qzd28=----ATTACHMENT:----Njg5ODAyODExOTY0Mzk5OCAyMzk4MTA2Njc0NTY5NDU1IDg3MTg5MDc5NTAxMjgzOTk=