Skip to content

Commit f58bd9b

Browse files
committed
Tracking: Remove previously added SYS_VAR_DIR (use SYMFONY_SYS_PATH) and improve language variables
1 parent 4dd011c commit f58bd9b

72 files changed

Lines changed: 34 additions & 216 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/locales/en_US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,4 +1477,4 @@
14771477
"Job": "Job",
14781478
"Modified prompt": "Modified prompt",
14791479
"Saved in Documents": "Saved in Documents"
1480-
}
1480+
}

public/main/inc/ajax/statistics.ajax.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Chamilo\CoreBundle\Entity\Session;
55
use Chamilo\CoreBundle\Framework\Container;
66
use Chamilo\CoreBundle\Helpers\ChamiloHelper;
7+
use League\Flysystem\FilesystemOperator;
78

89
/**
910
* Responses to AJAX calls.
@@ -1447,15 +1448,29 @@
14471448
if (api_is_windows_os()) {
14481449
$message = get_lang('The space used on disk cannot be measured properly on Windows-based systems.');
14491450
} else {
1450-
$dir = api_get_path(SYS_VAR_PATH);
1451-
$du = exec('du -sh '.$dir, $err);
1451+
// @TODO Scanning the var folder should be done through oneup_flysystem
1452+
/** @var FilesystemOperator $assetFS */
1453+
//$assetFS = Container::$container->get('oneup_flysystem.asset_filesystem');
1454+
/** @var FilesystemOperator $resourceFS */
1455+
//$resourceFS = Container::$container->get('oneup_flysystem.resource_filesystem');
1456+
/** @var FilesystemOperator $themesFS */
1457+
//$themesFS = Container::$container->get('oneup_flysystem.themes_filesystem');
1458+
/** @var FilesystemOperator $pluginsFS */
1459+
//$pluginsFS = Container::$container->get('oneup_flysystem.plugins_filesystem');
1460+
1461+
$dir = api_get_path(SYMFONY_SYS_PATH).'var/';
1462+
$du = exec('du -s '.$dir, $err);
14521463
list($size, $none) = explode("\t", $du);
1464+
$size = round($size / (1024*1024), 1);
14531465
unset($none);
1454-
$limit = 0;
1455-
if (isset($_configuration[$accessUrlId]['hosting_limit_disk_space'])) {
1456-
$limit = $_configuration[$accessUrlId]['hosting_limit_disk_space'];
1466+
$limit = '';
1467+
$url = api_get_access_url($accessUrlId)['url'];
1468+
if (!empty($_configuration[$accessUrlId]['hosting_limit_disk_space'])) {
1469+
$limit = round($_configuration[$accessUrlId]['hosting_limit_disk_space'] / (1024), 1);
1470+
$message = sprintf(get_lang('Total space used by portal %s is %sGB (limit is set to %sGB)'), $url, $size, $limit);
1471+
} else {
1472+
$message = sprintf(get_lang('Total space used by %s is %sGB'), $url, $size);
14571473
}
1458-
$message = sprintf(get_lang('Total space used by portal %s limit is %s MB'), $size, $limit);
14591474
}
14601475
echo Display::tag('H5', $message, ['style' => 'margin-bottom: 25px;']);
14611476
break;

public/main/inc/lib/api.lib.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@
350350
define('WEB_PLUGIN_PATH', 'WEB_PLUGIN_PATH');
351351
define('WEB_PLUGIN_ASSET_PATH', 'WEB_PLUGIN_ASSET_PATH');
352352
define('SYS_ARCHIVE_PATH', 'SYS_ARCHIVE_PATH');
353-
define('SYS_VAR_PATH', 'SYS_VAR_PATH');
354353
define('WEB_ARCHIVE_PATH', 'WEB_ARCHIVE_PATH');
355354
define('LIBRARY_PATH', 'LIBRARY_PATH');
356355
define('CONFIGURATION_PATH', 'CONFIGURATION_PATH');
@@ -763,7 +762,6 @@ function api_get_path($path = '', $configuration = [])
763762
SYS_CSS_PATH => $root_sys.'public/build/css/',
764763
SYS_PLUGIN_PATH => $root_sys.'public/plugin/',
765764
SYS_ARCHIVE_PATH => Container::$container ? Container::getCacheDir() : $root_sys.'var/cache/',
766-
SYS_VAR_PATH => Container::$container ? Container::getVarDir() : $root_sys.'var/',
767765
SYS_TEST_PATH => $root_sys.'tests/',
768766
SYS_TEMPLATE_PATH => $root_sys.'public/main/template/',
769767
SYS_PUBLIC_PATH => $root_sys.'public/',

translations/messages.ar.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19428,9 +19428,6 @@ msgstr "ازالة قاعدة البيانات القديمة"
1942819428
msgid "Remove old tables"
1942919429
msgstr "ازالة الجداول القديمة"
1943019430

19431-
msgid "Total space used by portal %s limit is %s MB"
19432-
msgstr "مجموع المساحة المستخدمة من قبل النظام %s الحد الاقصى هو %s MB"
19433-
1943419431
msgid "Event message management"
1943519432
msgstr "ادارة رسالة الحدث"
1943619433

translations/messages.ast_ES.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19415,9 +19415,6 @@ msgstr "Eliminar base de datos antigua"
1941519415
msgid "Remove old tables"
1941619416
msgstr "Eliminar tables antiguas"
1941719417

19418-
msgid "Total space used by portal %s limit is %s MB"
19419-
msgstr "Espaciu total usáu pol portal %s llimitáu a %s MB"
19420-
1942119418
msgid "Event message management"
1942219419
msgstr "Xestión de mensaxes d'eventos"
1942319420

translations/messages.bg.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19415,9 +19415,6 @@ msgstr "Изтриване на стара база данни"
1941519415
msgid "Remove old tables"
1941619416
msgstr "Изтриване на стари таблици"
1941719417

19418-
msgid "Total space used by portal %s limit is %s MB"
19419-
msgstr "Общо заето място от портала %s лимит %s MB"
19420-
1942119418
msgid "Event message management"
1942219419
msgstr "Управление на съобщения за събития"
1942319420

translations/messages.bn_BD.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19410,9 +19410,6 @@ msgstr "পুরানো ডাটাবেস মুছুন"
1941019410
msgid "Remove old tables"
1941119411
msgstr "পুরানো টেবিল মুছুন"
1941219412

19413-
msgid "Total space used by portal %s limit is %s MB"
19414-
msgstr "পোর্টাল %s দ্বারা ব্যবহৃত মোট স্থান %s MB সীমা"
19415-
1941619413
msgid "Event message management"
1941719414
msgstr "ঘটনা বার্তা ব্যবস্থাপনা"
1941819415

translations/messages.bo_CN.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19410,9 +19410,6 @@ msgstr ""
1941019410
msgid "Remove old tables"
1941119411
msgstr ""
1941219412

19413-
msgid "Total space used by portal %s limit is %s MB"
19414-
msgstr ""
19415-
1941619413
msgid "Event message management"
1941719414
msgstr ""
1941819415

translations/messages.bs_BA.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19410,9 +19410,6 @@ msgstr "Ukloni staru bazu podataka"
1941019410
msgid "Remove old tables"
1941119411
msgstr "Ukloni stare tabele"
1941219412

19413-
msgid "Total space used by portal %s limit is %s MB"
19414-
msgstr "Ukupno prostora korišteno od portala %s limit je %s MB"
19415-
1941619413
msgid "Event message management"
1941719414
msgstr "Upravljanje porukama događaja"
1941819415

translations/messages.ca_ES.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19428,9 +19428,6 @@ msgstr "Elimina la base de dades antiga"
1942819428
msgid "Remove old tables"
1942919429
msgstr "Elimina les taules antigues"
1943019430

19431-
msgid "Total space used by portal %s limit is %s MB"
19432-
msgstr "Espai tot utilitzat pel portal %s el límit és de %s MB"
19433-
1943419431
msgid "Event message management"
1943519432
msgstr "Administració d'esdeveniments"
1943619433

0 commit comments

Comments
 (0)