mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
🐛 Adjust deleteinstallfiles
to use PUBLIC_PATH.
This commit is contained in:
parent
0f27e9696b
commit
d2f4ded3ef
@ -512,24 +512,22 @@ HTML;
|
||||
$title = new DBVarchar("Title");
|
||||
$content = new DBHTMLText('Content');
|
||||
|
||||
// We can't delete index.php as it might be necessary for URL routing without mod_rewrite.
|
||||
// There's no safe way to detect usage of mod_rewrite across webservers,
|
||||
// so we have to assume the file is required.
|
||||
$installfiles = [
|
||||
// As of SS4, index.php is required and should never be deleted.
|
||||
$installfiles = array(
|
||||
'install.php',
|
||||
'config-form.css',
|
||||
'config-form.html',
|
||||
'index.html',
|
||||
];
|
||||
'install-frameworkmissing.html',
|
||||
'index.html'
|
||||
);
|
||||
|
||||
$unsuccessful = new ArrayList();
|
||||
foreach ($installfiles as $installfile) {
|
||||
if (file_exists(BASE_PATH . '/' . $installfile)) {
|
||||
@unlink(BASE_PATH . '/' . $installfile);
|
||||
$installfilepath = PUBLIC_PATH . '/' . $installfile;
|
||||
if (file_exists($installfilepath)) {
|
||||
@unlink($installfilepath);
|
||||
}
|
||||
|
||||
if (file_exists(BASE_PATH . '/' . $installfile)) {
|
||||
$unsuccessful->push(new ArrayData(['File' => $installfile]));
|
||||
if (file_exists($installfilepath)) {
|
||||
$unsuccessful->push(new ArrayData(array('File' => $installfile)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user