Response.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. <?php
  2. /**
  3. * Phergie
  4. *
  5. * PHP version 5
  6. *
  7. * LICENSE
  8. *
  9. * This source file is subject to the new BSD license that is bundled
  10. * with this package in the file LICENSE.
  11. * It is also available through the world-wide-web at this URL:
  12. * http://phergie.org/license
  13. *
  14. * @category Phergie
  15. * @package Phergie
  16. * @author Phergie Development Team <team@phergie.org>
  17. * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
  18. * @license http://phergie.org/license New BSD License
  19. * @link http://pear.phergie.org/package/Phergie
  20. */
  21. /**
  22. * Event originating from the server in response to an event sent by the
  23. * current client.
  24. *
  25. * @category Phergie
  26. * @package Phergie
  27. * @author Phergie Development Team <team@phergie.org>
  28. * @license http://phergie.org/license New BSD License
  29. * @link http://pear.phergie.org/package/Phergie
  30. * @link http://www.irchelp.org/irchelp/rfc/chapter6.html
  31. */
  32. class Phergie_Event_Response extends Phergie_Event_Abstract
  33. {
  34. /**
  35. * <nickname> No such nick/channel
  36. *
  37. * Used to indicate the nickname parameter supplied to a command is currently
  38. * unused.
  39. */
  40. const ERR_NOSUCHNICK = '401';
  41. /**
  42. * <server name> No such server
  43. *
  44. * Used to indicate the server name given currently doesn't exist.
  45. */
  46. const ERR_NOSUCHSERVER = '402';
  47. /**
  48. * <channel name> No such channel
  49. *
  50. * Used to indicate the given channel name is invalid.
  51. */
  52. const ERR_NOSUCHCHANNEL = '403';
  53. /**
  54. * <channel name> Cannot send to channel
  55. *
  56. * Sent to a user who is either (a) not on a channel which is mode +n or (b) not
  57. * a chanop (or mode +v) on a channel which has mode +m set and is trying to send
  58. * a PRIVMSG message to that channel.
  59. */
  60. const ERR_CANNOTSENDTOCHAN = '404';
  61. /**
  62. * <channel name> You have joined too many channels
  63. *
  64. * Sent to a user when they have joined the maximum number of allowed channels
  65. * and they try to join another channel.
  66. */
  67. const ERR_TOOMANYCHANNELS = '405';
  68. /**
  69. * <nickname> There was no such nickname
  70. *
  71. * Returned by WHOWAS to indicate there is no history information for that
  72. * nickname.
  73. */
  74. const ERR_WASNOSUCHNICK = '406';
  75. /**
  76. * <target> Duplicate recipients. No message delivered
  77. *
  78. * Returned to a client which is attempting to send PRIVMSG/NOTICE using the
  79. * user@host destination format and for a user@host which has several
  80. * occurrences.
  81. */
  82. const ERR_TOOMANYTARGETS = '407';
  83. /**
  84. * No origin specified
  85. *
  86. * PING or PONG message missing the originator parameter which is required since
  87. * these commands must work without valid prefixes.
  88. */
  89. const ERR_NOORIGIN = '409';
  90. /**
  91. * No recipient given (<command>)
  92. */
  93. const ERR_NORECIPIENT = '411';
  94. /**
  95. * No text to send
  96. */
  97. const ERR_NOTEXTTOSEND = '412';
  98. /**
  99. * <mask> No toplevel domain specified
  100. */
  101. const ERR_NOTOPLEVEL = '413';
  102. /**
  103. * <mask> Wildcard in toplevel domain
  104. *
  105. * 412 - 414 are returned by PRIVMSG to indicate that the message wasn't
  106. * delivered for some reason. ERR_NOTOPLEVEL and ERR_WILDTOPLEVEL are errors that
  107. * are returned when an invalid use of "PRIVMSG $<server>" or "PRIVMSG #<host>"
  108. * is attempted.
  109. */
  110. const ERR_WILDTOPLEVEL = '414';
  111. /**
  112. * <command> Unknown command
  113. *
  114. * Returned to a registered client to indicate that the command sent is unknown
  115. * by the server.
  116. */
  117. const ERR_UNKNOWNCOMMAND = '421';
  118. /**
  119. * MOTD File is missing
  120. *
  121. * Server's MOTD file could not be opened by the server.
  122. */
  123. const ERR_NOMOTD = '422';
  124. /**
  125. * <server> No administrative info available
  126. *
  127. * Returned by a server in response to an ADMIN message when there is an error in
  128. * finding the appropriate information.
  129. */
  130. const ERR_NOADMININFO = '423';
  131. /**
  132. * File error doing <file op> on <file>
  133. *
  134. * Generic error message used to report a failed file operation during the
  135. * processing of a message.
  136. */
  137. const ERR_FILEERROR = '424';
  138. /**
  139. * No nickname given
  140. *
  141. * Returned when a nickname parameter expected for a command and isn't found.
  142. */
  143. const ERR_NONICKNAMEGIVEN = '431';
  144. /**
  145. * <nick> Erroneus nickname
  146. *
  147. * Returned after receiving a NICK message which contains characters which do not
  148. * fall in the defined set. See section x.x.x for details on valid nicknames.
  149. */
  150. const ERR_ERRONEUSNICKNAME = '432';
  151. /**
  152. * <nick> Nickname is already in use
  153. *
  154. * Returned when a NICK message is processed that results in an attempt to change
  155. * to a currently existing nickname.
  156. */
  157. const ERR_NICKNAMEINUSE = '433';
  158. /**
  159. * <nick> Nickname collision KILL
  160. *
  161. * Returned by a server to a client when it detects a nickname collision
  162. * (registered of a NICK that already exists by another server).
  163. */
  164. const ERR_NICKCOLLISION = '436';
  165. /**
  166. * <nick> <channel> They aren't on that channel
  167. *
  168. * Returned by the server to indicate that the target user of the command is not
  169. * on the given channel.
  170. */
  171. const ERR_USERNOTINCHANNEL = '441';
  172. /**
  173. * <channel> You're not on that channel
  174. *
  175. * Returned by the server whenever a client tries to perform a channel effecting
  176. * command for which the client isn't a member.
  177. */
  178. const ERR_NOTONCHANNEL = '442';
  179. /**
  180. * <user> <channel> is already on channel
  181. *
  182. * Returned when a client tries to invite a user to a channel they are already
  183. * on.
  184. */
  185. const ERR_USERONCHANNEL = '443';
  186. /**
  187. * <user> User not logged in
  188. *
  189. * Returned by the summon after a SUMMON command for a user was unable to be
  190. * performed since they were not logged in.
  191. */
  192. const ERR_NOLOGIN = '444';
  193. /**
  194. * SUMMON has been disabled
  195. *
  196. * Returned as a response to the SUMMON command. Must be returned by any server
  197. * which does not implement it.
  198. */
  199. const ERR_SUMMONDISABLED = '445';
  200. /**
  201. * USERS has been disabled
  202. *
  203. * Returned as a response to the USERS command. Must be returned by any server
  204. * which does not implement it.
  205. */
  206. const ERR_USERSDISABLED = '446';
  207. /**
  208. * You have not registered
  209. *
  210. * Returned by the server to indicate that the client must be registered before
  211. * the server will allow it to be parsed in detail.
  212. */
  213. const ERR_NOTREGISTERED = '451';
  214. /**
  215. * <command> Not enough parameters
  216. *
  217. * Returned by the server by numerous commands to indicate to the client that it
  218. * didn't supply enough parameters.
  219. */
  220. const ERR_NEEDMOREPARAMS = '461';
  221. /**
  222. * You may not reregister
  223. *
  224. * Returned by the server to any link which tries to change part of the
  225. * registered details (such as password or user details from second USER
  226. * message).
  227. */
  228. const ERR_ALREADYREGISTRED = '462';
  229. /**
  230. * Your host isn't among the privileged
  231. *
  232. * Returned to a client which attempts to register with a server which does not
  233. * been setup to allow connections from the host the attempted connection is
  234. * tried.
  235. */
  236. const ERR_NOPERMFORHOST = '463';
  237. /**
  238. * Password incorrect
  239. *
  240. * Returned to indicate a failed attempt at registering a connection for which a
  241. * password was required and was either not given or incorrect.
  242. */
  243. const ERR_PASSWDMISMATCH = '464';
  244. /**
  245. * You are banned from this server
  246. *
  247. * Returned after an attempt to connect and register yourself with a server which
  248. * has been setup to explicitly deny connections to you.
  249. */
  250. const ERR_YOUREBANNEDCREEP = '465';
  251. /**
  252. * <channel> Channel key already set
  253. */
  254. const ERR_KEYSET = '467';
  255. /**
  256. * <channel> Cannot join channel (+l)
  257. */
  258. const ERR_CHANNELISFULL = '471';
  259. /**
  260. * <char> is unknown mode char to me
  261. */
  262. const ERR_UNKNOWNMODE = '472';
  263. /**
  264. * <channel> Cannot join channel (+i)
  265. */
  266. const ERR_INVITEONLYCHAN = '473';
  267. /**
  268. * <channel> Cannot join channel (+b)
  269. */
  270. const ERR_BANNEDFROMCHAN = '474';
  271. /**
  272. * <channel> Cannot join channel (+k)
  273. */
  274. const ERR_BADCHANNELKEY = '475';
  275. /**
  276. * Permission Denied- You're not an IRC operator
  277. *
  278. * Any command requiring operator privileges to operate must return this error to
  279. * indicate the attempt was unsuccessful.
  280. */
  281. const ERR_NOPRIVILEGES = '481';
  282. /**
  283. * <channel> You're not channel operator
  284. *
  285. * Any command requiring 'chanop' privileges (such as MODE messages) must return
  286. * this error if the client making the attempt is not a chanop on the specified
  287. * channel.
  288. */
  289. const ERR_CHANOPRIVSNEEDED = '482';
  290. /**
  291. * You cant kill a server!
  292. *
  293. * Any attempts to use the KILL command on a server are to be refused and this
  294. * error returned directly to the client.
  295. */
  296. const ERR_CANTKILLSERVER = '483';
  297. /**
  298. * No O-lines for your host
  299. *
  300. * If a client sends an OPER message and the server has not been configured to
  301. * allow connections from the client's host as an operator, this error must be
  302. * returned.
  303. */
  304. const ERR_NOOPERHOST = '491';
  305. /**
  306. * Unknown MODE flag
  307. *
  308. * Returned by the server to indicate that a MODE message was sent with a
  309. * nickname parameter and that the a mode flag sent was not recognized.
  310. */
  311. const ERR_UMODEUNKNOWNFLAG = '501';
  312. /**
  313. * Cant change mode for other users
  314. *
  315. * Error sent to any user trying to view or change the user mode for a user other
  316. * than themselves.
  317. */
  318. const ERR_USERSDONTMATCH = '502';
  319. /**
  320. * Dummy reply number. Not used.
  321. */
  322. const RPL_NONE = '300';
  323. /**
  324. * [<reply>{<space><reply>}]
  325. *
  326. * Reply format used by USERHOST to list replies to the query list. The reply
  327. * string is composed as follows <reply> = <nick>['*'] '=' <'+'|'-'><hostname>
  328. * The '*' indicates whether the client has registered as an Operator. The '-' or
  329. * '+' characters represent whether the client has set an AWAY message or not
  330. * respectively.
  331. */
  332. const RPL_USERHOST = '302';
  333. /**
  334. * [<nick> {<space><nick>}]
  335. *
  336. * Reply format used by ISON to list replies to the query list.
  337. */
  338. const RPL_ISON = '303';
  339. /**
  340. * <nick> <away message>
  341. */
  342. const RPL_AWAY = '301';
  343. /**
  344. * You are no longer marked as being away
  345. */
  346. const RPL_UNAWAY = '305';
  347. /**
  348. * You have been marked as being away
  349. *
  350. * These replies are used with the AWAY command (if allowed). RPL_AWAY is sent to
  351. * any client sending a PRIVMSG to a client which is away. RPL_AWAY is only sent
  352. * by the server to which the client is connected. Replies RPL_UNAWAY and
  353. * RPL_NOWAWAY are sent when the client removes and sets an AWAY message.
  354. */
  355. const RPL_NOWAWAY = '306';
  356. /**
  357. * <nick> <user> <host> * <real name>
  358. */
  359. const RPL_WHOISUSER = '311';
  360. /**
  361. * <nick> <server> <server info>
  362. */
  363. const RPL_WHOISSERVER = '312';
  364. /**
  365. * <nick> is an IRC operator
  366. */
  367. const RPL_WHOISOPERATOR = '313';
  368. /**
  369. * <nick> <integer> seconds idle
  370. */
  371. const RPL_WHOISIDLE = '317';
  372. /**
  373. * <nick> End of /WHOIS list
  374. */
  375. const RPL_ENDOFWHOIS = '318';
  376. /**
  377. * <nick> {[@|+]<channel><space>}
  378. *
  379. * Replies 311 - 313, 317 - 319 are all replies generated in response to a WHOIS
  380. * message. Given that there are enough parameters present, the answering server
  381. * must either formulate a reply out of the above numerics (if the query nick is
  382. * found) or return an error reply. The '*' in RPL_WHOISUSER is there as the
  383. * literal character and not as a wild card. For each reply set, only
  384. * RPL_WHOISCHANNELS may appear more than once (for long lists of channel names).
  385. * The '@' and '+' characters next to the channel name indicate whether a client
  386. * is a channel operator or has been granted permission to speak on a moderated
  387. * channel. The RPL_ENDOFWHOIS reply is used to mark the end of processing a
  388. * WHOIS message.
  389. */
  390. const RPL_WHOISCHANNELS = '319';
  391. /**
  392. * <nick> <user> <host> * <real name>
  393. */
  394. const RPL_WHOWASUSER = '314';
  395. /**
  396. * <nick> End of WHOWAS
  397. *
  398. * When replying to a WHOWAS message, a server must use the replies
  399. * RPL_WHOWASUSER, RPL_WHOISSERVER or ERR_WASNOSUCHNICK for each nickname in the
  400. * presented list. At the end of all reply batches, there must be RPL_ENDOFWHOWAS
  401. * (even if there was only one reply and it was an error).
  402. */
  403. const RPL_ENDOFWHOWAS = '369';
  404. /**
  405. * Channel Users Name
  406. */
  407. const RPL_LISTSTART = '321';
  408. /**
  409. * <channel> <# visible> <topic>
  410. */
  411. const RPL_LIST = '322';
  412. /**
  413. * End of /LIST
  414. *
  415. * Replies RPL_LISTSTART, RPL_LIST, RPL_LISTEND mark the start, actual replies
  416. * with data and end of the server's response to a LIST command. If there are no
  417. * channels available to return, only the start and end reply must be sent.
  418. */
  419. const RPL_LISTEND = '323';
  420. /**
  421. * <channel> <mode> <mode params>
  422. */
  423. const RPL_CHANNELMODEIS = '324';
  424. /**
  425. * <channel> No topic is set
  426. */
  427. const RPL_NOTOPIC = '331';
  428. /**
  429. * <channel> <topic>
  430. *
  431. * When sending a TOPIC message to determine the channel topic, one of two
  432. * replies is sent. If the topic is set, RPL_TOPIC is sent back else RPL_NOTOPIC.
  433. */
  434. const RPL_TOPIC = '332';
  435. /**
  436. * <channel> <nick>
  437. *
  438. * Returned by the server to indicate that the attempted INVITE message was
  439. * successful and is being passed onto the end client.
  440. */
  441. const RPL_INVITING = '341';
  442. /**
  443. * <user> Summoning user to IRC
  444. *
  445. * Returned by a server answering a SUMMON message to indicate that it is
  446. * summoning that user.
  447. */
  448. const RPL_SUMMONING = '342';
  449. /**
  450. * <version>.<debuglevel> <server> <comments>
  451. *
  452. * Reply by the server showing its version details. The <version> is the version
  453. * of the software being used (including any patchlevel revisions) and the
  454. * <debuglevel> is used to indicate if the server is running in "debug mode". The
  455. * "comments" field may contain any comments about the version or further version
  456. * details.
  457. */
  458. const RPL_VERSION = '351';
  459. /**
  460. * <channel> <user> <host> <server> <nick> <H|G>[*][@|+] <hopcount> <real name>
  461. */
  462. const RPL_WHOREPLY = '352';
  463. /**
  464. * <name> End of /WHO list
  465. *
  466. * The RPL_WHOREPLY and RPL_ENDOFWHO pair are used to answer a WHO message. The
  467. * RPL_WHOREPLY is only sent if there is an appropriate match to the WHO query.
  468. * If there is a list of parameters supplied with a WHO message, a RPL_ENDOFWHO
  469. * must be sent after processing each list item with <name> being the item.
  470. */
  471. const RPL_ENDOFWHO = '315';
  472. /**
  473. * <channel> [[@|+]<nick> [[@|+]<nick> [...]]]
  474. */
  475. const RPL_NAMREPLY = '353';
  476. /**
  477. * <channel> End of /NAMES list
  478. *
  479. * To reply to a NAMES message, a reply pair consisting of RPL_NAMREPLY and
  480. * RPL_ENDOFNAMES is sent by the server back to the client. If there is no
  481. * channel found as in the query, then only RPL_ENDOFNAMES is returned. The
  482. * exception to this is when a NAMES message is sent with no parameters and all
  483. * visible channels and contents are sent back in a series of RPL_NAMEREPLY
  484. * messages with a RPL_ENDOFNAMES to mark the end.
  485. */
  486. const RPL_ENDOFNAMES = '366';
  487. /**
  488. * <mask> <server> <hopcount> <server info>
  489. */
  490. const RPL_LINKS = '364';
  491. /**
  492. * <mask> End of /LINKS list
  493. *
  494. * In replying to the LINKS message, a server must send replies back using the
  495. * RPL_LINKS numeric and mark the end of the list using an RPL_ENDOFLINKS reply.v
  496. */
  497. const RPL_ENDOFLINKS = '365';
  498. /**
  499. * <channel> <banid>
  500. */
  501. const RPL_BANLIST = '367';
  502. /**
  503. * <channel> End of channel ban list
  504. *
  505. * When listing the active 'bans' for a given channel, a server is required to
  506. * send the list back using the RPL_BANLIST and RPL_ENDOFBANLIST messages. A
  507. * separate RPL_BANLIST is sent for each active banid. After the banids have been
  508. * listed (or if none present) a RPL_ENDOFBANLIST must be sent.
  509. */
  510. const RPL_ENDOFBANLIST = '368';
  511. /**
  512. * <string>
  513. */
  514. const RPL_INFO = '371';
  515. /**
  516. * End of /INFO list
  517. *
  518. * A server responding to an INFO message is required to send all its 'info' in a
  519. * series of RPL_INFO messages with a RPL_ENDOFINFO reply to indicate the end of
  520. * the replies.
  521. */
  522. const RPL_ENDOFINFO = '374';
  523. /**
  524. * - <server> Message of the day -
  525. */
  526. const RPL_MOTDSTART = '375';
  527. /**
  528. * - <text>
  529. */
  530. const RPL_MOTD = '372';
  531. /**
  532. * End of /MOTD command
  533. *
  534. * When responding to the MOTD message and the MOTD file is found, the file is
  535. * displayed line by line, with each line no longer than 80 characters, using
  536. * RPL_MOTD format replies. These should be surrounded by a RPL_MOTDSTART (before
  537. * the RPL_MOTDs) and an RPL_ENDOFMOTD (after).
  538. */
  539. const RPL_ENDOFMOTD = '376';
  540. /**
  541. * You are now an IRC operator
  542. *
  543. * RPL_YOUREOPER is sent back to a client which has just successfully issued an
  544. * OPER message and gained operator status.
  545. */
  546. const RPL_YOUREOPER = '381';
  547. /**
  548. * <config file> Rehashing
  549. *
  550. * If the REHASH option is used and an operator sends a REHASH message, an
  551. * RPL_REHASHING is sent back to the operator.
  552. */
  553. const RPL_REHASHING = '382';
  554. /**
  555. * <server> <string showing server's local time>
  556. *
  557. * When replying to the TIME message, a server must send the reply using the
  558. * RPL_TIME format above. The string showing the time need only contain the
  559. * correct day and time there. There is no further requirement for the time
  560. * string.
  561. */
  562. const RPL_TIME = '391';
  563. /**
  564. * UserID Terminal Host
  565. */
  566. const RPL_USERSSTART = '392';
  567. /**
  568. * %-8s %-9s %-8s
  569. */
  570. const RPL_USERS = '393';
  571. /**
  572. * End of users
  573. */
  574. const RPL_ENDOFUSERS = '394';
  575. /**
  576. * Nobody logged in
  577. *
  578. * If the USERS message is handled by a server, the replies RPL_USERSTART,
  579. * RPL_USERS, RPL_ENDOFUSERS and RPL_NOUSERS are used. RPL_USERSSTART must be
  580. * sent first, following by either a sequence of RPL_USERS or a single
  581. * RPL_NOUSER. Following this is RPL_ENDOFUSERS.
  582. */
  583. const RPL_NOUSERS = '395';
  584. /**
  585. * Link <version & debug level> <destination> <next server>
  586. */
  587. const RPL_TRACELINK = '200';
  588. /**
  589. * Try. <class> <server>
  590. */
  591. const RPL_TRACECONNECTING = '201';
  592. /**
  593. * H.S. <class> <server>
  594. */
  595. const RPL_TRACEHANDSHAKE = '202';
  596. /**
  597. * ???? <class> [<client IP address in dot form>]
  598. */
  599. const RPL_TRACEUNKNOWN = '203';
  600. /**
  601. * Oper <class> <nick>
  602. */
  603. const RPL_TRACEOPERATOR = '204';
  604. /**
  605. * User <class> <nick>
  606. */
  607. const RPL_TRACEUSER = '205';
  608. /**
  609. * Serv <class> <int>S <int>C <server> <nick!user|*!*>@<host|server>
  610. */
  611. const RPL_TRACESERVER = '206';
  612. /**
  613. * <newtype> 0 <client name>
  614. */
  615. const RPL_TRACENEWTYPE = '208';
  616. /**
  617. * File <logfile> <debug level>
  618. *
  619. * The RPL_TRACE* are all returned by the server in response to the TRACE
  620. * message. How many are returned is dependent on the the TRACE message and
  621. * whether it was sent by an operator or not. There is no predefined order for
  622. * which occurs first. Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and
  623. * RPL_TRACEHANDSHAKE are all used for connections which have not been fully
  624. * established and are either unknown, still attempting to connect or in the
  625. * process of completing the 'server handshake'. RPL_TRACELINK is sent by any
  626. * server which handles a TRACE message and has to pass it on to another server.
  627. * The list of RPL_TRACELINKs sent in response to a TRACE command traversing the
  628. * IRC network should reflect the actual connectivity of the servers themselves
  629. * along that path. RPL_TRACENEWTYPE is to be used for any connection which does
  630. * not fit in the other categories but is being displayed anyway.
  631. */
  632. const RPL_TRACELOG = '261';
  633. /**
  634. * <linkname> <sendq> <sent messages> <sent bytes> <received messages> <received
  635. * bytes> <time open>
  636. */
  637. const RPL_STATSLINKINFO = '211';
  638. /**
  639. * <command> <count>
  640. */
  641. const RPL_STATSCOMMANDS = '212';
  642. /**
  643. * C <host> * <name> <port> <class>
  644. */
  645. const RPL_STATSCLINE = '213';
  646. /**
  647. * N <host> * <name> <port> <class>
  648. */
  649. const RPL_STATSNLINE = '214';
  650. /**
  651. * I <host> * <host> <port> <class>
  652. */
  653. const RPL_STATSILINE = '215';
  654. /**
  655. * K <host> * <username> <port> <class>
  656. */
  657. const RPL_STATSKLINE = '216';
  658. /**
  659. * Y <class> <ping frequency> <connect frequency> <max sendq>
  660. */
  661. const RPL_STATSYLINE = '218';
  662. /**
  663. * <stats letter> End of /STATS report
  664. */
  665. const RPL_ENDOFSTATS = '219';
  666. /**
  667. * L <hostmask> * <servername> <maxdepth>
  668. */
  669. const RPL_STATSLLINE = '241';
  670. /**
  671. * Server Up %d days %d%02d%02d
  672. */
  673. const RPL_STATSUPTIME = '242';
  674. /**
  675. * O <hostmask> * <name>
  676. */
  677. const RPL_STATSOLINE = '243';
  678. /**
  679. * H <hostmask> * <servername>
  680. */
  681. const RPL_STATSHLINE = '244';
  682. /**
  683. * <user mode string>
  684. *
  685. * To answer a query about a client's own mode, RPL_UMODEIS is sent back.
  686. */
  687. const RPL_UMODEIS = '221';
  688. /**
  689. * There are <integer> users and <integer> invisible on <integer> servers
  690. */
  691. const RPL_LUSERCLIENT = '251';
  692. /**
  693. * <integer> operator(s) online
  694. */
  695. const RPL_LUSEROP = '252';
  696. /**
  697. * <integer> unknown connection(s)
  698. */
  699. const RPL_LUSERUNKNOWN = '253';
  700. /**
  701. * <integer> channels formed
  702. */
  703. const RPL_LUSERCHANNELS = '254';
  704. /**
  705. * I have <integer> clients and <integer> servers
  706. *
  707. * In processing an LUSERS message, the server sends a set of replies from
  708. * RPL_LUSERCLIENT, RPL_LUSEROP, RPL_USERUNKNOWN, RPL_LUSERCHANNELS and
  709. * RPL_LUSERME. When replying, a server must send back RPL_LUSERCLIENT and
  710. * RPL_LUSERME. The other replies are only sent back if a non-zero count is found
  711. * for them.
  712. */
  713. const RPL_LUSERME = '255';
  714. /**
  715. * <server> Administrative info
  716. */
  717. const RPL_ADMINME = '256';
  718. /**
  719. * <admin info>
  720. */
  721. const RPL_ADMINLOC1 = '257';
  722. /**
  723. * <admin info>
  724. */
  725. const RPL_ADMINLOC2 = '258';
  726. /**
  727. * <admin info>
  728. *
  729. * When replying to an ADMIN message, a server is expected to use replies
  730. * RLP_ADMINME through to RPL_ADMINEMAIL and provide a text message with each.
  731. * For RPL_ADMINLOC1 a description of what city, state and country the server is
  732. * in is expected, followed by details of the university and department
  733. * (RPL_ADMINLOC2) and finally the administrative contact for the server (an
  734. * email address here is required) in RPL_ADMINEMAIL.
  735. */
  736. const RPL_ADMINEMAIL = '259';
  737. /**
  738. * Reply code sent by the server, which can be compared to the ERR_* and
  739. * RPL_* constants
  740. *
  741. * @var string
  742. */
  743. protected $code;
  744. /**
  745. * Reply code description sent by the server.
  746. *
  747. * @var string
  748. */
  749. protected $description;
  750. /**
  751. * Raw data sent by the server
  752. *
  753. * @var string
  754. */
  755. protected $rawData;
  756. /**
  757. * Event type
  758. *
  759. * @var string
  760. */
  761. protected $type = 'response';
  762. /**
  763. * Sets the reply code sent by the server.
  764. *
  765. * @param string $code Reply code
  766. *
  767. * @return Phergie_Event_Response Provides a fluent interface
  768. */
  769. public function setCode($code)
  770. {
  771. $this->code = $code;
  772. return $this;
  773. }
  774. /**
  775. * Returns the reply code sent by the server.
  776. *
  777. * @return string
  778. */
  779. public function getCode()
  780. {
  781. return $this->code;
  782. }
  783. /**
  784. * Sets the reply code description sent by the server.
  785. *
  786. * @param string $description Reply code description
  787. *
  788. * @return Phergie_Event_Response Provides a fluent interface
  789. */
  790. public function setDescription($description)
  791. {
  792. $this->description = $description;
  793. return $this;
  794. }
  795. /**
  796. * Returns the reply code description sent by the server.
  797. *
  798. * @return string
  799. */
  800. public function getDescription()
  801. {
  802. return $this->description;
  803. }
  804. /**
  805. * Sets the raw buffer for the given event
  806. *
  807. * @param string $buffer Raw event buffer
  808. *
  809. * @return Phergie_Event_Response Provides a fluent interface
  810. */
  811. public function setRawData($buffer)
  812. {
  813. $this->rawData = $buffer;
  814. return $this;
  815. }
  816. /**
  817. * Returns the raw buffer that was sent from the server for that event
  818. *
  819. * @return string
  820. */
  821. public function getRawData()
  822. {
  823. return $this->rawData;
  824. }
  825. }