# wp-dbmanager/2.04/dbmanager/database-config.php

WP-DBManager, version 2.04. 76 lines.

- Page: https://pluginprobe.com/plugins/wp-dbmanager/2.04/code/dbmanager/database-config.php
- Raw: https://pluginprobe.com/plugins/wp-dbmanager/2.04/raw/dbmanager/database-config.php
- Modified: 2007-03-17T06:57:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-dbmanager/2.04/code/dbmanager/database-config.php#L10-L20`.

```php
<?php
/*
+----------------------------------------------------------------+
|																							|
|	WordPress 2.0 Plugin: WP-DBManager 2.04								|
|	Copyright (c) 2005 Lester "GaMerZ" Chan									|
|																							|
|	File Written By:																	|
|	- Lester "GaMerZ" Chan															|
|	- http://www.lesterchan.net													|
|																							|
|	File Information:																	|
|	- Database Config																|
|	- wp-content/plugins/dbmanager/database-config.php				|
|																							|
+----------------------------------------------------------------+
*/


### Check Whether User Can Manage Database
if(!current_user_can('manage_database')) {
	die('Access Denied');
}


### Variables Variables Variables
$base_name = plugin_basename('dbmanager/database-manager.php');
$base_page = 'admin.php?page='.$base_name;
$current_date = gmdate('l, jS F Y @ H:i', (time() + (get_settings('gmt_offset') * 3600)));
$backup = array();
$backup_options = get_settings('dbmanager_options');
$backup['date'] = current_time('timestamp');
$backup['mysqldumppath'] = $backup_options['mysqldumppath'];
$backup['mysqlpath'] = $backup_options['mysqlpath'];
$backup['path'] = $backup_options['path'];


### Format Bytes Into KB/MB
function format_size($rawSize) {
	if($rawSize / 1073741824 > 1) 
		return round($rawSize/1048576, 1) . ' GB';
	else if ($rawSize / 1048576 > 1)
		return round($rawSize/1048576, 1) . ' MB';
	else if ($rawSize / 1024 > 1)
		return round($rawSize/1024, 1) . ' KB';
	else
		return round($rawSize, 1) . ' bytes';
}


### Get File Extension
function file_ext($file_name) {
	return substr(strrchr($file_name, '.'), 1);
}


### Check Folder Whether There Is Any File Inside
function is_emtpy_folder($folder){
   if(is_dir($folder) ){
       $handle = opendir($folder);
       while( (gettype( $name = readdir($handle)) != 'boolean')){
               $name_array[] = $name;
       }
       foreach($name_array as $temp)
           $folder_content .= $temp;

       if($folder_content == '...')
           return true;
       else
           return false;
       closedir($handle);
   }
   else
       return true; // folder doesnt exist
}
?>
```
