[svn r10713] Small fixes in variable naming and path building

skala
Yannick Warnier 18 years ago
parent 2df17831fb
commit c42ee2cd90
  1. 6
      main/install/install_upgrade.lib.php
  2. 10
      main/install/update_courses.php

@ -404,7 +404,7 @@ function get_sql_file_contents($file,$section,$print_errors=true)
if($print_errors) echo $error;
return false;
}
$filepath = getcwd().$file;
$filepath = getcwd().'/'.$file;
if(!is_file($filepath) or !is_readable($filepath))
{
$error = "File $filepath not found or not readable in get_sql_file_contents()";
@ -412,7 +412,7 @@ function get_sql_file_contents($file,$section,$print_errors=true)
return false;
}
//read the file in an array
$file_contents = file(getcwd().$file);
$file_contents = file($filepath);
if(!is_array($file_contents) or count($file_contents)<1)
{
$error = "File $filepath looks empty in get_sql_file_contents()";
@ -428,7 +428,7 @@ function get_sql_file_contents($file,$section,$print_errors=true)
{
//This is a comment. Check if section name, otherwise ignore
$result = array();
if(preg_match('/^-- xx([A-B]*)xx/',$line,$result))
if(preg_match('/^-- xx([A-Z]*)xx/',$line,$result))
{ //we got a section name here
if($result[1] == strtoupper($section))
{ //we have the section we are looking for, start recording

@ -61,7 +61,7 @@ error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
$update_path=trim(stripslashes($_GET['update_path']));
$updateFromVersion=array('1.5','1.5.4','1.5.5');
$update_from_version=array('1.5','1.5.4','1.5.5');
/*
==============================================================================
@ -94,7 +94,7 @@ if($_POST['step2'])
$_POST['step2']=0;
}
elseif(!in_array(get_config_param('clarolineVersion'),$updateFromVersion))
elseif(!in_array(get_config_param('clarolineVersion'),$update_from_version))
{
$badUpdatePath=true;
@ -189,9 +189,9 @@ else
?>
<h2>Step 1 of 2 &ndash; Configuration</h2>
Please enter the path where the older version of Dokeos is installed (<?php echo implode('&nbsp;|&nbsp;',$updateFromVersion); ?>). The courses will be moved from that location to the Dokeos path.
Please enter the path where the older version of Dokeos is installed (<?php echo implode('&nbsp;|&nbsp;',$update_from_version); ?>). The courses will be moved from that location to the Dokeos path.
<br /><br />
<b>Notice:</b> Please run this update script only if you've just updated (incompletely) Dokeos <?php echo implode('&nbsp;|&nbsp;',$updateFromVersion); ?> to Dokeos <?php echo $dokeos_version; ?>!
<b>Notice:</b> Please run this update script only if you've just updated (incompletely) Dokeos <?php echo implode('&nbsp;|&nbsp;',$update_from_version); ?> to Dokeos <?php echo $dokeos_version; ?>!
<br /><br />
<?php
if($badUpdatePath)
@ -200,7 +200,7 @@ else
<br /><br />
<div style="background-color:white; color:red; text-align:center; font-weight:bold;">
Error!<br />
Dokeos <?php echo implode('|',$updateFromVersion); ?> has not been found in that directory.
Dokeos <?php echo implode('|',$update_from_version); ?> has not been found in that directory.
</div>
<?php
}

Loading…
Cancel
Save