PHPMQTT-CLI是基于PHPMQTT提供的命令行工具,支持发布和订阅。
___________________________|_\||||_\|\/|/_\__|__|||_)||_|||_)||\/||||||||||__/|_|__/|||||_|||||||_||_||_|_||_||_|\__\_\|_||_|安装composerrequiresimps/mqtt-cli使用Publish$phpvedor/bi/mqttpublish--helpDescriptio:PublishigsimplemessagesUsage:publish[optios]Optios:-H,--host[=HOST]Specifythehosttocoectto[default:"localhost"]-P,--port[=PORT]Coecttotheportspecified[default:1883]-t,--topic=TOPICTheMQTTtopicowhichtopublishthemessage-m,--message=MESSAGESedasiglemessagefromthecommadlie-i,--id[=ID]Theidtouseforthiscliet[default:""]--qos[=QOS]Specifythequalityofservicetouseforthemessage,from0,1ad2[default:0]--dup[=DUP]IftheDUPflagissetto0,itidicatesthatthisisthefirstoccasiothattheClietorServerhasattemptedtosedthisPUBLISHpacket[default:0]-r,--retai[=RETAIN]IftheRETAINflagissetto1iaPUBLISHpacketsetbyaCliettoaServer,theServerMUSTreplaceayexistigretaiedmessageforthistopicadstoretheApplicatioMessage[default:0]-u,--userame[=USERNAME]Provideauserametobeusedforautheticatigwiththebroker-p,--pw[=PW]Provideapasswordtobeusedforautheticatigwiththebroker-c,--clea-sessio[=CLEAN-SESSION]Settigthe'cleasessio'flag[default:true]-l,--level=LEVELMQTTProtocollevel[default:4]-k,--keepalive[=KEEPALIVE]TheumberofsecodsbetweesedigPINGcommadstothebrokerforthepurposesofiformigitwearestillcoectedadfuctioig[default:0]--will-topic[=WILL-TOPIC]ThetopicowhichtosedaWill,itheevetthattheclietdiscoectsuexpectedly--will-message[=WILL-MESSAGE]Specifyamessagethatwillbestoredbythebrokeradsetoutifthisclietdiscoectsuexpectedly--will-qos[=WILL-QOS]TheQoStousefortheWill[default:0]--will-retai[=WILL-RETAIN]Ifgive,iftheclietdiscoectsuexpectedlythemessagesetoutwillbetreatedasaretaiedmessage[default:0]-S,--ssl[=SSL]EableSSLecryptio[default:false]--cofig-path[=CONFIG-PATH]SettigtheSwoolecofigfilepath--properties-path[=PROPERTIES-PATH]SettigthePropertiescofigfilepath-h,--helpDisplayhelpforthegivecommad.Wheocommadisgivedisplayhelpforthelistcommad-q,--quietDootoutputaymessage-V,--versioDisplaythisapplicatioversio--asiForceANSIoutput--o-asiDisableANSIoutput-,--o-iteractioDootaskayiteractivequestio-v|vv|vvv,--verboseIcreasetheverbosityofmessages:1forormaloutput,2formoreverboseoutputad3fordebugHelp:AMQTTversio3.1/3.1.1/5.0clietforpublishigsimplemessagesSubscribe$phpvedor/bi/mqttsubscribe--helpDescriptio:SubscribigtotopicsUsage:subscribe[optios]Optios:-H,--host[=HOST]Specifythehosttocoectto[default:"localhost"]-P,--port[=PORT]Coecttotheportspecified[default:1883]-i,--id[=ID]Theidtouseforthiscliet[default:""]--qos=QOSSpecifythequalityofservicetouseforthemessage,from0,1ad2(multiplevaluesallowed)-t,--topic=TOPICTheMQTTtopictosubscribeto(multiplevaluesallowed)-u,--userame[=USERNAME]Provideauserametobeusedforautheticatigwiththebroker-p,--pw[=PW]Provideapasswordtobeusedforautheticatigwiththebroker-c,--clea-sessio[=CLEAN-SESSION]Settigthe'cleasessio'flag[default:true]-l,--level=LEVELMQTTProtocollevel[default:4]-k,--keepalive[=KEEPALIVE]TheumberofsecodsbetweesedigPINGcommadstothebrokerforthepurposesofiformigitwearestillcoectedadfuctioig[default:0]--will-topic[=WILL-TOPIC]ThetopicowhichtosedaWill,itheevetthattheclietdiscoectsuexpectedly--will-message[=WILL-MESSAGE]Specifyamessagethatwillbestoredbythebrokeradsetoutifthisclietdiscoectsuexpectedly--will-qos[=WILL-QOS]TheQoStousefortheWill[default:0]--will-retai[=WILL-RETAIN]Ifgive,iftheclietdiscoectsuexpectedlythemessagesetoutwillbetreatedasaretaiedmessage[default:0]-S,--ssl[=SSL]EableSSLecryptio[default:false]--cofig-path[=CONFIG-PATH]SettigtheSwoolecofigfilepath--properties-path[=PROPERTIES-PATH]SettigthePropertiescofigfilepath-U,--usubscribe[=UNSUBSCRIBE]Topicsthateedtobeusubscribed(multiplevaluesallowed)-e,--evet[=EVENT]SubscribedEvetDispatcher[default:""] -,--o-iteractio Dootaskayiteractivequestio -v|vv|vvv,--verbose Icreasetheverbosityofmessages:1forormaloutput,2formoreverboseoutputad3fordebug点击空白处退出提示










评论