.curver file found.";
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Generic actions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if($verbose) echo '
Updating Linea21 to version '. LINEA_VERSION . '
';
if($nocurverfile) echo ''.$nocurverfile.' Supposed version : '.$curver.'
';
// Run SQL updates
if($verbose) echo 'Running SQL updates
';
$sql_files = glob("../install/scripts_sql/patches/*.sql");
if($curver == $newver) exit("Seems to be up to date [Test : current version : " . $curver . " - new version : " . $newver . "].");
sort($sql_files, SORT_REGULAR ); // sort on name
foreach ($sql_files as $filename) {
$v = format_version_number(basename($filename, '.sql'));
// we get only SQL files > to previous version. if curver = 160, previous 120, 130, 140, 150 will be omitted
if($v > $curver) {
if($verbose) echo 'Applying SQL patches : '. $filename. '
' ;
// echo $v."
";
sql_update($filename, $sql_object);
}
}
// we run update PHP scripts
if($verbose) echo 'Running PHP scripts
';
$scripts = glob("../install/installer/data/update/*.php");
// sort to get the oldest first
sort($scripts, SORT_REGULAR ); // sort on name
foreach ($scripts as $filename) {
$v = substr(basename($filename), 0, 3); // we take the 3 first characters only to get version number
// we get only php files > to previous version. if curver = 160, previous 120, 130, 140, 150 will be omitted
if($v > $curver) {
if($verbose) echo 'Applying update routine : '.$filename. '
' ;
include_once($filename);
}
}
write_curver(); // we write current version in hidden file (config/.curver)
// Final message
!$l21auth->isAuthenticated() ? $url = '../admin/login.php' : $url = '../admin/logout.php?token='.$l21auth->GetSessionElement('logout_token');
echo '';