diff options
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/l10n/el.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/el.json | 2 | ||||
-rw-r--r-- | apps/files/l10n/en_GB.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/en_GB.json | 2 | ||||
-rw-r--r-- | apps/files/l10n/es.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/es.json | 2 | ||||
-rw-r--r-- | apps/files/l10n/fr.js | 4 | ||||
-rw-r--r-- | apps/files/l10n/fr.json | 4 | ||||
-rw-r--r-- | apps/files/l10n/sr.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/sr.json | 2 | ||||
-rw-r--r-- | apps/files/l10n/tr.js | 3 | ||||
-rw-r--r-- | apps/files/l10n/tr.json | 3 | ||||
-rw-r--r-- | apps/files/l10n/uk.js | 3 | ||||
-rw-r--r-- | apps/files/l10n/uk.json | 3 | ||||
-rw-r--r-- | apps/files/l10n/zh_CN.js | 6 | ||||
-rw-r--r-- | apps/files/l10n/zh_CN.json | 6 | ||||
-rw-r--r-- | apps/files/l10n/zh_HK.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/zh_HK.json | 2 | ||||
-rw-r--r-- | apps/files/lib/Command/Scan.php | 69 |
19 files changed, 85 insertions, 36 deletions
diff --git a/apps/files/l10n/el.js b/apps/files/l10n/el.js index 54ca0d31035..6f4c6db4fe8 100644 --- a/apps/files/l10n/el.js +++ b/apps/files/l10n/el.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Δημιουργία νέου φακέλου", "Upload file" : "Μεταφόρτωση αρχείου", "Recent" : "Πρόσφατα", + "This file has the tag {tag}" : "Αυτό το αρχείο έχει την ετικέτα {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Αυτό το αρχείο έχει τις ετικέτες {firstTags} και {lastTag}", "Not favorited" : "Δεν είναι αγαπημένο", "Remove from favorites" : "Αφαίρεση από τα αγαπημένα", "Add to favorites" : "Προσθήκη στα αγαπημένα", diff --git a/apps/files/l10n/el.json b/apps/files/l10n/el.json index e19ca8bc181..62bab6e341b 100644 --- a/apps/files/l10n/el.json +++ b/apps/files/l10n/el.json @@ -107,6 +107,8 @@ "Create new folder" : "Δημιουργία νέου φακέλου", "Upload file" : "Μεταφόρτωση αρχείου", "Recent" : "Πρόσφατα", + "This file has the tag {tag}" : "Αυτό το αρχείο έχει την ετικέτα {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Αυτό το αρχείο έχει τις ετικέτες {firstTags} και {lastTag}", "Not favorited" : "Δεν είναι αγαπημένο", "Remove from favorites" : "Αφαίρεση από τα αγαπημένα", "Add to favorites" : "Προσθήκη στα αγαπημένα", diff --git a/apps/files/l10n/en_GB.js b/apps/files/l10n/en_GB.js index c73292f069f..e0708ccdd23 100644 --- a/apps/files/l10n/en_GB.js +++ b/apps/files/l10n/en_GB.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Create new folder", "Upload file" : "Upload file", "Recent" : "Recent", + "This file has the tag {tag}" : "This file has the tag {tag}", + "This file has the tags {firstTags} and {lastTag}" : "This file has the tags {firstTags} and {lastTag}", "Not favorited" : "Not favourited", "Remove from favorites" : "Remove from favourites", "Add to favorites" : "Add to favourites", diff --git a/apps/files/l10n/en_GB.json b/apps/files/l10n/en_GB.json index c74a72b87db..ea827a9f8a1 100644 --- a/apps/files/l10n/en_GB.json +++ b/apps/files/l10n/en_GB.json @@ -107,6 +107,8 @@ "Create new folder" : "Create new folder", "Upload file" : "Upload file", "Recent" : "Recent", + "This file has the tag {tag}" : "This file has the tag {tag}", + "This file has the tags {firstTags} and {lastTag}" : "This file has the tags {firstTags} and {lastTag}", "Not favorited" : "Not favourited", "Remove from favorites" : "Remove from favourites", "Add to favorites" : "Add to favourites", diff --git a/apps/files/l10n/es.js b/apps/files/l10n/es.js index 61432fe570e..5893b81ab5d 100644 --- a/apps/files/l10n/es.js +++ b/apps/files/l10n/es.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Crear nueva carpeta", "Upload file" : "Subir archivo", "Recent" : "Reciente", + "This file has the tag {tag}" : "Este archivo tiene la etiqueta {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Este archivo tiene las etiquetas {firstTags} y {lastTag}", "Not favorited" : "Quitado como favorito", "Remove from favorites" : "Quitar de favoritos", "Add to favorites" : "Añadir a favoritos", diff --git a/apps/files/l10n/es.json b/apps/files/l10n/es.json index cabb9dca6c3..58c2d1a304e 100644 --- a/apps/files/l10n/es.json +++ b/apps/files/l10n/es.json @@ -107,6 +107,8 @@ "Create new folder" : "Crear nueva carpeta", "Upload file" : "Subir archivo", "Recent" : "Reciente", + "This file has the tag {tag}" : "Este archivo tiene la etiqueta {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Este archivo tiene las etiquetas {firstTags} y {lastTag}", "Not favorited" : "Quitado como favorito", "Remove from favorites" : "Quitar de favoritos", "Add to favorites" : "Añadir a favoritos", diff --git a/apps/files/l10n/fr.js b/apps/files/l10n/fr.js index fafff6d98e6..bbda95dafb5 100644 --- a/apps/files/l10n/fr.js +++ b/apps/files/l10n/fr.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Créer un nouveau dossier", "Upload file" : "Téléverser un fichier", "Recent" : "Récent", + "This file has the tag {tag}" : "Ce fichier a l'étiquette {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Ce fichier a les étiquettes {firstTags} et {lastTag}", "Not favorited" : "Non marqué comme favori", "Remove from favorites" : "Retirer des favoris", "Add to favorites" : "Ajouter aux favoris", @@ -174,6 +176,7 @@ OC.L10N.register( "Download file {name}" : "Télécharger le fichier {name}", "\"{displayName}\" action executed successfully" : "Action \"{displayName}\" exécutée avec succès", "\"{displayName}\" action failed" : "Échec de l'action \"{displayName}\"", + "Total rows summary" : "Récapitulatif du nombre total de lignes", "Select all" : "Tout sélectionner", "Unselect all" : "Tout désélectionner", "\"{displayName}\" failed on some elements " : "\"{displayName}\" a échoué pour avec certains éléments", @@ -229,6 +232,7 @@ OC.L10N.register( "Delete permanently" : "Supprimer définitivement", "Set up templates folder" : "Configurer le dossier des modèles", "Templates" : "Modèles", + "Create new templates folder" : "Créer un nouveau dossier de modèles", "Unable to initialize the templates directory" : "Impossible d'initialiser le dossier des modèles", "Toggle %1$s sublist" : "Basculer %1$s sous-liste", "Toggle grid view" : "Activer/Désactiver l'affichage mosaïque", diff --git a/apps/files/l10n/fr.json b/apps/files/l10n/fr.json index 6486b97d32e..19a6da272a7 100644 --- a/apps/files/l10n/fr.json +++ b/apps/files/l10n/fr.json @@ -107,6 +107,8 @@ "Create new folder" : "Créer un nouveau dossier", "Upload file" : "Téléverser un fichier", "Recent" : "Récent", + "This file has the tag {tag}" : "Ce fichier a l'étiquette {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Ce fichier a les étiquettes {firstTags} et {lastTag}", "Not favorited" : "Non marqué comme favori", "Remove from favorites" : "Retirer des favoris", "Add to favorites" : "Ajouter aux favoris", @@ -172,6 +174,7 @@ "Download file {name}" : "Télécharger le fichier {name}", "\"{displayName}\" action executed successfully" : "Action \"{displayName}\" exécutée avec succès", "\"{displayName}\" action failed" : "Échec de l'action \"{displayName}\"", + "Total rows summary" : "Récapitulatif du nombre total de lignes", "Select all" : "Tout sélectionner", "Unselect all" : "Tout désélectionner", "\"{displayName}\" failed on some elements " : "\"{displayName}\" a échoué pour avec certains éléments", @@ -227,6 +230,7 @@ "Delete permanently" : "Supprimer définitivement", "Set up templates folder" : "Configurer le dossier des modèles", "Templates" : "Modèles", + "Create new templates folder" : "Créer un nouveau dossier de modèles", "Unable to initialize the templates directory" : "Impossible d'initialiser le dossier des modèles", "Toggle %1$s sublist" : "Basculer %1$s sous-liste", "Toggle grid view" : "Activer/Désactiver l'affichage mosaïque", diff --git a/apps/files/l10n/sr.js b/apps/files/l10n/sr.js index 6979b7d8c59..d35a8150333 100644 --- a/apps/files/l10n/sr.js +++ b/apps/files/l10n/sr.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Направи нову фасциклу", "Upload file" : "Отпреми фајл", "Recent" : "Скорашњи", + "This file has the tag {tag}" : "Овај фајл има ознаку {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Овај фајл има ознаке {firstTags} и {lastTag}", "Not favorited" : "Није омиљено", "Remove from favorites" : "Избаци из омиљених", "Add to favorites" : "Додај у омиљене", diff --git a/apps/files/l10n/sr.json b/apps/files/l10n/sr.json index 8a0d1944f0d..0f478f45e16 100644 --- a/apps/files/l10n/sr.json +++ b/apps/files/l10n/sr.json @@ -107,6 +107,8 @@ "Create new folder" : "Направи нову фасциклу", "Upload file" : "Отпреми фајл", "Recent" : "Скорашњи", + "This file has the tag {tag}" : "Овај фајл има ознаку {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Овај фајл има ознаке {firstTags} и {lastTag}", "Not favorited" : "Није омиљено", "Remove from favorites" : "Избаци из омиљених", "Add to favorites" : "Додај у омиљене", diff --git a/apps/files/l10n/tr.js b/apps/files/l10n/tr.js index 1948442a290..d1a33520874 100644 --- a/apps/files/l10n/tr.js +++ b/apps/files/l10n/tr.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Klasör ekle", "Upload file" : "Dosya yükle", "Recent" : "Son", + "This file has the tag {tag}" : "Dosya {tag} olarak etiketlenmiş", + "This file has the tags {firstTags} and {lastTag}" : "Dosya {firstTags} ve {lastTag} olarak etiketlenmiş", "Not favorited" : "Sık kullanılanlarda değil", "Remove from favorites" : "Sık kullanılanlardan kaldır", "Add to favorites" : "Sık kullanılanlara ekle", @@ -230,6 +232,7 @@ OC.L10N.register( "Delete permanently" : "Kalıcı olarak sil", "Set up templates folder" : "Kalıp klasörünü ayarlayın", "Templates" : "Kalıplar", + "Create new templates folder" : "Yeni kalıp klasörü oluştur", "Unable to initialize the templates directory" : "Kalıp klasörü hazırlanamadı", "Toggle %1$s sublist" : "%1$s alt listesini aç/kapat", "Toggle grid view" : "Tablo görünümünü değiştir", diff --git a/apps/files/l10n/tr.json b/apps/files/l10n/tr.json index 9a6dfb0505c..5138396ffe0 100644 --- a/apps/files/l10n/tr.json +++ b/apps/files/l10n/tr.json @@ -107,6 +107,8 @@ "Create new folder" : "Klasör ekle", "Upload file" : "Dosya yükle", "Recent" : "Son", + "This file has the tag {tag}" : "Dosya {tag} olarak etiketlenmiş", + "This file has the tags {firstTags} and {lastTag}" : "Dosya {firstTags} ve {lastTag} olarak etiketlenmiş", "Not favorited" : "Sık kullanılanlarda değil", "Remove from favorites" : "Sık kullanılanlardan kaldır", "Add to favorites" : "Sık kullanılanlara ekle", @@ -228,6 +230,7 @@ "Delete permanently" : "Kalıcı olarak sil", "Set up templates folder" : "Kalıp klasörünü ayarlayın", "Templates" : "Kalıplar", + "Create new templates folder" : "Yeni kalıp klasörü oluştur", "Unable to initialize the templates directory" : "Kalıp klasörü hazırlanamadı", "Toggle %1$s sublist" : "%1$s alt listesini aç/kapat", "Toggle grid view" : "Tablo görünümünü değiştir", diff --git a/apps/files/l10n/uk.js b/apps/files/l10n/uk.js index 3ec993ffd2c..dff9c213f15 100644 --- a/apps/files/l10n/uk.js +++ b/apps/files/l10n/uk.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "Створити новий каталог", "Upload file" : "Завантажити файл", "Recent" : "Останні", + "This file has the tag {tag}" : "Цей файл має тег {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Цей файл має теги {firstTags} та {lastTag}", "Not favorited" : "Без зірочки", "Remove from favorites" : "Прибрати з вподобаного", "Add to favorites" : "Вподобати", @@ -230,6 +232,7 @@ OC.L10N.register( "Delete permanently" : "Вилучити назавжди", "Set up templates folder" : "Встановити каталог з шаблонами", "Templates" : "Шаблони", + "Create new templates folder" : "Створіть нову папку шаблонів", "Unable to initialize the templates directory" : "Неможливо встановити каталог з шаблонами", "Toggle %1$s sublist" : "Перемкнути вкладений список %1$s", "Toggle grid view" : "Перемкнути подання сіткою", diff --git a/apps/files/l10n/uk.json b/apps/files/l10n/uk.json index 5ea26244c66..2cf7e122922 100644 --- a/apps/files/l10n/uk.json +++ b/apps/files/l10n/uk.json @@ -107,6 +107,8 @@ "Create new folder" : "Створити новий каталог", "Upload file" : "Завантажити файл", "Recent" : "Останні", + "This file has the tag {tag}" : "Цей файл має тег {tag}", + "This file has the tags {firstTags} and {lastTag}" : "Цей файл має теги {firstTags} та {lastTag}", "Not favorited" : "Без зірочки", "Remove from favorites" : "Прибрати з вподобаного", "Add to favorites" : "Вподобати", @@ -228,6 +230,7 @@ "Delete permanently" : "Вилучити назавжди", "Set up templates folder" : "Встановити каталог з шаблонами", "Templates" : "Шаблони", + "Create new templates folder" : "Створіть нову папку шаблонів", "Unable to initialize the templates directory" : "Неможливо встановити каталог з шаблонами", "Toggle %1$s sublist" : "Перемкнути вкладений список %1$s", "Toggle grid view" : "Перемкнути подання сіткою", diff --git a/apps/files/l10n/zh_CN.js b/apps/files/l10n/zh_CN.js index 0d6978e5fbd..327e23ac172 100644 --- a/apps/files/l10n/zh_CN.js +++ b/apps/files/l10n/zh_CN.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "创建新文件夹", "Upload file" : "上传文件", "Recent" : "最近", + "This file has the tag {tag}" : "这个文件有 {tag} 标签", + "This file has the tags {firstTags} and {lastTag}" : "这个文件有 {firstTags} 和 {lastTag} 标签", "Not favorited" : "未收藏", "Remove from favorites" : "从收藏中移除", "Add to favorites" : "添加到收藏夹", @@ -176,9 +178,11 @@ OC.L10N.register( "\"{displayName}\" action failed" : "\"{displayName}\" 操作执行失败", "Select all" : "全部选择", "Unselect all" : "取消全选", + "\"{displayName}\" batch action executed successfully" : "批量操作 \"{displayName}\" 运行成功", "ascending" : "升序", "descending" : "降序", "Sort list by {column} ({direction})" : "按 {column} ({direction}) 排序列表", + "This list is not fully rendered for performances reasons. The files will be rendered as you navigate through the list." : "该列表因为性能原因没有完全加载。文件将会在您浏览列表的时候加载。", "Storage informations" : "存储信息", "{usedQuotaByte} used" : "{usedQuotaByte} 已使用", "{relative}% used" : "{relative}% 已使用", @@ -187,6 +191,7 @@ OC.L10N.register( "Choose file or folder to transfer" : "选择要转移的文件或文件夹", "Change" : "修改", "New owner" : "新的拥有者", + "Search for an account" : "搜索一个账户", "Choose a file or folder to transfer" : "选择要转移的文件或文件夹", "Transfer" : "转移", "Transfer {path} to {userid}" : "将 {path} 转移给 {userid}", @@ -225,6 +230,7 @@ OC.L10N.register( "Delete permanently" : "彻底删除", "Set up templates folder" : "设置模板文件夹", "Templates" : "模板", + "Create new templates folder" : "新建模板文件夹", "Unable to initialize the templates directory" : "无法初始化模板目录", "Toggle %1$s sublist" : "切换 %1$s 子列表", "Toggle grid view" : "切换网格视图", diff --git a/apps/files/l10n/zh_CN.json b/apps/files/l10n/zh_CN.json index 97a7c05d76c..149b51ed282 100644 --- a/apps/files/l10n/zh_CN.json +++ b/apps/files/l10n/zh_CN.json @@ -107,6 +107,8 @@ "Create new folder" : "创建新文件夹", "Upload file" : "上传文件", "Recent" : "最近", + "This file has the tag {tag}" : "这个文件有 {tag} 标签", + "This file has the tags {firstTags} and {lastTag}" : "这个文件有 {firstTags} 和 {lastTag} 标签", "Not favorited" : "未收藏", "Remove from favorites" : "从收藏中移除", "Add to favorites" : "添加到收藏夹", @@ -174,9 +176,11 @@ "\"{displayName}\" action failed" : "\"{displayName}\" 操作执行失败", "Select all" : "全部选择", "Unselect all" : "取消全选", + "\"{displayName}\" batch action executed successfully" : "批量操作 \"{displayName}\" 运行成功", "ascending" : "升序", "descending" : "降序", "Sort list by {column} ({direction})" : "按 {column} ({direction}) 排序列表", + "This list is not fully rendered for performances reasons. The files will be rendered as you navigate through the list." : "该列表因为性能原因没有完全加载。文件将会在您浏览列表的时候加载。", "Storage informations" : "存储信息", "{usedQuotaByte} used" : "{usedQuotaByte} 已使用", "{relative}% used" : "{relative}% 已使用", @@ -185,6 +189,7 @@ "Choose file or folder to transfer" : "选择要转移的文件或文件夹", "Change" : "修改", "New owner" : "新的拥有者", + "Search for an account" : "搜索一个账户", "Choose a file or folder to transfer" : "选择要转移的文件或文件夹", "Transfer" : "转移", "Transfer {path} to {userid}" : "将 {path} 转移给 {userid}", @@ -223,6 +228,7 @@ "Delete permanently" : "彻底删除", "Set up templates folder" : "设置模板文件夹", "Templates" : "模板", + "Create new templates folder" : "新建模板文件夹", "Unable to initialize the templates directory" : "无法初始化模板目录", "Toggle %1$s sublist" : "切换 %1$s 子列表", "Toggle grid view" : "切换网格视图", diff --git a/apps/files/l10n/zh_HK.js b/apps/files/l10n/zh_HK.js index 61c7b00c1c2..c51b90cebe2 100644 --- a/apps/files/l10n/zh_HK.js +++ b/apps/files/l10n/zh_HK.js @@ -109,6 +109,8 @@ OC.L10N.register( "Create new folder" : "新增資料夾", "Upload file" : "上傳檔案", "Recent" : "最新", + "This file has the tag {tag}" : "此檔案有標籤 {tag}", + "This file has the tags {firstTags} and {lastTag}" : "此檔案有標籤 {firstTags} 與 {lastTag}", "Not favorited" : "未加入至最愛", "Remove from favorites" : "從最愛中移除", "Add to favorites" : "加到我的最愛", diff --git a/apps/files/l10n/zh_HK.json b/apps/files/l10n/zh_HK.json index c9dbf1a731a..33e803bfdd6 100644 --- a/apps/files/l10n/zh_HK.json +++ b/apps/files/l10n/zh_HK.json @@ -107,6 +107,8 @@ "Create new folder" : "新增資料夾", "Upload file" : "上傳檔案", "Recent" : "最新", + "This file has the tag {tag}" : "此檔案有標籤 {tag}", + "This file has the tags {firstTags} and {lastTag}" : "此檔案有標籤 {firstTags} 與 {lastTag}", "Not favorited" : "未加入至最愛", "Remove from favorites" : "從最愛中移除", "Add to favorites" : "加到我的最愛", diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index a59665c56e9..6c7a607d2af 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -58,6 +58,7 @@ class Scan extends Base { protected float $execTime = 0; protected int $foldersCounter = 0; protected int $filesCounter = 0; + protected int $errorsCounter = 0; private IRootFolder $root; private MetadataManager $metadataManager; @@ -148,10 +149,12 @@ class Scan extends Base { $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE); + ++$this->errorsCounter; }); $scanner->listen('\OC\Files\Utils\Scanner', 'normalizedNameMismatch', function ($fullPath) use ($output) { $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); + ++$this->errorsCounter; }); try { @@ -164,14 +167,17 @@ class Scan extends Base { $output->writeln("<error>Home storage for user $user not writable or 'files' subdirectory missing</error>"); $output->writeln(' ' . $e->getMessage()); $output->writeln('Make sure you\'re running the scan command only as the user the web server runs as'); + ++$this->errorsCounter; } catch (InterruptedException $e) { # exit the function if ctrl-c has been pressed $output->writeln('Interrupted by user'); } catch (NotFoundException $e) { $output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>'); + ++$this->errorsCounter; } catch (\Exception $e) { $output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>'); $output->writeln('<error>' . $e->getTraceAsString() . '</error>'); + ++$this->errorsCounter; } } @@ -192,11 +198,6 @@ class Scan extends Base { $users = $input->getArgument('user_id'); } - # restrict the verbosity level to VERBOSITY_VERBOSE - if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - } - # check quantity of users to be process and show it on the command line $users_total = count($users); if ($users_total === 0) { @@ -204,7 +205,7 @@ class Scan extends Base { return 1; } - $this->initTools(); + $this->initTools($output); $user_count = 0; foreach ($users as $user) { @@ -236,15 +237,19 @@ class Scan extends Base { /** * Initialises some useful tools for the Command */ - protected function initTools() { + protected function initTools(OutputInterface $output) { // Start the timer $this->execTime = -microtime(true); // Convert PHP errors to exceptions - set_error_handler([$this, 'exceptionErrorHandler'], E_ALL); + set_error_handler( + fn (int $severity, string $message, string $file, int $line): bool => + $this->exceptionErrorHandler($output, $severity, $message, $file, $line), + E_ALL + ); } /** - * Processes PHP errors as exceptions in order to be able to keep track of problems + * Processes PHP errors in order to be able to show them in the output * * @see https://www.php.net/manual/en/function.set-error-handler.php * @@ -252,15 +257,17 @@ class Scan extends Base { * @param string $message * @param string $file the filename that the error was raised in * @param int $line the line number the error was raised - * - * @throws \ErrorException */ - public function exceptionErrorHandler($severity, $message, $file, $line) { - if (!(error_reporting() & $severity)) { - // This error code is not included in error_reporting - return; + public function exceptionErrorHandler(OutputInterface $output, int $severity, string $message, string $file, int $line): bool { + if (($severity === E_DEPRECATED) || ($severity === E_USER_DEPRECATED)) { + // Do not show deprecation warnings + return false; } - throw new \ErrorException($message, 0, $severity, $file, $line); + $e = new \ErrorException($message, 0, $severity, $file, $line); + $output->writeln('<error>Error during scan: ' . $e->getMessage() . '</error>'); + $output->writeln('<error>' . $e->getTraceAsString() . '</error>', OutputInterface::VERBOSITY_VERY_VERBOSE); + ++$this->errorsCounter; + return true; } /** @@ -271,28 +278,18 @@ class Scan extends Base { $this->execTime += microtime(true); $headers = [ - 'Folders', 'Files', 'Elapsed time' + 'Folders', + 'Files', + 'Errors', + 'Elapsed time', ]; - - $this->showSummary($headers, null, $output); - } - - /** - * Shows a summary of operations - * - * @param string[] $headers - * @param string[] $rows - * @param OutputInterface $output - */ - protected function showSummary($headers, $rows, OutputInterface $output) { $niceDate = $this->formatExecTime(); - if (!$rows) { - $rows = [ - $this->foldersCounter, - $this->filesCounter, - $niceDate, - ]; - } + $rows = [ + $this->foldersCounter, + $this->filesCounter, + $this->errorsCounter, + $niceDate, + ]; $table = new Table($output); $table ->setHeaders($headers) |