} else { output("Wrote config to " . $config_path . "\n"); } } else { output("\nYour config settings haven't changed.\n"); } // check public/.htaccess file: output("\n"); if (file_exists($htaccess_path)) { $ask_rewrite = new ConfigEntry("apply.htaccess", "AbsolutePath", "The RewriteBase for " . $htaccess_path, NULL, "/"); if (file_exists($htaccess_path)) { foreach (file($htaccess_path) as $line) { $match = array(); if (preg_match("#^([ \t]*RewriteBase[ \t]*)([^ \t\n]*)[ \t]*\$#", $line, $match) > 0) { $ask_rewrite->set_config_answer($match[2]); $ask_rewrite->set_answer($match[2]); break; } } } $htaccess_changed = FALSE; $htaccess = file($htaccess_path); $htaccess_template = file($htaccess_template_path); if (count($htaccess) != count($htaccess_template)) { $htaccess_changed = TRUE; } else { for ($i = 0; $i < count($htaccess_template); $i++) { if (strpos($htaccess[$i], "RewriteBase") !== FALSE && strpos($htaccess_template[$i], "RewriteBase") !== FALSE) { continue; } if ($htaccess[$i] != $htaccess_template[$i]) {