From 6f4fdb1035e546f0339a729f78850205d1017f45 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Fri, 26 Sep 2014 04:29:52 +0000 Subject: [PATCH] Add database name and schema to info page Improve info display & formatting Only show 8 chars of the last commit --- include/staff/system.inc.php | 136 ++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 51 deletions(-) diff --git a/include/staff/system.inc.php b/include/staff/system.inc.php index 2a5b06658..4238e3dbe 100644 --- a/include/staff/system.inc.php +++ b/include/staff/system.inc.php @@ -2,7 +2,38 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied'); $commit = GIT_VERSION != '$git' ? GIT_VERSION : ( - @shell_exec('git rev-parse HEAD') ?: '?'); + @shell_exec('git rev-parse HEAD | cut -b 1-8') ?: '?'); + +$extensions = array( + 'gd' => array( + 'name' => 'gdlib', + 'desc' => __('Used for image manipulation and PDF printing') + ), + 'imap' => array( + 'name' => 'imap', + 'desc' => __('Used for email fetching') + ), + 'xml' => array( + 'name' => 'xml', + 'desc' => __('XML API') + ), + 'dom' => array( + 'name' => 'xml-dom', + 'desc' => __('Used for HTML email processing') + ), + 'json' => array( + 'name' => 'json', + 'desc' => __('Improves performance creating and processing JSON') + ), + 'mbstring' => array( + 'name' => 'mbstring', + 'desc' => __('Highly recommended for non western european language content') + ), + 'phar' => array( + 'name' => 'phar', + 'desc' => __('Highly recommended for plugins and language packs') + ), + ); ?> <h2><?php echo __('About this osTicket Installation'); ?></h2> @@ -13,69 +44,72 @@ $commit = GIT_VERSION != '$git' ? GIT_VERSION : ( </thead> <tbody> <tr><td><?php echo __('osTicket Version'); ?></td> - <td><span class="ltr"><?php echo sprintf("%s (%s)", THIS_VERSION, $commit); ?></span></td></tr> - <tr><td><?php echo __('Server Software'); ?></td> + <td><span class="ltr"><?php + echo sprintf("%s (%s)", THIS_VERSION, trim($commit)); ?></span></td></tr> + <tr><td><?php echo __('Web Server Software'); ?></td> <td><span class="ltr"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></span></td></tr> - <tr><td><?php echo __('PHP Version'); ?></td> - <td><span class="ltr"><?php echo phpversion(); ?></span></td></tr> <tr><td><?php echo __('MySQL Version'); ?></td> <td><span class="ltr"><?php echo db_version(); ?></span></td></tr> - - <tr><td><?php echo __('PHP Extensions'); ?></td> - <td><table><tbody> - <tr><td><i class="icon icon-<?php - echo extension_loaded('gd')?'check':'warning-sign'; ?>"></i></td> - <td>gdlib</td> - <td><?php echo __('Used for image manipulation and PDF printing'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('imap')?'check':'warning-sign'; ?>"></i></td> - <td>imap</td> - <td><?php echo __('Used for email fetching'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('xml')?'check':'warning-sign'; ?>"></i></td> - <td>xml</td> - <td><?php echo __('XML API'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('dom')?'check':'warning-sign'; ?>"></i></td> - <td>xml-dom</td> - <td><?php echo __('Used for HTML email processing'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('json')?'check':'warning-sign'; ?>"></i></td> - <td>json</td> - <td><?php echo __('Improves performance creating and processing JSON'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('mbstring')?'check':'warning-sign'; ?>"></i></td> - <td>mbstring</td> - <td><?php echo __('Highly recommended for non western european language content'); ?></td></tr> - <tr><td><i class="icon icon-<?php - echo extension_loaded('phar')?'check':'warning-sign'; ?>"></i></td> - <td>phar</td> - <td><?php echo __('Highly recommended for plugins and language packs'); ?></td></tr> - </tbody></table></td></tr> - <tr><td><?php echo __('PHP Settings'); ?></td> - <td><table><tbody> - <tr><td><i class="icon icon-<?php - echo ini_get('cgi.fix_pathinfo') == 1 ?'check':'warning-sign'; ?>"></i> - </td><td> - <span class="ltr"><code>cgi.fix_pathinfo</code> = - <?php echo ini_get('cgi.fix_pathinfo'); ?> - </span></td><td> - <span class="faded"><?php echo __('"1" is recommended if AJAX is not working'); ?></span> - </td></tr> - </tbody></table></td></tr> + <tr><td><?php echo __('PHP Version'); ?></td> + <td><span class="ltr"><?php echo phpversion(); ?></span></td></tr> +</tbody> +<thead> + <tr><th colspan="2"><?php echo __('PHP Extensions'); ?></th></tr> +</thead> +<tbody> + <?php + foreach($extensions as $ext => $info) { ?> + <tr><td><?php echo $info['name']; ?></td> + <td><?php + echo sprintf('<i class="icon icon-%s"></i> %s', + extension_loaded($ext) ? 'check' : 'warning-sign', + $info['desc']); + ?> + </td> + </tr> + <?php + } ?> +</tbody> +<thead> + <tr><th colspan="2"><?php echo __('PHP Settings'); ?></th></tr> +</thead> +<tbody> + <tr> + <td><span class="ltr"><code>cgi.fix_pathinfo</code></span></td> + <td><i class="icon icon-<?php + echo ini_get('cgi.fix_pathinfo') == 1 ? 'check' : 'warning-sign'; ?>"></i> + <span class="faded"><?php echo __('"1" is recommended if AJAX is not working'); ?></span> + </td> + </tr> + <tr> + <td><span class="ltr"><code>date.timezone</code></span></td> + <td><i class="icon icon-<?php + echo ini_get('date.timezone') ? 'check' : 'warning-sign'; ?>"></i> + <span class="faded"><?php + echo ini_get('date.timezone') + ?: __('Setting default timezone is highly recommended'); + ?></span> + </td> + </tr> </tbody> <thead> - <tr><th colspan="2"><?php echo __('Database Usage'); ?></th></tr> + <tr><th colspan="2"><?php echo __('Database Information and Usage'); ?></th></tr> </thead> <tbody> - <tr><td><?php echo __('Database Space Used'); ?></td> + <tr><td><?php echo __('Schema'); ?></td> + <td><?php echo sprintf('<span class="ltr">%s (%s)</span>', DBNAME, DBHOST); ?> </td> + </tr> + <tr><td><?php echo __('Schema Signature'); ?></td> + <td><?php echo $cfg->getSchemaSignature(); ?> </td> + </tr> + <tr><td><?php echo __('Space Used'); ?></td> <td><?php $sql = 'SELECT sum( data_length + index_length ) / 1048576 total_size FROM information_schema.TABLES WHERE table_schema = ' .db_input(DBNAME); $space = db_result(db_query($sql)); echo sprintf('%.2f MiB', $space); ?></td> - <tr><td><?php echo __('Database Space for Attachments'); ?></td> + <tr><td><?php echo __('Space for Attachments'); ?></td> <td><?php $sql = 'SELECT SUM(LENGTH(filedata)) / 1048576 FROM '.FILE_CHUNK_TABLE; $space = db_result(db_query($sql)); -- GitLab