aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-02 09:13:37 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-02 09:13:37 -0500
commita5d89ccf653748c471a3c62c46a02db3be4e23dc (patch)
tree5f321ae68793d7554e5077b0131568c4c7a5b04d
parent25d11f6cdcc200ae00332197c9bd86858e3620b8 (diff)
downloadelgg-a5d89ccf653748c471a3c62c46a02db3be4e23dc.tar.gz
elgg-a5d89ccf653748c471a3c62c46a02db3be4e23dc.tar.bz2
Fixes #4164 adds a server statistics page to admin area
-rw-r--r--engine/lib/admin.php1
-rw-r--r--languages/en.php12
-rw-r--r--views/default/admin/statistics/overview.php4
-rw-r--r--views/default/admin/statistics/overview/basic.php (renamed from views/default/admin/statistics/basic.php)0
-rw-r--r--views/default/admin/statistics/overview/numentities.php (renamed from views/default/admin/statistics/numentities.php)0
-rw-r--r--views/default/admin/statistics/server.php8
-rw-r--r--views/default/admin/statistics/server/php.php33
-rw-r--r--views/default/admin/statistics/server/web_server.php16
8 files changed, 72 insertions, 2 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 1f085eee4..5a475a9f0 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -262,6 +262,7 @@ function admin_init() {
// statistics
elgg_register_admin_menu_item('administer', 'statistics', null, 20);
elgg_register_admin_menu_item('administer', 'overview', 'statistics');
+ elgg_register_admin_menu_item('administer', 'server', 'statistics');
// users
elgg_register_admin_menu_item('administer', 'users', null, 20);
diff --git a/languages/en.php b/languages/en.php
index acc8e0bc0..d9149a689 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -568,6 +568,7 @@ $english = array(
'admin:statistics' => "Statistics",
'admin:statistics:overview' => 'Overview',
+ 'admin:statistics:server' => 'Server Info',
'admin:appearance' => 'Appearance',
'admin:administer_utilities' => 'Utilities',
@@ -726,6 +727,17 @@ $english = array(
'admin:statistics:label:version:release' => "Release",
'admin:statistics:label:version:version' => "Version",
+ 'admin:server:label:php' => 'PHP',
+ 'admin:server:label:web_server' => 'Web Server',
+ 'admin:server:label:server' => 'Server',
+ 'admin:server:label:log_location' => 'Log Location',
+ 'admin:server:label:php_version' => 'PHP version',
+ 'admin:server:label:php_ini' => 'PHP ini file location',
+ 'admin:server:label:php_log' => 'PHP Log',
+ 'admin:server:label:mem_avail' => 'Memory available',
+ 'admin:server:label:mem_used' => 'Memory used',
+ 'admin:server:error_log' => "Web server's error log",
+
'admin:user:label:search' => "Find users:",
'admin:user:label:searchbutton' => "Search",
diff --git a/views/default/admin/statistics/overview.php b/views/default/admin/statistics/overview.php
index 2f5b25121..ac5aaac36 100644
--- a/views/default/admin/statistics/overview.php
+++ b/views/default/admin/statistics/overview.php
@@ -8,6 +8,6 @@
echo elgg_view('admin/statistics/extend');
-echo elgg_view_module('inline', elgg_echo('admin:statistics:label:basic'), elgg_view('admin/statistics/basic'));
+echo elgg_view_module('inline', elgg_echo('admin:statistics:label:basic'), elgg_view('admin/statistics/overview/basic'));
-echo elgg_view_module('inline', elgg_echo('admin:statistics:label:numentities'), elgg_view('admin/statistics/numentities')); \ No newline at end of file
+echo elgg_view_module('inline', elgg_echo('admin:statistics:label:numentities'), elgg_view('admin/statistics/overview/numentities'));
diff --git a/views/default/admin/statistics/basic.php b/views/default/admin/statistics/overview/basic.php
index 2c9b3b88e..2c9b3b88e 100644
--- a/views/default/admin/statistics/basic.php
+++ b/views/default/admin/statistics/overview/basic.php
diff --git a/views/default/admin/statistics/numentities.php b/views/default/admin/statistics/overview/numentities.php
index af4ae2773..af4ae2773 100644
--- a/views/default/admin/statistics/numentities.php
+++ b/views/default/admin/statistics/overview/numentities.php
diff --git a/views/default/admin/statistics/server.php b/views/default/admin/statistics/server.php
new file mode 100644
index 000000000..9d21addc1
--- /dev/null
+++ b/views/default/admin/statistics/server.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Server information
+ */
+
+echo elgg_view_module('inline', elgg_echo('admin:server:label:web_server'), elgg_view('admin/statistics/server/web_server'));
+
+echo elgg_view_module('inline', elgg_echo('admin:server:label:php'), elgg_view('admin/statistics/server/php'));
diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php
new file mode 100644
index 000000000..4a59b95fb
--- /dev/null
+++ b/views/default/admin/statistics/server/php.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Server PHP info
+ */
+
+$php_log = ini_get('error_log');
+if (!$php_log) {
+ $php_log = elgg_echo('admin:server:error_log');
+}
+
+?>
+<table class="elgg-table-alt">
+ <tr class="odd">
+ <td><b><?php echo elgg_echo('admin:server:label:php_version'); ?> :</b></td>
+ <td><?php echo phpversion(); ?></td>
+ </tr>
+ <tr class="even">
+ <td><b><?php echo elgg_echo('admin:server:label:php_ini'); ?> :</b></td>
+ <td><?php echo php_ini_loaded_file(); ?></td>
+ </tr>
+ <tr class="odd">
+ <td><b><?php echo elgg_echo('admin:server:label:php_log'); ?> :</b></td>
+ <td><?php echo $php_log; ?></td>
+ </tr>
+ <tr class="even">
+ <td><b><?php echo elgg_echo('admin:server:label:mem_avail'); ?> :</b></td>
+ <td><?php echo number_format(elgg_get_ini_setting_in_bytes('memory_limit')); ?></td>
+ </tr>
+ <tr class="odd">
+ <td><b><?php echo elgg_echo('admin:server:label:mem_used'); ?> :</b></td>
+ <td><?php echo number_format(memory_get_peak_usage()); ?></td>
+ </tr>
+</table>
diff --git a/views/default/admin/statistics/server/web_server.php b/views/default/admin/statistics/server/web_server.php
new file mode 100644
index 000000000..904a54f4b
--- /dev/null
+++ b/views/default/admin/statistics/server/web_server.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Web server info
+ */
+
+?>
+<table class="elgg-table-alt">
+ <tr class="odd">
+ <td><b><?php echo elgg_echo('admin:server:label:server'); ?> :</b></td>
+ <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
+ </tr>
+ <tr class="even">
+ <td><b><?php echo elgg_echo('admin:server:label:log_location'); ?> :</b></td>
+ <td><?php echo getenv('APACHE_LOG_DIR'); ?></td>
+ </tr>
+</table>