Download the PHP package dimtrovich/db-dumper without Composer

On this page you can find all versions of the php package dimtrovich/db-dumper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db-dumper

EN | FR

Backup and restore database content

Tests Code Coverage Coding Standards Build Status Code Intelligence Status Quality Score PHPStan Total Downloads Latest Version PHP


Db Dumper is a tool that offers you a simple and efficient way to export and import your database in PHP. It is somewhat of a PHP version of the command-line tool mysqldump that comes with MySQL, without dependencies, with output compression and reasonable default parameters.

Db Dumper supports backing up table structures, the data itself, views, triggers, and events.

Features

Db Dumper supports:

Db Dumper is designed to work with the main current database management systems. The list below outlines their support:

Prerequisites

Installation

Using Composer:

After installing this package, you must first ensure that you have access to a PDO instance as the export and import systems need it.

Data Export (backup)

Data export is the main functionality of this package. Db Dumper offers you a simple API to backup your database with the same options offered by native MySQL or PostgreSQL commands (mysqldump / pgrestore)

Modifying values during export

You can register a callable that will be used to transform values during export. A typical use case is removing sensitive data from database backups:

Getting information about table export

You can register a callable that will be used to report the progress of the backup:

Table-specific export conditions

You can define table-specific WHERE clauses to limit the data of tables that can be exported. These clauses override the default where parameter:

Table-specific export limits

You can also define table-specific limits to limit the number of records that will be saved for each table:

Exporter configuration options

The constructor of the Exporter class accepts a third parameter which is an array designating the data export options.

Option | Type | Default | Description ------- | ------- | ------- | ------- `include-tables` | `array` | `[]` | Include only these tables (array of table names), include all if empty. `exclude-tables` | `array` | `[]` | Exclude these tables (array of table names), include all if empty, supports regular expressions. `include-views` | `array` | `[]` | Include only these views (array of view names), include all if empty. By default, all views named in the `include-tables` array are included. `compress` | `Gzip`, `Bzip2`, `None`, `GzipStream` | `None` | `init_commands` | `array` | `[]` | `no-data` | `array` | `[]` | Do not save data for these tables (array of table names), supports regular expressions. `if-not-exists` | `bool` | `false` | Create a new table only if a table of the same name does not already exist. No error message is generated if the table already exists. `reset-auto-increment` | `bool` | `false` | Removes the `AUTO_INCREMENT` option from the database definition. Useful when used with `no-data`, so that when the database is recreated, it starts at 1 instead of using an old value. `add-drop-database` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-database) `add-drop-table` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-table) `add-drop-trigger` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-trigger) `add-locks` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-locks) `complete-insert` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_complete-insert) `databases` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_databases) `default-character-set` | `utf8`, `utf8mb4`, `binary` | `utf8` | `disable-keys` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_disable-keys) `extended-insert` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_extended-insert) `events` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_events) `hex-blob` | `bool` | `true` | (Faster than escaped content). [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_hex-blob) `insert-ignore` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_insert-ignore) `lock-tables` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables) `net_buffer_length` | `int` | `1000000` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_net_buffer_length) `no-autocommit` | `bool` | `true` | Option to disable autocommit (faster inserts, no problems with index keys). [MySQL Documentation](https://dev.mysql.com/doc/refman/4.1/en/commit.html) `no-create-db` | `bool` | `false` | Option to disable backing up database creation instructions. [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-create-db) `no-create-info` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-create-info) `routines` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_routines) `single-transaction` | `bool` | `true` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction) `skip-triggers` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_triggers) `skip-tz-utc` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_tz-utc) `skip-comments` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_comments) `skip-dump-date` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_dump-date) `skip-definer` | `bool` | `false` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.7/en/mysqlpump.html#option_mysqlpump_skip-definer) `where` | `string` | `''` | [MySQL Documentation](https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_where)

Data Import (Restore)

Just like with data export, Db Dumper provides you with a simple API to restore your database from a backup file (.sql, .gz, .gzip, .bz2, .bzip2).

The file extension of the restore file determines the type of compression to use:

Get Information on Table Import

You can register a callable that will be used to report the progress of the restoration:

Errors

To back up a database, you need the following privileges:

Use SHOW GRANTS FOR user@host; to check the user's privileges. See the following link for more information:

What are the minimum privileges required to get a backup of a MySQL database schema?

To restore a database, you need the following privileges:

Tests

The unit tests for this package are written using the Kahlan library. The tests cover SQLite, but tests for MySQL have not been written, although tests have been conducted in a real environment. PRs in this direction are welcome.

Todo

Contribution

Please see CONTRIBUTING for more details.

License

This project is open-source software licensed under the MIT license. Please see the License File for more information.

Credits

Although significantly modified, the code for DB Dumper's exporter was inspired by MySQLDump - PHP maintained by Diego Torres. We would like to thank him.

That said, note that this package was created by Dimitri Sitchet Tomkeu and is maintained by All Contributors.


All versions of db-dumper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dimtrovich/db-dumper contains the following files

Loading the files please wait ...