Beispiel #1
0
function cos_upgrade_to($version)
{
    common::echoMessage("Will now pull source, and checkout latest tag", 'y');
    $command = "git fetch --tags && git checkout master && git pull && git checkout {$version}";
    $ret = common::execCommand($command);
    if ($ret) {
        common::abort('Aborting upgrade');
    }
    common::echoMessage("Will upgrade vendor with composer according to version", 'y');
    $command = "composer update";
    $ret = common::systemCommand($command);
    if ($ret) {
        common::abort('Composer update failed.');
    }
    common::echoMessage("Will upgrade all modules and templates the versions in the profile", 'y');
    // Upgrade all modules and templates
    $profile = conf::getModuleIni('system_profile');
    if (!$profile) {
        $profile = 'default';
    }
    upgrade_from_profile(array('clone_only' => 1, 'profile' => $profile));
    // reload any changes
    common::echoMessage("Reloading all configuration files", 'y');
    $p = new profile();
    $p->reloadProfile($profile);
    common::echoMessage("Load modules changes into database", 'y');
    cos_config_reload();
}
Beispiel #2
0
/**
 * wrapper function for reloading a profile
 * does the same as loading a profile, but keeps config/config.ini
 */
function reload_profile($options)
{
    $pro = new profile();
    $pro->reloadProfile($options['profile']);
}