ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
MysqlIfsnopDumper Class Reference
+ Inheritance diagram for MysqlIfsnopDumper:
+ Collaboration diagram for MysqlIfsnopDumper:

Public Member Functions

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

Data Fields

const FILE_NAME = "dump.sql"
 

Protected Attributes

string $export_hooks_path
 

Detailed Description

Definition at line 21 of file MysqlIfsnopDumper.php.

Constructor & Destructor Documentation

◆ __construct()

MysqlIfsnopDumper::__construct ( ?string  $export_hooks_path)

Definition at line 27 of file MysqlIfsnopDumper.php.

References $export_hooks_path.

28  {
29  $this->export_hooks_path = $export_hooks_path;
30  }

Member Function Documentation

◆ createDump()

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

Implements MysqlDumper.

Definition at line 32 of file MysqlIfsnopDumper.php.

References Vendor\Package\$e, and $export_hooks_path.

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

Field Documentation

◆ $export_hooks_path

string MysqlIfsnopDumper::$export_hooks_path
protected

Definition at line 25 of file MysqlIfsnopDumper.php.

Referenced by __construct(), and createDump().

◆ FILE_NAME

const MysqlIfsnopDumper::FILE_NAME = "dump.sql"

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