Aliyun MNS Documents: https://www.aliyun.com/product/mns
Aliyun MNS Console: https://mns.console.aliyun.com
To install composer by following commands, or see composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
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.
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
.
The basic steps are:
- Set AliCloud AK/SK/Endpoint In
Tests/aliyun-mns.ini
. - In the SDK root directory, run
vendor/bin/phpunit
.