<?php
if((strpos($fromVersion, 'pro') === false && $fromVersion < '4_1') or (strpos($fromVersion, 'pro') !== false && $fromVersion < 'pro2_1'))
{
    $this->execSQL($this->app->getBasepath() . 'db' . DS . 'xuanxuan.sql');

    $this->loadModel('install')->setXuanxuan();
}
else
{
    $xuanxuanVersion = $this->getXuanxuanVersion();

    /* Fix bug the below versions of zdoo saved the wrong version of xuanxuan. */
    $versions = array('6.5', 'biz5.5', 'biz5.6');
    foreach($versions as $version)
    {
        if($version == $xuanxuanVersion && $version == $this->config->global->version) $xuanxuanVersion = '3.3';
    }

    $this->upgradeXuanxuan($xuanxuanVersion);
}
