Skip to content

Commit

Permalink
Fixed issue #5296: Command line installation not working
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10342 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jun 23, 2011
1 parent 251ef62 commit 493f0b9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
10 changes: 5 additions & 5 deletions admin/install/cmd_install.php
Expand Up @@ -12,7 +12,6 @@
*
* $Id: index.php 4729 2008-05-31 21:32:02Z nijaba $
*/
$cmd_install=true;
if (isset($argv[1]) && ($argv[1]=='install'|| $argv[1]=='upgrade') && isset($argv[2]) && isset($argv[3]))
{
require_once($argv[2]);
Expand All @@ -21,6 +20,7 @@
else
{
require_once(dirname(__FILE__).'/../../config-defaults.php');
$cmd_install=true;
require_once(dirname(__FILE__).'/../../common.php');
}
// SET THE LANGUAGE???? -> DEFAULT SET TO EN FOR NOW
Expand Down Expand Up @@ -108,14 +108,14 @@
$command = str_replace('$databasetabletype', $databasetabletype, $command);




if(!$connect->Execute($command,false))
{
print ("\n".$clang->gT("Executing").".....".$command."...".$clang->gT('Failed! Reason:')."\n".$connect->ErrorMsg()."\n\n");
$success=1;
}



$command = '';
Expand Down Expand Up @@ -157,7 +157,7 @@

$upgradedbtype=$databasetype;
if ($upgradedbtype=='mssql_n' || $upgradedbtype=='odbc_mssql' || $upgradedbtype=='odbtp') $upgradedbtype='mssql';
if ($upgradedbtype=='mssqnlative') $upgradedbtype='mssqlnative';
if ($upgradedbtype=='mssqnlative') $upgradedbtype='mssqlnative';
include ('upgrade-all.php');
include ('upgrade-'.$upgradedbtype.'.php');

Expand Down
6 changes: 3 additions & 3 deletions common.php
Expand Up @@ -232,12 +232,12 @@


//check if database exist and access is not via install script
if (!$database_exists && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
if (!$database_exists && !$cmd_install && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
die ("<br/>The LimeSurvey database does not exist. Please run the <a href='$homeurl/install/index.php'>install script</a> to create the necessary database.");
}

// Check if the DB is up to date
if ($dbexistsbutempty && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
// Check if the DB is up to date and access is not via install script
if ($dbexistsbutempty && !$cmd_install && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
die ("<br />The LimeSurvey database does exist but it seems to be empty. Please run the <a href='$homeurl/install/index.php'>install script</a> to create the necessary tables.");
}

Expand Down
27 changes: 17 additions & 10 deletions config-defaults.php
Expand Up @@ -44,7 +44,14 @@

// FILE LOCATIONS

$rooturl = "http://{$_SERVER['HTTP_HOST']}/limesurvey"; //The root web url for your limesurvey installation.
// File Locations
if (isset($cmd_install) && $cmd_install) {
$rooturl = "http://localhost/limesurvey"; // A safe Root URL if we're doing a cmd_install
} else {
$rooturl = "http://{$_SERVER['HTTP_HOST']}/limesurvey"; // The root web url for your limesurvey installation (without a trailing slash).
// The double quotes (") are important.
$cmd_install = false;
}

$rootdir = dirname(__FILE__); // This is the physical disk location for your limesurvey installation. Normally you don't have to touch this setting.
// If you use IIS then you MUST enter the complete rootdir e.g. : $rootDir="C:\Inetpub\wwwroot\limesurvey"!
Expand Down Expand Up @@ -100,9 +107,9 @@

// $sessionlifetime sets how long until a survey session expires in seconds
$sessionlifetime = 3600;
// $sessionhandler can be either 'file' or 'db'. (default: 'file').
// Generally you don't want to change that unless you are using LimeSurvey on load-balanced servers
$sessionhandler = 'file';
// $sessionhandler can be either 'file' or 'db'. (default: 'file').
// Generally you don't want to change that unless you are using LimeSurvey on load-balanced servers
$sessionhandler = 'file';



Expand Down Expand Up @@ -366,13 +373,13 @@

/**
* When this settings is true/1 (default = false/0) then the printable survey option will show a reference
* to the "lime_survey_12345" table which stores the survey answers.
* to the "lime_survey_12345" table which stores the survey answers.
* It will show a code like "12345X22X333name":
* 12345 = surveyID
* 22 = groupID
* 333 = questionID
* name = answer code (only shown for certain question types
*
*
* This code will be shown in front of each question and in front of each answer option at the printable survey.
* It can be used as a data analysis code book for querying data from the main response table.
*/
Expand Down Expand Up @@ -497,7 +504,7 @@
* to the http part of your normal LimeSurvey URL.
* e.g. https://your.domain.org/limesurvey/admin/admin.php
* If LimeSurvey comes up as normal, then everything is fine. If you
* get a page not found error or permission denied error then
* get a page not found error or permission denied error then
*/
$force_ssl = ''; // DO not turn on unless you are sure your server supports SSL/HTTPS

Expand All @@ -508,7 +515,7 @@
* server doesn't have HTTPS enabled, the only way to turn it off is
* by changing a value in the database directly. This allows you to
* force HTTPS off while you change the global settings for Force Secure.
*
*
* false = do nothing;
* true = override $force_ssl=on;
*
Expand All @@ -533,7 +540,7 @@
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='' && $_SERVER['HTTPS']!='off')
{
$rooturl=str_replace('http://', 'https://', $rooturl);
}
}
//-----------------------------------------------------

// === Advanced Setup
Expand Down Expand Up @@ -563,7 +570,7 @@
$imagedir = "$rootdir".DIRECTORY_SEPARATOR."images"; // The directory path of the image directory
$uploaddir = "$rootdir".DIRECTORY_SEPARATOR."upload";
$standardtemplaterootdir = "$rootdir".DIRECTORY_SEPARATOR."templates"; // The directory path of the standard templates
$usertemplaterootdir = "$uploaddir".DIRECTORY_SEPARATOR."templates"; // The directory path of the user templates
$usertemplaterootdir = "$uploaddir".DIRECTORY_SEPARATOR."templates"; // The directory path of the user templates

$sCKEditorURL = "$homeurl/scripts/ckeditor.36";
$ckeditexpandtoolbar = true; // defines if the CKeditor toolbar should be opened by default
Expand Down

0 comments on commit 493f0b9

Please sign in to comment.