From 3e48fbc0efb92b56d9b3a677da98dc6dbac6b730 Mon Sep 17 00:00:00 2001 From: Danny Matthijs Date: Fri, 4 Jun 2021 19:41:29 +0200 Subject: [PATCH 1/2] merge composer --- symfony/.env.dist | 4 ++ symfony/composer.json | 3 +- symfony/composer.lock | 114 +++++++++++++++++++++++++++++++++++------- symfony/symfony.lock | 9 ++++ 4 files changed, 112 insertions(+), 18 deletions(-) diff --git a/symfony/.env.dist b/symfony/.env.dist index 4be5ec4..c87187c 100644 --- a/symfony/.env.dist +++ b/symfony/.env.dist @@ -106,3 +106,7 @@ JWT_PASSPHRASE=d18b3a23aecce6de9a75dc3d00bc2489 # Elastic search ELASTICSEARCH_HOST=elastic:changeme@localhost:9200 + +###> symfony/firebase-notifier ### +# FIREBASE_DSN=firebase://TOKEN@default +###< symfony/firebase-notifier ### diff --git a/symfony/composer.json b/symfony/composer.json index 31432c3..1a4b576 100644 --- a/symfony/composer.json +++ b/symfony/composer.json @@ -54,6 +54,7 @@ "symfony/console": "5.2.*", "symfony/dotenv": "^5.1", "symfony/expression-language": "5.2.*", + "symfony/firebase-notifier": "^5.1", "symfony/flex": "^1.2", "symfony/form": "5.2.*", "symfony/framework-bundle": "^5.1", @@ -63,7 +64,7 @@ "symfony/mime": "5.2.*", "symfony/monolog-bridge": "^5.1", "symfony/monolog-bundle": "^3.1", - "symfony/notifier": "5.2.*", + "symfony/notifier": "^5.1", "symfony/process": "5.2.*", "symfony/property-access": "5.2.*", "symfony/property-info": "5.2.*", diff --git a/symfony/composer.lock b/symfony/composer.lock index 7ad848e..1f1965f 100644 --- a/symfony/composer.lock +++ b/symfony/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "375a70e080eb0ff9c35d0d28341d3f89", + "content-hash": "d63c5116a20c835abab596a2894ecfff", "packages": [ { "name": "antishov/doctrine-extensions-bundle", @@ -8169,6 +8169,73 @@ ], "time": "2021-02-15T18:55:04+00:00" }, + { + "name": "symfony/firebase-notifier", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/firebase-notifier.git", + "reference": "4686311b911c8b51e8eef5b10056b586e3422902" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/firebase-notifier/zipball/4686311b911c8b51e8eef5b10056b586e3422902", + "reference": "4686311b911c8b51e8eef5b10056b586e3422902", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/http-client": "^4.3|^5.0", + "symfony/notifier": "^5.3" + }, + "type": "symfony-bridge", + "autoload": { + "psr-4": { + "Symfony\\Component\\Notifier\\Bridge\\Firebase\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jeroen Spee", + "homepage": "https://github.com/Jeroeny" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Firebase Notifier Bridge", + "homepage": "https://symfony.com", + "keywords": [ + "firebase", + "notifier" + ], + "support": { + "source": "https://github.com/symfony/firebase-notifier/tree/v5.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-26T17:43:10+00:00" + }, { "name": "symfony/flex", "version": "v1.12.2", @@ -9378,16 +9445,16 @@ }, { "name": "symfony/notifier", - "version": "v5.2.4", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/symfony/notifier.git", - "reference": "bdb8702e91f19fc64d0c678f41fed144d0263657" + "reference": "9272976b845ace9b74d60d20b2f655a3c23bd1ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/notifier/zipball/bdb8702e91f19fc64d0c678f41fed144d0263657", - "reference": "bdb8702e91f19fc64d0c678f41fed144d0263657", + "url": "https://api.github.com/repos/symfony/notifier/zipball/9272976b845ace9b74d60d20b2f655a3c23bd1ef", + "reference": "9272976b845ace9b74d60d20b2f655a3c23bd1ef", "shasum": "" }, "require": { @@ -9396,21 +9463,31 @@ "symfony/polyfill-php80": "^1.15" }, "conflict": { - "symfony/firebase-notifier": "<5.2", - "symfony/free-mobile-notifier": "<5.2", + "symfony/discord-notifier": "<5.3", + "symfony/esendex-notifier": "<5.3", + "symfony/firebase-notifier": "<5.3", + "symfony/free-mobile-notifier": "<5.3", + "symfony/google-chat-notifier": "<5.3", "symfony/http-kernel": "<4.4", - "symfony/mattermost-notifier": "<5.2", - "symfony/nexmo-notifier": "<5.2", - "symfony/ovh-cloud-notifier": "<5.2", - "symfony/rocket-chat-notifier": "<5.2", - "symfony/sinch-notifier": "<5.2", - "symfony/slack-notifier": "<5.2", - "symfony/telegram-notifier": "<5.2", - "symfony/twilio-notifier": "<5.2" + "symfony/infobip-notifier": "<5.3", + "symfony/linked-in-notifier": "<5.3", + "symfony/mattermost-notifier": "<5.3", + "symfony/mobyt-notifier": "<5.3", + "symfony/nexmo-notifier": "<5.3", + "symfony/ovh-cloud-notifier": "<5.3", + "symfony/rocket-chat-notifier": "<5.3", + "symfony/sendinblue-notifier": "<5.3", + "symfony/sinch-notifier": "<5.3", + "symfony/slack-notifier": "<5.3", + "symfony/smsapi-notifier": "<5.3", + "symfony/telegram-notifier": "<5.3", + "symfony/twilio-notifier": "<5.3", + "symfony/zulip-notifier": "<5.3" }, "require-dev": { "symfony/event-dispatcher-contracts": "^2", - "symfony/http-client-contracts": "^2" + "symfony/http-client-contracts": "^2", + "symfony/messenger": "^4.4 || ^5.0" }, "type": "library", "autoload": { @@ -9441,6 +9518,9 @@ "notification", "notifier" ], + "support": { + "source": "https://github.com/symfony/notifier/tree/v5.3.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -9455,7 +9535,7 @@ "type": "tidelift" } ], - "time": "2021-01-14T15:42:36+00:00" + "time": "2021-05-26T17:43:10+00:00" }, { "name": "symfony/options-resolver", diff --git a/symfony/symfony.lock b/symfony/symfony.lock index 0851be4..bc0a357 100644 --- a/symfony/symfony.lock +++ b/symfony/symfony.lock @@ -631,6 +631,15 @@ "symfony/finder": { "version": "v5.2.4" }, + "symfony/firebase-notifier": { + "version": "5.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "5.1", + "ref": "a6e63ab1ddcc32c93bc064a19084810bfa673c7b" + } + }, "symfony/flex": { "version": "1.0", "recipe": { From bfdf615ebd2bc90b3f09ffc0d783af54766c2866 Mon Sep 17 00:00:00 2001 From: Danny Matthijs Date: Fri, 4 Jun 2021 19:42:22 +0200 Subject: [PATCH 2/2] Head start for Firebase notifications --- symfony/config/packages/notifier.yaml | 1 + .../src/Command/IcappsFirebaseTestCommand.php | 64 +++++++++++++++++++ symfony/symfony.lock | 3 + 3 files changed, 68 insertions(+) create mode 100644 symfony/src/Command/IcappsFirebaseTestCommand.php diff --git a/symfony/config/packages/notifier.yaml b/symfony/config/packages/notifier.yaml index 6afeb2d..d079b8d 100644 --- a/symfony/config/packages/notifier.yaml +++ b/symfony/config/packages/notifier.yaml @@ -1,6 +1,7 @@ framework: notifier: #chatter_transports: + # firebase: '%env(FIREBASE_DSN)%' # slack: '%env(SLACK_DSN)%' # telegram: '%env(TELEGRAM_DSN)%' #texter_transports: diff --git a/symfony/src/Command/IcappsFirebaseTestCommand.php b/symfony/src/Command/IcappsFirebaseTestCommand.php new file mode 100644 index 0000000..889ba40 --- /dev/null +++ b/symfony/src/Command/IcappsFirebaseTestCommand.php @@ -0,0 +1,64 @@ +notifier = $notifier; + }*/ + + protected function configure() + { + $this + ->setDescription(self::$defaultDescription) + ->addArgument('message', InputArgument::OPTIONAL, 'Notification message') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + $message = $input->getArgument('message'); + + if (empty($message)) { + $message = 'Sending a Firebase Notification from Icapps <3'; + } + + $io->note(sprintf('You are sending a notification to Firebase : %s', $message)); + // TODO: figure out how we can test this? + //$chat = new ChatMessage($message); + //$this->notifier->send($chat); + + $io->success("Notification sent, please check Firebase! Good job! Now it's time for coffee ;)"); + + return Command::SUCCESS; + } +} diff --git a/symfony/symfony.lock b/symfony/symfony.lock index bc0a357..b5f5a0c 100644 --- a/symfony/symfony.lock +++ b/symfony/symfony.lock @@ -302,6 +302,9 @@ "namshi/jose": { "version": "7.2.3" }, + "nesbot/carbon": { + "version": "2.48.1" + }, "nikic/php-parser": { "version": "v4.10.4" },