public function purge( $titles = null, $pageids = null, $revids = null, $force = false, $redirects = false, $convert = false, $generator = null ) {

		$apiArr = array(
			'action' => 'purge'
		);

		if( is_null( $titles ) && is_null( $pageids ) && is_null( $revids ) ) {
			pecho( "Error: Nothing to purge.\n\n", PECHO_WARN );
			return false;
		}
		Hooks::runHook( 'StartPurge', array( &$titles ) );
		if( !is_null( $titles ) ) {
			if( is_array( $titles ) ) $titles = implode( '|', $titles );
			$apiArr['titles'] = $titles;
		}
		if( !is_null( $pageids ) ) {
			if( is_array( $pageids ) ) $pageids = implode( '|', $pageids );
			$apiArr['pageids'] = $pageids;
		}
		if( !is_null( $revids ) ) {
			if( is_array( $revids ) ) $revids = implode( '|', $revids );
			$apiArr['revids'] = $revids;
		}
		if( $redirects ) $apiArr['redirects'] = '';
		if( $force ) $apiArr['forcelinkupdate'] = '';
		if( $convert ) $apiArr['converttitles'] = '';

		$genparams = $this->generatorvalues;
		if( !is_null( $generator ) ) {
			if( in_array( $generator, $genparams ) ) {
				$apiArr['generator'] = 'g' . $generator;
			} else pecho( "Invalid generator value detected.  Omitting...\n\n", PECHO_WARN );
		}

		pecho( "Purging...\n\n", PECHO_NOTICE );

		Hooks::runHook( 'StartPurge', array( &$apiArr ) );

		$result = $this->apiQuery( $apiArr, true, true, false );

		if( isset( $result['purge'] ) ) {
			foreach( $result['purge'] as $page ){
				if( !isset( $page['purged'] ) ) {
					pecho( "Purge error on {$page['title']}...\n\n" . print_r( $page, true ) . "\n\n", PECHO_FATAL );
					return false;
				}
			}
			return true;

		} else {
			pecho( "Purge error...\n\n" . print_r( $result, true ), PECHO_FATAL );
			return false;
		}
	}