mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-05 06:58:50 +00:00
fix #1154
This commit is contained in:
parent
3d2b9e2e23
commit
f5618feb73
3 changed files with 13 additions and 8 deletions
|
@ -392,8 +392,11 @@ final class Tools
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($files as $fileInfo) {
|
foreach ($files as $fileInfo) {
|
||||||
$todo = ($fileInfo->isDir() ? 'rmdir' : 'unlink');
|
$filename = $fileInfo->getFilename();
|
||||||
$todo($fileInfo->getRealPath());
|
if (!$filename[0] == '.') {
|
||||||
|
$todo = ($fileInfo->isDir() ? 'rmdir' : 'unlink');
|
||||||
|
$todo($fileInfo->getRealPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tools::logm('empty cache');
|
Tools::logm('empty cache');
|
||||||
|
|
|
@ -18,11 +18,11 @@ require_once('install_functions.php');
|
||||||
|
|
||||||
if (isset($_GET['clean'])) {
|
if (isset($_GET['clean'])) {
|
||||||
if (is_dir('install')){
|
if (is_dir('install')){
|
||||||
delTree('install');
|
delTree('install', true);
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
}
|
}
|
||||||
if (is_dir('cache')) {
|
if (is_dir('cache')) {
|
||||||
delTree('cache', false);
|
delTree('cache', false, false);
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,12 @@ function pdoDrivers() {
|
||||||
* Here in case of .gitignore files
|
* Here in case of .gitignore files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function delTree($dir, $withdirectory="true") {
|
function delTree($dir, $withdirectory=true, $hiddenfiles = true) {
|
||||||
$files = array_diff(scandir($dir), array('.','..'));
|
if ($hiddenfiles) {
|
||||||
foreach ($files as $file) {
|
$files = array_diff(scandir($dir), array('.','..'));
|
||||||
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
|
foreach ($files as $file) {
|
||||||
|
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($withdirectory) {
|
if ($withdirectory) {
|
||||||
return rmdir($dir);
|
return rmdir($dir);
|
||||||
|
|
Loading…
Reference in a new issue