logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MediaWiki::Bot::Constants - constants for MediaWiki::Bot

Authors

       •   Dan Collins <dcollins@cpan.org>

       •   Mike.lifeguard <lifeguard@cpan.org>

       •   Alex Rowe <alex.d.rowe@gmail.com>

       •   Oleg Alexandrov <oleg.alexandrov@gmail.com>

       •   jmax.code <jmax.code@gmail.com>

       •   Stefan Petrea <stefan.petrea@gmail.com>

       •   kc2aei <kc2aei@gmail.com>

       •   bosborne@alum.mit.edu

       •   Brian Obio <brianobio@gmail.com>

       •   patch and bug report contributors

Availability

       The project homepage is <https://metacpan.org/module/MediaWiki::Bot>.

       The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN).  Visit
       <http://www.perl.com/CPAN/>      to      find      a      CPAN      site     near     you,     or     see
       <https://metacpan.org/module/MediaWiki::Bot/>.

Bugs And Limitations

       You   can   make   new   bug   reports,   and   view   existing   ones,  through  the  web  interface  at
       <https://github.com/MediaWiki-Bot/MediaWiki-Bot/issues>.

Constants

       The available constants are divided into 5 tags, which can be imported individually:

       •   err - the error constants, inherited from MediaWiki::API

       •   bool - boolean constants

       •   page - page existence

       •   file - file (image/media) existence status (which is not boolean)

       •   ns  -  some  namespace  numbers.  Achtung!  Incomplete!  Use  MediaWiki::Bot's  functions for getting
           namespace information for your wiki.

Description

       Exportable constants used by MediaWiki::Bot. Use these constants in your code to avoid the use of magical
       numbers, and to ensure compatibility with future changes in "MediaWiki::Bot".

       You can also import ":constants" or any constant name(s) from MediaWiki::Bot:

           use MediaWiki::Bot qw(:constants);
           use MediaWiki::Bot qw(PAGE_NONEXISTENT);

Exports

       No symbols are exported by default. The available tags are err, bool, page, file, ns, and all.

Name

       MediaWiki::Bot::Constants - constants for MediaWiki::Bot

Source

       The development version is on  github  at  <https://github.com/MediaWiki-Bot/MediaWiki-Bot>  and  may  be
       cloned from <git://github.com/MediaWiki-Bot/MediaWiki-Bot.git>

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
           }

Version

       version 5.007000

See Also