Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check if mod_rewrite exists during installation and enable removal of…
… script name from the url accordingly

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11679 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
GautamGupta committed Dec 18, 2011
1 parent 8daca31 commit 8d1d0c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/config.php
Expand Up @@ -52,7 +52,7 @@
'urlManager' => array(
'urlFormat' => 'path',
'rules' => require('routes.php'),
'showScriptName' => false,
'showScriptName' => true,
),

),
Expand Down
12 changes: 11 additions & 1 deletion application/controllers/InstallerController.php
Expand Up @@ -878,6 +878,16 @@ function _writeConfigFile()
extract(self::_getDatabaseConfig());
$sDsn = sprintf(self::_getDsn($sDatabaseType, $sDatabasePort), $sDatabaseLocation, $sDatabaseName, $sDatabasePort);

// mod_rewrite existence check
if ((function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) || strtolower(getenv('HTTP_MOD_REWRITE')) == 'on')
{
$showScriptName = "\t\t\t" . "'showScriptName' => false," . "\n";
}
else
{
$showScriptName = "\t\t\t" . "'showScriptName' => true," . "\n";
}

$dbdata = "<?php if (!defined('BASEPATH')) exit('No direct script access allowed');" . "\n"
."/*"."\n"
."| -------------------------------------------------------------------"."\n"
Expand Down Expand Up @@ -943,7 +953,7 @@ function _writeConfigFile()
."\t\t" . "'urlManager' => array(" . "\n"
."\t\t\t" . "'urlFormat' => 'path'," . "\n"
."\t\t\t" . "'rules' => require('routes.php')," . "\n"
."\t\t\t" . "'showScriptName' => false," . "\n"
. $showScriptName
."\t\t" . ")," . "\n"
."\t" . "" . "\n"

Expand Down

0 comments on commit 8d1d0c4

Please sign in to comment.