From c303c6354bdffbe6c219323f3bac8742a96da417 Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Fri, 7 Aug 2015 20:07:36 +0100 Subject: [PATCH] Update YAML component, load via composer --- _config/Oembed.yml | 16 ++++++++-------- composer.json | 3 ++- core/manifest/ConfigManifest.php | 8 +++----- i18n/i18nTextCollector.php | 15 ++++++--------- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/_config/Oembed.yml b/_config/Oembed.yml index 02be4c601..f1f90c644 100644 --- a/_config/Oembed.yml +++ b/_config/Oembed.yml @@ -3,16 +3,16 @@ name: Oembed Oembed: providers: 'http://*.youtube.com/watch*': - http: 'http://www.youtube.com/oembed/', + http: 'http://www.youtube.com/oembed/' https: 'https://www.youtube.com/oembed/?scheme=https' 'https://*.youtube.com/watch*': - http: 'http://www.youtube.com/oembed/', + http: 'http://www.youtube.com/oembed/' https: 'https://www.youtube.com/oembed/?scheme=https' 'http://*.youtu.be/*': - http: 'http://www.youtube.com/oembed/', + http: 'http://www.youtube.com/oembed/' https: 'https://www.youtube.com/oembed/?scheme=https' 'https://youtu.be/*': - http: 'http://www.youtube.com/oembed/', + http: 'http://www.youtube.com/oembed/' https: 'https://www.youtube.com/oembed/?scheme=https' 'http://*.flickr.com/*': 'http://www.flickr.com/services/oembed/' @@ -23,16 +23,16 @@ Oembed: 'http://*.hulu.com/watch/*': 'http://www.hulu.com/api/oembed.json' 'http://*.vimeo.com/*': - http: 'http://www.vimeo.com/api/oembed.json', + http: 'http://www.vimeo.com/api/oembed.json' https: 'https://www.vimeo.com/api/oembed.json' 'https://*.vimeo.com/*': - http: 'http://www.vimeo.com/api/oembed.json', + http: 'http://www.vimeo.com/api/oembed.json' https: 'https://www.vimeo.com/api/oembed.json' 'http://twitter.com/*': - http: 'https://api.twitter.com/1/statuses/oembed.json', + http: 'https://api.twitter.com/1/statuses/oembed.json' https: 'https://api.twitter.com/1/statuses/oembed.json' 'https://twitter.com/*': - http: 'https://api.twitter.com/1/statuses/oembed.json', + http: 'https://api.twitter.com/1/statuses/oembed.json' https: 'https://api.twitter.com/1/statuses/oembed.json' autodiscover: true diff --git a/composer.json b/composer.json index 6d4acb8e5..e590f59b5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "php": ">=5.4.0", "composer/installers": "~1.0", "monolog/monolog": "~1.11", - "league/flysystem": "~1.0.12" + "league/flysystem": "~1.0.12", + "symfony/yaml": "~2.7" }, "require-dev": { "phpunit/PHPUnit": "~3.7" diff --git a/core/manifest/ConfigManifest.php b/core/manifest/ConfigManifest.php index 22e6dd51e..e1a7bfadb 100644 --- a/core/manifest/ConfigManifest.php +++ b/core/manifest/ConfigManifest.php @@ -1,5 +1,6 @@ addModule(dirname(dirname($pathname))); - - // Use the Zend copy of this script to prevent class conflicts when RailsYaml is included - require_once 'thirdparty/zend_translate_railsyaml/library/Translate/Adapter/thirdparty/sfYaml/lib/' - . 'sfYamlParser.php'; - $parser = new sfYamlParser(); + + $parser = new Parser(); // The base header $base = array( diff --git a/i18n/i18nTextCollector.php b/i18n/i18nTextCollector.php index faa8a0231..10f9bb69d 100644 --- a/i18n/i18nTextCollector.php +++ b/i18n/i18nTextCollector.php @@ -1,4 +1,7 @@ $spec) { @@ -793,12 +792,10 @@ class i18nTextCollector_Writer_RailsYaml implements i18nTextCollector_Writer { } // Write YAML - $oldVersion = sfYaml::getSpecVersion(); - sfYaml::setSpecVersion('1.1'); - $yamlHandler = new sfYaml(); + $dumper = new Dumper(); + $dumper->setIndentation(2); // TODO Dumper can't handle YAML comments, so the context information is currently discarded - $result = $yamlHandler->dump(array($locale => $entitiesNested), 99); - sfYaml::setSpecVersion($oldVersion); + $result = $dumper->dump(array($locale => $entitiesNested), 99); return $result; } }