ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MysqlIfsnopDumper Class Reference
+ Inheritance diagram for MysqlIfsnopDumper:
+ Collaboration diagram for MysqlIfsnopDumper:

Public Member Functions

 __construct (protected ?string $export_hooks_path)
 
 createDump (string $host, string $user, string $password, string $name, string $port, string $target)
 
 createDump (string $host, string $user, string $password, string $name, string $port, string $target)
 

Data Fields

const FILE_NAME = "dump.sql"
 

Detailed Description

Definition at line 23 of file MysqlIfsnopDumper.php.

Constructor & Destructor Documentation

◆ __construct()

MysqlIfsnopDumper::__construct ( protected ?string  $export_hooks_path)

Definition at line 27 of file MysqlIfsnopDumper.php.

28 {
29 }

Member Function Documentation

◆ createDump()

MysqlIfsnopDumper::createDump ( string  $host,
string  $user,
string  $password,
string  $name,
string  $port,
string  $target 
)

Implements MysqlDumper.

Definition at line 31 of file MysqlIfsnopDumper.php.

38 : void {
39 if (!is_null($this->export_hooks_path) && !is_readable($this->export_hooks_path)) {
40 throw new Exception("Export hooks file '$this->export_hooks_path' is not readable.");
41 }
42
43 try {
44 $dumper = new Mysqldump(
45 "mysql:host=$host;port=$port;dbname=$name",
46 $user,
47 $password,
48 ['add-drop-table' => true]
49 );
50 if (!is_null($this->export_hooks_path)) {
51 include $this->export_hooks_path;
52 }
53 $dumper->start($target . "/" . self::FILE_NAME);
54 } catch (\Exception $e) {
55 throw new Exception("Error during sql dump: " . $e->getMessage(), $e->getCode(), $e);
56 }
57 }

Field Documentation

◆ FILE_NAME

const MysqlIfsnopDumper::FILE_NAME = "dump.sql"

The documentation for this class was generated from the following file: