🐛 Adjust deleteinstallfiles to use PUBLIC_PATH.

This commit is contained in:
Maxime Rainville 2018-05-24 10:08:43 +12:00 committed by Maxime Rainville
parent 0f27e9696b
commit d2f4ded3ef

View File

@ -512,24 +512,22 @@ HTML;
$title = new DBVarchar("Title"); $title = new DBVarchar("Title");
$content = new DBHTMLText('Content'); $content = new DBHTMLText('Content');
// We can't delete index.php as it might be necessary for URL routing without mod_rewrite. // As of SS4, index.php is required and should never be deleted.
// There's no safe way to detect usage of mod_rewrite across webservers, $installfiles = array(
// so we have to assume the file is required.
$installfiles = [
'install.php', 'install.php',
'config-form.css', 'install-frameworkmissing.html',
'config-form.html', 'index.html'
'index.html', );
];
$unsuccessful = new ArrayList(); $unsuccessful = new ArrayList();
foreach ($installfiles as $installfile) { foreach ($installfiles as $installfile) {
if (file_exists(BASE_PATH . '/' . $installfile)) { $installfilepath = PUBLIC_PATH . '/' . $installfile;
@unlink(BASE_PATH . '/' . $installfile); if (file_exists($installfilepath)) {
@unlink($installfilepath);
} }
if (file_exists(BASE_PATH . '/' . $installfile)) { if (file_exists($installfilepath)) {
$unsuccessful->push(new ArrayData(['File' => $installfile])); $unsuccessful->push(new ArrayData(array('File' => $installfile)));
} }
} }