aliyun / aliyun-mns-php-sdk
Aliyun Message and Notification Service SDK for PHP, PHP>=5.5.0
Installs: 223 206
Dependents: 16
Suggesters: 0
Security: 0
Stars: 32
Watchers: 9
Forks: 27
Open Issues: 6
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: >=6.0.0
- psr/http-message: ^1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-22 02:55:37 UTC
README
Aliyun MNS Documents: https://www.aliyun.com/product/mns
Aliyun MNS Console: https://mns.console.aliyun.com
Intall Composer
To install composer by following commands, or see composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Install & Use
Add require to your composer.json
{ "require": { "aliyun/aliyun-mns-php-sdk": ">=1.0.0" } }
Use Composer to install requires
composer install
Note: php version>=5.5.0, and xml extension of php is required.
Run the Samples
The basic steps are:
- Set AliCloud AK/SK In Env, please see: configure-the-alibaba-cloud-accesskey-environment
- Run (In the SDK root directory):
CreateQueueAndSendMessage.php
: Set theEndpoint
at the bottom and Runphp Samples/Queue/CreateQueueAndSendMessage.php
.CreateTopicAndPushMessageToQueue.php
: Set theEndpoint
at the bottom and RunSamples/Topic/CreateTopicAndPushMessageToQueue.php
.CreateTopicAndPublishMessage.php
: Set theEndpoint
,ip
andport
at the bottom and RunSamples/Topic/CreateTopicAndPublishMessage.php
.TopicSubscribe.php
: Set theEndpoint
,region
andaccountId
at the bottom and RunSamples/Topic/TopicSubscribe.php
.
Run the Tests
The basic steps are:
- Set AliCloud AK/SK/Endpoint In
Tests/aliyun-mns.ini
. - In the SDK root directory, run
vendor/bin/phpunit
.