Changeset 999917
- Timestamp:
- 10/01/2014 04:08:51 PM (12 years ago)
- Location:
- mailingreport/trunk
- Files:
-
- 18 edited
-
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) (4 diffs)
-
vendor/mailingreport/mailingreport-php/README.md (modified) (2 diffs)
-
vendor/mailingreport/mailingreport-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)
Legend:
- Unmodified
- Added
- Removed
-
mailingreport/trunk/Mgrt/Wordpress/Manager/SyncManager.php
r988045 r999917 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) { -
mailingreport/trunk/Mgrt/Wordpress/Manager/ViewManager.php
r988045 r999917 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)) { -
mailingreport/trunk/Mgrt/Wordpress/Shortcode/NewsletterShortcode.php
r988045 r999917 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 -
mailingreport/trunk/Mgrt/Wordpress/Sync/ExportSyncProcessor.php
r988045 r999917 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 } -
mailingreport/trunk/Mgrt/Wordpress/Widget/NewsletterWidget.php
r988045 r999917 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 -
mailingreport/trunk/mgrt.php
r988045 r999917 4 4 * Plugin URI: https://wordpress.org/plugins/mailingreport/ 5 5 * Description: Link your MailingReport account with your Wordpress website. 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: MailingReport 8 8 * Author URI: https://profiles.wordpress.org/mailingreport … … 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 -
mailingreport/trunk/readme.txt
r988045 r999917 23 23 24 24 == Changelog == 25 1.1 Fixed compatibility with PHP 5.3.3 25 26 1.0 First release -
mailingreport/trunk/vendor/autoload.php
r988045 r999917 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 2c59dc65826ca7e2729c512ba3cc274e::getLoader();7 return ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74::getLoader(); -
mailingreport/trunk/vendor/composer/autoload_real.php
r988045 r999917 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2c59dc65826ca7e2729c512ba3cc274e5 class ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 2c59dc65826ca7e2729c512ba3cc274e', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 2c59dc65826ca7e2729c512ba3cc274e', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 45 45 } 46 46 47 function composerRequire 2c59dc65826ca7e2729c512ba3cc274e($file)47 function composerRequire060ca4b102a48fb3b8c53424287d9c74($file) 48 48 { 49 49 require $file; -
mailingreport/trunk/vendor/composer/installed.json
r988045 r999917 65 65 "string" 66 66 ] 67 },68 {69 "name": "symfony/event-dispatcher",70 "version": "v2.5.4",71 "version_normalized": "2.5.4.0",72 "target-dir": "Symfony/Component/EventDispatcher",73 "source": {74 "type": "git",75 "url": "https://github.com/symfony/EventDispatcher.git",76 "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b"77 },78 "dist": {79 "type": "zip",80 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/8faf5cc7e80fde74a650a36e60d32ce3c3e0457b",81 "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b",82 "shasum": ""83 },84 "require": {85 "php": ">=5.3.3"86 },87 "require-dev": {88 "psr/log": "~1.0",89 "symfony/config": "~2.0",90 "symfony/dependency-injection": "~2.0",91 "symfony/stopwatch": "~2.2"92 },93 "suggest": {94 "symfony/dependency-injection": "",95 "symfony/http-kernel": ""96 },97 "time": "2014-07-28 13:20:46",98 "type": "library",99 "extra": {100 "branch-alias": {101 "dev-master": "2.5-dev"102 }103 },104 "installation-source": "dist",105 "autoload": {106 "psr-0": {107 "Symfony\\Component\\EventDispatcher\\": ""108 }109 },110 "notification-url": "https://packagist.org/downloads/",111 "license": [112 "MIT"113 ],114 "authors": [115 {116 "name": "Symfony Community",117 "homepage": "http://symfony.com/contributors"118 },119 {120 "name": "Fabien Potencier",121 "email": "fabien@symfony.com"122 }123 ],124 "description": "Symfony EventDispatcher Component",125 "homepage": "http://symfony.com"126 67 }, 127 68 { … … 226 167 "type": "git", 227 168 "url": "https://github.com/mailingreport/mailingreport-php.git", 228 "reference": " 68541224460018326ad6fad6c6fe35dd88ccde0f"229 }, 230 "dist": { 231 "type": "zip", 232 "url": "https://api.github.com/repos/mailingreport/mailingreport-php/zipball/ 68541224460018326ad6fad6c6fe35dd88ccde0f",233 "reference": " 68541224460018326ad6fad6c6fe35dd88ccde0f",169 "reference": "a8ef467c7f0372fca4d97c6d7eff58e0ab9358ef" 170 }, 171 "dist": { 172 "type": "zip", 173 "url": "https://api.github.com/repos/mailingreport/mailingreport-php/zipball/a8ef467c7f0372fca4d97c6d7eff58e0ab9358ef", 174 "reference": "a8ef467c7f0372fca4d97c6d7eff58e0ab9358ef", 234 175 "shasum": "" 235 176 }, … … 242 183 "phpunit/phpunit": "~3.7" 243 184 }, 244 "time": "2014-09- 09 12:31:54",185 "time": "2014-09-30 12:28:36", 245 186 "type": "library", 246 187 "extra": { … … 268 209 "wrapper" 269 210 ] 211 }, 212 { 213 "name": "symfony/event-dispatcher", 214 "version": "v2.5.5", 215 "version_normalized": "2.5.5.0", 216 "target-dir": "Symfony/Component/EventDispatcher", 217 "source": { 218 "type": "git", 219 "url": "https://github.com/symfony/EventDispatcher.git", 220 "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46" 221 }, 222 "dist": { 223 "type": "zip", 224 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f6281337bf5f985f585d1db6a83adb05ce531f46", 225 "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46", 226 "shasum": "" 227 }, 228 "require": { 229 "php": ">=5.3.3" 230 }, 231 "require-dev": { 232 "psr/log": "~1.0", 233 "symfony/config": "~2.0", 234 "symfony/dependency-injection": "~2.0,<2.6.0", 235 "symfony/stopwatch": "~2.2" 236 }, 237 "suggest": { 238 "symfony/dependency-injection": "", 239 "symfony/http-kernel": "" 240 }, 241 "time": "2014-09-28 15:56:11", 242 "type": "library", 243 "extra": { 244 "branch-alias": { 245 "dev-master": "2.5-dev" 246 } 247 }, 248 "installation-source": "dist", 249 "autoload": { 250 "psr-0": { 251 "Symfony\\Component\\EventDispatcher\\": "" 252 } 253 }, 254 "notification-url": "https://packagist.org/downloads/", 255 "license": [ 256 "MIT" 257 ], 258 "authors": [ 259 { 260 "name": "Symfony Community", 261 "homepage": "http://symfony.com/contributors" 262 }, 263 { 264 "name": "Fabien Potencier", 265 "email": "fabien@symfony.com" 266 } 267 ], 268 "description": "Symfony EventDispatcher Component", 269 "homepage": "http://symfony.com" 270 270 } 271 271 ] -
mailingreport/trunk/vendor/mailingreport/mailingreport-php/README.md
r988045 r999917 217 217 * ```$contact->getEmail()``` will return a ```string```. 218 218 * ```$contact->getMailingLists()``` will return an array of ```MailingList``` objects. 219 * ```$contact->getMailingListsToArray()``` will return an array of ```integer```. 219 220 * ```$contact->getCustomFields()``` will return an array of ```CustomField``` objects. 221 * ```$contact->getCustomFieldsToArray()``` will return an array of CustomFields, formatted as an array of {id, value}. 220 222 * ```$contact->getLatitude()``` will return a ```string```. 221 223 * ```$contact->getLongitude()``` will return a ```string```. … … 230 232 * ```$contact->setMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 231 233 * ```$contact->setCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 234 235 _Other methods_ 236 237 * ```$contact->addMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 238 * ```$contact->removeMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects. 239 * ```$contact->addMailingList($mailingList)``` where ```$mailingList``` is a ```MailingList``` object. 240 * ```$contact->removeMailingList($mailingList)``` where ```$mailingList``` is a ```MailingList``` object. 241 * ```$contact->addCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 242 * ```$contact->removeCustomFields($customFields)``` where ```$customFields``` is an array of ```CustomField``` objects. 243 * ```$contact->addCustomField($customFields)``` where ```$customFields``` is a ```CustomField``` object. 244 * ```$contact->removeCustomField($customFields)``` where ```$customFields``` is a ```CustomField``` object. 232 245 233 246 -
mailingreport/trunk/vendor/mailingreport/mailingreport-php/src/Mgrt/Model/Contact.php
r988045 r999917 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 -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
r988045 r999917 272 272 $info += array( 273 273 'type' => 'Closure', 274 'pretty' => 'closure' 274 'pretty' => 'closure', 275 275 ); 276 276 } elseif (is_string($listener)) { -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php
r988045 r999917 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\"."); -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
r988045 r999917 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 } -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
r988045 r999917 363 363 return array('pre.foo' => array( 364 364 array('preFoo1'), 365 array('preFoo2', 10) 365 array('preFoo2', 10), 366 366 )); 367 367 } -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
r988045 r999917 19 19 class GenericEventTest extends \PHPUnit_Framework_TestCase 20 20 { 21 22 21 /** 23 22 * @var GenericEvent -
mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
r988045 r999917 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",
Note: See TracChangeset
for help on using the changeset viewer.