Ejemplo n.º 1
0
/** Invoke upgrades
 * @param $versions array	The version upgrade scripts to run
 */
function run_upgrade($versions)
{
    global $dryrun;
    foreach ($versions as $version) {
        out("Upgrading to " . $version . "..");
        install_upgrade($version);
        if (!$dryrun) {
            setversion($version);
        }
        out("Upgrading to " . $version . "..OK");
    }
}
Ejemplo n.º 2
0
if (!file_exists(dirname(__FILE__) . '/module.xml')) {
    out(_('Cant Find Framework XML'));
    return false;
}
//This is also run in moduleadmin class
//why? well because in developer mode this file doesnt exist, only the
//module.xml exists so we have to do it in multiple places. yaaaaay :-|
$fwxml = simplexml_load_file(dirname(__FILE__) . '/module.xml');
//setversion to whatever is in framework.xml forever for here on out.
$fwver = (string) $fwxml->version;
if (!empty($fwver)) {
    if (!function_exists('setversion')) {
        die('Cant find function setversion');
        return false;
    }
    setversion($fwver);
    if (getVersion() != $fwver) {
        out(_('Internal Error. Function install_getversion did not match the Framework version, even after it was suppose to be applied'));
        return false;
    }
} else {
    out(_('Version from Framework was empty, cant continue'));
    return false;
}
//sbin is not set correctly starting in 2.9, this is a stop-gap till we fix the installer in 13
exec('export PATH=/usr/local/sbin:$PATH && which -a amportal', $output, $return_var);
$file = null;
foreach ($output as $f) {
    if (!is_link($f)) {
        $file = $f;
        break;