2017 © Pedro Peláez
 

library webino-dbdump

Database Dump Utility for Zend Framework 2

image

webino/webino-dbdump

Database Dump Utility for Zend Framework 2

  • Saturday, December 2, 2017
  • by Webino
  • Repository
  • 1 Watchers
  • 2 Stars
  • 536 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Database Dump Utility
for Zend Framework 2

Build Status Coverage Status Dependency Status, (*1)

Latest Stable Version Scrutinizer Quality Score Total Downloads, (*2)

Utility used to dump a database into a SQL file, and to load that file into a database., (*3)

Features

  • Dump an entire database into a SQL file
  • Load a SQL file into a database

Setup

Following steps are necessary to get this module working, considering a zf2-skeleton or very similar application:, (*4)

  1. Run php composer.phar require webino/webino-db-dump:0.1.0, (*5)

  2. Add WebinoDbDump to the enabled modules list, (*6)

QuickStart

  • For example, add this settings to your module config:, (*7)

    'di' => [
        'instance' => [
            'alias' => [
                'DefaultDbDump' => \WebinoDbDump\Db\Dump\Dump::class,
            ],
        ],
        'DefaultDbDump' => [
            'parameters' => [
                'adapter' => \Zend\Db\Adapter\Adapter::class,
            ],
        ],
    ],

    NOTE: Change the DefaultAdapterDump and \Zend\Db\Adapter\Adapter::class as you wish., (*8)

  • Then, add this code to your controller action:, (*9)

    // We encourage to use Dependency Injection instead of Service Locator
    $dbDump = $this->getServiceLocator()->get('DefaultDbDump');
    
    // saves the sql code of the entire database to a file
    $dbDump->save('example/dump.sql');
    
    // drops & creates tables/views, triggers and inserts the data
    $dbDump->load('example/dump.sql');

    NOTE: If you don't know how to inject the WebinoDbDump into action controller, check out test/resources., (*10)

    NOTE: Use stream wrappers, e.g. compress.zlib://example.dump.sql.gz, if you want compression., (*11)

Changelog

0.1.0

  • Initial release

Develop

Dependency Status, (*12)

We will appreciate any contributions on development of this module., (*13)

Learn How to develop Webino modules, (*14)

Todo

  • Tests
  • Add support for more platforms (currently only Mysql)
  • Better exceptions
  • More options
  • Events dump

Addendum

Please, if you are interested in this Zend Framework module report any issues and don't hesitate to contribute., (*15)

Report a bug | Fork me, (*16)

The Versions

09/04 2016

dev-master

9999999-dev http://github.com/webino/WebinoDbDump

Database Dump Utility for Zend Framework 2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

database framework zf2 zend db dump webino

09/04 2016

0.1.0

0.1.0.0 http://github.com/webino/WebinoDbDump

Database Dump Utility for Zend Framework 2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

database framework zf2 zend db dump webino