public function import( $page = null, $summary = '', $site = null, $fullhistory = true, $templates = true, $namespace = null, $root = false ) {

		$tokens = $this->get_tokens();

		$apiArray = array(
			'action'  => 'import',
			'summary' => $summary,
			'token'   => $tokens['import']
		);

		if( $root ) $apiArray['rootpage'] = '';

		if( !is_null( $page ) ) {
			if( !is_file( $page ) ) {
				$apiArray['interwikipage'] = $page;
				if( !is_null( $site ) ) {
					$apiArray['interwikisource'] = $site;
				} else {
					pecho( "Error: You must specify a site to import from.\n\n", PECHO_FATAL );
					return false;
				}
				if( !is_null( $namespace ) ) $apiArray['namespace'] = $namespace;
				if( $fullhistory ) $apiArray['fullhistory'] = '';
				if( $templates ) $apiArray['templates'] = '';
				pecho( "Importing $page from $site...\n\n", PECHO_NOTICE );
			} else {
				$apiArray['xml'] = "@$page";
				pecho( "Uploading XML...\n\n", PECHO_NOTICE );
			}
		} else {
			pecho( "Error: You must specify an interwiki page or a local XML file to import.\n\n", PECHO_FATAL );
			return false;
		}

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

		if( isset( $result['import'] ) ) {
			if( isset( $result['import']['page'] ) ) {
				return true;
			} else {
				pecho( "Import error...\n\n" . print_r( $result['import'], true ) . "\n\n", PECHO_FATAL );
				return false;
			}
		} else {
			pecho( "Import error...\n\n" . print_r( $result, true ), PECHO_FATAL );
			return false;
		}

	}