Vergleich admin/dbtools.php - 1.2.0 - 1.2.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 66Zeile 66
	{
cperror($lang->error_no_tables_selected);
}

	{
cperror($lang->error_no_tables_selected);
}

 
	
@set_time_limit(0);

	
if($mybb->input['write'] == 'disk')
{

	
if($mybb->input['write'] == 'disk')
{

Zeile 79Zeile 81
			}

$fp = gzopen($file.'.gz', 'w9');

			}

$fp = gzopen($file.'.gz', 'w9');

		}

		}

		else
{
$fp = fopen($file.'.sql', 'w');

		else
{
$fp = fopen($file.'.sql', 'w');

Zeile 105Zeile 107
	
$time = date('dS F Y \a\t H:i', time());
$header = "-- MyBB Database Backup\n-- Generated: ".$time."\n---------------------------------------\n\n";

	
$time = date('dS F Y \a\t H:i', time());
$header = "-- MyBB Database Backup\n-- Generated: ".$time."\n---------------------------------------\n\n";

	
if($mybb->input['write'] == 'disk')
{
if($mybb->input['type'] == 'gzip')
{
gzwrite($fp, $header, strlen($header));
}
else
{
fputs($fp, $header, strlen($header));
}
}
else
{
if($mybb->input['type'] == 'gzip')
{
echo gzencode($header);
}
else
{
echo $header;
}
}


	$contents = $header;
























	foreach($mybb->input['tables'] as $table)
{
$field_list = array();

	foreach($mybb->input['tables'] as $table)
{
$field_list = array();

Zeile 141Zeile 120
		if($mybb->input['contents'] != 'data')
{
$structure = $db->show_create_table($table)."\n";

		if($mybb->input['contents'] != 'data')
{
$structure = $db->show_create_table($table)."\n";

			if($mybb->input['write'] == 'disk')
{
if($type == 'gzip')
{
gzwrite($fp, $structure, strlen($structure));
}
else
{
fputs($fp, $structure, strlen($structure));
}
}
else
{
if($mybb->input['type'] == 'gzip')
{
echo gzencode($structure);
}
else
{
echo $structure;
}
}

			$contents .= $structure;






















		}
if($mybb->input['contents'] != 'structure')
{

		}
if($mybb->input['contents'] != 'structure')
{

Zeile 173Zeile 131
				$comma = '';
foreach($field_list as $field)
{

				$comma = '';
foreach($field_list as $field)
{

					if(!isset($row[$field]))

					if(!isset($row[$field]) || trim($row[$field]) == "")

					{
$insert .= $comma.'NULL';
}

					{
$insert .= $comma.'NULL';
}

Zeile 181Zeile 139
					{
$insert .= $comma."'".$db->escape_string($row[$field])."'";
}

					{
$insert .= $comma."'".$db->escape_string($row[$field])."'";
}

					$comma = ',';
}
$insert .= ")\n";
if($mybb->input['write'] == 'disk')
{
if($type == 'gzip')
{
gzwrite($fp, $insert, strlen($insert));
}
else
{
fputs($fp, $insert, strlen($insert));
}
}
else
{
if($mybb->input['type'] == 'gzip')
{
echo gzencode($insert);
}
else
{
echo $insert;
}

					$comma = ',';
























				}

				}

 
				$insert .= ")\n";
$contents .= $insert;

			}
}
}

			}
}
}

Zeile 214Zeile 151
	{
if($mybb->input['type'] == 'gzip')
{

	{
if($mybb->input['type'] == 'gzip')
{

 
			gzwrite($fp, $contents);

			gzclose($fp);
}
else
{

			gzclose($fp);
}
else
{

 
			fwrite($fp, $contents);

			fclose($fp);
}


			fclose($fp);
}


Zeile 233Zeile 172
		$file_from_admindir = 'dbtools.php?'.SID.'&action=dlbackup&file='.basename($file).$ext;
$lang->backup_complete = sprintf($lang->backup_complete, $file.$ext, $file_from_admindir);
cpmessage($lang->backup_complete);

		$file_from_admindir = 'dbtools.php?'.SID.'&action=dlbackup&file='.basename($file).$ext;
$lang->backup_complete = sprintf($lang->backup_complete, $file.$ext, $file_from_admindir);
cpmessage($lang->backup_complete);

 
	}
else
{
if($mybb->input['type'] == "gzip")
{
echo gzencode($contents);
}
else
{
echo $contents;
}

	}
}


	}
}