Skip to content

Commit 080d6d8

Browse files
committed
Update line lengths
1 parent 0201d7b commit 080d6d8

1 file changed

Lines changed: 32 additions & 15 deletions

File tree

syslog.class.php

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
* Usage
5252
*
5353
* require_once('syslog.class.php');
54-
* $syslog = new Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, $protocol = NET_SYSLOG_UDP,
55-
* $_procid = NET_SYSLOG_NILVALUE);
54+
* $syslog = new Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE,
55+
* $protocol = NET_SYSLOG_UDP, $_procid = NET_SYSLOG_NILVALUE);
5656
* $syslog->logger($priority = LOG_LOCAL0 + LOG_NOTICE, $content = "");
5757
* or
58-
* $syslog->logger542X($priority = 133, $content = "Default content", $msgid = NET_SYSLOG_NILVALUE,
59-
* $structured_data = NET_SYSLOG_NILVALUE);
58+
* $syslog->logger542X($priority = 133, $content = "Default content",
59+
* $msgid = NET_SYSLOG_NILVALUE, $structured_data = NET_SYSLOG_NILVALUE);
6060
* or
6161
* $syslog->logger3164($priority = 133, $content = "Default content");
6262
*
@@ -121,13 +121,12 @@
121121
* You should have received a copy of the GNU General Public License
122122
* along with this program. If not, see <http://www.gnu.org/licenses/>.
123123
*
124-
* @category Networking
125-
* @package Net_Syslog
126-
* @author Laurent Vromman <laurent@vromman.org>
127-
* @copyright 2013 Laurent Vromman
128-
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 3
129-
* @version SVN: $Id$
130-
* @link http://pear.php.net/package/Net_Syslog
124+
* @category Networking
125+
* @package Net_Syslog
126+
* @author Laurent Vromman <laurent@vromman.org>
127+
* @copyright 2013 Laurent Vromman
128+
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 3
129+
* @link http://pear.php.net/package/Net_Syslog
131130
*/
132131

133132

@@ -218,7 +217,14 @@
218217
*/
219218
class Net_Syslog
220219
{
221-
private $_hostname; // no embedded space, no domain name, only a-z A-Z 0-9 and other authorized characters
220+
/**
221+
* Sender hostname
222+
* No domain name, only a-z A-Z 0-9 and other authorized characters
223+
*
224+
* @acess private
225+
* @var string
226+
*/
227+
private $_hostname;
222228
private $_server; // Syslog destination server
223229
private $_port; // Standard syslog port is 514 or 6514 for RFC 5425 (TLS)
224230
private $_protocol; // Allow to specify between udp, tcp, ssl and tls
@@ -257,7 +263,10 @@ public function Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE,
257263
$this->setHostname($hostname);
258264

259265
$this->setProtocol($protocol);
260-
if (!in_array($this->_protocol, array(NET_SYSLOG_UDP, NET_SYSLOG_TCP, NET_SYSLOG_SSL, NET_SYSLOG_TLS))) {
266+
if (!in_array($this->_protocol,
267+
array(NET_SYSLOG_UDP, NET_SYSLOG_TCP, NET_SYSLOG_SSL, NET_SYSLOG_TLS)
268+
)
269+
) {
261270
$this->_protocol = NET_SYSLOG_UDP;
262271
}
263272
// RFC5425
@@ -349,7 +358,13 @@ private function openSocket ()
349358
}
350359
$sslContext = stream_context_create($contextOptions);
351360

352-
$this->_socket = stream_socket_client($this->_protocol."://".$this->_server.":".$this->_port, $errno, $errstr, ini_get("default_socket_timeout"), STREAM_CLIENT_CONNECT, $sslContext);
361+
$this->_socket = stream_socket_client(
362+
$this->_protocol."://".$this->_server.":".$this->_port,
363+
$errno,
364+
$errstr,
365+
ini_get("default_socket_timeout"),
366+
STREAM_CLIENT_CONNECT,
367+
$sslContext);
353368

354369
if (!$this->_socket) {
355370
throw new Exception("ERROR: $errno - $errstr");
@@ -406,7 +421,9 @@ public function logger($priority = 133, $content = "Default content",
406421
}
407422
else {
408423
$actualtime = time();
409-
$timestamp = date("M ", $actualtime).substr(date(" j", $actualtime), -2).date(" H:i:s", $actualtime);
424+
$timestamp = date("M ", $actualtime)
425+
.substr(date(" j", $actualtime), -2)
426+
.date(" H:i:s", $actualtime);
410427
$syslog_version = "";
411428
}
412429
$header = $pri.$syslog_version.$timestamp." ".$this->_hostname." ";

0 commit comments

Comments
 (0)