Class to work with database backups
- Author
- Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m @api
- Since
- 100.0.2
Definition at line 19 of file Db.php.
◆ __construct()
- Parameters
-
Definition at line 29 of file Db.php.
31 $this->_backupFactory = $backupFactory;
◆ _isLineLastInCommand()
_isLineLastInCommand |
( |
|
$line | ) |
|
|
protected |
Checks whether the line is last in sql command
- Parameters
-
- Returns
- bool
Definition at line 68 of file Db.php.
70 $cleanLine = trim($line);
71 $lineLength = strlen($cleanLine);
73 $returnResult =
false;
74 if ($lineLength > 0) {
75 $lastSymbolIndex = $lineLength - 1;
76 if ($cleanLine[$lastSymbolIndex] ==
';') {
◆ create()
Implements Create Backup functionality for Db
- Returns
- bool
Implements BackupInterface.
Definition at line 89 of file Db.php.
92 ignore_user_abort(
true);
94 $this->_lastOperationSucceed =
false;
96 $backup = $this->_backupFactory->createBackupModel()->setTime(
106 $backupDb = $this->_backupFactory->createBackupDbModel();
107 $backupDb->createBackup($backup);
109 $this->_lastOperationSucceed =
true;
◆ getDBSize()
Get database size
- Returns
- int
Definition at line 119 of file Db.php.
121 $backupDb = $this->_backupFactory->createBackupDbModel();
122 return $backupDb->getDBBackupSize();
◆ getType()
◆ rollback()
Implements Rollback functionality for Db
- Returns
- bool
Implements BackupInterface.
Definition at line 39 of file Db.php.
42 ignore_user_abort(
true);
44 $this->_lastOperationSucceed =
false;
46 $archiveManager =
new Archive();
50 foreach ($file as $statement) {
57 $this->_lastOperationSucceed =
true;
◆ $_backupFactory
The documentation for this class was generated from the following file:
- vendor/magento/framework/Backup/Db.php