Changeset 1000678
- Timestamp:
- 10/02/2014 02:47:45 PM (12 years ago)
- Location:
- mgrt/trunk
- Files:
-
- 27 edited
-
LICENSE (modified) (1 diff)
-
Mgrt/Wordpress/Manager/SyncManager.php (modified) (2 diffs)
-
Mgrt/Wordpress/Manager/ViewManager.php (modified) (4 diffs)
-
Mgrt/Wordpress/Shortcode/NewsletterShortcode.php (modified) (1 diff)
-
Mgrt/Wordpress/Sync/ExportSyncProcessor.php (modified) (5 diffs)
-
Mgrt/Wordpress/Widget/NewsletterWidget.php (modified) (1 diff)
-
mgrt.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (8 diffs)
-
vendor/mgrt/mgrt-php/README.md (modified) (2 diffs)
-
vendor/mgrt/mgrt-php/src/Mgrt/Model/Contact.php (modified) (2 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php (modified) (6 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php (modified) (2 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php (modified) (8 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mgrt/trunk/LICENSE
r986149 r1000678 1 Copyright (c) 2011-2014 Mgrt <contact@mgrt. net>1 Copyright (c) 2011-2014 Mgrt <contact@mgrt.com> 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining a copy of -
mgrt/trunk/Mgrt/Wordpress/Manager/SyncManager.php
r986149 r1000678 289 289 ); 290 290 $opts = array(); 291 291 292 if ($list_id != -1) { 292 $opts[] = (new MailingList())->setId(intval($list_id)); 293 $ml = new MailingList(); 294 $ml->setId(intval($list_id)); 295 $opts[] = $ml; 293 296 } 294 297 $opts[] = array( … … 366 369 $this->import_sync = true; 367 370 if (isset($_GET['webhook']) && $_SERVER['REQUEST_METHOD'] == 'POST') { 368 $call = (new WebhookCallInput())369 ->setSecretKey($this->bootstrap->getDataManager()->getOption('webhook_secret_key', MGRT__OPTION_KEY.'-webhook'))370 ->fromInputs();371 $call = new WebhookCallInput(); 372 $call->setSecretKey($this->bootstrap->getDataManager()->getOption('webhook_secret_key', MGRT__OPTION_KEY.'-webhook')); 373 $call->fromInputs(); 371 374 372 375 if ($call === false) { -
mgrt/trunk/Mgrt/Wordpress/Manager/ViewManager.php
r988019 r1000678 38 38 { 39 39 if (is_string($views)) { 40 $views = [$views];40 $views = array($views); 41 41 } 42 42 … … 88 88 { 89 89 if (is_string($views)) { 90 $views = [$views];90 $views = array($views); 91 91 } 92 92 … … 105 105 $object = new $class($this->bootstrap); 106 106 107 if (!is_subclass_of($object, 'Mgrt\Wordpress\AbstractView', false)) { 108 return; 109 } 107 108 // if (!is_subclass_of($object, 'Mgrt\Wordpress\AbstractView', false)) { 109 // return; 110 // } 110 111 111 112 $this->loaded[$view] = $object; … … 191 192 } 192 193 193 $args = ['page' => $page];194 $args = array('page' => $page); 194 195 195 196 if (!empty($action)) { -
mgrt/trunk/Mgrt/Wordpress/Shortcode/NewsletterShortcode.php
r986149 r1000678 131 131 $mailingLists = array(); 132 132 foreach ($targets as $targetId) { 133 $mailingLists[] = (new MailingList())->setId($targetId); 133 $ml = new MailingList(); 134 $ml->setId($targetId); 135 $mailingLists[] = $ml; 134 136 } 135 137 136 138 $customFields = array(); 137 139 foreach ($fields as $fieldId => $fieldValue) { 138 $customFields[] = (new CustomField())->setId($fieldId)->setValue($fieldValue); 140 $cf = new CustomField(); 141 $cf 142 ->setId($fieldId) 143 ->setValue($fieldValue); 144 $customFields[] = $cf; 139 145 } 140 146 -
mgrt/trunk/Mgrt/Wordpress/Sync/ExportSyncProcessor.php
r988019 r1000678 54 54 $mailingLists = array(); 55 55 foreach ($lists as $listId) { 56 $mailingLists[] = (new MailingList())->setId($listId); 56 $ml = new MailingList(); 57 $ml->setId($listId); 58 $mailingLists[] = $ml; 57 59 } 58 60 … … 103 105 $mailingLists = array(); 104 106 foreach ($clists as $listId) { 105 $mailingLists[] = (new MailingList())->setId($listId); 107 $ml = new MailingList(); 108 $ml->setId($listId); 109 $mailingLists[] = $ml; 106 110 } 107 111 … … 165 169 $mailingLists = array(); 166 170 foreach ($lists as $listId) { 167 $mailingLists[] = (new MailingList())->setId($listId); 171 $m = new MailingList(); 172 $ml->setId($listId); 173 $mailingLists[] = $ml; 168 174 } 169 175 … … 238 244 } 239 245 } 240 241 $c ustomFields[] = (new CustomField())246 $cf = new CustomField(); 247 $cf 242 248 ->setId(intval($mgrt_field_id)) 243 249 ->setValue($fields[$wp_field_name]); 250 $customFields[] = $cf; 251 244 252 } 245 253 … … 261 269 } 262 270 263 $customFields[] = (new CustomField()) 271 $cf = new CustomField(); 272 $cf 264 273 ->setId(intval($fieldId)) 265 274 ->setValue($fields[$viewKey][Profile::FIELD_KEY.$fieldId]); 275 $customFields[] = $cf; 266 276 } 267 277 } -
mgrt/trunk/Mgrt/Wordpress/Widget/NewsletterWidget.php
r986149 r1000678 54 54 $mailingLists = array(); 55 55 foreach ($targets as $targetId) { 56 $mailingLists[] = (new MailingList())->setId($targetId); 56 $ml = new MailingList(); 57 $ml->setId($targetId); 58 $mailingLists[] = $ml; 57 59 } 58 60 -
mgrt/trunk/mgrt.php
r988019 r1000678 4 4 * Plugin URI: https://wordpress.org/plugins/mgrt/ 5 5 * Description: Link your Mgrt account with your Wordpress website. 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: Mgrt 8 8 * Author URI: https://profiles.wordpress.org/mgrt … … 86 86 }); 87 87 88 add_action('init', array(new \Mgrt\Wordpress\Bootstrap(), 'init')); 88 $MgrtBootstrap = new \Mgrt\Wordpress\Bootstrap(); 89 add_action('init', array($MgrtBootstrap, 'init')); 89 90 -
mgrt/trunk/readme.txt
r988019 r1000678 23 23 24 24 == Changelog == 25 1.1 Fixed compatibility with PHP 5.3.3 25 26 1.0 First release -
mgrt/trunk/vendor/autoload.php
r988019 r1000678 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit dea41aaff7a9ac591f8543b489dce4c1::getLoader();7 return ComposerAutoloaderInit1f5d41660b8df351eee1b81bc3e12ebb::getLoader(); -
mgrt/trunk/vendor/composer/autoload_real.php
r988019 r1000678 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit dea41aaff7a9ac591f8543b489dce4c15 class ComposerAutoloaderInit1f5d41660b8df351eee1b81bc3e12ebb 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit dea41aaff7a9ac591f8543b489dce4c1', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInit1f5d41660b8df351eee1b81bc3e12ebb', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit dea41aaff7a9ac591f8543b489dce4c1', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInit1f5d41660b8df351eee1b81bc3e12ebb', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 45 45 } 46 46 47 function composerRequire dea41aaff7a9ac591f8543b489dce4c1($file)47 function composerRequire1f5d41660b8df351eee1b81bc3e12ebb($file) 48 48 { 49 49 require $file; -
mgrt/trunk/vendor/composer/installed.json
r986149 r1000678 2 2 { 3 3 "name": "symfony/yaml", 4 "version": "v2.5. 4",5 "version_normalized": "2.5. 4.0",4 "version": "v2.5.5", 5 "version_normalized": "2.5.5.0", 6 6 "target-dir": "Symfony/Component/Yaml", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/symfony/Yaml.git", 10 "reference": " 01a7695bcfb013d0a15c6757e15aae120342986f"11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/symfony/Yaml/zipball/ 01a7695bcfb013d0a15c6757e15aae120342986f",15 "reference": " 01a7695bcfb013d0a15c6757e15aae120342986f",10 "reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/symfony/Yaml/zipball/b1dbc53593b98c2d694ebf383660ac9134d30b96", 15 "reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96", 16 16 "shasum": "" 17 17 }, … … 19 19 "php": ">=5.3.3" 20 20 }, 21 "time": "2014-0 8-31 03:22:04",21 "time": "2014-09-22 09:14:18", 22 22 "type": "library", 23 23 "extra": { … … 117 117 { 118 118 "name": "symfony/event-dispatcher", 119 "version": "v2.5. 4",120 "version_normalized": "2.5. 4.0",119 "version": "v2.5.5", 120 "version_normalized": "2.5.5.0", 121 121 "target-dir": "Symfony/Component/EventDispatcher", 122 122 "source": { 123 123 "type": "git", 124 124 "url": "https://github.com/symfony/EventDispatcher.git", 125 "reference": " 8faf5cc7e80fde74a650a36e60d32ce3c3e0457b"126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/ 8faf5cc7e80fde74a650a36e60d32ce3c3e0457b",130 "reference": " 8faf5cc7e80fde74a650a36e60d32ce3c3e0457b",125 "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46" 126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f6281337bf5f985f585d1db6a83adb05ce531f46", 130 "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46", 131 131 "shasum": "" 132 132 }, … … 137 137 "psr/log": "~1.0", 138 138 "symfony/config": "~2.0", 139 "symfony/dependency-injection": "~2.0 ",139 "symfony/dependency-injection": "~2.0,<2.6.0", 140 140 "symfony/stopwatch": "~2.2" 141 141 }, … … 144 144 "symfony/http-kernel": "" 145 145 }, 146 "time": "2014-0 7-28 13:20:46",146 "time": "2014-09-28 15:56:11", 147 147 "type": "library", 148 148 "extra": { … … 270 270 { 271 271 "name": "mgrt/mgrt-php", 272 "version": " dev-master",273 "version_normalized": " 9999999-dev",272 "version": "2.1.0", 273 "version_normalized": "2.1.0.0", 274 274 "source": { 275 275 "type": "git", 276 276 "url": "https://github.com/mgrt/mgrt-php.git", 277 "reference": " c945bf684a22dcc0277b671fa83024e82742647b"278 }, 279 "dist": { 280 "type": "zip", 281 "url": "https://api.github.com/repos/mgrt/mgrt-php/zipball/ c945bf684a22dcc0277b671fa83024e82742647b",282 "reference": " c945bf684a22dcc0277b671fa83024e82742647b",277 "reference": "b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5" 278 }, 279 "dist": { 280 "type": "zip", 281 "url": "https://api.github.com/repos/mgrt/mgrt-php/zipball/b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5", 282 "reference": "b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5", 283 283 "shasum": "" 284 284 }, … … 289 289 "symfony/yaml": "~2.1" 290 290 }, 291 "time": "2014- 09-09 13:17:18",291 "time": "2014-10-02 14:33:25", 292 292 "type": "library", 293 293 "extra": { … … 296 296 } 297 297 }, 298 "installation-source": " source",298 "installation-source": "dist", 299 299 "autoload": { 300 300 "psr-0": { -
mgrt/trunk/vendor/mgrt/mgrt-php/README.md
r986149 r1000678 213 213 * ```$contact->getEmail()``` will return a ```string```. 214 214 * ```$contact->getMailingLists()``` will return an array of ```MailingList``` objects. 215 * ```$contact->getMailingListsToArray()``` will return an array of ```integer```. 215 216 * ```$contact->getCustomFields()``` will return an array of ```CustomField``` objects. 217 * ```$contact->getCustomFieldsToArray()``` will return an array of CustomFields, formatted as an array of {id, value}. 216 218 * ```$contact->getLatitude()``` will return a ```string```. 217 219 * ```$contact->getLongitude()``` will return a ```string```. … … 226 228 * ```$contact->setMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 227 229 * ```$contact->setCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 230 231 _Other methods_ 232 233 * ```$contact->addMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 234 * ```$contact->removeMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 235 * ```$contact->addMailingList($mailingList)``` where ```$mailingList``` is a ```MailingList``` object. 236 * ```$contact->removeMailingList($mailingList)``` where ```$mailingList``` is a ```MailingList``` object. 237 * ```$contact->addCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 238 * ```$contact->removeCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 239 * ```$contact->addCustomField($customFields)``` where ```$customFields``` is a ```CustomField``` object. 240 * ```$contact->removeCustomField($customFields)``` where ```$customFields``` is a ```CustomField``` object. 228 241 229 242 -
mgrt/trunk/vendor/mgrt/mgrt-php/src/Mgrt/Model/Contact.php
r986149 r1000678 47 47 } 48 48 49 public function removeMailingList(MailingList $mailingList) 50 { 51 return $this->removeMailingLists(array($mailingList)); 52 } 53 54 public function removeMailingLists(array $datas) 55 { 56 $filter = array(); 57 foreach ($datas as $key => $value) { 58 if ($value instanceof MailingList) { 59 $filter = $value->getId(); 60 } else { 61 $filter = is_array($value) ? $value['id'] : $value; 62 } 63 64 if (isset($this->mailing_lists[$filter])) { 65 unset($this->mailing_lists[$filter]); 66 } 67 } 68 69 return $this; 70 } 71 49 72 public function addCustomField(CustomField $customField) 50 73 { … … 73 96 74 97 return $this->addCustomFields($datas); 98 } 99 100 public function removeCustomField(CustomField $customField) 101 { 102 return $this->removeCustomFields(array($customField)); 103 } 104 105 public function removeCustomFields(array $datas) 106 { 107 $filter = array(); 108 foreach ($datas as $key => $value) { 109 if ($value instanceof CustomField) { 110 $filter = $value->getId(); 111 } else { 112 $filter = is_array($value) ? $value['id'] : $value; 113 } 114 115 if (isset($this->custom_fields[$filter])) { 116 unset($this->custom_fields[$filter]); 117 } 118 } 119 120 return $this; 75 121 } 76 122 -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
r986149 r1000678 272 272 $info += array( 273 273 'type' => 'Closure', 274 'pretty' => 'closure' 274 'pretty' => 'closure', 275 275 ); 276 276 } elseif (is_string($listener)) { -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php
r986149 r1000678 25 25 $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); 26 26 27 $tdispatcher->addListener('foo', $listener = function () { ; });27 $tdispatcher->addListener('foo', $listener = function () {; }); 28 28 $listeners = $dispatcher->getListeners('foo'); 29 29 $this->assertCount(1, $listeners); … … 39 39 $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); 40 40 41 $tdispatcher->addListener('foo', $listener = function () { ; });41 $tdispatcher->addListener('foo', $listener = function () {; }); 42 42 $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); 43 43 } … … 51 51 $this->assertFalse($tdispatcher->hasListeners('foo')); 52 52 53 $tdispatcher->addListener('foo', $listener = function () { ; });53 $tdispatcher->addListener('foo', $listener = function () {; }); 54 54 $this->assertTrue($dispatcher->hasListeners('foo')); 55 55 $this->assertTrue($tdispatcher->hasListeners('foo')); … … 76 76 $dispatcher = new EventDispatcher(); 77 77 $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); 78 $tdispatcher->addListener('foo', $listener = function () { ; });78 $tdispatcher->addListener('foo', $listener = function () {; }); 79 79 80 80 $this->assertEquals(array(), $tdispatcher->getCalledListeners()); … … 93 93 $dispatcher = new EventDispatcher(); 94 94 $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); 95 $tdispatcher->addListener('foo', $listener1 = function () { ; });96 $tdispatcher->addListener('foo', $listener2 = function () { ; });95 $tdispatcher->addListener('foo', $listener1 = function () {; }); 96 $tdispatcher->addListener('foo', $listener2 = function () {; }); 97 97 98 98 $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); … … 109 109 $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); 110 110 $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); 111 $tdispatcher->addListener('foo', $listener2 = function () { ; });111 $tdispatcher->addListener('foo', $listener2 = function () {; }); 112 112 113 113 $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
r986149 r1000678 137 137 class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface 138 138 { 139 public static function getSubscribedEvents() {} 139 public static function getSubscribedEvents() 140 { 141 } 140 142 } -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
r986149 r1000678 363 363 return array('pre.foo' => array( 364 364 array('preFoo1'), 365 array('preFoo2', 10) 365 array('preFoo2', 10), 366 366 )); 367 367 } -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
r986149 r1000678 19 19 class GenericEventTest extends \PHPUnit_Framework_TestCase 20 20 { 21 22 21 /** 23 22 * @var GenericEvent -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
r986149 r1000678 20 20 }, 21 21 "require-dev": { 22 "symfony/dependency-injection": "~2.0 ",22 "symfony/dependency-injection": "~2.0,<2.6.0", 23 23 "symfony/config": "~2.0", 24 24 "symfony/stopwatch": "~2.2", -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
r986149 r1000678 27 27 // on the input arrays. This ordering of the characters avoids the use of strtr, 28 28 // which performs more slowly. 29 private static $escapees = array('\\ \\', '\\"', '"',29 private static $escapees = array('\\', '\\\\', '\\"', '"', 30 30 "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", 31 31 "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", 32 32 "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", 33 33 "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", 34 "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9" );35 private static $escaped = array('\\ "', '\\\\', '\\"',34 "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); 35 private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', 36 36 "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", 37 37 "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", 38 38 "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", 39 39 "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", 40 "\\N", "\\_", "\\L", "\\P" );40 "\\N", "\\_", "\\L", "\\P",); 41 41 42 42 /** -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
r986149 r1000678 411 411 * @return string A YAML string 412 412 * 413 * @throws ParseException when object parsing support was disabled and the parser detected a PHP object 413 * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved 414 414 */ 415 415 private static function evaluateScalar($scalar, $references = array()) … … 423 423 } else { 424 424 $value = substr($scalar, 1); 425 } 426 427 // an unquoted * 428 if (false === $value || '' === $value) { 429 throw new ParseException('A reference must contain at least one character.'); 425 430 } 426 431 -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
r986149 r1000678 94 94 $c = $this->getRealCurrentLineNb() + 1; 95 95 $parser = new Parser($c); 96 $parser->refs = & $this->refs;97 $data[] = $parser->parse($this->getNextEmbedBlock( ), $exceptionOnInvalidType, $objectSupport);96 $parser->refs = & $this->refs; 97 $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport); 98 98 } else { 99 99 if (isset($values['leadspaces']) … … 104 104 $c = $this->getRealCurrentLineNb(); 105 105 $parser = new Parser($c); 106 $parser->refs = & $this->refs;106 $parser->refs = & $this->refs; 107 107 108 108 $block = $values['value']; … … 161 161 $c = $this->getRealCurrentLineNb() + 1; 162 162 $parser = new Parser($c); 163 $parser->refs = & $this->refs;163 $parser->refs = & $this->refs; 164 164 $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport); 165 165 … … 212 212 $c = $this->getRealCurrentLineNb() + 1; 213 213 $parser = new Parser($c); 214 $parser->refs = & $this->refs;214 $parser->refs = & $this->refs; 215 215 $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport); 216 216 // Spec: Keys MUST be unique; first one wins. … … 317 317 * Returns the next embed block of YAML. 318 318 * 319 * @param int $indentation The indent level at which the block is to be read, or null for default 319 * @param int $indentation The indent level at which the block is to be read, or null for default 320 * @param bool $inSequence True if the enclosing data structure is a sequence 320 321 * 321 322 * @return string A YAML string … … 323 324 * @throws ParseException When indentation problem are detected 324 325 */ 325 private function getNextEmbedBlock($indentation = null) 326 { 327 $this->moveToNextLine(); 326 private function getNextEmbedBlock($indentation = null, $inSequence = false) 327 { 328 $oldLineIndentation = $this->getCurrentLineIndentation(); 329 330 if (!$this->moveToNextLine()) { 331 return; 332 } 328 333 329 334 if (null === $indentation) { … … 340 345 341 346 $data = array(substr($this->currentLine, $newIndent)); 347 348 if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { 349 // the previous line contained a dash but no item content, this line is a sequence item with the same indentation 350 // and therefore no nested list or mapping 351 $this->moveToPreviousLine(); 352 353 return; 354 } 342 355 343 356 $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine); … … 670 683 return (0 === strpos($this->currentLine, '- ')); 671 684 } 672 673 685 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php
r986149 r1000678 56 56 $this->dumper->setIndentation(7); 57 57 58 $expected = <<<EOF58 $expected = <<<EOF 59 59 '': bar 60 60 foo: '#bar' … … 109 109 { '': bar, foo: '#bar', 'foo''bar': { }, bar: [1, foo], foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } } 110 110 EOF; 111 $this->assertEquals($expected, $this->dumper->dump($this->array, -10), '->dump() takes an inline level argument');112 $this->assertEquals($expected, $this->dumper->dump($this->array, 0), '->dump() takes an inline level argument');113 114 $expected = <<<EOF111 $this->assertEquals($expected, $this->dumper->dump($this->array, -10), '->dump() takes an inline level argument'); 112 $this->assertEquals($expected, $this->dumper->dump($this->array, 0), '->dump() takes an inline level argument'); 113 114 $expected = <<<EOF 115 115 '': bar 116 116 foo: '#bar' … … 200 200 $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, true, false); 201 201 } 202 203 /** 204 * @dataProvider getEscapeSequences 205 */ 206 public function testEscapedEscapeSequencesInQuotedScalar($input, $expected) 207 { 208 $this->assertEquals($expected, $this->dumper->dump($input)); 209 } 210 211 public function getEscapeSequences() 212 { 213 return array( 214 'null' => array("\t\\0", '"\t\\\\0"'), 215 'bell' => array("\t\\a", '"\t\\\\a"'), 216 'backspace' => array("\t\\b", '"\t\\\\b"'), 217 'horizontal-tab' => array("\t\\t", '"\t\\\\t"'), 218 'line-feed' => array("\t\\n", '"\t\\\\n"'), 219 'vertical-tab' => array("\t\\v", '"\t\\\\v"'), 220 'form-feed' => array("\t\\f", '"\t\\\\f"'), 221 'carriage-return' => array("\t\\r", '"\t\\\\r"'), 222 'escape' => array("\t\\e", '"\t\\\\e"'), 223 'space' => array("\t\\ ", '"\t\\\\ "'), 224 'double-quote' => array("\t\\\"", '"\t\\\\\\""'), 225 'slash' => array("\t\\/", '"\t\\\\/"'), 226 'backslash' => array("\t\\\\", '"\t\\\\\\\\"'), 227 'next-line' => array("\t\\N", '"\t\\\\N"'), 228 'non-breaking-space' => array("\t\\�", '"\t\\\\�"'), 229 'line-separator' => array("\t\\L", '"\t\\\\L"'), 230 'paragraph-separator' => array("\t\\P", '"\t\\\\P"'), 231 ); 232 } 202 233 } 203 234 -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml
r986149 r1000678 11 11 php: | 12 12 array('apple', 'banana', 'carrot') 13 --- 14 test: Sequence With Item Being Null In The Middle 15 brief: | 16 You can specify a list in YAML by placing each 17 member of the list on a new line with an opening 18 dash. These lists are called sequences. 19 yaml: | 20 - apple 21 - 22 - carrot 23 php: | 24 array('apple', null, 'carrot') 25 --- 26 test: Sequence With Last Item Being Null 27 brief: | 28 You can specify a list in YAML by placing each 29 member of the list on a new line with an opening 30 dash. These lists are called sequences. 31 yaml: | 32 - apple 33 - banana 34 - 35 php: | 36 array('apple', 'banana', null) 13 37 --- 14 38 test: Nested Sequences -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
r986149 r1000678 146 146 ); 147 147 $this->assertSame(array($foo), Inline::parse('[*foo]', false, false, array('foo' => $foo))); 148 } 149 150 /** 151 * @expectedException \Symfony\Component\Yaml\Exception\ParseException 152 * @expectedExceptionMessage A reference must contain at least one character. 153 */ 154 public function testParseUnquotedAsterisk() 155 { 156 Inline::parse('{ foo: * }'); 157 } 158 159 /** 160 * @expectedException \Symfony\Component\Yaml\Exception\ParseException 161 * @expectedExceptionMessage A reference must contain at least one character. 162 */ 163 public function testParseUnquotedAsteriskFollowedByAComment() 164 { 165 Inline::parse('{ foo: * #foo }'); 148 166 } 149 167 … … 211 229 212 230 '[foo, bar: { foo: bar }]' => array('foo', '1' => array('bar' => array('foo' => 'bar'))), 213 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%' ,), true, '@service_container',),231 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), 214 232 ); 215 233 } … … 258 276 '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), 259 277 260 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%' ,), true, '@service_container',),278 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), 261 279 ); 262 280 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php
r986149 r1000678 406 406 EOF; 407 407 $expected = array( 408 'foo' => "\n\nbar" 408 'foo' => "\n\nbar", 409 409 ); 410 410 … … 450 450 iconv("UTF-8", "ISO-8859-1", "foo: 'äöüß'"), 451 451 iconv("UTF-8", "ISO-8859-15", "euro: '€'"), 452 iconv("UTF-8", "CP1252", "cp1252: '©ÉÇáñ'") 452 iconv("UTF-8", "CP1252", "cp1252: '©ÉÇáñ'"), 453 453 ); 454 454 … … 459 459 $this->fail('charsets other than UTF-8 are rejected.'); 460 460 } catch (\Exception $e) { 461 $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.');461 $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); 462 462 } 463 463 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php
r986149 r1000678 131 131 } 132 132 if (0x800 > $c) { 133 return chr(0xC0 | $c >>6).chr(0x80 | $c & 0x3F);133 return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); 134 134 } 135 135 if (0x10000 > $c) { 136 return chr(0xE0 | $c >>12).chr(0x80 | $c>>6 & 0x3F).chr(0x80 | $c & 0x3F);136 return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); 137 137 } 138 138 139 return chr(0xF0 | $c >>18).chr(0x80 | $c>>12 & 0x3F).chr(0x80 | $c>>6 & 0x3F).chr(0x80 | $c & 0x3F);139 return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); 140 140 } 141 141 }
Note: See TracChangeset
for help on using the changeset viewer.