Holdorf.dk/Software

Software Development Blog

phpMyDumper 1.10 released

Finally, I have released my next version of phpMyDumper. This new version includes improvements that I needed when used in my work as a web programmer.

First of all it now supports UTF-8 connections as default with the MySQL server. The php class will create files encoded as UTF-8 which is important when your database is used with non-US languages.

Another important feature is the option to dump AUTO_INCREMENT in table structures. Older versions of MySQL (before 4.0) does not dump AUTO_INCREMENT when using the SHOW CREATE TABLE statement.

When using phpMyDumper in a backup environment, you want to know which MySQL server version created your sql files. phpMyDumper now dumps this information in the top of the sql file.

At last, you will also be able to know the progress of phpMyDumper. It will display the name of the created sql file and information about which table is being processed. Progress information is only avaible when dumping to a sql file.

In the last version I forgot to include an example of how to use the stream feature of phpMyDumper. The following code shows how, and the example will also be included in the download package.

<?php
/*
* phpMyDumper
* -------------
* Version: 1.10
* Copyright (c) 2009 by Micky Holdorf
* Holdorf.dk/Software - micky.holdorf@gmail.com
* GNU Public License http://opensource.org/licenses/gpl-license.php
*
*/


@include_once('phpMyDumper.php');

$dbhost = "localhost";
$dbuser = "user";
$dbpass = "password";
$dbname = "database";

$filename  = ""; // Filename of dump, default: "dump.php"
$compress  = false; // Dump as a compressed file, default: false

$connection = @mysql_connect($dbhost,$dbuser,$dbpass);
$dump = new phpMyDumper($dbname,$connection,$filename,$compress);

$dump->dropTable = true; // Dump DROP TABLE statement, default: true
$dump->createTable = true; // Dump CREATE TABLE statement, default: true
$dump->tableData = true; // Dump table data, default: true
$dump->expInsert = false; // Dump expanded INSERT statements, default: false
$dump->hexValue = false; // Dump strings as hex values, default: false
$dump->phpMyAdmin = true; // Formats dump file like phpMyAdmin export, default: true
$dump->utf8 = true; // Uses UTF-8 connection with MySQL server, default: true
$dump->autoincrement = false; // Dump AUTO_INCREMENT statement using older MySQL servers, default: false

$dump->doDump();
echo $dump->filestream;
?>

Comments are closed.