/usr/share/perl5/MediaWiki/Bot/Constants.pm is in libmediawiki-bot-perl 5.006003-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | package MediaWiki::Bot::Constants;
use strict;
use warnings;
# ABSTRACT: constants for MediaWiki::Bot
our $VERSION = '5.006003'; # VERSION
use MediaWiki::API; # How to grab these constants?
use Constant::Generate {
ERR_NO_ERROR => MediaWiki::API->ERR_NO_ERROR,
ERR_CONFIG => MediaWiki::API->ERR_CONFIG,
ERR_HTTP => MediaWiki::API->ERR_HTTP,
ERR_API => MediaWiki::API->ERR_API,
ERR_LOGIN => MediaWiki::API->ERR_LOGIN,
ERR_EDIT => MediaWiki::API->ERR_EDIT,
ERR_PARAMS => MediaWiki::API->ERR_PARAMS,
ERR_UPLOAD => MediaWiki::API->ERR_UPLOAD,
ERR_DOWNLOAD => MediaWiki::API->ERR_DOWNLOAD,
ERR_CAPTCHA => 10,
RET_TRUE => !!1,
RET_FALSE => !!0,
PAGE_NONEXISTENT => -1,
FILE_NONEXISTENT => 0,
FILE_LOCAL => 1,
FILE_SHARED => 2,
FILE_PAGE_TEXT_ONLY => 3,
NS_USER => 2,
NS_FILE => 6,
NS_CATEGORY => 14,
};#, dualvar => 1;
use Exporter qw(import);
our %EXPORT_TAGS = (
err => [qw(
ERR_NO_ERROR
ERR_CONFIG
ERR_HTTP
ERR_API
ERR_LOGIN
ERR_EDIT
ERR_PARAMS
ERR_UPLOAD
ERR_DOWNLOAD
ERR_CAPTCHA
)],
bool => [qw( RET_TRUE RET_FALSE )],
page => [qw( PAGE_NONEXISTENT )],
file => [qw( FILE_NONEXISTENT FILE_LOCAL FILE_SHARED FILE_PAGE_TEXT_ONLY )],
ns => [qw( NS_USER NS_FILE NS_CATEGORY )],
);
Exporter::export_tags(qw(err));
Exporter::export_ok_tags(qw(bool page file ns));
{
my %seen;
push @{$EXPORT_TAGS{all}},
grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}} foreach keys %EXPORT_TAGS;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MediaWiki::Bot::Constants - constants for MediaWiki::Bot
=head1 VERSION
version 5.006003
=head1 SYNOPSIS
use MediaWiki::Bot;
use MediaWiki::Bot::Constants qw(:file);
my $bot = MediaWiki::Bot->new();
my $file_existence = $bot->test_image_exists("File:...");
# Make sense of MediaWiki::Bot's random numbers
if ($file_existence == FILE_LOCAL) {
# Get from local media repository
}
elsif ($file_existence == FILE_SHARED) {
# Get from shared (remote) media repository
}
=head1 DESCRIPTION
Exportable constants used by L<MediaWiki::Bot>. Use these constants
in your code to avoid the use of magical numbers, and to ensure
compatibility with future changes in C<MediaWiki::Bot>.
You can also import C<:constants> or any constant name(s) from
L<MediaWiki::Bot>:
use MediaWiki::Bot qw(:constants);
use MediaWiki::Bot qw(PAGE_NONEXISTENT);
=head1 CONSTANTS
The available constants are divided into 5 tags, which can be imported
individually:
=over 4
=item *
err - the error constants, inherited from L<MediaWiki::API>
=item *
bool - boolean constants
=item *
page - page existence
=item *
file - file (image/media) existence status (which is not boolean)
=item *
ns - some namespace numbers. B<Achtung!> Incomplete! Use L<MediaWiki::Bot>'s
functions for getting namespace information for your wiki.
=back
=head1 EXPORTS
No symbols are exported by default. The available tags are err, bool, page, file, ns, and all.
=head1 AVAILABILITY
The project homepage is L<https://metacpan.org/module/MediaWiki::Bot>.
The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
site near you, or see L<https://metacpan.org/module/MediaWiki::Bot/>.
=head1 SOURCE
The development version is on github at L<http://github.com/MediaWiki-Bot/MediaWiki-Bot>
and may be cloned from L<git://github.com/MediaWiki-Bot/MediaWiki-Bot.git>
=head1 BUGS AND LIMITATIONS
You can make new bug reports, and view existing ones, through the
web interface at L<https://github.com/MediaWiki-Bot/MediaWiki-Bot/issues>.
=head1 AUTHORS
=over 4
=item *
Dan Collins <dcollins@cpan.org>
=item *
Mike.lifeguard <lifeguard@cpan.org>
=item *
Alex Rowe <alex.d.rowe@gmail.com>
=item *
Oleg Alexandrov <oleg.alexandrov@gmail.com>
=item *
jmax.code <jmax.code@gmail.com>
=item *
Stefan Petrea <stefan.petrea@gmail.com>
=item *
kc2aei <kc2aei@gmail.com>
=item *
bosborne@alum.mit.edu
=item *
Brian Obio <brianobio@gmail.com>
=item *
patch and bug report contributors
=back
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2016 by the MediaWiki::Bot team <perlwikibot@googlegroups.com>.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
=cut
|