Difference between revisions of "Logins.php"

From Apibot
Jump to: navigation, search
(straightening up the wiki)
m (Mains -> Core)
 
Line 13: Line 13:
 
</pre>
 
</pre>
  
After you have defined your login here, you can conveniently create the bot <code>Mains</code> object with it as an argument:
+
After you have defined your login here, you can conveniently create the bot <code>Core</code> object with it as an argument:
  
<code>$mains = new Mains ( $mybot_wp_en );</code>
+
<code>$core = new Core ( $mybot_wp_en );</code>
  
 
To improve the encapsulation and for convenience, login descriptions are typically included in a global array variable, most often called <code>$logins</code>.
 
To improve the encapsulation and for convenience, login descriptions are typically included in a global array variable, most often called <code>$logins</code>.

Latest revision as of 01:34, 10 November 2014

Description

logins.php is not actually an Apibot module, in the sense of programming code that implements features. It is rather a storage for logins that Apibot will use when logging to a wiki.

A login description is a PHP associative array that contains login infomation. A typical login description follows:

$mybot_wp_en = array (
  'user'            => "MyBot",         // username for the bot account in this wiki
  'password'        => "m4b0tp@ssW0rd", // password for the bot account
  'wiki'            => $wikipedia_en,   // the wiki the bot will operate on (defined in wikis.php)
);

After you have defined your login here, you can conveniently create the bot Core object with it as an argument:

$core = new Core ( $mybot_wp_en );

To improve the encapsulation and for convenience, login descriptions are typically included in a global array variable, most often called $logins.