<?php
/*========================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.0 Release Candidate 1 - Nulled by xFWarez.is
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
/*
if (!isset($GLOBALS['vbulletin']->db))
{
	exit;
}
*/

class vB_Upgrade_522a4 extends vB_Upgrade_Version
{
	/*Constants=====================================================================*/

	/*Properties====================================================================*/

	/**
	* The short version of the script
	*
	* @var	string
	*/
	public $SHORT_VERSION = '522a4';

	/**
	* The long version of the script
	*
	* @var	string
	*/
	public $LONG_VERSION  = '5.2.2 Alpha 4';

	/**
	* Versions that can upgrade to this script
	*
	* @var	string
	*/
	public $PREV_VERSION = '5.2.2 Alpha 3';

	/**
	* Beginning version compatibility
	*
	* @var	string
	*/
	public $VERSION_COMPAT_STARTS = '';

	/**
	* Ending version compatibility
	*
	* @var	string
	*/
	public $VERSION_COMPAT_ENDS   = '';


	public function step_1()
	{
		$this->show_message($this->phrase['version']['522a4']['update_sitemap_directory']);

		$datastore = vB::getDatastore();
		$sitemappath =  $datastore->getOption('sitemap_path');

		//if we currently have an index file, assume that path is absolute or otherwise fine.
		//we check specifically for the file because people not using the sitepath will
		//have the default value and the default directory which should now line up
		if (!resolve_server_path($sitemappath . '/vbulletin_sitemap_index.xml.gz'))
		{
			//attempt to reconstruct the path that would resolve the old way
			if(resolve_server_path('admincp/' . $sitemappath))
			{
				 $datastore->setOption('sitemap_path', 'admincp/' . $sitemappath);
			}
		}
	}
}

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 10:32, Fri Feb 2nd 2018
|| # CVS: $RCSfile$ - $Revision$
|| ####################################################################
\*======================================================================*/
