?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
PK q6[i Sys/Hostname/FQDN.pmnu W+A package Sys::Hostname::FQDN;
#use 5.006;
use strict;
#use warnings;
use Carp;
use vars qw($VERSION @ISA @EXPORT_OK);
$VERSION = do { my @r = (q$Revision: 0.11 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
require Exporter;
require DynaLoader;
#use AutoLoader;
@ISA = qw(Exporter DynaLoader);
@EXPORT_OK = qw (
asciihostinfo
gethostinfo
inet_ntoa
inet_aton
fqdn
short
);
bootstrap Sys::Hostname::FQDN $VERSION;
# Preloaded methods go here.
sub DESTROY {};
# Autoload methods go after =cut, and are processed by the autosplit program.
sub short {
return (split(/\./,&usually_short))[0];
}
sub fqdn {
return (gethostbyname(&usually_short))[0];
}
sub gethostinfo {
return gethostbyname(&usually_short);
}
sub asciihostinfo {
my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname(&usually_short);
for(0..$#addrs) {
$addrs[$_] = inet_ntoa($addrs[$_]);
}
return ($name,$aliases,$addrtype,$length,@addrs);
}
=head1 NAME
Sys::Hostname::FQDN - Get the short or long hostname
=cut
1;
__END__
=head1 SYNOPSIS
use Sys::Hostname::FQDN qw(
asciihostinfo
gethostinfo
inet_ntoa
inet_aton
fqdn
short
);
$host = short();
$fqdn = fqdn();
($name,$aliases,$addrtype,$length,@addrs)=gethostinfo();
($name,$aliases,$addrtype,$length,@addrs)=asciihostinfo();
$dotquad = inet_ntoa($netaddr);
$netaddr = inet_aton($dotquad);
=head1 INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
Solaris users, see the 'hints' subdirectory if you have problems with the
build.
=head1 DESCRIPTION
B uses the host 'C' library to discover the (usually)
short host name, then uses (perl) gethostbyname to extract the real
hostname.
The results from gethostbyname are exported as B and
B as a convenience since they are available. Similarly, the
'C' library functions B and B are exported.
=over 4
=item $host = short();
returns the host part of this host's FQDN.
=item $fqdn = fqdn();
returns the fully qualified host name of this host.
=item ($name,$aliases,$addrtype,$length,@addrs)=gethostinfo();
returns:
$name fully qualifed host name of this host.
$aliases alternate names for this host.
$addrtype The type of address; always AF_INET at present.
$length The length of the address in bytes.
@addrs array of network addresses for this host
in network byte order.
=item ($name,$aliases,$addrtype,$length,@addrs)=asciihostinfo();
returns:
$name fully qualifed host name of this host.
$aliases alternate names for this host.
$addrtype The type of address; always AF_INET at present.
$length The length of the address in bytes.
@addrs array of dot quad IP addresses for this host.
=item $dotquad = inet_ntoa($netaddr);
input: packed network address in network byte order.
returns: dot quad IP address.
=item $netaddr = inet_aton($dotquad);
input: dot quad IP address.
returns: packed network address in network byte order.
=back
=head1 DEPENDENCIES
none
=head1 EXPORT
None by default
=head1 EXPORT_OK
asciihostinfo
gethostinfo
inet_ntoa
inet_aton
fqdn
short
=head1 ACKNOWLEDGEMENTS
The workaround for systems that do not have 'inet_aton' is taken directly
from Socket.xs in the Perl 5 kit for perl-5.8.0 by Larry Wall, copyright
1989-2002. Thank you Larry for making PERL possible for all of us.
=head1 AUTHOR
Michael Robinton
=head1 COPYRIGHT AND LICENCE
Copyright 2003-2010, Michael Robinton
This module is free software; you can redistribute it and/or modify it
under the terms of either:
a) the GNU General Public License as published by the Free Software
Foundation; either version 1, or (at your option) any later version,
or
b) the "Artistic License" which comes with this module.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
the GNU General Public License or the Artistic License for more details.
You should have received a copy of the Artistic License with this
module, in the file ARTISTIC. If not, I'll be glad to provide one.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
=cut
PK B[{w Log/Syslog/Fast/PP.pmnu W+A package Log::Syslog::Fast::PP;
use 5.006002;
use strict;
use warnings;
require Exporter;
use Carp 'croak';
our @ISA = qw(Exporter);
# protocols
use constant LOG_UDP => 0; # UDP
use constant LOG_TCP => 1; # TCP
use constant LOG_UNIX => 2; # UNIX socket
# format
use constant LOG_RFC3164 => 0;
use constant LOG_RFC5424 => 1;
use POSIX 'strftime';
use IO::Socket::INET;
use IO::Socket::UNIX;
our %EXPORT_TAGS = (
protos => [qw/ LOG_TCP LOG_UDP LOG_UNIX /],
formats => [qw/ LOG_RFC3164 LOG_RFC5424 /],
);
push @{ $EXPORT_TAGS{'all'} }, @{ $EXPORT_TAGS{'protos'} };
push @{ $EXPORT_TAGS{'all'} }, @{ $EXPORT_TAGS{'formats'} };
our @EXPORT_OK = @{ $EXPORT_TAGS{'all'} };
our @EXPORT = qw();
use constant PRIORITY => 0;
use constant SENDER => 1;
use constant NAME => 2;
use constant PID => 3;
use constant SOCK => 4;
use constant LAST_TIME => 5;
use constant PREFIX => 6;
use constant PREFIX_LEN => 7;
use constant FORMAT => 8;
sub new {
my $ref = shift;
my $class = ref $ref || $ref;
my ($proto, $hostname, $port, $facility, $severity, $sender, $name) = @_;
my $self = bless [
($facility << 3) | $severity, # prio
$sender, # sender
$name, # name
$$, # pid
undef, # sock
undef, # last_time
undef, # prefix
undef, # prefix_len
LOG_RFC3164, # format
], $class;
$self->update_prefix(time());
$self->set_receiver($proto, $hostname, $port);
return $self;
}
sub update_prefix {
my $self = shift;
my $t = shift;
$self->[LAST_TIME] = $t;
my $timestr = strftime("%h %e %T", localtime $t);
if ($self->[FORMAT] == LOG_RFC5424) {
$timestr = strftime("%Y-%m-%dT%H:%M:%S%z", localtime $t);
}
$self->[PREFIX] = sprintf "<%d>%s %s %s[%d]: ",
$self->[PRIORITY], $timestr, $self->[SENDER], $self->[NAME], $self->[PID];
if ($self->[FORMAT] == LOG_RFC5424) {
$self->[PREFIX] = sprintf "<%d>1 %s %s %s %d - - ",
$self->[PRIORITY], $timestr, $self->[SENDER], $self->[NAME], $self->[PID];
}
}
sub set_receiver {
my $self = shift;
my ($proto, $hostname, $port) = @_;
if ($proto == LOG_TCP) {
$self->[SOCK] = IO::Socket::INET->new(
Proto => 'tcp',
PeerHost => $hostname,
PeerPort => $port,
);
}
elsif ($proto == LOG_UDP) {
$self->[SOCK] = IO::Socket::INET->new(
Proto => 'udp',
PeerHost => $hostname,
PeerPort => $port,
);
}
elsif ($proto == LOG_UNIX) {
eval {
$self->[SOCK] = IO::Socket::UNIX->new(
Proto => SOCK_STREAM,
Peer => $hostname,
);
};
if ($@ || !$self->[SOCK]) {
$self->[SOCK] = IO::Socket::UNIX->new(
Proto => SOCK_DGRAM,
Peer => $hostname,
);
}
}
die "Error in ->set_receiver: $!" unless $self->[SOCK];
}
sub set_priority {
my $self = shift;
my ($facility, $severity) = @_;
$self->[PRIORITY] = ($facility << 3) | $severity;
$self->update_prefix(time);
}
sub set_facility {
my $self = shift;
$self->set_priority(shift, $self->get_severity);
}
sub set_severity {
my $self = shift;
$self->set_priority($self->get_facility, shift);
}
sub set_sender {
my $self = shift;
$self->[SENDER] = shift;
$self->update_prefix(time);
}
sub set_name {
my $self = shift;
$self->[NAME] = shift;
$self->update_prefix(time);
}
sub set_pid {
my $self = shift;
$self->[PID] = shift;
$self->update_prefix(time);
}
sub set_format {
my $self = shift;
$self->[FORMAT] = shift;
$self->update_prefix(time);
}
sub send {
my $now = $_[2] || time;
# update the prefix if seconds have rolled over
if ($now != $_[0][LAST_TIME]) {
$_[0]->update_prefix($now);
}
send $_[0][SOCK], $_[0][PREFIX] . $_[1], 0;
}
sub get_priority {
my $self = shift;
return $self->[PRIORITY];
}
sub get_facility {
my $self = shift;
return $self->[PRIORITY] >> 3;
}
sub get_severity {
my $self = shift;
return $self->[PRIORITY] & 7;
}
sub get_sender {
my $self = shift;
return $self->[SENDER];
}
sub get_name {
my $self = shift;
return $self->[NAME];
}
sub get_pid {
my $self = shift;
return $self->[PID];
}
sub get_format {
my $self = shift;
return $self->[FORMAT];
}
1;
__END__
=head1 NAME
Log::Syslog::Fast::PP - XS-free, API-compatible version of Log::Syslog::Fast
=head1 SYNOPSIS
use Log::Syslog::Fast::PP ':all';
my $logger = Log::Syslog::Fast::PP->new(LOG_UDP, "127.0.0.1", 514, LOG_LOCAL0, LOG_INFO, "mymachine", "logger");
$logger->send("log message", time);
=head1 DESCRIPTION
This module should be fully API-compatible with L; refer to
its documentation for usage.
=head1 AUTHOR
Adam Thomason, Eathomason@cpan.orgE
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009-2011 by Say Media, Inc.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.
=cut
PK B[^k Log/Syslog/Fast/XS.pmnu W+A package Log::Syslog::Fast::XS;
use 5.006002;
use strict;
use warnings;
require Exporter;
use Log::Syslog::Constants ();
use Carp 'croak';
our $VERSION = '0.58';
require XSLoader;
XSLoader::load('Log::Syslog::Fast::XS', $VERSION);
1;
__END__
=head1 NAME
Log::Syslog::Fast::XS - XS implementation of Log::Syslog::Fast
=head1 DESCRIPTION
This is the XS implementation of L. See its documentation
for usage.
=head1 AUTHOR
Adam Thomason, Eathomason@cpan.orgE
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009-2011 by Say Media, Inc.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.
=cut
PK B[+5I I Log/Syslog/Fast/Simple.pmnu W+A package Log::Syslog::Fast::Simple;
use strict;
use warnings;
use Log::Syslog::Fast ':all';
use Sys::Hostname;
require Exporter;
our @ISA = qw(Exporter);
our %EXPORT_TAGS = %Log::Syslog::Fast::EXPORT_TAGS;
our @EXPORT_OK = @Log::Syslog::Fast::EXPORT_OK;
our @EXPORT = qw();
use constant _LOGGERS => 0;
use constant _ARGS => 1;
use constant _PROTO => 0;
use constant _HOSTNAME => 1;
use constant _PORT => 2;
use constant _FACILITY => 3;
use constant _SEVERITY => 4;
use constant _SENDER => 5;
use constant _NAME => 6;
use constant _FORMAT => 7;
sub new {
my $what = shift;
my $class = ref $what || $what;
my $default_name = $0;
$default_name =~ s,.*/,,;
$default_name =~ s/[^\w.-_]//g;
my $args = (@_ == 1 && ref $_[0] eq 'HASH') ? $_[0] : {@_};
$args->{proto} ||= LOG_UDP;
$args->{hostname} ||= '127.0.0.1';
$args->{port} ||= 514;
$args->{facility} ||= LOG_LOCAL0;
$args->{severity} ||= LOG_INFO;
$args->{sender} ||= Sys::Hostname::hostname;
$args->{name} ||= $default_name;
$args->{format} ||= LOG_RFC3164;
return bless [
[], # loggers
[@{ $args }{qw/
proto hostname port facility severity sender name format
/}],
], $class;
}
sub send {
my $severity = $_[3] || $_[0][_ARGS][_SEVERITY];
my $facility = $_[4] || $_[0][_ARGS][_FACILITY];
my $logger = $_[0][_LOGGERS][$facility][$severity];
if (!$logger) {
my @args = @{ $_[0][_ARGS] };
$args[_FACILITY] = $facility;
$args[_SEVERITY] = $severity;
my $format = pop(@args);
$logger = $_[0][_LOGGERS][$facility][$severity] = Log::Syslog::Fast->new(@args);
$logger->set_format($format);
}
return $logger->send($_[1], $_[2] || time);
}
1;
__END__
=head1 NAME
Log::Syslog::Fast::Simple - Wrapper around Log::Syslog::Fast that adds some
flexibility at the expense of additional runtime overhead.
=head1 SYNOPSIS
use Log::Syslog::Fast::Simple;
# Simple usage:
$logger = Log::Syslog::Fast::Simple->new;
$logger->send("log message");
# More customized usage:
$logger = Log::Syslog::Fast::Simple->new(
loghost => 'myloghost',
port => 6666,
facility => LOG_LOCAL2,
severity => LOG_INFO,
sender => 'mymachine',
name => 'myapp',
);
$logger->send("log message", time, LOG_LOCAL3, LOG_DEBUG);
=head1 DESCRIPTION
This module wraps L to provide a constructor with reasonable
defaults and a send() method that optionally accepts override parameters for
facility and severity.
=head1 METHODS
=over 4
=item Log::Syslog::Fast::Simple-Enew(%params);
Create a new Log::Syslog::Fast::Simple object with given parameters (may be a
hash or hashref). Takes the following named parameters which have the same
meaning as in Log::Syslog::Fast.
=over 4
=item proto
Defaults to LOG_UDP
=item loghost
Defaults to 127.0.0.1
=item port
Defaults to 514
=item facility
Defaults to LOG_LOCAL0
=item severity
Defaults to LOG_INFO
=item sender
Defaults to Sys::Hostname::hostname
=item name
Defaults to a cleaned $0
=back
=item $logger-Esend($logmsg, [$time], [$severity], [$facility])
Send a syslog message through the configured logger. If $time is not provided,
the current time is used. If $severity or $facility are not provided, the
default provided at construction time is used.
=back
=head1 EXPORT
Same as Log::Syslog::Fast.
=head1 SEE ALSO
L
=head1 AUTHOR
Adam Thomason, Eathomason@sixapart.comE
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009-2011 by Say Media, Inc.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.
=cut
PK B[x Log/Syslog/Fast.pmnu W+A package Log::Syslog::Fast;
use 5.006002;
use strict;
use warnings;
require Exporter;
use Log::Syslog::Constants ();
use Carp 'croak';
our $VERSION = '0.58';
our @ISA = qw(Log::Syslog::Constants Exporter);
# protocols
use constant LOG_UDP => 0; # UDP
use constant LOG_TCP => 1; # TCP
use constant LOG_UNIX => 2; # UNIX socket
# formats
use constant LOG_RFC3164 => 0;
use constant LOG_RFC5424 => 1;
our %EXPORT_TAGS = (
protos => [qw/ LOG_TCP LOG_UDP LOG_UNIX /],
formats => [qw/ LOG_RFC3164 LOG_RFC5424 /],
%Log::Syslog::Constants::EXPORT_TAGS,
);
push @{ $EXPORT_TAGS{'all'} }, @{ $EXPORT_TAGS{'protos'} };
push @{ $EXPORT_TAGS{'all'} }, @{ $EXPORT_TAGS{'formats'} };
our @EXPORT_OK = @{ $EXPORT_TAGS{'all'} };
our @EXPORT = qw();
sub AUTOLOAD {
(my $meth = our $AUTOLOAD) =~ s/.*:://;
if (Log::Syslog::Constants->can($meth)) {
return Log::Syslog::Constants->$meth(@_);
}
croak "Undefined subroutine $AUTOLOAD";
}
require XSLoader;
XSLoader::load('Log::Syslog::Fast', $VERSION);
1;
__END__
=head1 NAME
Log::Syslog::Fast - Perl extension for sending syslog messages over TCP, UDP,
or UNIX sockets with minimal CPU overhead.
=head1 SYNOPSIS
use Log::Syslog::Fast ':all';
my $logger = Log::Syslog::Fast->new(LOG_UDP, "127.0.0.1", 514, LOG_LOCAL0, LOG_INFO, "mymachine", "logger");
$logger->send("log message", time);
=head1 DESCRIPTION
This module sends syslog messages over a network socket. It works like
L in setlogsock's 'udp', 'tcp', or 'unix' modes, but without the
significant CPU overhead of that module when used for high-volume logging. Use
of this specialized module is only recommended if 1) you must use network
syslog as a messaging transport but 2) need to minimize the time spent in the
logger.
This module supercedes the less general L.
=head1 METHODS
=over 4
=item Log::Syslog::Fast-Enew($proto, $hostname, $port, $facility, $severity, $sender, $name);
Create a new Log::Syslog::Fast object with the following parameters:
=over 4
=item $proto
The transport protocol: one of LOG_TCP, LOG_UDP, or LOG_UNIX.
If LOG_TCP or LOG_UNIX is used, calls to $logger-Esend() will block until
remote receipt of the message is confirmed. If LOG_UDP is used, the call will
never block and may fail if insufficient buffer space exists in the network
stack (in which case an exception will be thrown).
With LOG_UNIX, I<< ->new >> will first attempt to connect with a SOCK_STREAM
socket, and then try a SOCK_DGRAM if that is what the server expects (e.g.
rsyslog).
=item $hostname
For LOG_TCP and LOG_UDP, the destination hostname where a syslogd is running.
For LOG_UNIX, the path to the UNIX socket where syslogd is listening (typically
/dev/log).
=item $port
For LOG_TCP and LOG_UDP, the destination port where a syslogd is listening,
usually 514. Ignored for LOG_UNIX.
=item $facility
The syslog facility constant, eg 16 for 'local0'. See RFC3164 section 4.1.1 (or
Esys/syslog.hE) for appropriate constant values. See L below
for making these available by name.
The I value is computed from the facility and severity per the RFC.
=item $severity
The syslog severity constant, eg 6 for 'info'. See RFC3164 section 4.1.1 (or
Esys/syslog.hE) for appropriate constant values. See L below
for making these available by name.
=item $sender
The originating hostname. Sys::Hostname::hostname is typically a reasonable
source for this.
=item $name
The program name or tag to use for the message.
=back
=item $logger-Esend($logmsg, [$time])
=item $logger-Eemit($logmsg, [$time])
Send a syslog message through the configured logger. If $time is not provided,
B