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/composerAdd require to your composer.json
{
"require": {
"aliyun/aliyun-mns-php-sdk": ">=1.0.0"
}
}Use Composer to install requires
composer installNote: 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 theEndpointat the bottom and Runphp Samples/Queue/CreateQueueAndSendMessage.php.CreateTopicAndPushMessageToQueue.php: Set theEndpointat the bottom and RunSamples/Topic/CreateTopicAndPushMessageToQueue.php.CreateTopicAndPublishMessage.php: Set theEndpoint,ipandportat the bottom and RunSamples/Topic/CreateTopicAndPublishMessage.php.TopicSubscribe.php: Set theEndpoint,regionandaccountIdat 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.