adding some time information

This commit is contained in:
Ralf Becker 2016-01-22 11:32:17 +00:00
parent 50ee8dded0
commit 2b10affe08
3 changed files with 37 additions and 28 deletions

View File

@ -165,6 +165,7 @@ class filemanager_admin extends filemanager_ui
if (!Versioning\StreamWrapper::check_delete_version(null))
{
$msg = lang('Permission denied')."\n\n".lang('You are NOT allowed to finally delete older versions and deleted files!');
$msg_type = 'error';
}
else
{
@ -173,39 +174,45 @@ class filemanager_admin extends filemanager_ui
if (!Vfs::file_exists($content['versionedpath']) || !Vfs::is_dir($content['versionedpath']))
{
$msg = lang('Directory "%1" NOT found!', $content['versionedpath']);
}
// shortcut to efficently delete every old version and deleted file
elseif ($content['versionedpath'] == '/' && !$content['ctime'])
{
$msg = lang('%1 files deleted.', Versioning\StreamWrapper::purge_all_versioning());
$msg_type = 'error';
}
else
{
@set_time_limit(0);
$starttime = microtime(true);
$deleted = $errors = 0;
Vfs::find($content['versionedpath'], array(
'show-deleted' => true,
'hidden' => true,
'depth' => true,
'path_preg' => '#/\.(attic|versions)/#',
)+(!(int)$content['ctime'] ? array() : array(
'ctime' => ($content['ctime']<0?'-':'+').(int)$content['ctime'],
)), function($path) use (&$deleted, &$errors)
// shortcut to efficently delete every old version and deleted file
if ($content['versionedpath'] == '/' && !$content['ctime'])
{
if (Vfs::is_dir($path))
$deleted = Versioning\StreamWrapper::purge_all_versioning();
}
else
{
Vfs::find($content['versionedpath'], array(
'show-deleted' => true,
'hidden' => true,
'depth' => true,
'path_preg' => '#/\.(attic|versions)/#',
)+(!(int)$content['ctime'] ? array() : array(
'ctime' => ($content['ctime']<0?'-':'+').(int)$content['ctime'],
)), function($path) use (&$deleted, &$errors)
{
Vfs::rmdir($path);
}
elseif (Vfs::unlink($path))
{
++$deleted;
}
else
{
++$errors;
}
});
$msg = $errors ? lang('%1 files deleted with %2 errors!', $deleted, $errors) : lang('%1 files deleted.', $deleted);
if (($is_dir = Vfs::is_dir($path)) && Vfs::rmdir($path) ||
!$is_dir && Vfs::unlink($path))
{
++$deleted;
}
else
{
++$errors;
}
});
}
$time = number_format(microtime(true)-$starttime, 1);
$msg = ($errors ? lang('%1 errors deleting!', $errors)."\n\n" : '').
lang('%1 files or directories deleted in %2 seconds.', $deleted, $time);
$msg_type = $errors ? 'error' : 'info';
}
Vfs::$is_root = false;
}

View File

@ -5,14 +5,15 @@
%1 elements linked. filemanager de %1 Elemente verknüpft.
%1 errors copying (%2 diretories and %3 files copied)! filemanager de %1 Fehler beim Kopieren (%2 Verzeichnisse und %3 Dateien kopiert)!
%1 errors deleteting (%2 directories and %3 files deleted)! filemanager de %1 Fehler beim Löschen (%2 Verzeichnisse und %3 Dateien gelöscht)!
%1 errors deleting! filemanager de %1 Fehler beim Löschen!
%1 errors linking (%2)! filemanager de %1 Fehler beim Verknüpfen (%2)!
%1 errors moving (%2 files moved)! filemanager de %1 Fehler beim Verschieben (%2 Dateien verschoben)!
%1 failed, %2 succeded filemanager de %1 fehlgeschlagen, %2 erfolgreich
%1 files common de %1 Dateien
%1 files copied. filemanager de %1 Dateien kopiert.
%1 files deleted with %2 errors! filemanager de %1 Dateien gelöscht mit %2 Fehlern!
%1 files deleted. filemanager de %1 Dateien gelöscht.
%1 files moved. filemanager de %1 Dateien verschoben.
%1 files or directories deleted in %2 seconds. filemanager de %1 Dateinen oder Verzeichnisse in %2 Sekunden gelöscht.
%1 shares deleted. filemanager de %1 Freigaben gelöscht.
%1 starts with '%2' filemanager de %1 beginnt mit '%2'
%1 successful unmounted. filemanager de %1 erfolgreich unmounted.

View File

@ -5,14 +5,15 @@
%1 elements linked. filemanager en %1 elements linked.
%1 errors copying (%2 diretories and %3 files copied)! filemanager en %1 errors copying, %2 directories and %3 files copied!
%1 errors deleteting (%2 directories and %3 files deleted)! filemanager en %1 errors deleting, %2 directories and %3 files deleted!
%1 errors deleting! filemanager en %1 errors deleting!
%1 errors linking (%2)! filemanager en %1 errors linking (%2)!
%1 errors moving (%2 files moved)! filemanager en %1 errors moving. %2 files moved!
%1 failed, %2 succeded filemanager en %1 failed, %2 succeeded.
%1 files common en %1 files
%1 files copied. filemanager en %1 files copied.
%1 files deleted with %2 errors! filemanager en %1 files deleted with %2 errors!
%1 files deleted. filemanager en %1 files deleted.
%1 files moved. filemanager en %1 files moved.
%1 files or directories deleted in %2 seconds. filemanager en %1 files or directories deleted in %2 seconds.
%1 shares deleted. filemanager en %1 shares deleted.
%1 starts with '%2' filemanager en %1 starts with '%2'
%1 successful unmounted. filemanager en %1 successful unmounted.