From 24117c24ce8717a4096a7da54f773a2fd793738b Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Thu, 27 Sep 2018 18:53:16 +0200 Subject: [PATCH 1/4] Get PHP Configuration for upload limit and display in /admin summary site --- mod/admin.php | 2 ++ view/theme/frio/templates/admin/summary.tpl | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/mod/admin.php b/mod/admin.php index d4fcc533f7..0cb30924a8 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -908,6 +908,7 @@ function admin_page_summary(App $a) $queues = ['label' => L10n::t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue]; + $php_settings = [L10n::t('PHP Values'), ['upload_max_filesize' => ini_get('upload_max_filesize'), 'post_max_size' => ini_get('post_max_size'), 'memory_limit' => ini_get('memory_limit')]]; $t = get_markup_template('admin/summary.tpl'); return replace_macros($t, [ @@ -923,6 +924,7 @@ function admin_page_summary(App $a) '$codename' => FRIENDICA_CODENAME, '$build' => Config::get('system', 'build'), '$addons' => [L10n::t('Active addons'), $a->addons], + '$php' => $php_settings, '$showwarning' => $showwarning, '$warningtext' => $warningtext ]); diff --git a/view/theme/frio/templates/admin/summary.tpl b/view/theme/frio/templates/admin/summary.tpl index 30eca8dc0f..6cdcb65929 100644 --- a/view/theme/frio/templates/admin/summary.tpl +++ b/view/theme/frio/templates/admin/summary.tpl @@ -57,6 +57,23 @@
{{$version.0}}
{{$platform}} '{{$codename}}' {{$version.1}} - {{$build}}
+ + {{* PHP Values. *}} +
+
+
{{$php.0}}
+
+ + + + {{foreach $php.1 as $k => $p}} + + {{/foreach}} + +
ConfigurationValue
{{$k}}{{$p}}
+
+
+
From 16d37acca178f8e6e49484194516a5762e3f77b0 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Thu, 27 Sep 2018 19:00:24 +0200 Subject: [PATCH 2/4] fix indent --- view/theme/frio/templates/admin/summary.tpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/view/theme/frio/templates/admin/summary.tpl b/view/theme/frio/templates/admin/summary.tpl index 6cdcb65929..ff70a0c7cb 100644 --- a/view/theme/frio/templates/admin/summary.tpl +++ b/view/theme/frio/templates/admin/summary.tpl @@ -64,13 +64,13 @@
{{$php.0}}
- - - {{foreach $php.1 as $k => $p}} - - {{/foreach}} - -
ConfigurationValue
{{$k}}{{$p}}
+ ConfigurationValue + + {{foreach $php.1 as $k => $p}} + {{$k}}{{$p}} + {{/foreach}} + +
From 1803862fc54e2968af275841c1e48a66dd0d4aa9 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Thu, 27 Sep 2018 19:46:28 +0200 Subject: [PATCH 3/4] associative array + adding mysql value + removing table header --- mod/admin.php | 12 ++++++++++-- view/theme/frio/templates/admin/summary.tpl | 12 ++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 0cb30924a8..562845ecc8 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -908,7 +908,15 @@ function admin_page_summary(App $a) $queues = ['label' => L10n::t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue]; - $php_settings = [L10n::t('PHP Values'), ['upload_max_filesize' => ini_get('upload_max_filesize'), 'post_max_size' => ini_get('post_max_size'), 'memory_limit' => ini_get('memory_limit')]]; + + $r = q("SHOW variables LIKE 'max_allowed_packet'"); + $max_allowed_packet = (($r) ? $r[0]['Value'] : 0); + + $server_settings = ['label' => L10n::t('Server Settings'), + 'php' => ['upload_max_filesize' => ini_get('upload_max_filesize'), + 'post_max_size' => ini_get('post_max_size'), + 'memory_limit' => ini_get('memory_limit')], + 'mysql' => ['max_allowed_packet' => $max_allowed_packet]]; $t = get_markup_template('admin/summary.tpl'); return replace_macros($t, [ @@ -924,7 +932,7 @@ function admin_page_summary(App $a) '$codename' => FRIENDICA_CODENAME, '$build' => Config::get('system', 'build'), '$addons' => [L10n::t('Active addons'), $a->addons], - '$php' => $php_settings, + '$serversettings' => $server_settings, '$showwarning' => $showwarning, '$warningtext' => $warningtext ]); diff --git a/view/theme/frio/templates/admin/summary.tpl b/view/theme/frio/templates/admin/summary.tpl index ff70a0c7cb..3c33f92fdb 100644 --- a/view/theme/frio/templates/admin/summary.tpl +++ b/view/theme/frio/templates/admin/summary.tpl @@ -58,15 +58,19 @@
{{$platform}} '{{$codename}}' {{$version.1}} - {{$build}}
- {{* PHP Values. *}} + {{* Server Settings. *}}

-
{{$php.0}}
+
{{$serversettings.label}}
- - {{foreach $php.1 as $k => $p}} + + {{foreach $serversettings.php as $k => $p}} + + {{/foreach}} + + {{foreach $serversettings.mysql as $k => $p}} {{/foreach}} From 1add30cc5b4cd83c08e46fe127daa6c8195e204a Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Thu, 27 Sep 2018 20:04:33 +0200 Subject: [PATCH 4/4] Adding serversettings table in template for non frio themes --- view/templates/admin/summary.tpl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/view/templates/admin/summary.tpl b/view/templates/admin/summary.tpl index 8929cfbecd..202fd43b3e 100644 --- a/view/templates/admin/summary.tpl +++ b/view/templates/admin/summary.tpl @@ -44,5 +44,22 @@
{{$platform}} '{{$codename}}' {{$version.1}} - {{$build}} +
+
{{$serversettings.label}}
+
+
ConfigurationValue
PHP
{{$k}}{{$p}}
MySQL / MariaDB
{{$k}}{{$p}}
+ + + {{foreach $serversettings.php as $k => $p}} + + {{/foreach}} + + {{foreach $serversettings.mysql as $k => $p}} + + {{/foreach}} + +
PHP
{{$k}}{{$p}}
MySQL / MariaDB
{{$k}}{{$p}}
+ +