From f7f9f993bce8d0ec776f9eb7ddf0c982c169f0cc Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Dec 2017 16:29:27 +0100 Subject: [PATCH] changed zip script --- composer.lock | 10 +- system/vendor/composer/installed.json | 102 +++++++++--------- system/vendor/symfony/yaml/Inline.php | 22 +++- .../yaml/Tests/Fixtures/sfMergeKey.yml | 8 +- .../vendor/symfony/yaml/Tests/ParserTest.php | 12 +++ 5 files changed, 94 insertions(+), 60 deletions(-) diff --git a/composer.lock b/composer.lock index de86fba..66589e5 100644 --- a/composer.lock +++ b/composer.lock @@ -543,16 +543,16 @@ }, { "name": "symfony/yaml", - "version": "v2.8.31", + "version": "v2.8.32", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d819bf267e901727141fe828ae888486fd21236e" + "reference": "968ef42161e4bc04200119da473077f9e7015128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d819bf267e901727141fe828ae888486fd21236e", - "reference": "d819bf267e901727141fe828ae888486fd21236e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128", + "reference": "968ef42161e4bc04200119da473077f9e7015128", "shasum": "" }, "require": { @@ -588,7 +588,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:25:56+00:00" + "time": "2017-11-29T09:33:18+00:00" }, { "name": "twig/twig", diff --git a/system/vendor/composer/installed.json b/system/vendor/composer/installed.json index 4deef4a..a270811 100644 --- a/system/vendor/composer/installed.json +++ b/system/vendor/composer/installed.json @@ -576,57 +576,6 @@ "router" ] }, - { - "name": "symfony/yaml", - "version": "v2.8.31", - "version_normalized": "2.8.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "d819bf267e901727141fe828ae888486fd21236e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d819bf267e901727141fe828ae888486fd21236e", - "reference": "d819bf267e901727141fe828ae888486fd21236e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "time": "2017-11-05T15:25:56+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" - }, { "name": "erusev/parsedown", "version": "1.6.4", @@ -673,5 +622,56 @@ "markdown", "parser" ] + }, + { + "name": "symfony/yaml", + "version": "v2.8.32", + "version_normalized": "2.8.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "968ef42161e4bc04200119da473077f9e7015128" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128", + "reference": "968ef42161e4bc04200119da473077f9e7015128", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "time": "2017-11-29T09:33:18+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com" } ] diff --git a/system/vendor/symfony/yaml/Inline.php b/system/vendor/symfony/yaml/Inline.php index a10c0e4..a4367fb 100644 --- a/system/vendor/symfony/yaml/Inline.php +++ b/system/vendor/symfony/yaml/Inline.php @@ -375,6 +375,7 @@ class Inline $output = array(); $len = strlen($mapping); ++$i; + $allowOverwrite = false; // {foo: bar, bar:foo, ...} while ($i < $len) { @@ -394,6 +395,10 @@ class Inline // key $key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false); + if ('<<' === $key) { + $allowOverwrite = true; + } + // value $done = false; @@ -405,7 +410,12 @@ class Inline // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + foreach ($value as $parsedValue) { + $output += $parsedValue; + } + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; @@ -416,7 +426,10 @@ class Inline // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; @@ -429,7 +442,10 @@ class Inline // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; diff --git a/system/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml b/system/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml index 59f6125..499446c 100644 --- a/system/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml +++ b/system/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml @@ -22,6 +22,7 @@ yaml: | foo: bar foo: ignore bar: foo + bar_inline: {a: before, d: other, <<: *foo, b: new, x: Oren, c: { foo: bar, foo: ignore, bar: foo}} duplicate: foo: bar foo: ignore @@ -46,15 +47,20 @@ yaml: | p: 12345 z: <<: *nestedref + head_inline: &head_inline { <<: [ *foo , *dong , *foo2 ] } + recursive_inline: { <<: *head_inline, c: { <<: *foo2 } } php: | array( 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull'), 'bar' => array('a' => 'before', 'd' => 'other', 'e' => null, 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'), + 'bar_inline' => array('a' => 'before', 'd' => 'other', 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'e' => 'notnull', 'x' => 'Oren'), 'duplicate' => array('foo' => 'bar'), 'foo2' => array('a' => 'Ballmer'), 'ding' => array('fi', 'fei', 'fo', 'fam'), 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'), 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), 'taz' => array('a' => 'Steve', 'w' => array('p' => 1234)), - 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345)) + 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345)), + 'head_inline' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), + 'recursive_inline' => array('a' => 'Steve', 'b' => 'Clark', 'c' => array('a' => 'Ballmer'), 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), ) diff --git a/system/vendor/symfony/yaml/Tests/ParserTest.php b/system/vendor/symfony/yaml/Tests/ParserTest.php index 9cafc92..c990423 100644 --- a/system/vendor/symfony/yaml/Tests/ParserTest.php +++ b/system/vendor/symfony/yaml/Tests/ParserTest.php @@ -1280,6 +1280,18 @@ YAML; $this->assertSame($expected, $this->parser->parse($yaml)); } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Reference "foo" does not exist + */ + public function testEvalRefException() + { + $yaml = <<parser->parse($yaml); + } } class B