Installer tweak for Windows: normalize line endings to platform standard in generated config.php
Added a comment that the writable directory checks are insufficient to catch ACL problems on Windows; need a better check for that.
This commit is contained in:
parent
fba140f4e0
commit
45392bef33
@ -128,6 +128,7 @@ abstract class Installer
|
|||||||
$pass = false;
|
$pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @fixme this check seems to be insufficient with Windows ACLs
|
||||||
if (!is_writable(INSTALLDIR)) {
|
if (!is_writable(INSTALLDIR)) {
|
||||||
$this->warning(sprintf('Cannot write config file to: <code>%s</code></p>', INSTALLDIR),
|
$this->warning(sprintf('Cannot write config file to: <code>%s</code></p>', INSTALLDIR),
|
||||||
sprintf('On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR));
|
sprintf('On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR));
|
||||||
@ -409,6 +410,10 @@ abstract class Installer
|
|||||||
"\$config['db']['database'] = '{$this->db['database']}';\n\n".
|
"\$config['db']['database'] = '{$this->db['database']}';\n\n".
|
||||||
($this->db['type'] == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":'').
|
($this->db['type'] == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":'').
|
||||||
"\$config['db']['type'] = '{$this->db['type']}';\n\n";
|
"\$config['db']['type'] = '{$this->db['type']}';\n\n";
|
||||||
|
|
||||||
|
// Normalize line endings for Windows servers
|
||||||
|
$cfg = str_replace("\n", PHP_EOL, $cfg);
|
||||||
|
|
||||||
// write configuration file out to install directory
|
// write configuration file out to install directory
|
||||||
$res = file_put_contents(INSTALLDIR.'/config.php', $cfg);
|
$res = file_put_contents(INSTALLDIR.'/config.php', $cfg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user