.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Google::SafeBrowsing2::DBI 3pm" .TH Net::Google::SafeBrowsing2::DBI 3pm "2021-01-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Google::SafeBrowsing2::DBI \- Base class for all DBI\-based back\-end storage for the Google Safe Browsing v2 database .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::Google::SafeBrowsing2::MySQL; \& \& my $storage = Net::Google::SafeBrowsing2::MySQL\->new(host => \*(Aq127.0.0.1\*(Aq, database => \*(AqGoogleSafeBrowsingv2\*(Aq); \& ... \& $storage\->close(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a base implementation of Net::Google::SafeBrowsing2::Storage using \s-1DBI.\s0 .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "\fBnew()\fP" .IX Subsection "new()" This method should be overwritten. .PP Arguments .IP "keep_all" 4 .IX Item "keep_all" Optional. Set to 1 to keep old information (such as expiring full hashes) in the database. 0 (delete) by default. .SH "PUBLIC FUNCTIONS" .IX Header "PUBLIC FUNCTIONS" .RS 4 See Net::Google::SafeBrowsing2::Storage for a complete list of public functions. .RE .SS "\fBclose()\fP" .IX Subsection "close()" Cleanup old full hashes, and close the connection to the database. .PP .Vb 1 \& $storage\->close(); .Ve .SS "\fBexport()\fP" .IX Subsection "export()" Export add chunks and sub chunks to a file. The file content looks like what Google sends in redirections. The file can be used with the \f(CW\*(C`import_chunks\*(C'\fR function from \f(CW\*(C`Net::Google::SafeBrowsing2\*(C'\fR. This is useful when moving from one back-end storage to another .PP .Vb 1 \& $storage\->export(list => MALWARE); .Ve .PP Arguments .IP "list" 4 .IX Item "list" Required. The Google Safe Browsing list to export. .IP "file" 4 .IX Item "file" Optional. Filename to export to. Uses \*(L"$list.dat\*(R" by default. .SH "CHANGELOG" .IX Header "CHANGELOG" .IP "0.7" 4 .IX Item "0.7" New \f(CW\*(C`export()\*(C'\fR function. .Sp Keep empty sub chunks. .Sp Fix index for sub chunks. .IP "0.6" 4 .IX Item "0.6" Add option keep_all to keep expired full hashes. Useful for debugging. .IP "0.5" 4 .IX Item "0.5" Return the hostkey in get_add_chunks. .IP "0.4" 4 .IX Item "0.4" Fix duplicate insert of add chunks and sub chunks. .IP "0.3" 4 .IX Item "0.3" Add reset function to reset all tables for a given list .IP "0.2" 4 .IX Item "0.2" Replace \*(L"\s-1INSERT OR REPLACE\*(R"\s0 statements by \s-1DELETE + INSERT\s0 to work with all databases .SH "SEE ALSO" .IX Header "SEE ALSO" See Net::Google::SafeBrowsing2 for handling Google Safe Browsing v2. .PP See Net::Google::SafeBrowsing2::Storage for the list of public functions. .PP See Net::Google::SafeBrowsing2::Sqlite for a back-end using Sqlite. .PP Google Safe Browsing v2 \s-1API:\s0 .SH "AUTHOR" .IX Header "AUTHOR" Julien Sobrier, or .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2011 by Julien Sobrier .PP 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.8 or, at your option, any later version of Perl 5 you may have available.