Plugin Directory

Changeset 999917


Ignore:
Timestamp:
10/01/2014 04:08:51 PM (12 years ago)
Author:
mailingreport
Message:

Compatibility with PHP 5.3.3

Location:
mailingreport/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • mailingreport/trunk/Mgrt/Wordpress/Manager/SyncManager.php

    r988045 r999917  
    289289        );
    290290        $opts = array();
     291
    291292        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;
    293296        }
    294297        $opts[] = array(
     
    366369        $this->import_sync = true;
    367370        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();
    371374
    372375            if ($call === false) {
  • mailingreport/trunk/Mgrt/Wordpress/Manager/ViewManager.php

    r988045 r999917  
    3838    {
    3939        if (is_string($views)) {
    40             $views = [$views];
     40            $views = array($views);
    4141        }
    4242
     
    8888    {
    8989        if (is_string($views)) {
    90             $views = [$views];
     90            $views = array($views);
    9191        }
    9292
     
    105105            $object = new $class($this->bootstrap);
    106106
    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            // }
    110111
    111112            $this->loaded[$view] = $object;
     
    191192        }
    192193
    193         $args = ['page' => $page];
     194        $args = array('page' => $page);
    194195
    195196        if (!empty($action)) {
  • mailingreport/trunk/Mgrt/Wordpress/Shortcode/NewsletterShortcode.php

    r988045 r999917  
    131131        $mailingLists = array();
    132132        foreach ($targets as $targetId) {
    133             $mailingLists[] = (new MailingList())->setId($targetId);
     133            $ml = new MailingList();
     134            $ml->setId($targetId);
     135            $mailingLists[] = $ml;
    134136        }
    135137
    136138        $customFields = array();
    137139        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;
    139145        }
    140146
  • mailingreport/trunk/Mgrt/Wordpress/Sync/ExportSyncProcessor.php

    r988045 r999917  
    5454        $mailingLists = array();
    5555        foreach ($lists as $listId) {
    56             $mailingLists[] = (new MailingList())->setId($listId);
     56            $ml = new MailingList();
     57            $ml->setId($listId);
     58            $mailingLists[] = $ml;
    5759        }
    5860
     
    103105            $mailingLists = array();
    104106            foreach ($clists as $listId) {
    105                 $mailingLists[] = (new MailingList())->setId($listId);
     107                $ml = new MailingList();
     108                $ml->setId($listId);
     109                $mailingLists[] = $ml;
    106110            }
    107111
     
    165169        $mailingLists = array();
    166170        foreach ($lists as $listId) {
    167             $mailingLists[] = (new MailingList())->setId($listId);
     171            $m = new MailingList();
     172            $ml->setId($listId);
     173            $mailingLists[] = $ml;
    168174        }
    169175
     
    238244                }
    239245            }
    240 
    241             $customFields[] = (new CustomField())
     246            $cf = new CustomField();
     247            $cf
    242248                ->setId(intval($mgrt_field_id))
    243249                ->setValue($fields[$wp_field_name]);
     250            $customFields[] = $cf;
     251
    244252        }
    245253
     
    261269                }
    262270
    263                 $customFields[] = (new CustomField())
     271                $cf = new CustomField();
     272                $cf
    264273                    ->setId(intval($fieldId))
    265274                    ->setValue($fields[$viewKey][Profile::FIELD_KEY.$fieldId]);
     275                $customFields[] = $cf;
    266276            }
    267277        }
  • mailingreport/trunk/Mgrt/Wordpress/Widget/NewsletterWidget.php

    r988045 r999917  
    5454        $mailingLists = array();
    5555        foreach ($targets as $targetId) {
    56             $mailingLists[] = (new MailingList())->setId($targetId);
     56            $ml = new MailingList();
     57            $ml->setId($targetId);
     58            $mailingLists[] = $ml;
    5759        }
    5860
  • mailingreport/trunk/mgrt.php

    r988045 r999917  
    44 * Plugin URI: https://wordpress.org/plugins/mailingreport/
    55 * Description: Link your MailingReport account with your Wordpress website.
    6  * Version: 1.0
     6 * Version: 1.1
    77 * Author: MailingReport
    88 * Author URI: https://profiles.wordpress.org/mailingreport
     
    8686});
    8787
    88 add_action('init', array(new \Mgrt\Wordpress\Bootstrap(), 'init'));
     88$MgrtBootstrap = new \Mgrt\Wordpress\Bootstrap();
     89add_action('init', array($MgrtBootstrap, 'init'));
    8990
  • mailingreport/trunk/readme.txt

    r988045 r999917  
    2323
    2424== Changelog ==
     251.1 Fixed compatibility with PHP 5.3.3
    25261.0 First release
  • mailingreport/trunk/vendor/autoload.php

    r988045 r999917  
    55require_once __DIR__ . '/composer' . '/autoload_real.php';
    66
    7 return ComposerAutoloaderInit2c59dc65826ca7e2729c512ba3cc274e::getLoader();
     7return ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74::getLoader();
  • mailingreport/trunk/vendor/composer/autoload_real.php

    r988045 r999917  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2c59dc65826ca7e2729c512ba3cc274e
     5class ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit2c59dc65826ca7e2729c512ba3cc274e', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit2c59dc65826ca7e2729c512ba3cc274e', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit060ca4b102a48fb3b8c53424287d9c74', 'loadClassLoader'));
    2525
    2626        $map = require __DIR__ . '/autoload_namespaces.php';
     
    4545}
    4646
    47 function composerRequire2c59dc65826ca7e2729c512ba3cc274e($file)
     47function composerRequire060ca4b102a48fb3b8c53424287d9c74($file)
    4848{
    4949    require $file;
  • mailingreport/trunk/vendor/composer/installed.json

    r988045 r999917  
    6565            "string"
    6666        ]
    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"
    12667    },
    12768    {
     
    226167            "type": "git",
    227168            "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",
    234175            "shasum": ""
    235176        },
     
    242183            "phpunit/phpunit": "~3.7"
    243184        },
    244         "time": "2014-09-09 12:31:54",
     185        "time": "2014-09-30 12:28:36",
    245186        "type": "library",
    246187        "extra": {
     
    268209            "wrapper"
    269210        ]
     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"
    270270    }
    271271]
  • mailingreport/trunk/vendor/mailingreport/mailingreport-php/README.md

    r988045 r999917  
    217217* ```$contact->getEmail()``` will return a ```string```.
    218218* ```$contact->getMailingLists()``` will return an array of ```MailingList``` objects.
     219* ```$contact->getMailingListsToArray()``` will return an array of ```integer```.
    219220* ```$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}.
    220222* ```$contact->getLatitude()``` will return a ```string```.
    221223* ```$contact->getLongitude()``` will return a ```string```.
     
    230232* ```$contact->setMailingLists($mailingList)``` where ```$mailingList``` is an array of ```MailingList``` objects.
    231233* ```$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.
    232245
    233246
  • mailingreport/trunk/vendor/mailingreport/mailingreport-php/src/Mgrt/Model/Contact.php

    r988045 r999917  
    4747    }
    4848
     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
    4972    public function addCustomField(CustomField $customField)
    5073    {
     
    7396       
    7497        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;
    75121    }
    76122
  • mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php

    r988045 r999917  
    272272            $info += array(
    273273                'type' => 'Closure',
    274                 'pretty' => 'closure'
     274                'pretty' => 'closure',
    275275            );
    276276        } elseif (is_string($listener)) {
  • mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php

    r988045 r999917  
    2525        $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
    2626
    27         $tdispatcher->addListener('foo', $listener = function () { ; });
     27        $tdispatcher->addListener('foo', $listener = function () {; });
    2828        $listeners = $dispatcher->getListeners('foo');
    2929        $this->assertCount(1, $listeners);
     
    3939        $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
    4040
    41         $tdispatcher->addListener('foo', $listener = function () { ; });
     41        $tdispatcher->addListener('foo', $listener = function () {; });
    4242        $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo'));
    4343    }
     
    5151        $this->assertFalse($tdispatcher->hasListeners('foo'));
    5252
    53         $tdispatcher->addListener('foo', $listener = function () { ; });
     53        $tdispatcher->addListener('foo', $listener = function () {; });
    5454        $this->assertTrue($dispatcher->hasListeners('foo'));
    5555        $this->assertTrue($tdispatcher->hasListeners('foo'));
     
    7676        $dispatcher = new EventDispatcher();
    7777        $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
    78         $tdispatcher->addListener('foo', $listener = function () { ; });
     78        $tdispatcher->addListener('foo', $listener = function () {; });
    7979
    8080        $this->assertEquals(array(), $tdispatcher->getCalledListeners());
     
    9393        $dispatcher = new EventDispatcher();
    9494        $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 () {; });
    9797
    9898        $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\".");
     
    109109        $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger);
    110110        $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); });
    111         $tdispatcher->addListener('foo', $listener2 = function () { ; });
     111        $tdispatcher->addListener('foo', $listener2 = function () {; });
    112112
    113113        $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  
    137137class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
    138138{
    139     public static function getSubscribedEvents() {}
     139    public static function getSubscribedEvents()
     140    {
     141    }
    140142}
  • mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php

    r988045 r999917  
    363363        return array('pre.foo' => array(
    364364            array('preFoo1'),
    365             array('preFoo2', 10)
     365            array('preFoo2', 10),
    366366        ));
    367367    }
  • mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php

    r988045 r999917  
    1919class GenericEventTest extends \PHPUnit_Framework_TestCase
    2020{
    21 
    2221    /**
    2322     * @var GenericEvent
  • mailingreport/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json

    r988045 r999917  
    2020    },
    2121    "require-dev": {
    22         "symfony/dependency-injection": "~2.0",
     22        "symfony/dependency-injection": "~2.0,<2.6.0",
    2323        "symfony/config": "~2.0",
    2424        "symfony/stopwatch": "~2.2",
Note: See TracChangeset for help on using the changeset viewer.