@@ -112,11 +112,14 @@ class User {
/**
* Construction method for the User class
*
* @fixme Return in constructor method.
*
* @access public
* @param Wiki &$wikiClass The Wiki class object
* @param mixed $pgUsername Username
* @param Wiki $wikiClass
* @return null|false
* @param mixed $pgUsername Username
* @throws AssertFailure
* @throws LoggedOut
* @throws MWAPIError
*/
public function __construct( Wiki &$wikiClass, $pgUsername ) {

@@ -136,7 +139,7 @@ public function __construct( Wiki &$wikiClass, $pgUsername ) {
)
);

if( !$uiRes ) {
if (!empty($uiRes)) {
$this->username = $pgUsername;
$this->exists = false;
} else {
@@ -163,6 +166,7 @@ public function __construct( Wiki &$wikiClass, $pgUsername ) {
}
} elseif( isset( $uiRes['query']['users'][0]['missing'] ) || isset( $uiRes['query']['users'][0]['invalid'] ) ) {
$this->exists = false;

return false;
} else {
$this->editcount = $uiRes['query']['users'][0]['editcount'];
@@ -167,6 +167,16 @@ class Wiki {
* @access protected
*/
protected $nobots = true;

/**
* Nobots task name if nobots is enables. Perfect for multiple doing the same task.
*
* (default value: null)
*
* @var string
* @access protected
*/
protected $nobotsTaskname = null;

/**
* Text to search for in the optout= field of the {{nobots}} template
@@ -254,7 +264,7 @@ class Wiki {
protected $cached_config;

/**
* Contruct function for the wiki. Handles login and related functions.
* Construct function for the wiki. Handles login and related functions.
*
* @access public
* @see Peachy::newWiki()
@@ -401,6 +411,7 @@ public function __construct( $configuration, $extensions = array(), $recursed =
$lgarray['lgtoken'] = $token;
}

// FIXME: Why is there a return in a constructor? Should an error be thrown?
if( isset( $configuration['nologin'] ) ) {
$this->nologin = true;
return;
@@ -532,20 +543,31 @@ public function logout() {
public function set_runpage( $page = null ) {
$this->runpage = $page;
}

/**
* Sets a specific taskname to comply with the nobots template.
*
* @param string $taskname Name of bot task. Default null.
* @access public
* @return void
*/
public function set_taskname( $taskname = null ) {
$this->nobotsTaskname = $taskname;
}

/**
* Queries the API.
*
* @access public
* @param array $arrayParams Parameters given to query with (default: array())
* @param bool $post Should it be a POST reqeust? (default: false)
* @param bool $post Should it be a POST request? (default: false)
* @param bool $errorcheck
* @param bool $recursed Is this a recursed reqest (default: false)
* @param bool $recursed Is this a recursed request (default: false)
* @param bool $assertcheck Use MediaWiki's assert feature to prevent unwanted edits (default: true)
* @throws LoggedOut
* @throws AssertFailure (see $assertcheck)
* @throws MWAPIError (API unavailable)
* @return array Returns an array with the API result
* @return array|bool Returns an array with the API result
*/
public function apiQuery( $arrayParams = array(), $post = false, $errorcheck = true, $recursed = false, $assertcheck = true ) {

@@ -812,10 +834,11 @@ public function get_mw_version() {
* @access public
* @link http://wiki.peachy.compwhizii.net/wiki/Manual/Wiki::listHandler
* @param array $tArray Parameters given to query with (default: array()). In addition to those recognised by the API, ['_code'] should be set to the first two characters of all the parameters in a list=XXX API call - for example, with allpages, the parameters start with 'ap', with recentchanges, the parameters start with 'rc' - and is required; ['_limit'] imposes a hard limit on the number of results returned (optional) and ['_lhtitle'] simplifies a multidimensional result into a unidimensional result - lhtitle is the key of the sub-array to return. (optional)
* @throws BadEntryError
* @param array $resume Parameter passed back at the end of a list-handler operation. Pass parameter back through to resume listhandler operation. (optional)
* @throws BadEntryError
* @return array Returns an array with the API result
*/
public function listHandler( $tArray = array() ) {
public function listHandler( $tArray = array(), &$resume = null ) {

if( isset( $tArray['_code'] ) ) {
$code = $tArray['_code'];
@@ -835,9 +858,15 @@ public function listHandler( $tArray = array() ) {
} else {
$lhtitle = null;
}
if( !is_null( $resume ) ) {
$tArray = array_merge( $tArray, $resume );
} else {
$resume = array();
}

$tArray['action'] = 'query';
$tArray[$code . 'limit'] = 'max';
$tArray['rawcontinue'] = 1;

if( isset( $limit ) && !is_null( $limit ) ) {
if( !is_numeric( $limit ) ) {
@@ -886,37 +915,40 @@ public function listHandler( $tArray = array() ) {
if( !is_null( $lhtitle ) ) {
if( isset( $y[$lhtitle] ) ) {
$y = $y[$lhtitle];
} else {
if( is_array( $y ) ) $endArray = array_merge( $endArray, $y );
else $endArray[] = $y;
continue;
} else {
continue;
}
}

$endArray[] = $y;
}
}

if( !is_null( $limit ) && $limit != 'max' ) {
if( count( $endArray ) >= $limit ) {
$endArray = array_slice( $endArray, 0, $limit );
break;
$endArray[] = $y;
}
}

if( isset( $tRes['query-continue'] ) ) {
foreach( $tRes['query-continue'] as $z ){
if( isset( $z[$code . 'continue'] ) ) {
$continue = $z[$code . 'continue'];
$continue = $resume[$code . 'continue'] = $z[$code . 'continue'];
} elseif( isset( $z[$code . 'offset'] ) ) {
$offset = $z[$code . 'offset'];
$offset = $resume[$code . 'offset'] = $z[$code . 'offset'];
} elseif( isset( $z[$code . 'start'] ) ) {
$start = $z[$code . 'start'];
$start = $resume[$code . 'start'] = $z[$code . 'start'];
} elseif( isset( $z[$code . 'from'] ) ) {
$from = $z[$code . 'from'];
$from = $resume[$code . 'from'] = $z[$code . 'from'];
}
}
} else {
$resume = array();
break;
}

if( !is_null( $limit ) && $limit != 'max' ) {
if( count( $endArray ) >= $limit ) {
$endArray = array_slice( $endArray, 0, $limit );
break;
}
}

}

@@ -1594,14 +1626,46 @@ public function tags( $prop = array( 'name', 'displayname', 'description', 'hitc
return $this->listHandler( $tgArray );
}

public function get_watchlist( $minor = null, $bot = null, $anon = null, $patrolled = null, $namespace = null, $user = null, $excludeuser = null, $start = null, $end = null, $prop = array(
/**
* @FIXME Implement this method
*
* @param null $minor
* @param null $bot
* @param null $anon
* @param null $patrolled
* @param null $namespace
* @param null $user
* @param null $excludeuser
* @param null $start
* @param null $end
* @param array $prop
* @param int $limit
*/
public function get_watchlist(
$minor = null,
$bot = null,
$anon = null,
$patrolled = null,
$namespace = null,
$user = null,
$excludeuser = null,
$start = null,
$end = null,
$prop = array(
'ids', 'title', 'flags', 'user', 'comment', 'parsedcomment', 'timestamp', 'patrol', 'sizes',
'notificationtimestamp'
), $limit = 50 ) {
pecho( "Error: " . __METHOD__ . " has not been programmed as of yet.\n\n", PECHO_ERROR );
}

public function get_watchlistraw( $namespace = null, $changed = null ) {
/**
* @FIXME Implement this method
*
* @param null $namespace
* @param null $changed
*/
public function get_watchlistraw($namespace = null, $changed = null)
{
pecho( "Error: " . __METHOD__ . " has not been programmed as of yet.\n\n", PECHO_ERROR );
}

@@ -1638,7 +1702,15 @@ public function exturlusage( $url, $pgProtocol = 'http', $prop = array( 'title'

}

public function users( $users = array(), $prop = array(
/**
* @FIXME Implement this method
*
* @param array $users
* @param array $prop
*/
public function users(
$users = array(),
$prop = array(
'blockinfo', 'groups', 'editcount', 'registration', 'emailable', 'gender'
) ) {
pecho( "Error: " . __METHOD__ . " has not been programmed as of yet.\n\n", PECHO_ERROR );
@@ -1670,7 +1742,13 @@ public function random( $namespaces = array( 0 ), $limit = 1, $onlyredirects = f
return $this->listHandler( $rnArray );
}

public function protectedtitles( $namespace = array( 0 ) ) {
/**
* @FIXME Implement this method
*
* @param array $namespace
*/
public function protectedtitles($namespace = array(0))
{
pecho( "Error: " . __METHOD__ . " has not been programmed as of yet.\n\n", PECHO_ERROR );
}

@@ -1948,6 +2026,8 @@ public function export() {
* @param mixed $rev3
* @return string|bool False on failure
* @see Diff::load
*
* @fixme: this uses Diff::load, which has been deprecated and Plugin removed from codebase
*/
public function diff( $method = 'unified', $rev1, $rev2, $rev3 = null ) {
$r1array = array(
@@ -2008,8 +2088,6 @@ public function diff( $method = 'unified', $rev1, $rev2, $rev3 = null ) {
if( $method == "raw" ) return array( $r1text, $r2text, $r3text );
return Diff::load( $method, $r1text, $r2text, $r3text );
}


}

/**
@@ -2354,14 +2432,18 @@ public function getSSH() {
return $this->SSH;
}

/**
* Performs nobots checking, new message checking, etc
*
* @var string $action Name of action.
* @var string $title Name of page to check for nobots
* @access public
* @return void
*/
/**
* Performs nobots checking, new message checking, etc
*
* @param string $action Name of action.
* @param null|string $title Name of page to check for nobots
* @param null $pageidp
* @throws AssertFailure
* @throws EditError
* @throws LoggedOut
* @throws MWAPIError
* @access public
*/
public function preEditChecks( $action = "Edit", $title = null, $pageidp = null ) {
global $pgDisablechecks, $pgMasterrunpage;
if( $pgDisablechecks ) return;
@@ -2407,7 +2489,7 @@ public function preEditChecks( $action = "Edit", $title = null, $pageidp = null
}

//Perform nobots checks, login checks, /Run checks
if( checkExclusion( $this, $oldtext, $this->get_username(), $this->get_optout() ) && $this->get_nobots() ) {
if( checkExclusion( $this, $oldtext, $this->get_username(), $this->get_optout(), $this->nobotsTaskname ) && $this->get_nobots() ) {
throw new EditError( "Nobots", "The page has a nobots template" );
}

@@ -26,6 +26,10 @@ class XMLParse {
* @access public
* @param string $data Either an url to an xml file, or a raw XML string. Peachy will autodetect which is which.
* @return array Parsed XML
* @throws BadEntryError
* @throws DependencyError
* @throws HookError
* @throws XMLError
*/
public static function load( $data ) {
$http = HTTP::getDefaultInstance();
@@ -68,6 +72,8 @@ public static function load( $data ) {

/**
* @param SimpleXMLElement $xml
* @param $arr
* @param $namespaces
*/
private static function recurse( $xml, &$arr, $namespaces ) {

@@ -105,5 +111,4 @@ private static function recurse( $xml, &$arr, $namespaces ) {
}
}
}

}
}
@@ -117,7 +117,7 @@
//Check for updates before loading Peachy.
if( !$pgDisableUpdates && !defined( 'PEACHY_PHPUNIT_TESTS' ) ) {
//the below MUST have its own Http object or else things will break
$updater = new AutoUpdate( new Http() );
$updater = new AutoUpdate(new HTTP());
$Uptodate = $updater->Checkforupdate();
if( !$Uptodate ) $updater->updatePeachy();
}
@@ -32,9 +32,10 @@ class AbuseFilter {
*
* @access public
* @param Wiki &$wikiClass The Wiki class object
* @return void
* @throws DependencyError
*/
function __construct( Wiki &$wikiClass ) {
public function __construct(Wiki &$wikiClass)
{
$this->wiki = $wikiClass;

if( !array_key_exists( 'Abuse Filter', $wikiClass->get_extensions() ) ) {
@@ -21,7 +21,8 @@

class CheckUser {

function __construct( Wiki &$wikiclass = null ) {
public function __construct(Wiki &$wikiclass = null)
{

$extensions = $wikiClass->get_extensions();
if( !array_key_exists( 'CheckUser', $extensions ) ) {
@@ -20,10 +20,10 @@
class CodeReview {

private $wiki;

private $repo;

function __construct( Wiki &$wikiClass, $repo ) {
public function __construct(Wiki &$wikiClass, $repo)
{
$this->wiki = $wikiClass;
$this->repo = $repo;

@@ -53,5 +53,4 @@ public function testupload() { }

public function comments() { }


}
@@ -67,6 +67,7 @@ class Email {
* @param string $fromName Name of sender.
* @param string $subject Subject of email
* @param string $message Message to send
* @throws DependencyError
*/
function __construct( $fromEmail, $fromName, $subject, $message ) {

@@ -21,6 +21,10 @@ class FlaggedRevs {

private $wiki;

/**
* @param Wiki $wikiClass
* @throws DependencyError
*/
function __construct( Wiki &$wikiClass ) {

if( !array_key_exists( 'FlaggedRevs', $wikiClass->get_extensions() ) ) {
@@ -30,6 +34,17 @@ function __construct( Wiki &$wikiClass ) {
$this->wiki = $wikiClass;
}

/**
* @param $revid
* @param null $reason
* @param int $status
* @return bool
* @throws AssertFailure
* @throws BadEntryError
* @throws HookError
* @throws LoggedOut
* @throws MWAPIError
*/
public function review( $revid, $reason = null, $status = 1 ) {

if( !in_array( 'review', $this->wiki->get_userrights() ) ) {
@@ -81,6 +96,19 @@ public function review( $revid, $reason = null, $status = 1 ) {
}
}

/**
* @param $title
* @param string $level
* @param null $reason
* @param bool|false $autoreview
* @param bool|false $watch
* @return bool
* @throws AssertFailure
* @throws BadEntryError
* @throws HookError
* @throws LoggedOut
* @throws MWAPIError
*/
public function stabilize( $title, $level = 'none', $reason = null, $autoreview = false, $watch = false ) {

if( !in_array( 'stablesettings', $this->wiki->get_userrights() ) ) {
@@ -142,6 +170,4 @@ public function unreviewedpages() { }

public function oldreviewedpages() { }


}

@@ -89,7 +89,11 @@ class GlobalUserInfo {
* @access public
* @param Wiki &$wikiClass The Wiki class object
* @param mixed $pgUsername Username
* @return void
* @throws APIError
* @throws AssertFailure
* @throws DependencyError
* @throws LoggedOut
* @throws MWAPIError
*/
function __construct( Wiki &$wikiClass, $pgUsername ) {

@@ -112,9 +116,9 @@ function __construct( Wiki &$wikiClass, $pgUsername ) {
if( !isset( $guiRes['query']['globaluserinfo'] ) ) {
$this->exists = false;
if( isset( $guiRes['error'] ) && $guiRes['error']['code'] != 'guinosuchuser' ) {
throw new APIError( $guiRes['error'] );
throw new MWAPIError($guiRes['error']);
} elseif( @$guiRes['error']['code'] != 'guinosuchuser' ) {
throw new APIError( array( 'code' => 'UnknownError', 'info' => 'Unknown API Error' ) );
throw new MWAPIError(array('code' => 'UnknownError', 'info' => 'Unknown API Error'));
}
} else {
$this->groups = $guiRes['query']['globaluserinfo']['groups'];
@@ -123,7 +127,6 @@ function __construct( Wiki &$wikiClass, $pgUsername ) {
$this->id = $guiRes['query']['globaluserinfo']['id'];
$this->registration = $guiRes['query']['globaluserinfo']['registration'];
}

}

/**
@@ -44,7 +44,6 @@ class IRC {
* @param string $pgPort Port to use
* @param string $Gecos AKA Real Name, Information field, etc.
* @param string|array Channel (s) to connect to
* @return void
*/
function __construct( $User, $Nick, $Pass, $Server, $pgPort, $Gecos, $Channel ) {
$this->f = fsockopen( $Server, $pgPort, $errno, $errstr, 30 );
@@ -251,7 +250,7 @@ public static function parseRC( $msg ) {
$return['username'] = $m[12];
$return['len'] = $m[14];
$return['comment'] = $m[15];
$return['timestamp'] = time( 'u' );
$return['timestamp'] = time();
$return['is_new'] = false;
$return['is_minor'] = false;
$return['is_bot'] = false;
@@ -283,22 +282,30 @@ public static function parseRC( $msg ) {
}
}

public static function get_error( $errno ) {
switch( $errno ){
case 401:
return "Nickname/Channel is currently unused";
case 402:
return "Server not found";
case 403:
return "Channel not found";
case 404:
return "Cannot send to channel";
case 405:
return "Too many channels joined";
case 406:
return "There was no such nickname";

}
/**
* @param $errno
* @return bool|string
*/
public static function get_error($errno)
{
if ($errno != null) {
switch ($errno) {
case 401:
return "Nickname/Channel is currently unused";
case 402:
return "Server not found";
case 403:
return "Channel not found";
case 404:
return "Cannot send to channel";
case 405:
return "Too many channels joined";
case 406:
return "There was no such nickname";
}
} else {
return false;
}
}
}

@@ -353,21 +360,7 @@ function __construct( $server, $pgPort = 6667, $user, $pass, $nick, $channel, $c
if( @$parsed['type'] == 'PRIVMSG' ) {
Hooks::runHook( 'SimpleIRCPrivMSG', array( &$parsed, &$irc, &$this ) );
}


}
}


}











@@ -41,7 +41,6 @@ class RPED {
*
* @access public
* @param Wiki &$wikiClass The Wiki class object
* @return void
*/
function __construct( Wiki &$wikiClass ) {
$this->wiki = $wikiClass;
@@ -24,8 +24,12 @@ class SiteMatrix {
*
* @static
* @access public
* @param Wiki &$wikiClass The Wiki class object
* @param Wiki &$wikiClass The Wiki class object
* @return array List of all wikis
* @throws AssertFailure
* @throws DependencyError
* @throws LoggedOut
* @throws MWAPIError
*/
public static function load( Wiki &$wikiClass ) {

@@ -263,7 +263,7 @@ public static function radio( $name, $value, $checked = false, $attribs = array(
public static function label( $label, $id, $attribs = array() ) {
$a = array( 'for' => $id );

# FIXME avoid copy pasting below:
// FIXME avoid copy pasting below:
if( isset( $attribs['class'] ) ) {
$a['class'] = $attribs['class'];
}
@@ -528,6 +528,9 @@ public static function escapeJsString( $string ) {
* Arrays are converted to JS arrays, objects are converted to JS associative
* arrays (objects). So cast your PHP associative arrays to objects before
* passing them to here.
*
* @param $value
* @return int|string
*/
public static function encodeJsVar( $value ) {
if( is_bool( $value ) ) {
@@ -578,7 +581,7 @@ public static function encodeJsVar( $value ) {
*/
public static function encodeJsCall( $name, $args, $pretty = false ) {
foreach( $args as &$arg ){
$arg = self::encodeJsVar( $arg, $pretty );
$arg = self::encodeJsVar($arg);
if( $arg === false ) {
return false;
}
@@ -4,6 +4,11 @@

class GenFunctionsTest extends \PHPUnit_Framework_TestCase {

/**
* Data Provider for test_iin_array()
*
* @return array
*/
public function provide_iin_array() {
return array(
array( 'BOO', array( 'boo' ), true ),
@@ -18,11 +23,19 @@ public function provide_iin_array() {
/**
* @dataProvider provide_iin_array
* @covers ::iin_array
* @param $needle
* @param $haystack
* @param $expected
*/
public function test_iin_array( $needle, $haystack, $expected ) {
$this->assertEquals( $expected, iin_array( $needle, $haystack ) );
}

/**
* Data Provider for test_strtoupper_safe()
*
* @return array
*/
public function provide_strtoupper_safe() {
return array(
array( 'foo', 'FOO' ),
@@ -36,11 +49,18 @@ public function provide_strtoupper_safe() {
/**
* @dataProvider provide_strtoupper_safe
* @covers ::strtoupper_safe
* @param $input
* @param $expected
*/
public function test_strtoupper_safe( $input, $expected ) {
$this->assertSame( $expected, strtoupper_safe( $input ) );
}

/**
* Data Provider for test_in_string()
*
* @return array
*/
public function provide_in_string() {
return array(
array( 'B', 'aBc', false, true ),
@@ -52,11 +72,20 @@ public function provide_in_string() {
/**
* @dataProvider provide_in_string
* @covers ::in_string
* @param $needle
* @param $haystack
* @param $insensitive
* @param $expected
*/
public function test_in_string( $needle, $haystack, $insensitive, $expected ) {
$this->assertEquals( $expected, in_string( $needle, $haystack, $insensitive ) );
}

/**
* Data Provider for test_in_array_recursive()
*
* @return array
*/
public function provide_in_array_recursive() {
return array(
array( 'BOO', array( 'boo' ), true, true ),
@@ -75,11 +104,20 @@ public function provide_in_array_recursive() {
/**
* @dataProvider provide_in_array_recursive
* @covers ::in_array_recursive
* @param $needle
* @param $haystack
* @param $insensitive
* @param $expected
*/
public function test_in_array_recursive( $needle, $haystack, $insensitive, $expected ) {
$this->assertEquals( $expected, in_array_recursive( $needle, $haystack, $insensitive ) );
}

/**
* Data Provider for test_checkExclusion()
*
* @return array
*/
public function provide_checkExclusion() {
return array(
array( false, '' ),
@@ -93,6 +131,10 @@ public function provide_checkExclusion() {
/**
* @dataProvider provide_checkExclusion
* @covers ::checkExclusion
* @param $expected
* @param $text
* @param null $pgUsername
* @param null $optout
*/
public function test_checkExclusion( $expected, $text, $pgUsername = null, $optout = null ) {
$this->assertSame( $expected, checkExclusion( $this->getMockWiki(), $text, $pgUsername, $optout ) );
@@ -1,59 +1,62 @@
<?php
//This file is the default configuration file for Peachy. Please do not modify it. Please create a file called config.local.inc.php with the variables you want altered.

//Controls weather or not the peachy tag is displayed at the end of edit summaries.
$pgNotag = false;
$pgTag = " ([[en:WP:PEACHY|Peachy ".PEACHYVERSION."]])";

//For debugging purposes. This generates enourmous amounts of data. Switch off if your space is limited.
$pgLogGetCommunicationData = true;
$pgLogPostCommunicationData = true;
$pgLogCommunicationData = true;
$pgLogSuccessfulCommunicationData = true;
$pgLogFailedCommunicationData = true;

//Bot output
$pgDisplayPostOutData = true;
$pgDisplayGetOutData = true;
$pgDisplayPechoVerbose = false; //Major security risk if set to true. Switch to true at your own risk.
$pgDisplayPechoNormal = true;
$pgDisplayPechoNotice = true;
$pgDisplayPechoWarn = true;
$pgDisplayPechoError = true;
$pgDisplayPechoFatal = true;
$pgWebOutput = false; //Switch to true if you are using a webserver to output your data instead of commandline.

//This controls bot checks, before doing an action. This change will affect every bot using it. Enabling it drops the edit rate.
$pgDisablechecks = false;

//Sometimes a site certificate can't be verified causing the connection to be terminated. Set this to false, if this is the case. Do so at your own risk.
$pgVerifyssl = true;

//Disable automatic updates. You will need to download updates manually then, until it is re-enabled again.
$pgDisableUpdates = false;
$pgExperimentalupdates = false;

//If your bots run on the Wikimedia Foundation Labs, this will allow Peachy to accomodate some it's features to work with the labs environment.
$pgUseLabs = false;

//API Communication settings.
$pgThrowExceptions = true;
$pgMaxAttempts = 20;

//Global bot settings
$pgMasterrunpage = null;

//SSH Settings - Should Peachy SSH into a server as it initializes?
$pgUseSSH = false;
$pgHost = null;
$pgPort = 22;
$pgUsername = null;
$pgPassphrase = null; //Passphrase to decrypt key file for authentication or password to authenticate with to server
$pgPrikey = null; //File path to the private key file.
$pgProtocol = 2; //SSH protocol to use. 1=SSH1 or 2=SSH2.
$pgTimeout = 10;

//Import local settings if available
if( file_exists($pgIP.'config.local.inc.php') ) require_once( $pgIP.'config.local.inc.php' );

?>
/**
* This file is the default configuration file for Peachy. Please do not modify it. Please create a file called
* config.local.inc.php with the variables you want altered.
*/

//Controls whether or not the peachy tag is displayed at the end of edit summaries.
$pgNotag = false;
$pgTag = " ([[en:WP:PEACHY|Peachy " . PEACHYVERSION . "]])";

//For debugging purposes. This generates enourmous amounts of data. Switch off if your space is limited.
$pgLogGetCommunicationData = true;
$pgLogPostCommunicationData = true;
$pgLogCommunicationData = true;
$pgLogSuccessfulCommunicationData = true;
$pgLogFailedCommunicationData = true;

//Bot output
$pgDisplayPostOutData = true;
$pgDisplayGetOutData = true;
$pgDisplayPechoVerbose = false; //Major security risk if set to true. Switch to true at your own risk.
$pgDisplayPechoNormal = true;
$pgDisplayPechoNotice = true;
$pgDisplayPechoWarn = true;
$pgDisplayPechoError = true;
$pgDisplayPechoFatal = true;
$pgWebOutput = false; //Switch to true if you are using a webserver to output your data instead of commandline.

//This controls bot checks, before doing an action. This change will affect every bot using it. Enabling it drops the edit rate.
$pgDisablechecks = false;

//Sometimes a site certificate can't be verified causing the connection to be terminated. Set this to false, if this is the case. Do so at your own risk.
$pgVerifyssl = true;

//Disable automatic updates. You will need to download updates manually then, until it is re-enabled again.
$pgDisableUpdates = false;
$pgExperimentalupdates = false;

//If your bots run on the Wikimedia Foundation Labs, this will allow Peachy to accomodate some it's features to work with the labs environment.
$pgUseLabs = false;

//API Communication settings.
$pgThrowExceptions = true;
$pgMaxAttempts = 20;

//Global bot settings
$pgMasterrunpage = null;

//SSH Settings - Should Peachy SSH into a server as it initializes?
$pgUseSSH = false;
$pgHost = null;
$pgPort = 22;
$pgUsername = null;
$pgPassphrase = null; //Passphrase to decrypt key file for authentication or password to authenticate with to server
$pgPrikey = null; //File path to the private key file.
$pgProtocol = 2; //SSH protocol to use. 1=SSH1 or 2=SSH2.
$pgTimeout = 10;

//Import local settings if available
if (file_exists($pgIP . 'config.local.inc.php')) {
require_once($pgIP . 'config.local.inc.php');
}