ifsnop / mysqldump-php

PHP version of mysqldump cli that comes with MySQL
https://github.com/ifsnop/mysqldump-php
GNU General Public License v3.0
1.25k stars 300 forks source link

Uncaught Error: Call to undefined method Ifsnop\Mysqldump\Mysqldump::setTransformTableRowHook() #193

Closed apurbajnu closed 4 years ago

apurbajnu commented 4 years ago

Uncaught Error: Call to undefined method Ifsnop\Mysqldump\Mysqldump::setTransformTableRowHook() `use Ifsnop\Mysqldump as IMysqldump; /**

class WP_SMART_DB_BACKUP {

/**
 * $dump containt dump object
 */
private $dump;

public function __construct()
{
    $this->dump = new IMysqldump\Mysqldump( 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD );

}

public function db_backup_create( $name = 'undefined.sql' ) {
    $this->proccess();
    $this->dump->start( $name );
}

private function proccess(){

    $this->dump->setTransformTableRowHook(function ($tableName, array $row) {

        error_log(print_r($tableName,1));

        return $row;
    }); 

}

}`

garas commented 4 years ago

setTransformTableRowHook() method currently exists only in master branch, but not in latest 2.8 tag.

Install master branch with composer require ifsnop/mysqldump-php:dev-master.

@ifsnop Could you make new release?

ifsnop commented 4 years ago

Done!