本文整理汇总了PHP中get_database_size函数的典型用法代码示例。如果您正苦于以下问题:PHP get_database_size函数的具体用法?PHP get_database_size怎么用?PHP get_database_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_database_size函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: output_database_size
function output_database_size()
{
$database_size = get_database_size(SDATA_DB_NAME, SDATA_DB_PREFIX);
echo <<<EOF
<html>
<head>
<style>
body {
font-family: Helvetica;
font-size: 13pt;
}
h1 {
margin-top: 2em;
}
th, td {
text-align: left;
}
#database-table-list {
margin-top: 2em;
margin-bottom: 4em;
}
</style>
</head>
<body>
<center>
<h1>Database Backup</h1>
<p>Database is {$database_size} MB*. <a href="?do_backup=1">Backup Now</a></p>
EOF;
$big_tables = array();
foreach (get_table_list() as $table_name) {
$table_size = get_table_size(SDATA_DB_NAME, $table_name);
if ($table_size > MAX_TABLE_BACKUP_SIZE) {
$big_tables[$table_name] = round($table_size, 2);
}
}
if (count($big_tables) > 0) {
echo "<br /><br /><br /><p>The following tables are too large and must be backed up separately.</p>";
echo "<table id='database-table-list'>";
echo "<tr><th>Table</th><th style='text-align:right;'>Size</th></tr>";
foreach ($big_tables as $table_name => $table_size) {
echo "<tr><td><a href='?do_backup=1&table_name=" . urlencode($table_name) . "'>{$table_name}</a></td><td style='text-align:right;'>{$table_size} MB</td></tr>";
}
echo "</table>";
} else {
echo "<small><p>Each table is smaller than " . MAX_TABLE_BACKUP_SIZE . " MB and will be included in the backup file.<p></small>";
}
echo <<<EOF
<small><p>* Size of the database on disk will not match the size of the backup file, which may be much smaller.<p></small>
</center>
</body>
</html>
EOF;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:53,代码来源:backup.php
示例2: main
//.........这里部分代码省略.........
$phpbb_dispatcher->dispatch('core.acp_main_notice');
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$total_files = $config['num_files'];
$start_date = $user->format_date($config['board_startdate']);
$boarddays = (time() - $config['board_startdate']) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
$avatar_dir_size = 0;
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) {
while (($file = readdir($avatar_dir)) !== false) {
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) {
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
}
closedir($avatar_dir);
$avatar_dir_size = get_formatted_filesize($avatar_dir_size);
} else {
// Couldn't open Avatar dir.
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
}
if ($posts_per_day > $total_posts) {
$posts_per_day = $total_posts;
}
if ($topics_per_day > $total_topics) {
$topics_per_day = $total_topics;
}
if ($users_per_day > $total_users) {
$users_per_day = $total_users;
}
if ($files_per_day > $total_files) {
$files_per_day = $total_files;
}
if ($config['allow_attachments'] || $config['allow_pm_attach']) {
$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3 * 60 * 60);
$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);
} else {
$total_orphan = false;
}
$dbsize = get_database_size();
$template->assign_vars(array('TOTAL_POSTS' => $total_posts, 'POSTS_PER_DAY' => $posts_per_day, 'TOTAL_TOPICS' => $total_topics, 'TOPICS_PER_DAY' => $topics_per_day, 'TOTAL_USERS' => $total_users, 'USERS_PER_DAY' => $users_per_day, 'TOTAL_FILES' => $total_files, 'FILES_PER_DAY' => $files_per_day, 'START_DATE' => $start_date, 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'TOTAL_ORPHAN' => $total_orphan, 'S_TOTAL_ORPHAN' => $total_orphan === false ? false : true, 'GZIP_COMPRESSION' => $config['gzip_compress'] && @extension_loaded('zlib') ? $user->lang['ON'] : $user->lang['OFF'], 'DATABASE_INFO' => $db->sql_server_info(), 'BOARD_VERSION' => $config['version'], 'U_ACTION' => $this->u_action, 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=inactive&mode=list'), 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=update&mode=version_check'), 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'versioncheck_force=1'), 'S_VERSIONCHECK' => $auth->acl_get('a_board') ? true : false, 'S_ACTION_OPTIONS' => $auth->acl_get('a_board') ? true : false, 'S_FOUNDER' => $user->data['user_type'] == USER_FOUNDER ? true : false));
$log_data = array();
$log_count = false;
if ($auth->acl_get('a_viewlogs')) {
view_log('admin', $log_data, $log_count, 5);
foreach ($log_data as $row) {
$template->assign_block_vars('log', array('USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action']));
}
}
if ($auth->acl_get('a_user')) {
$user->add_lang('memberlist');
$inactive = array();
$inactive_count = 0;
view_inactive_users($inactive, $inactive_count, 10);
foreach ($inactive as $row) {
$template->assign_block_vars('inactive', array('INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 'JOINED' => $user->format_date($row['user_regdate']), 'LAST_VISIT' => !$row['user_lastvisit'] ? ' - ' : $user->format_date($row['user_lastvisit']), 'REASON' => $row['inactive_reason'], 'USER_ID' => $row['user_id'], 'POSTS' => $row['user_posts'] ? $row['user_posts'] : 0, 'REMINDED' => $row['user_reminded'], 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=users&mode=overview')), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=users&mode=overview&u={$row['user_id']}"), 'U_SEARCH_USER' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", "author_id={$row['user_id']}&sr=posts") : ''));
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable']) {
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array('S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary)));
}
// Warn if install is still present
if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) {
$template->assign_var('S_REMOVE_INSTALL', true);
}
// Warn if no search index is created
if ($config['num_posts'] && class_exists($config['search_type'])) {
$error = false;
$search_type = $config['search_type'];
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if (!$search->index_created()) {
$template->assign_vars(array('S_SEARCH_INDEX_MISSING' => true, 'L_NO_SEARCH_INDEX' => $user->lang('NO_SEARCH_INDEX', $search->get_name(), '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=acp_search&mode=index') . '">', '</a>')));
}
}
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && $phpbb_filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx)) {
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x2));
}
if (extension_loaded('mbstring')) {
$template->assign_vars(array('S_MBSTRING_LOADED' => true, 'S_MBSTRING_FUNC_OVERLOAD_FAIL' => intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING), 'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => @ini_get('mbstring.encoding_translation') != 0, 'S_MBSTRING_HTTP_INPUT_FAIL' => !in_array(@ini_get('mbstring.http_input'), array('pass', '')), 'S_MBSTRING_HTTP_OUTPUT_FAIL' => !in_array(@ini_get('mbstring.http_output'), array('pass', ''))));
}
// Fill dbms version if not yet filled
if (empty($config['dbms_version'])) {
$config->set('dbms_version', $db->sql_server_info(true));
}
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
}
开发者ID:MrAdder,项目名称:phpbb,代码行数:101,代码来源:acp_main.php
示例3: main
//.........这里部分代码省略.........
}
$db->sql_freeresult($result);
$sql_ary = array();
foreach ($posted as $user_id => $topic_row) {
foreach ($topic_row as $topic_id) {
$sql_ary[] = array('user_id' => $user_id, 'topic_id' => $topic_id, 'topic_posted' => 1);
}
}
unset($posted);
if (sizeof($sql_ary)) {
switch (SQL_LAYER) {
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary) {
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
break;
}
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$total_files = $config['num_files'];
$start_date = $user->format_date($config['board_startdate']);
$boarddays = (time() - $config['board_startdate']) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
$upload_dir_size = $config['upload_dir_size'] >= 1048576 ? sprintf('%.2f ' . $user->lang['MB'], $config['upload_dir_size'] / 1048576) : ($config['upload_dir_size'] >= 1024 ? sprintf('%.2f ' . $user->lang['KB'], $config['upload_dir_size'] / 1024) : sprintf('%.2f ' . $user->lang['BYTES'], $config['upload_dir_size']));
$avatar_dir_size = 0;
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) {
while (($file = readdir($avatar_dir)) !== false) {
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) {
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
}
@closedir($avatar_dir);
// This bit of code translates the avatar directory size into human readable format
// Borrowed the code from the PHP.net annoted manual, origanally written by:
// Jesse ([email protected])
$avatar_dir_size = $avatar_dir_size >= 1048576 ? sprintf('%.2f ' . $user->lang['MB'], $avatar_dir_size / 1048576) : ($avatar_dir_size >= 1024 ? sprintf('%.2f ' . $user->lang['KB'], $avatar_dir_size / 1024) : sprintf('%.2f ' . $user->lang['BYTES'], $avatar_dir_size));
} else {
// Couldn't open Avatar dir.
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
}
if ($posts_per_day > $total_posts) {
$posts_per_day = $total_posts;
}
if ($topics_per_day > $total_topics) {
$topics_per_day = $total_topics;
}
if ($users_per_day > $total_users) {
$users_per_day = $total_users;
}
if ($files_per_day > $total_files) {
$files_per_day = $total_files;
}
$dbsize = get_database_size();
$s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING'));
$template->assign_vars(array('TOTAL_POSTS' => $total_posts, 'POSTS_PER_DAY' => $posts_per_day, 'TOTAL_TOPICS' => $total_topics, 'TOPICS_PER_DAY' => $topics_per_day, 'TOTAL_USERS' => $total_users, 'USERS_PER_DAY' => $users_per_day, 'TOTAL_FILES' => $total_files, 'FILES_PER_DAY' => $files_per_day, 'START_DATE' => $start_date, 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'GZIP_COMPRESSION' => $config['gzip_compress'] ? $user->lang['ON'] : $user->lang['OFF'], 'U_ACTION' => append_sid("{$phpbb_admin_path}index.{$phpEx}"), 'S_ACTION_OPTIONS' => $auth->acl_get('a_board') ? $s_action_options : ''));
$log_data = array();
$log_count = 0;
if ($auth->acl_get('a_viewlogs')) {
view_log('admin', $log_data, $log_count, 5);
foreach ($log_data as $row) {
$template->assign_block_vars('log', array('USERNAME' => $row['username'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action']));
}
}
if ($auth->acl_get('a_user')) {
$sql = 'SELECT user_id, username, user_regdate
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE . '
ORDER BY user_regdate ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$template->assign_block_vars('inactive', array('DATE' => $user->format_date($row['user_regdate']), 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=users&mode=overview&u={$row['user_id']}")));
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable']) {
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array('S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary)));
}
// Display debug_extra notice
if (defined('DEBUG_EXTRA')) {
$template->assign_var('S_DEBUG_EXTRA', true);
}
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
}
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:acp_main.php
示例4: main
//.........这里部分代码省略.........
}
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
break;
case 'purge_cache':
if ((int) $user->data['user_type'] !== USER_FOUNDER) {
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
global $cache;
$cache->purge();
// Clear permissions
$auth->acl_clear_prefetch();
cache_moderators();
add_log('admin', 'LOG_PURGE_CACHE');
break;
}
}
}
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$total_files = $config['num_files'];
$start_date = $user->format_date($config['board_startdate']);
$boarddays = (time() - $config['board_startdate']) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
$avatar_dir_size = 0;
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) {
while (($file = readdir($avatar_dir)) !== false) {
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) {
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
}
closedir($avatar_dir);
$avatar_dir_size = get_formatted_filesize($avatar_dir_size);
} else {
// Couldn't open Avatar dir.
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
}
if ($posts_per_day > $total_posts) {
$posts_per_day = $total_posts;
}
if ($topics_per_day > $total_topics) {
$topics_per_day = $total_topics;
}
if ($users_per_day > $total_users) {
$users_per_day = $total_users;
}
if ($files_per_day > $total_files) {
$files_per_day = $total_files;
}
if ($config['allow_attachments'] || $config['allow_pm_attach']) {
$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3 * 60 * 60);
$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);
} else {
$total_orphan = false;
}
$dbsize = get_database_size();
$template->assign_vars(array('TOTAL_POSTS' => $total_posts, 'POSTS_PER_DAY' => $posts_per_day, 'TOTAL_TOPICS' => $total_topics, 'TOPICS_PER_DAY' => $topics_per_day, 'TOTAL_USERS' => $total_users, 'USERS_PER_DAY' => $users_per_day, 'TOTAL_FILES' => $total_files, 'FILES_PER_DAY' => $files_per_day, 'START_DATE' => $start_date, 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'TOTAL_ORPHAN' => $total_orphan, 'S_TOTAL_ORPHAN' => $total_orphan === false ? false : true, 'GZIP_COMPRESSION' => $config['gzip_compress'] ? $user->lang['ON'] : $user->lang['OFF'], 'DATABASE_INFO' => $db->sql_server_info(), 'BOARD_VERSION' => $config['version'], 'U_ACTION' => $this->u_action, 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=inactive&mode=list'), 'S_ACTION_OPTIONS' => $auth->acl_get('a_board') ? true : false, 'S_FOUNDER' => $user->data['user_type'] == USER_FOUNDER ? true : false));
$log_data = array();
$log_count = 0;
if ($auth->acl_get('a_viewlogs')) {
view_log('admin', $log_data, $log_count, 5);
foreach ($log_data as $row) {
$template->assign_block_vars('log', array('USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action']));
}
}
if ($auth->acl_get('a_user')) {
$inactive = array();
$inactive_count = 0;
view_inactive_users($inactive, $inactive_count, 10);
foreach ($inactive as $row) {
$template->assign_block_vars('inactive', array('INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 'JOINED' => $user->format_date($row['user_regdate']), 'LAST_VISIT' => !$row['user_lastvisit'] ? ' - ' : $user->format_date($row['user_lastvisit']), 'REASON' => $row['inactive_reason'], 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=users&mode=overview&u={$row['user_id']}")));
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable']) {
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array('S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary)));
}
// Warn if install is still present
if (file_exists($phpbb_root_path . 'install')) {
$template->assign_var('S_REMOVE_INSTALL', true);
}
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) {
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x2));
}
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
}
开发者ID:BackupTheBerlios,项目名称:phpbb-hu-svn,代码行数:101,代码来源:acp_main.php
示例5: while
echo 'Cookie path: ' . $config['cookie_path'] . '<br />';
echo 'Cookie secure: ' . ($config['cookie_secure'] ? 'Yes' : 'No') . '<br /><br />';
$sql = 'SELECT config_name, config_value FROM ' . CONFIG_TABLE . ' WHERE config_name = "cookie_domain"
OR config_name = "cookie_name" OR config_name = "cookie_path" OR config_name = "cookie_secure"';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
echo 'DB ' . $row['config_name'] . ': ' . $row['config_value'] . '<br />';
}
$db->sql_freeresult($result);
echo '<br />';
}
if ($chk_dbase == 'Yes') {
include_once $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
echo '<strong>[b]Database Settings[/b]</strong><br />';
echo 'Database system: ' . $db->sql_server_info() . '<br />';
echo 'Database size: ' . get_database_size() . '<br />';
echo 'Database host: ' . $dbhost . '<br />';
echo 'Database port: ' . $dbport . '<br />';
echo 'Database name: ' . $dbname . '<br />';
echo 'Database user: ' . $dbuser . '<br />';
// We don't want the password posted publicly so we'll check if it is blank
if (mb_strlen($dbpasswd, 'UTF-8') > 0) {
echo 'Database password: {removed}<br />';
} else {
echo 'Database password: is blank<br />';
}
echo 'Table prefix: ' . $table_prefix . '<br />';
echo 'Cache ($acm_type): ' . $acm_type . '<br />';
echo 'PHP extensions ($load_extensions): ' . $load_extensions . '<br />';
$config_lc = count(file($phpbb_root_path . 'config.' . $phpEx));
echo 'config.php line count: ' . $config_lc . ' ';
开发者ID:TWEagle,项目名称:Support,代码行数:31,代码来源:support_info.php
示例6: COUNT
$sql = "SELECT COUNT(*) as temp_images\n FROM " . IMAGES_TEMP_TABLE;
$row = $site_db->query_firstrow($sql);
$awaiting_validation = preg_replace("/" . $site_template->start . "num_images" . $site_template->end . "/siU", $row['temp_images'], $lang['images_awaiting_validation']);
$awaiting_validation = sprintf("<a href=\"" . $site_sess->url("validateimages.php?action=validateimages") . "\">%s</a>", $awaiting_validation);
echo "<td width=\"16%\"><b>" . $lang['images'] . "</b></td><td width=\"16%\">" . $total_images . " / " . $awaiting_validation . "</td>\n";
$size = 0;
echo "<td width=\"16%\"><b>" . $lang['thumb_directory'] . "</b></td><td width=\"16%\">" . format_file_size(get_dir_size(THUMB_PATH)) . "</td>\n";
echo "</tr>";
//3
echo "<tr class=\"" . get_row_bg() . "\">\n";
$sql = "SELECT COUNT(*) as users\n FROM " . USERS_TABLE . "\n WHERE " . get_user_table_field("", "user_id") . " <> " . GUEST;
$row = $site_db->query_firstrow($sql);
echo "<td width=\"16%\"><b>" . $lang['users'] . "</b></td><td width=\"16%\">" . $row['users'] . "</td>\n";
echo "<td width=\"16%\"><b>" . $lang['database'] . "</b></td><td width=\"16%\">";
include ROOT_PATH . 'includes/db_utils.php';
get_database_size();
if (!empty($global_info['database_size']['total'])) {
if (!empty($global_info['database_size']['4images'])) {
$db_status = $lang['homestats_total'] . " <b>" . format_file_size($global_info['database_size']['total']) . "</b> / ";
$db_status .= "4images: <b>" . format_file_size($global_info['database_size']['4images']) . "</b>";
} else {
$db_status = format_file_size(!empty($global_info['database_size']['total']));
}
} else {
$db_status = "n/a";
}
echo $db_status . "</td>\n";
echo "</tr>";
show_table_footer();
$sql = "SELECT SUM(cat_hits) AS sum\n FROM " . CATEGORIES_TABLE;
$row = $site_db->query_firstrow($sql);
开发者ID:abhinay100,项目名称:fourimages_app,代码行数:31,代码来源:home.php
示例7: parsebytesize
echo "<table align='center' cellspacing='0' cellpadding='0'>\n<tr>\n";
echo "<td valign='top'>\n";
echo "<table align='center' cellspacing='0' cellpadding='0'>\n<tr>\n";
echo "<td colspan='2' class='tbl2' align='left'>" . $locale['451'] . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['414'] . "</td>\n";
echo "<td class='tbl'>" . $db_name . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['415'] . "</td>\n";
echo "<td class='tbl'>" . $db_prefix . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['452'] . "</td>\n";
echo "<td class='tbl'>" . parsebytesize(get_database_size(), 2, false) . " (" . get_table_count() . " " . $locale['419'] . ")</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['453'] . "</td>\n";
echo "<td class='tbl'>" . parsebytesize(get_database_size($db_prefix), 2, false) . " (" . get_table_count($db_prefix) . " " . $locale['419'] . ")</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='left' colspan='2' class='tbl2'>" . $locale['454'] . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['431'] . " <span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='backup_filename' value='backup_" . stripsiteinput($settings['sitename']) . "_" . date('Y-m-d-Hi') . "' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['455'] . "</td>\n";
echo "<td class='tbl'><select name='backup_type' class='textbox' style='width:150px;'>\n";
if (function_exists("gzencode")) {
echo "<option value='.gz' selected='selected'>.sql.gz " . $locale['456'] . "</option>\n";
}
echo "<option value='.sql'>.sql</option>\n";
echo "</select></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='right' class='tbl'>" . $locale['460'] . " <span style='color:#ff0000'>*</span></td>\n";
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:db_backup.php
示例8: T_
<?php
if (get_cron_running()) {
echo '<li><div id="BP_startupdate">' . T_('The update is running') . '</div></li>';
} else {
echo '<li><div id="BP_stopupdate">' . T_('The update is stopped') . '</div></li>';
}
if (file_exists(dirname(__FILE__) . '/../inc/STOP')) {
echo '<li><div id="BP_disableupdate">' . T_('The update is disabled') . '</div></li>';
}
if ($blog_settings->get('planet_index_update')) {
echo '<li><div id="BP_index_update">' . T_('The update on loading of index page enabled') . '</div></li>';
}
?>
<li><div id="BP_stats_db"><?php
echo T_('Current size of the database :');
echo ' <strong>' . formatfilesize(get_database_size()) . '</strong>';
?>
</div></li>
<li><div id="BP_nb_articles"><?php
echo T_('Number of articles in the DB :');
echo ' <strong>' . $nb_posts . '</strong>';
?>
</div></li>
<li><div id="BP_nb_votes"><?php
echo T_('Number of votes in the DB :');
echo ' <strong>' . $nb_votes . '</strong>';
?>
</div></li>
<li><div id="BP_nb_members"><?php
echo T_('Number of members in the DB :');
echo ' <strong>' . $nb_users . '</strong>';
开发者ID:archcidburnziso,项目名称:Bilboplanet,代码行数:31,代码来源:index.php
示例9: sprintf
$topics_per_day = sprintf("%.2f", $total_topics / $boarddays);
$users_per_day = sprintf("%.2f", $total_users / $boarddays);
$avatar_dir_size = $cache->obtain_avatars_size();
if ($posts_per_day > $total_posts) {
$posts_per_day = $total_posts;
}
if ($topics_per_day > $total_topics) {
$topics_per_day = $total_topics;
}
if ($users_per_day > $total_users) {
$users_per_day = $total_users;
}
//
// DB size ... MySQL only
//
$dbsize = get_database_size();
$sql = "SELECT VERSION() AS mysql_version";
$db->sql_return_on_error(true);
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);
if (!$result) {
throw_error("Couldn't obtain MySQL Version", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$mysql_version = $row['mysql_version'];
$db->sql_freeresult($result);
$template->assign_vars(array('NUMBER_OF_POSTS' => $total_posts, 'NUMBER_OF_TOPICS' => $total_topics, 'NUMBER_OF_USERS' => $total_users, 'START_DATE' => $start_date, 'POSTS_PER_DAY' => $posts_per_day, 'TOPICS_PER_DAY' => $topics_per_day, 'USERS_PER_DAY' => $users_per_day, 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DB_SIZE' => $dbsize, 'PHPBB_VERSION' => '2' . $config['version'], 'PHP_VERSION' => phpversion(), 'MYSQL_VERSION' => $mysql_version, 'NUMBER_OF_DEACTIVATED_USERS' => $total_deactivated_users, 'NUMBER_OF_MODERATORS' => $total_moderators, 'NUMBER_OF_JUNIOR_ADMINISTRATORS' => $total_junior_administrators, 'NUMBER_OF_ADMINISTRATORS' => $total_administrators, 'NAMES_OF_DEACTIVATED' => $deactivated_names, 'NAMES_OF_MODERATORS' => $moderator_names, 'NAMES_OF_JUNIOR_ADMINISTRATORS' => $junior_administrator_names, 'NAMES_OF_ADMINISTRATORS' => $administrator_names, 'GZIP_COMPRESSION' => $config['gzip_compress'] ? $lang['ON'] : $lang['OFF']));
// End forum statistics
// Get users online information.
$onlinerow_reg = get_online_users('site', true, true, '', 0, 0);
$sql = "SELECT session_page, session_forum_id, session_topic_id, session_logged_in, session_time, session_ip, session_start, session_browser\n\t\tFROM " . SESSIONS_TABLE . "\n\t\tWHERE session_logged_in = '0'\n\t\t\tAND session_time >= " . (time() - ONLINE_REFRESH) . "\n\t\tORDER BY session_time DESC";
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:index.php
注:本文中的get_database_size函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论