From: Raphaƫl Gertz Date: Sun, 10 Sep 2017 17:49:32 +0000 (+0200) Subject: Cleanup and add features to implement X-Git-Tag: 0.0.1~18 X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/f25c5f291854b10f8786aca9c2e7c3df46b34261?hp=2332b61314761398d9c2d368aa0ce92ca0f397cc Cleanup and add features to implement --- diff --git a/Twig/PackTokenParser.php b/Twig/PackTokenParser.php index 8218ee1..5a21f7e 100644 --- a/Twig/PackTokenParser.php +++ b/Twig/PackTokenParser.php @@ -75,15 +75,18 @@ class PackTokenParser extends \Twig_TokenParser { //Replace star with sha1 if (($pos = strpos($output, '*')) !== false) { - #XXX: assetic code : substr(sha1(serialize($inputs).serialize($filters).serialize($options)), 0, 7) + #XXX: assetic code: substr(sha1(serialize($inputs).serialize($filters).serialize($options)), 0, 7) $output = substr($output, 0, $pos).sha1(serialize($inputs).serialize($filters)).substr($output, $pos + 1); } //Deal with inputs + //TODO: support @jquery ? or is it supported already with fileLocator->locate ? for($k = 0; $k < count($inputs); $k++) { //Deal with generic url if (strpos($inputs[$k], '//') === 0) { //TODO: set this as a parameter (scheme) + #if ($containerInterface->hasParameter('rapsys_pack.default_scheme')) { + # if ($parameters = $containerInterface->getParameter('rapsys_pack.default_scheme')) { $inputs[$k] = 'https:'.$inputs[$k]; //Deal with non url path } elseif (strpos($inputs[$k], '://') === false) { @@ -123,6 +126,9 @@ class PackTokenParser extends \Twig_TokenParser { $ctx = stream_context_create( array( 'http' => array( + //TODO: set this as a parameter (scheme) + #if ($containerInterface->hasParameter('rapsys_pack.input_timeout')) { + # if ($parameters = $containerInterface->getParameter('rapsys_pack.input_timeout')) { 'timeout' => 5 ) )