<?php
/*
 * XML Sitemap Feed upgrade routines
 *
 * @since 0.1
 */
class XMLSitemapFeed_News_Advanced_Upgrade {

	/*
	 * constructor: manages upgrade
	 *
	 * @since 0.1
	 */
	function __construct( $db_version = null )
	{
		if ( $db_version )
			$this->upgrade( $db_version );
		else
			$this->install();

		update_option( 'xmlsf_advanced_news_version', XMLSF_NEWS_ADV_VERSION );
	}

	/*
	 * set up default plugin data
	 *
	 * @since 0.1
	 */
	function install()
	{
		add_option( 'xmlsf_news_log', '', null, false );

		// Kilroy was here
		if ( defined('WP_DEBUG') && WP_DEBUG ) {
			error_log('Google News Advanced version '.XMLSF_NEWS_ADV_VERSION.' installed.');
		}
	}

	/*
	 * upgrade plugin data
	 *
	 * @since 0.1
	 */
	function upgrade( $db_version )
	{
		if ( version_compare( '0.1', $db_version, '>' ) ) {
		}

		if ( defined('WP_DEBUG') && WP_DEBUG ) {
			error_log('Google News Advanced upgraded from '.$db_version.' to '.XMLSF_NEWS_ADV_VERSION);
		}
	}

}
