diff --git a/include/functions.php b/include/functions.php index 3c386f1..fd6fa57 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,63 +1,72 @@ . /** * Shortcuts very useful when you are creating a bot */ /** * Get a single wiki from its UID * * Some known UIDs: * wikidatawiki - Wikidata * commonswiki - Wikimedia Commons * metawiki - Meta-wiki * itwiki - Wikipedia (it) * * @param string $uid * @return mw\StaticSite */ function wiki( $uid ) { return \web\MediaWikis::findFromUID( $uid ); } /** * Get Wikidata * * @return wm\Wikidata */ function wikidata() { return wiki( 'wikidatawiki' ); } /** * Get Wikimedia Commons * * @return wm\Wikidata */ function commons() { return wiki( 'commonswiki' ); } /** * Get the Italian Wikipedia * * @return wm\WikipediaIt */ function itwiki() { return wiki( 'itwiki' ); } + +/** + * Enable debug mode + * + * @param $status status Enable debug or not + */ +function bozmw_debug( $status = true ) { + \cli\Log::$DEBUG = $status; +}