fix in installer

This commit is contained in:
Diego Najar 2018-09-26 17:55:19 +02:00
parent 9d5fe7cd08
commit b921662fd8
3 changed files with 20 additions and 11 deletions

View File

@ -122,23 +122,26 @@ class Filesystem {
// Delete a file or directory recursive // Delete a file or directory recursive
// The directory is delete // The directory is delete
public static function deleteRecursive($source) public static function deleteRecursive($source, $deleteDirectory=true)
{ {
if (!self::directoryExists($source)) { if (!self::directoryExists($source)) {
return false; return false;
} }
foreach(new RecursiveIteratorIterator( foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($source, FilesystemIterator::SKIP_DOTS), new RecursiveDirectoryIterator($source, FilesystemIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST) as $item) { RecursiveIteratorIterator::CHILD_FIRST) as $item) {
if($item->isFile()) { if ($item->isFile()) {
unlink($item); unlink($item);
} else { } else {
rmdir($item); rmdir($item);
} }
} }
return rmdir($source); if ($deleteDirectory) {
return rmdir($source);
}
return true;
} }
// Compress a file or directory // Compress a file or directory
@ -216,7 +219,7 @@ class Filesystem {
$number = 0; $number = 0;
$tmpName = $filename.'_'.$number.'.'.$fileExtension; $tmpName = $filename.'_'.$number.'.'.$fileExtension;
while (Sanitize::pathFile($path.$tmpName)) { while (Sanitize::pathFile($path.$tmpName)) {
$number++; $number = $number + 1;
$tmpName = $filename.'_'.$number.'.'.$fileExtension; $tmpName = $filename.'_'.$number.'.'.$fileExtension;
} }
} }

View File

@ -96,6 +96,8 @@ class pluginRemoteContent extends Plugin {
Filesystem::deleteRecursive(PATH_UPLOADS); Filesystem::deleteRecursive(PATH_UPLOADS);
mkdir(PATH_PAGES, 0755, true); mkdir(PATH_PAGES, 0755, true);
mkdir(PATH_UPLOADS, 0755, true); mkdir(PATH_UPLOADS, 0755, true);
mkdir(PATH_UPLOADS_PROFILES, 0755, true);
mkdir(PATH_UPLOADS_THUMBNAILS, 0755, true);
return true; return true;
} }

View File

@ -591,12 +591,16 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
<?php <?php
$system = checkSystem(); $system = checkSystem();
if (!empty($system)) { if (!empty($system)) {
foreach ($system as $values) { foreach ($system as $error) {
echo '<div class="uk-panel">'; echo '
echo '<div class="uk-panel-badge uk-badge uk-badge-danger">FAIL</div>'; <table class="table">
echo '<h3 class="uk-panel-title">'.$values['title'].'</h3>'; <tbody>
echo $values['errorText']; <tr>
echo '</div>'; <th>'.$error.'</th>
</tr>
</tbody>
</table>
';
} }
} }
elseif (isset($_GET['language'])) elseif (isset($_GET['language']))