@@ -353,53 +353,114 @@ private function getServerAddress()
353353 }
354354 }
355355
356+ /**
357+ * RFC Mode setter
358+ *
359+ * @param int $rfc The RFC mode. Can be NET_SYSLOG_RFC542X or NET_SYSLOG_RFC3164
360+ *
361+ * @access public
362+ */
356363 public function setRFC ($ rfc )
357364 {
358365 $ this ->_rfc = $ rfc ;
359366 }
360367
368+ /**
369+ * Sender hostname setter
370+ *
371+ * @param string $hostname No domain name, only a-z A-Z 0-9 and other authorized characters
372+ *
373+ * @access public
374+ */
361375 public function setHostname ($ hostname )
362376 {
363377 $ this ->_hostname = substr ($ hostname , 0 , 255 );
364378 if (strlen ($ this ->_hostname ) == 0 ) $ this ->_hostname = NET_SYSLOG_NILVALUE ;
365379 }
366380
381+ /**
382+ * Remote server address setter
383+ *
384+ * @param string $server Can be an ip or a network name
385+ *
386+ * @access public
387+ */
367388 public function setServer ($ server )
368389 {
369390 $ this ->_server = $ server ;
370391 }
371392
393+ /**
394+ * Remote server port setter
395+ *
396+ * @param int $port TCP or UDP port on the remote syslog server
397+ *
398+ * @access public
399+ */
372400 public function setPort ($ port )
373401 {
374402 if ((intval ($ port ) > 0 ) && (intval ($ port ) < 65536 )) {
375403 $ this ->_port = intval ($ port );
376404 }
377405 }
378406
407+ /**
408+ * Protocol setter
409+ *
410+ * @param string $protocol Can be NET_SYSLOG_UDP, NET_SYSLOG_TCP, NET_SYSLOG_SSL or NET_SYSLOG_TLS
411+ *
412+ * @access public
413+ */
379414 public function setProtocol ($ protocol )
380415 {
381416 if (in_array ($ protocol , array (NET_SYSLOG_UDP , NET_SYSLOG_TCP , NET_SYSLOG_SSL , NET_SYSLOG_TLS ))) {
382417 $ this ->_protocol = $ protocol ;
383418 }
384419 }
385420
421+ /**
422+ * CA File setter
423+ *
424+ * @param string $cafile Filename for CA Certificate used in SSL connection, if necessary
425+ *
426+ * @access public
427+ */
386428 public function setCAFile ($ cafile )
387429 {
388430 $ this ->_cafile = $ cafile ;
389431 }
390432
433+ /**
434+ * ProcID setter
435+ *
436+ * @param string $procid ProcID as defined in RFC 5424
437+ *
438+ * @access public
439+ */
391440 public function setProcid ($ procid )
392441 {
393442 $ this ->_procid = substr ($ procid , 0 , 128 );
394443 if (strlen ($ this ->_procid ) == 0 ) $ this ->_procid = NET_SYSLOG_NILVALUE ;
395444 }
396445
446+ /**
447+ * AppName setter
448+ *
449+ * @param string $appname AppName as defined in RFC 5424
450+ *
451+ * @access public
452+ */
397453 public function setAppname ($ appname )
398454 {
399455 $ this ->_appname = substr ($ appname , 0 , 48 );
400456 if (strlen ($ this ->_appname ) == 0 ) $ this ->_appname = NET_SYSLOG_NILVALUE ;
401457 }
402458
459+ /**
460+ * Open the socket to connect to the remote syslog server
461+ *
462+ * @access private
463+ */
403464 private function openSocket ()
404465 {
405466 if ($ this ->_socket )
@@ -429,6 +490,11 @@ private function openSocket ()
429490 }
430491 }
431492
493+ /**
494+ * Close the socket to the remote syslog server
495+ *
496+ * @access private
497+ */
432498 private function closeSocket ()
433499 {
434500 fclose ($ this ->_socket );
0 commit comments