Skip to content
Snippets Groups Projects
Commit a4d5c0bd authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #1323 from protich/feature/db-info


Add database name and schema signature to the system info page

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 08fd1996 6f4fdb10
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,38 @@ ...@@ -2,7 +2,38 @@
if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied'); if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied');
$commit = GIT_VERSION != '$git' ? GIT_VERSION : ( $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> <h2><?php echo __('About this osTicket Installation'); ?></h2>
...@@ -13,69 +44,72 @@ $commit = GIT_VERSION != '$git' ? GIT_VERSION : ( ...@@ -13,69 +44,72 @@ $commit = GIT_VERSION != '$git' ? GIT_VERSION : (
</thead> </thead>
<tbody> <tbody>
<tr><td><?php echo __('osTicket Version'); ?></td> <tr><td><?php echo __('osTicket Version'); ?></td>
<td><span class="ltr"><?php echo sprintf("%s (%s)", THIS_VERSION, $commit); ?></span></td></tr> <td><span class="ltr"><?php
<tr><td><?php echo __('Server Software'); ?></td> 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> <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> <tr><td><?php echo __('MySQL Version'); ?></td>
<td><span class="ltr"><?php echo db_version(); ?></span></td></tr> <td><span class="ltr"><?php echo db_version(); ?></span></td></tr>
<tr><td><?php echo __('PHP Version'); ?></td>
<tr><td><?php echo __('PHP Extensions'); ?></td> <td><span class="ltr"><?php echo phpversion(); ?></span></td></tr>
<td><table><tbody> </tbody>
<tr><td><i class="icon icon-<?php <thead>
echo extension_loaded('gd')?'check':'warning-sign'; ?>"></i></td> <tr><th colspan="2"><?php echo __('PHP Extensions'); ?></th></tr>
<td>gdlib</td> </thead>
<td><?php echo __('Used for image manipulation and PDF printing'); ?></td></tr> <tbody>
<tr><td><i class="icon icon-<?php <?php
echo extension_loaded('imap')?'check':'warning-sign'; ?>"></i></td> foreach($extensions as $ext => $info) { ?>
<td>imap</td> <tr><td><?php echo $info['name']; ?></td>
<td><?php echo __('Used for email fetching'); ?></td></tr> <td><?php
<tr><td><i class="icon icon-<?php echo sprintf('<i class="icon icon-%s"></i> %s',
echo extension_loaded('xml')?'check':'warning-sign'; ?>"></i></td> extension_loaded($ext) ? 'check' : 'warning-sign',
<td>xml</td> $info['desc']);
<td><?php echo __('XML API'); ?></td></tr> ?>
<tr><td><i class="icon icon-<?php </td>
echo extension_loaded('dom')?'check':'warning-sign'; ?>"></i></td> </tr>
<td>xml-dom</td> <?php
<td><?php echo __('Used for HTML email processing'); ?></td></tr> } ?>
<tr><td><i class="icon icon-<?php </tbody>
echo extension_loaded('json')?'check':'warning-sign'; ?>"></i></td> <thead>
<td>json</td> <tr><th colspan="2"><?php echo __('PHP Settings'); ?></th></tr>
<td><?php echo __('Improves performance creating and processing JSON'); ?></td></tr> </thead>
<tr><td><i class="icon icon-<?php <tbody>
echo extension_loaded('mbstring')?'check':'warning-sign'; ?>"></i></td> <tr>
<td>mbstring</td> <td><span class="ltr"><code>cgi.fix_pathinfo</code></span></td>
<td><?php echo __('Highly recommended for non western european language content'); ?></td></tr> <td><i class="icon icon-<?php
<tr><td><i class="icon icon-<?php echo ini_get('cgi.fix_pathinfo') == 1 ? 'check' : 'warning-sign'; ?>"></i>
echo extension_loaded('phar')?'check':'warning-sign'; ?>"></i></td> <span class="faded"><?php echo __('"1" is recommended if AJAX is not working'); ?></span>
<td>phar</td> </td>
<td><?php echo __('Highly recommended for plugins and language packs'); ?></td></tr> </tr>
</tbody></table></td></tr> <tr>
<tr><td><?php echo __('PHP Settings'); ?></td> <td><span class="ltr"><code>date.timezone</code></span></td>
<td><table><tbody> <td><i class="icon icon-<?php
<tr><td><i class="icon icon-<?php echo ini_get('date.timezone') ? 'check' : 'warning-sign'; ?>"></i>
echo ini_get('cgi.fix_pathinfo') == 1 ?'check':'warning-sign'; ?>"></i> <span class="faded"><?php
</td><td> echo ini_get('date.timezone')
<span class="ltr"><code>cgi.fix_pathinfo</code> = ?: __('Setting default timezone is highly recommended');
<?php echo ini_get('cgi.fix_pathinfo'); ?> ?></span>
</span></td><td> </td>
<span class="faded"><?php echo __('"1" is recommended if AJAX is not working'); ?></span> </tr>
</td></tr>
</tbody></table></td></tr>
</tbody> </tbody>
<thead> <thead>
<tr><th colspan="2"><?php echo __('Database Usage'); ?></th></tr> <tr><th colspan="2"><?php echo __('Database Information and Usage'); ?></th></tr>
</thead> </thead>
<tbody> <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 <td><?php
$sql = 'SELECT sum( data_length + index_length ) / 1048576 total_size $sql = 'SELECT sum( data_length + index_length ) / 1048576 total_size
FROM information_schema.TABLES WHERE table_schema = ' FROM information_schema.TABLES WHERE table_schema = '
.db_input(DBNAME); .db_input(DBNAME);
$space = db_result(db_query($sql)); $space = db_result(db_query($sql));
echo sprintf('%.2f MiB', $space); ?></td> 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 <td><?php
$sql = 'SELECT SUM(LENGTH(filedata)) / 1048576 FROM '.FILE_CHUNK_TABLE; $sql = 'SELECT SUM(LENGTH(filedata)) / 1048576 FROM '.FILE_CHUNK_TABLE;
$space = db_result(db_query($sql)); $space = db_result(db_query($sql));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment