PHPMQTT-CLI是基于PHPMQTT提供的命令行工具,支持发布和订阅。
___________________________|_\||||_\|\/|/_\__|__|||_)||_|||_)||\/||||||||||__/|_|__/|||||_|||||||_||_||_|_||_||_|\__\_\|_||_|安装composerrequiresimps/mqtt-cli使用Publish$phpvendor/bin/mqttpublish--helpDescription:PublishingsimplemessagesUsage:publish[options]Options:-H,--host[=HOST]Specifythehosttoconnectto[default:"localhost"]-P,--port[=PORT]Connecttotheportspecified[default:1883]-t,--topic=TOPICTheMQTTtopiconwhichtopublishthemessage-m,--message=MESSAGESendasinglemessagefromthecommandline-i,--id[=ID]Theidtouseforthisclient[default:""]--qos[=QOS]Specifythequalityofservicetouseforthemessage,from0,1and2[default:0]--dup[=DUP]IftheDUPflagissetto0,itindicatesthatthisisthefirstoccasionthattheClientorServerhasattemptedtosendthisPUBLISHpacket[default:0]-r,--retain[=RETAIN]IftheRETAINflagissetto1inaPUBLISHpacketsentbyaClienttoaServer,theServerMUSTreplaceanyexistingretainedmessageforthistopicandstoretheApplicationMessage[default:0]-u,--username[=USERNAME]Provideausernametobeusedforauthenticatingwiththebroker-p,--pw[=PW]Provideapasswordtobeusedforauthenticatingwiththebroker-c,--clean-session[=CLEAN-SESSION]Settingthe'cleansession'flag[default:true]-l,--level=LEVELMQTTProtocollevel[default:4]-k,--keepalive[=KEEPALIVE]ThenumberofsecondsbetweensendingPINGcommandstothebrokerforthepurposesofinformingitwearestillconnectedandfunctioning[default:0]--will-topic[=WILL-TOPIC]ThetopiconwhichtosendaWill,intheeventthattheclientdisconnectsunexpectedly--will-message[=WILL-MESSAGE]Specifyamessagethatwillbestoredbythebrokerandsentoutifthisclientdisconnectsunexpectedly--will-qos[=WILL-QOS]TheQoStousefortheWill[default:0]--will-retain[=WILL-RETAIN]Ifgiven,iftheclientdisconnectsunexpectedlythemessagesentoutwillbetreatedasaretainedmessage[default:0]-S,--ssl[=SSL]EnableSSLencryption[default:false]--config-path[=CONFIG-PATH]SettingtheSwooleconfigfilepath--properties-path[=PROPERTIES-PATH]SettingthePropertiesconfigfilepath-h,--helpDisplayhelpforthegivencommand.Whennocommandisgivendisplayhelpforthelistcommand-q,--quietDonotoutputanymessage-V,--versionDisplaythisapplicationversion--ansiForceANSIoutput--no-ansiDisableANSIoutput-n,--no-interactionDonotaskanyinteractivequestion-v|vv|vvv,--verboseIncreasetheverbosityofmessages:1fornormaloutput,2formoreverboseoutputand3fordebugHelp:AnMQTTversion3.1/3.1.1/5.0clientforpublishingsimplemessagesSubscribe$phpvendor/bin/mqttsubscribe--helpDescription:SubscribingtotopicsUsage:subscribe[options]Options:-H,--host[=HOST]Specifythehosttoconnectto[default:"localhost"]-P,--port[=PORT]Connecttotheportspecified[default:1883]-i,--id[=ID]Theidtouseforthisclient[default:""]--qos=QOSSpecifythequalityofservicetouseforthemessage,from0,1and2(multiplevaluesallowed)-t,--topic=TOPICTheMQTTtopictosubscribeto(multiplevaluesallowed)-u,--username[=USERNAME]Provideausernametobeusedforauthenticatingwiththebroker-p,--pw[=PW]Provideapasswordtobeusedforauthenticatingwiththebroker-c,--clean-session[=CLEAN-SESSION]Settingthe'cleansession'flag[default:true]-l,--level=LEVELMQTTProtocollevel[default:4]-k,--keepalive[=KEEPALIVE]ThenumberofsecondsbetweensendingPINGcommandstothebrokerforthepurposesofinformingitwearestillconnectedandfunctioning[default:0]--will-topic[=WILL-TOPIC]ThetopiconwhichtosendaWill,intheeventthattheclientdisconnectsunexpectedly--will-message[=WILL-MESSAGE]Specifyamessagethatwillbestoredbythebrokerandsentoutifthisclientdisconnectsunexpectedly--will-qos[=WILL-QOS]TheQoStousefortheWill[default:0]--will-retain[=WILL-RETAIN]Ifgiven,iftheclientdisconnectsunexpectedlythemessagesentoutwillbetreatedasaretainedmessage[default:0]-S,--ssl[=SSL]EnableSSLencryption[default:false]--config-path[=CONFIG-PATH]SettingtheSwooleconfigfilepath--properties-path[=PROPERTIES-PATH]SettingthePropertiesconfigfilepath-U,--unsubscribe[=UNSUBSCRIBE]Topicsthatneedtobeunsubscribed(multiplevaluesallowed)-e,--event[=EVENT]SubscribedEventDispatcher[default:""] -n,--no-interaction Donotaskanyinteractivequestion -v|vv|vvv,--verbose Increasetheverbosityofmessages:1fornormaloutput,2formoreverboseoutputand3fordebug点击空白处退出提示
评论