Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ function step1(){

$php_modules = (array) @apache_get_modules();
$l_modrewrite=(in_array('mod_rewrite',$php_modules)) ? 1:0;
$class_alert['modrewrite']= ($l_modrewrite) ? 'install-ok' : 'install-alert';
$alert_rewrite_na='';
}
// caso CGI
else{

$php_modules= array();
$l_modrewrite='na';
$class_alert['modrewrite']= 'install-na';
$alert_rewrite_na=_('This information is not available, since it seems to be using PHP as CGI');
require_once("../inc/func.mod_rewrite.php");
$doc_root="http://".$_SERVER['HTTP_HOST'].str_replace("/_install/index.php",'',$_SERVER['PHP_SELF']);
$l_modrewrite=(check_mod_rewrite($doc_root)) ? 1:0;
}
$class_alert['modrewrite']= ($l_modrewrite) ? 'install-ok' : 'install-alert';
$alert_rewrite_na='';

$l_mysqli=(in_array('mysqli',$ext)) ? 1:0;
$l_mysql_old=(in_array('mysql',$ext)) ? 1:0;
Expand Down
21 changes: 17 additions & 4 deletions admin/vfront.info.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,24 @@
// IMPOSTAZIONI IMPORTANTI ---------------------------------------------------------------------------------------------------
$OUT.="<h2 class=\"title-vfrontinfo\">"._("Apache Modules")."</h2>";

$modules_apache=(array) @apache_get_modules();

$flog.="ApacheLoadedModules: ".implode(",",$modules_apache)."\n";
if(function_exists('apache_get_modules')){
$modules_apache=(array) @apache_get_modules();
$flog.="ApacheLoadedModules: ".implode(",",$modules_apache)."\n";
$apache_mod_rewrite=(in_array("mod_rewrite", $modules_apache)) ? "<span class=\"verde\">"._("YES")."</span>" : "<span class=\"rosso\">"._("NO")."</span>";
}
else{
$flog.="ApacheLoadedModules: apache_get_modules() not available\n";
require_once("../inc/func.mod_rewrite.php");
if (check_mod_rewrite(FRONT_DOCROOT)) {
$flog.="mod_rewrite test succeeded\n";
$apache_mod_rewrite="<span class=\"verde\">"._("YES")."</span>";
}
else{
$flog.="mod_rewrite test failed\n";
$apache_mod_rewrite="<span class=\"rosso\">"._("NO")."</span>";
}
}

$apache_mod_rewrite=(in_array("mod_rewrite", $modules_apache)) ? "<span class=\"verde\">"._("YES")."</span>" : "<span class=\"rosso\">"._("NO")."</span>";
$OUT.="<span class=\"grigio\">"._("Mod_rewrite:")."</span> <strong>$apache_mod_rewrite</strong>\n";
$OUT.="<div class=\"piccolo\">"._("VFront requires the use of mod_rewrite for different functions, such as generating reports")."</div><br />\n";

Expand Down
8 changes: 8 additions & 0 deletions inc/func.mod_rewrite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

function check_mod_rewrite($root){
$test = file_get_contents($root.'/inc/mod_rewrite/test');
return $test == 'YES';
}

?>
4 changes: 4 additions & 0 deletions inc/mod_rewrite/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<IfModule rewrite_module>
RewriteEngine On
RewriteRule ^test$ test.php
</IfModule>
2 changes: 2 additions & 0 deletions inc/mod_rewrite/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
print "YES";