view release on metacpan or search on metacpan
ext/Tripletail-HtmlFilter/HtmlFilter.pm view on Meta::CPAN
}
}
}
1;
sub _new {
my $class = shift;
my $opts = { @_ };
my $this = bless [] => $class;
$this->[INTEREST] = $opts->{interest};
$this->[TRACK] = $opts->{track};
$this->[FILTER_TEXT] = $opts->{filter_text};
$this->[FILTER_COMMENT] = $opts->{filter_comment};
$this->[CONTEXT] = Tripletail::HtmlFilter::Context->_new;
$this->[HTML] = undef; # æåå
$this->[OUTPUT] = []; # Tripletail::HtmlFilter::{Element,Text,Comment}
ext/Tripletail-HtmlFilter/HtmlFilter.pm view on Meta::CPAN
use constant {
IN => 0,
ADDED => 1,
DELETED => 2,
CURRENT => 3,
};
sub _new {
my $class = shift;
my $this = bless [] => $class;
$this->[IN] = [];
$this->[ADDED] = [];
$this->[DELETED] = undef;
$this->[CURRENT] = undef; # Tripletail::HtmlFilter::{Element,Comment,Text}
$this;
}
sub newElement {
my $this = shift;
ext/Tripletail-HtmlFilter/HtmlFilter.pm view on Meta::CPAN
our @ISA = qw(Tripletail::HtmlFilter::ElementBase);
sub _new {
my $class = shift;
my $name = shift; # undefå¯
if (ref $name) {
die __PACKAGE__."#_new, ARG[1] was bad Ref. [$name]\n";
}
my $this = bless [] => $class;
$this->[NAME] = $name;
$this->[ATTRS] = []; # [[key, val], [key, val], ...]
$this->[ATTR_H] = {}; # key => [key, val] ($this->[ATTRS]ã®è¦ç´ ã¨å
±æ)
$this->[TAIL] = undef;
$this;
}
sub name {
# 注æ: ãã®ã¡ã½ãã㯠XS å´ã§ã¯ä½¿ç¨ãããªãã
ext/Tripletail-HtmlFilter/HtmlFilter.pm view on Meta::CPAN
package Tripletail::HtmlFilter::Text;
use constant {
STR => 0,
};
our @ISA = qw(Tripletail::HtmlFilter::ElementBase);
sub _new {
my $class = shift;
my $str = shift;
my $this = bless [] => $class;
$this->[STR] = $str;
$this;
}
sub str {
my $this = shift;
if (@_) {
$this->[STR] = shift;
lib/Tripletail/CSV.pm view on Meta::CPAN
use IO::Handle ();
use IO::Scalar ();
use version 0.77;
1;
sub _new {
my $class = shift;
my $this = bless {} => $class;
eval {
require Text::CSV_XS;
};
if ($@) {
die __PACKAGE__."#new: Text::CSV_XS is unavailable. (Text::CSV_XSã使ç¨ã§ãã¾ãã)\n";
}
my $opts = do {
if (Text::CSV_XS->VERSION >= version->parse('1.02')) {
lib/Tripletail/CSV.pm view on Meta::CPAN
package Tripletail::CSV::Parser;
use strict;
use warnings;
sub _new {
my $class = shift;
my $csv = shift;
my $fh = shift;
my $this = bless {} => $class;
$this->{csv} = $csv;
$this->{fh} = $fh;
$this;
}
sub next {
my $this = shift;
if ($this->{fh}->eof) {
lib/Tripletail/CharConv.pm view on Meta::CPAN
}
else {
# 両æ¹ã¨ããµãã¼ãå¤
my $utf8 = Encode::find_encoding($from)->decode($str);
return Encode::find_encoding($to)->encode($utf8);
}
}
sub __new {
my $class = shift;
my $this = bless {} => $class;
return $this;
}
__END__
=encoding utf-8
=for stopwords
lib/Tripletail/DB.pm view on Meta::CPAN
\&__term,
);
undef;
}
sub _new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
$this->{group} = $group;
$this->{namequery} = $TL->INI->get($group => 'namequery' => undef);
$this->{autoreyry} = $TL->INI->get($group => 'autoretry' => undef);
$this->{type} = $TL->INI->get($group => 'type');
$this->{bufsize} = undef; # æ£ã®å¤ã§ãªããã°ç¡å¶é
$this->{types_symtable} = \%Tripletail::DB::SQL_TYPES::;
$this->{dbh} = {}; # {DBã»ããå => Tripletail::DB::Dbh}
$this->{dbname} = {}; # {DBã³ãã¯ã·ã§ã³å => Tripletail::DB::Dbh}
lib/Tripletail/DB/Dbh.pm view on Meta::CPAN
package Tripletail::DB::Dbh;
use strict;
use warnings;
use Hash::Util qw(lock_hash);
sub new {
my $class = shift;
my $setname = shift;
my $dbname = shift;
my $this = bless {} => $class;
$this->{setname } = $setname;
$this->{inigroup} = $dbname;
$this->{dbh } = undef; # DBI-dbh
$this->{type } = undef; # set on connect().
$this;
}
sub getSetName {
return shift->{setname};
lib/Tripletail/DB/Sth.pm view on Meta::CPAN
use warnings;
use Tripletail;
use Scalar::Lazy;
my $STH_ID = 0;
sub new {
my $class = shift;
my $db = shift;
my $dbh = shift;
my $sth = shift;
my $this = bless {} => $class;
$this->{db_center} = $db; # Tripletail::DB
$this->{dbh} = $dbh; # Tripletail::DB::DBH
$this->{sth} = $sth; # native sth
$this->{ret} = undef; # last return value
$this->{id} = $STH_ID++;
$this;
}
lib/Tripletail/Debug.pm view on Meta::CPAN
$_INSTANCE = $class->__new(@_);
}
$_INSTANCE;
}
sub __new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
$this->{group} = defined $group ? $group : 'Debug';
$this->{enabled} = $TL->INI->get($this->{group} => enable_debug => undef);
$this->{popup_type} = $TL->INI->get($this->{group} => 'popup_type', 'none');
$this->{warn_logging} = $TL->INI->get($this->{group} => 'warn_logging', 1);
$this->{warn_popup} = $TL->INI->get($this->{group} => 'warn_popup', 1);
$this->{log_popup} = $TL->INI->get($this->{group} => 'log_popup', 1);
lib/Tripletail/Error.pm view on Meta::CPAN
# $TL->newError($type, $msg);
# $TL->newError($type, $msg, $title);
#
sub _new {
# ã¹ã¿ãã¯ãã¬ã¼ã¹ãæã£ãä¾å¤ãªãã¸ã§ã¯ããçæããã
# è¿ãããã¤ã³ã¹ã¿ã³ã¹ã¯ "" æ¼ç®åã«ãã£ã¦æåååãå¯è½ã§ããã
my $class = shift;
my $type = shift; # 'error' / 'warn' / 'file-update' / 'memory-leak'
my $msg = shift; # $@
my $title = shift; # ä»»æã®æåå
my $this = bless {} => $class;
$this->{message} = $msg;
$this->{type} = $type;
$this->{title} = $title || "Error: $msg";
$this->{frames} = []; # Tripletail::Error::Frame
$this->{source} = {}; # ãã¡ã¤ã«ãã¹ => ä¸èº«
$this->{show_trace} = undef;
$this->{show_vars} = undef;
$this->{show_src} = undef;
$this->{suppress_internal} = 1;
lib/Tripletail/Error.pm view on Meta::CPAN
$i + 1, sprintf('%5d | %s', $i + 1, $lines[$i]));
}
}
package Tripletail::Error::Frame;
use strict;
use warnings;
sub new {
my $class = shift;
my $this = bless {} => $class;
$this->{level} = shift;
$this->{fpath} = shift;
$this->{line} = shift;
$this->{func} = shift;
$this->{vars} = {}; # '$foo' => 666
$this->{vars_shallow} = {}; # '$doo' => 'ARRAY(0x81940f8)'
$this;
}
lib/Tripletail/FileSentinel.pm view on Meta::CPAN
foreach ( @targets ) {
$TL->log(__PACKAGE__, " autoWatch(): $_");
$this->watch($_);
}
$this;
}
sub _new {
my $class = shift;
my $this = bless {} => $class;
$this->{lastmod} = {}; # {file path => epoch}
if(defined($0)) {
$this->watch($0);
}
my $filename = $TL->INI->getFilePath;
if(defined($filename)) {
$this->watch($filename);
}
lib/Tripletail/Filter.pm view on Meta::CPAN
# -----------------------------------------------------------------------------
package Tripletail::Filter;
use strict;
use warnings;
use Tripletail;
1;
sub _new {
my $class = shift;
my $this = bless {} => $class;
# æ¢ã«ããããåºåãããã©ãã
$this->{header_flushed} = undef;
# ç½®æããããã(setHeaderã§è¨å®ããããã®)
$this->{replacement} = {}; # {ãã¼ => å¤}
# 追å ããããã(addHeaderã§è¨å®ããããã®)
$this->{addition} = {}; # {ãã¼ => [å¤, ...]}
lib/Tripletail/InputFilter.pm view on Meta::CPAN
# -----------------------------------------------------------------------------
package Tripletail::InputFilter;
use strict;
use warnings;
use Tripletail;
1;
sub _new {
my $class = shift;
my $this = bless {} => $class;
$this;
}
sub _formFromPairs {
# æ»ãå¤: Tripletail::Form
my $this = shift;
my $pairs = shift;
my $filename_h = shift;
lib/Tripletail/MemCached.pm view on Meta::CPAN
# -----------------------------------------------------------------------------
package Tripletail::MemCached;
use Tripletail;
use strict;
use warnings;
1;
sub _new {
my $class = shift;
my $this = bless {} => $class;
my @servers;
$this->{servers} = $TL->INI->get('MemCached' => servers => undef);
if(!defined($this->{servers})) {
push(@servers,'localhost:11211');
} else {
foreach my $tmp (split(/\s+/, $this->{servers})) {
push(@servers,split(/\s?,\s?/, $tmp));
}
lib/Tripletail/MemorySentinel.pm view on Meta::CPAN
}
sub __install {
my $this = shift;
$TL->setHook('postRequest', _HOOK_PRIORITY, sub { $this->__postRequest });
}
sub _new {
my $class = shift;
my $this = bless {} => $class;
$this->{getmemfunc} = undef; # ã¡ã¢ãªä½¿ç¨éãåå¾ããçºã®é¢æ°ã'NONE'ãªãåå¨ããªãã
$this->{getmemfh} = undef;
$this->{initial} = undef; # æåã®postRequestã®æç¹ã§ã®ã¡ã¢ãªä½¿ç¨é
$this->{permissible} = {}; # {key => size} ç¨éå¥ã®ã¡ã¢ãªä½¿ç¨è¨±å®¹é
$this->setPermissibleSize(_HEAP => 10 * 1024); # 10 MiB
$this;
}
lib/Tripletail/Pager.pm view on Meta::CPAN
use Tripletail;
1;
sub _new {
my $class = shift;
my $DB = Tripletail::_isa($_[0], 'Tripletail::DB')
? shift
: $TL->getDB(shift);
my $this = bless {} => $class;
$this->{db } = $DB;
$this->{dbtype} = $DB->getType;
$this->{pagesize} = 30;
$this->{current} = 1;
$this->{maxlinks} = 10;
$this->{formkey} = 'pageid';
$this->{formparam} = undef;
$this->{pagingtype} = 0;
lib/Tripletail/Sendmail/Esmtp.pm view on Meta::CPAN
use base 'Tripletail::Sendmail';
use strict;
use warnings;
use Tripletail;
1;
sub _new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
$this->{group} = $group;
$this->{dbgroup} = $TL->INI->get($group => 'dbgroup');
$this->{resend} = $TL->INI->get($group => 'resend', 1);
$this->{resendlimit} = $TL->INI->get($group => 'resendlimit', '24 hours');
$this;
}
lib/Tripletail/Sendmail/MailQueue.pm view on Meta::CPAN
use Tripletail::Sendmail::Smtp;
use Unicode::Japanese ();
our $QUEUE_ID_COUNT = 0;
1;
sub _new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
local($_);
$this->{queuedir} = do {
my $queuedir = $TL->INI->get($group => 'queuedir');
$queuedir =~ s!/+$!!; # æ«å°¾ã® / ãæ¶ã
$queuedir;
};
$this->{group} = $group;
lib/Tripletail/Sendmail/Sendmail.pm view on Meta::CPAN
use base 'Tripletail::Sendmail';
use strict;
use warnings;
use Tripletail;
1;
sub _new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
$this->{group} = $group;
$this->{log} = $TL->INI->get($group => 'logging');
$this->{commandline} = $TL->INI->get($group => 'commandline', '/usr/sbin/sendmail -t -i');
$this;
}
sub send {
my $this = shift;
lib/Tripletail/Sendmail/Smtp.pm view on Meta::CPAN
use warnings;
use Tripletail;
use IO::Socket::INET;
use base 'Tripletail::Sendmail';
1;
sub _new {
my $class = shift;
my $group = shift;
my $this = bless {} => $class;
$this->{group } = $group;
$this->{timeout} = $TL->INI->get($group => timeout => 300 );
$this->{host } = $TL->INI->get($group => host => 'localhost');
$this->{log } = $TL->INI->get($group => logging => undef );
$this->{sock } = undef;
$this->{status } = undef;
$this->{timeout_period} = $TL->parsePeriod($this->{timeout});
lib/Tripletail/TagCheck.pm view on Meta::CPAN
}
}eg;
$str;
}
package Tripletail::TagCheck::TagInfo;
sub new {
my $class = shift;
my $tag = shift;
my $this = bless {} => $class;
$this->{tag} = $tag;
$this->{must_be_empty} = undef;
$this->{allowed_attributes} = undef; # 屿§å => 1
$this->{allowed_children} = undef; # è¦ç´ å => 1
$this->{is_text_allowed} = 1;
$this->{tagbreak} = undef; # undefã§ãªããã°tag breakããªã¼ãã¼ã©ã¤ã
$this;
}
lib/Tripletail/Template.pm view on Meta::CPAN
sub __rel2abs
{
my $path = shift;
my $base = shift;
$_REL2ABS_CACHE{"$path\0$base"} ||= File::Spec::Functions::rel2abs($path, $base);
}
sub _new {
my $class = shift;
my $this = bless {} => $class;
$this->{root} = Tripletail::Template::Node->_new(
undef, undef, undef, $TL->INI->get(Template => allow_unexpanded_tags => 'false'));
$this->{basepath} = $TL->INI->get_reloc('Template' => 'basepath', '.');
if( !File::Spec::Functions::file_name_is_absolute($this->{basepath}) )
{
my $cwd = $TL::CWD || $TL->_cwd;
$this->{basepath} = __rel2abs($this->{basepath}, $cwd);
}
lib/Tripletail/Template/Node.pm view on Meta::CPAN
# tmplvec ã®å
å®¹ã¯æµ
ãå¤åããã(ã¤ã¾ãé
åã¯å¤åãã¦ãé
åã®è¦ç´ ã¾ã§ã¯
# å¤åããªãã)
sub _new {
my $class = shift;
my $parent = shift; # Tripletail::Template::Node ã¾ã㯠undef (rootã®å ´å)
my $name = shift; # <!mark>ã®ååãrootãªãundef
my $html = shift; # template html
my $allow_unexpanded_tags = shift; # allow_unexpanded_tags
my $this = bless {} => $class;
$this->_reset;
$this->{parent} = $parent;
$this->{name} = defined($name) ? lc $name : undef; # rootã®å ´åã¯ä½¿ããããã¨ã¯ãªã.
$this->{allow_unexpanded_tags} = $allow_unexpanded_tags || 'false';
if(defined $html) {
$this->_setTemplate($html);
}
lib/Tripletail/Value.pm view on Meta::CPAN
my $DEFAULT_DATE_FORMAT = $YYYYMMDD;
my $DEFAULT_TIME_FORMAT = $HHMMSS;
my $DEFAULT_DATETIME_FORMAT = $YYYYMMDDHHMMSS;
1;
#---------------------------------- ä¸è¬
sub _new {
my $class = shift;
my $this = bless {} => $class;
$this->{value} = undef;
if(@_) {
$this->set(@_);
}
$this;
}