Merge pull request #3028 from Nicofuma/ticket/13139

[ticket/13139] Update Twig to 1.18.0

* Nicofuma/ticket/13139:
  [ticket/13139] Fix tests
  [ticket/13139] Update Twig to 1.8.0
  [ticket/13139] Update Twig to 1.16.2
This commit is contained in:
Andreas Fischer 2015-02-03 15:08:36 +01:00
commit ceaba8aaf9
4 changed files with 23 additions and 18 deletions

View file

@ -36,7 +36,7 @@
"symfony/routing": "2.5.*", "symfony/routing": "2.5.*",
"symfony/twig-bridge": "2.5.*", "symfony/twig-bridge": "2.5.*",
"symfony/yaml": "2.5.*", "symfony/yaml": "2.5.*",
"twig/twig": "1.13.*" "twig/twig": "1.*"
}, },
"require-dev": { "require-dev": {
"fabpot/goutte": "1.0.*", "fabpot/goutte": "1.0.*",

21
phpBB/composer.lock generated
View file

@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
], ],
"hash": "2faf4ba24774c0d51cff4b78d4a81a68", "hash": "372e66644eb8d1504f88471de6d6dac6",
"packages": [ "packages": [
{ {
"name": "lusitanian/oauth", "name": "lusitanian/oauth",
@ -910,16 +910,16 @@
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v1.13.2", "version": "v1.18.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fabpot/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf",
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -928,7 +928,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.13-dev" "dev-master": "1.18-dev"
} }
}, },
"autoload": { "autoload": {
@ -951,6 +951,11 @@
"name": "Armin Ronacher", "name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com", "email": "armin.ronacher@active-4.com",
"role": "Project Founder" "role": "Project Founder"
},
{
"name": "Twig Team",
"homepage": "http://twig.sensiolabs.org/contributors",
"role": "Contributors"
} }
], ],
"description": "Twig, the flexible, fast, and secure template language for PHP", "description": "Twig, the flexible, fast, and secure template language for PHP",
@ -958,7 +963,7 @@
"keywords": [ "keywords": [
"templating" "templating"
], ],
"time": "2013-08-03 15:35:31" "time": "2015-01-25 17:32:08"
} }
], ],
"packages-dev": [ "packages-dev": [

View file

@ -152,6 +152,12 @@ class asset
*/ */
public function set_path($path, $urlencode = false) public function set_path($path, $urlencode = false)
{ {
// Since 1.7.0 Twig returns the real path of the file. We need it to be relative to the working directory.
$real_root_path = realpath('.') . DIRECTORY_SEPARATOR;
if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path) {
$path = str_replace('\\', '/', substr($path, strlen($real_root_path)));
}
if ($urlencode) if ($urlencode)
{ {
$paths = explode('/', $path); $paths = explode('/', $path);
@ -161,6 +167,7 @@ class asset
} }
$path = implode('/', $paths); $path = implode('/', $paths);
} }
$this->components['path'] = $path; $this->components['path'] = $path;
} }

View file

@ -83,13 +83,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
public function template_data() public function template_data()
{ {
$url_base = explode('/', dirname(__FILE__));
foreach ($url_base as &$dir)
{
$dir = rawurlencode($dir);
}
$url_base = implode('/', $url_base);
return array( return array(
/* /*
array( array(
@ -107,11 +100,11 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
), ),
array( array(
array('TEST' => 3), array('TEST' => 3),
'<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />', '<link href="tests/template/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
), ),
array( array(
array('TEST' => 4), array('TEST' => 4),
'<link href="' . $url_base . '/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />', '<link href="tests/template/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
), ),
); );
} }