YaWK  24.1
Yet another WebKit
YAWK\BACKUP\DATABASE\mysqlBackup Class Reference
+ Inheritance diagram for YAWK\BACKUP\DATABASE\mysqlBackup:

Public Member Functions

 doSqlBackup ($db)
 Start mysqldump and check if .sql file exists. Zip it afterwards if enabled. More...
 
 excludeTables ($excludeTables)
 Exclude tables from backup. More...
 
 generateZipArchive ($db, $sqlBackup)
 ZIP Archive method generates a zip archive from .sql file. More...
 
 getDatabaseConfig ()
 Get current database config. More...
 
 getHashValue ($db)
 get hash value from .sql backup file More...
 
 includeMysqldumpClass ($db)
 Include mysqldump-php and create new dump object. More...
 
 includeTables ($includeTables)
 Include only this tables into backup. More...
 
 initMysqlBackup ($db, $overwriteBackup, $zipBackup, $storeSqlTmp)
 Initialize this database backup class. More...
 
 setDumpSettings ()
 Set mysqldump settings. More...
 
 sqlFileExists ()
 Check if .sql backup file exists. More...
 
 startMysqlBackup ($db)
 Start and manage mysql backup routine. More...
 
- Public Member Functions inherited from YAWK\BACKUP\backup
 __construct ($db)
 backup constructor. prepare temp folder on class instantiation More...
 
 checkFolders ($restoreFolders)
 check restore folders, check + set permissions of restore folders More...
 
 checkPermissions ($folder)
 check folder permissions and return permissions as string (eg 0755) More...
 
 checkZipFunction ()
 Check if ZipArchive function exists. More...
 
 doRestore ($db, $restoreFolders)
 Restore Data physically to folder, restore .sql file to database if needed. More...
 
 getArchiveBackupFilesArray ()
 get all files from archive backup folder into array More...
 
 getCurrentBackupFilesArray ()
 get all files from current backup folder into array More...
 
 init ($db)
 Init Backup Class (run backup) More...
 
 parseIniFile ($db, $iniFile)
 Parse backup ini file. More...
 
 restore ($db, $file, $folder)
 Manage how a backup will be restored from backup folder. More...
 
 run ($db)
 Run a new backup, depending on chosen backup method. More...
 
 runDatabaseBackup ($db, $storeSqlTmp)
 Include mysql backup class and run mysqldump backup. More...
 
 runFileBackup ($db)
 Run File Backup from $sourceFolder. More...
 
 setIniFile (object $db)
 Set backup information file (backup.ini) More...
 
 setPermissions ($folder, $filemode)
 set folder permissions and do some chmod stuff to with given $filemode to $folder More...
 
 zipFolder ($db, $source, $destination)
 Zip a whole folder from $source to $destination.zip. More...
 

Public Attributes

 $backupMode = 'include'
 
 $backupSqlFile = 'database-backup.sql'
 
 $dumpSettings = array()
 
 $excludeTablesArray = array()
 
 $hashValue = ''
 
 $includeTablesArray = array()
 
 $mysqldump
 
 $sqlBackup = ''
 
 $sqlPath = '../system/backup/current/'
 
 $zip
 
- Public Attributes inherited from YAWK\BACKUP\backup
 $archiveBackupFile = ''
 
 $archiveBackupFiles = array()
 
 $archiveBackupFolder = '../system/backup/archive/'
 
 $archiveBackupNewFile = ''
 
 $archiveBackupSubFolder = ''
 
 $archiveBackupSubFolders = array()
 
 $backupMethod = "database"
 
 $backupSettings = array()
 
 $configFile = ''
 
 $configFilename = "backup.ini"
 
 $currentBackupFiles = array()
 
 $currentBackupFolder = '../system/backup/current/'
 
 $downloadFolder = '../system/backup/download/'
 
 $fileBackup
 
 $mysqlBackup
 
 $overwriteBackup = "true"
 
 $removeAfterZip = "true"
 
 $restoreFile = ''
 
 $restoreFiles = array()
 
 $restoreFolder = ''
 
 $restoreFolders = array()
 
 $restoreMode = ''
 
 $restoreStatus = array()
 
 $sourceFolder = ''
 
 $storeSqlTmp = "false"
 
 $targetFolder = '../system/backup/current/'
 
 $tmpFolder = '../system/backup/tmp/'
 
 $zipBackup = "true"
 

Private Attributes

 $config
 
 $dbname
 
 $host
 
 $pass
 
 $port
 
 $prefix
 
 $user
 

Detailed Description

Definition at line 23 of file backup-mysqlBackup.php.

Member Function Documentation

◆ doSqlBackup()

YAWK\BACKUP\DATABASE\mysqlBackup::doSqlBackup (   $db)

Start mysqldump and check if .sql file exists. Zip it afterwards if enabled.

return bool if $this->sqlBackup exists

Returns
bool true|false

Definition at line 311 of file backup-mysqlBackup.php.

313  {
314 
315  // check if .sql file should be stored in tmp folder...
316  if (isset($this->storeSqlTmp) && ($this->storeSqlTmp == "true"))
317  { // check if subdir database exists
318  if (is_writeable($this->tmpFolder))
319  { // check if tmp subdir (database) exists...
320  if (!is_dir($this->tmpFolder."database"))
321  { // if not, create it
322  mkdir($this->tmpFolder."database");
323  }
324  // set sql path to temp folder
325  $this->sqlPath = $this->tmpFolder."database/";
326  // set whole sql backup file path + filename
327  $this->sqlBackup = $this->sqlPath.$this->backupSqlFile;
328  }
329  else
330  {
331  \YAWK\sys::setSyslog($db, 51, 1, "failed to create database backup: $this->tmpFolder is not writeable", 0, 0, 0, 0);
332  return false;
333  }
334  }
335 
336  // check if .sql path is writeable
337  if (is_writeable($this->sqlPath))
338  {
339  // ok then...
340  try
341  { // try to start backup
342  $this->mysqldump->start($this->sqlBackup, $this->dumpSettings);
343  }
344  // on fail: catch error
345  catch (Exception $e)
346  {
347  // output mysqldump error
348  \YAWK\sys::setSyslog($db, 52, 2, "".$e->getMessage()."", 0, 0, 0, 0);
349  // echo 'mysqldump-php error: ' . $e->getMessage();
350  }
351 
352  // check if file exists
353  if ($this->sqlFileExists())
354  {
355  // ok, backup done
356  // add ini file
357  $this->backupSettings = $this->setBackupSettings($db);
358  if ($this->setIniFile($db) === true)
359  {
360  // backup ini file written
361  }
362  else
363  {
364  // set syslog entry: ini file not written
365  \YAWK\sys::setSyslog($db, 51, 1, "failed to write $this->configFile", 0, 0, 0, 0);
366  }
367 
368  // check if .sql file should be zipped
369  if ($this->zipBackup == "true")
370  {
371  // generate zip archive
372  if ($this->generateZipArchive($db, $this->sqlBackup) === true)
373  {
374  // zip archive created
375  \YAWK\sys::setSyslog($db, 49, 0, "created database backup $this->sqlBackup", 0, 0, 0, 0);
376  return true;
377  }
378  else
379  { // failed to create zip archive
380  \YAWK\sys::setSyslog($db, 51, 1, "failed to create database zip archive", 0, 0, 0, 0);
381  return false;
382  }
383  }
384  else
385  { // zip backup diabled, no zip needed
386  return true;
387  }
388  }
389  else
390  { // .sql file does not exist - backup failed?
391  return false;
392  }
393  }
394  else
395  {
396  \YAWK\sys::setSyslog($db, 51, 1, "failed to create database backup: $this->sqlPath is not writeable", 0, 0, 0, 0);
397  return false;
398  }
generateZipArchive($db, $sqlBackup)
ZIP Archive method generates a zip archive from .sql file.
sqlFileExists()
Check if .sql backup file exists.
setIniFile(object $db)
Set backup information file (backup.ini)
Definition: backup.php:254

References $db, YAWK\BACKUP\DATABASE\mysqlBackup\generateZipArchive(), YAWK\BACKUP\backup\setIniFile(), and YAWK\BACKUP\DATABASE\mysqlBackup\sqlFileExists().

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\startMysqlBackup().

◆ excludeTables()

YAWK\BACKUP\DATABASE\mysqlBackup::excludeTables (   $excludeTables)

Exclude tables from backup.

Parameters
array$excludeTablesarray
Returns
array $this->dumpSettings

awaits an array with all tables that should be excluded

Definition at line 117 of file backup-mysqlBackup.php.

119  { // check if exclude tables are set
120  if (isset($excludeTables) && (is_array($excludeTables) && (!empty($excludeTables))))
121  {
122  // set excludeTables array
123  $this->excludeTablesArray = $excludeTables;
124 
125  // walk through exclude tables array
126  foreach ($this->excludeTablesArray AS $exclude => $table)
127  { // add exclude table to array
128  $this->dumpSettings['exclude-tables'][] = $table;
129  }
130  }
131 
132  // check if dump settings array is set and not empty
133  if (isset($this->dumpSettings['exclude-tables']) && (is_array($this->dumpSettings['exclude-tables']) && (!empty($this->dumpSettings['exclude-tables']))))
134  { // return dump settings array
135  return $this->dumpSettings;
136  }
137  else
138  { // no tables set for inclusion - return empty array
139  return $this->dumpSettings['exclude-tables'] = array();
140  }

References YAWK\BACKUP\DATABASE\mysqlBackup\$dumpSettings.

◆ generateZipArchive()

YAWK\BACKUP\DATABASE\mysqlBackup::generateZipArchive (   $db,
  $sqlBackup 
)

ZIP Archive method generates a zip archive from .sql file.

Parameters
string$sqlBackuprelative path + filename to the .sql backup file

zip the .sql file and return bool if zip archive exists

Returns
bool true|false

Definition at line 406 of file backup-mysqlBackup.php.

408  {
409  if ($this->zipBackup == "true")
410  { // check if ZipArchive class is available
411  if ($this->checkZipFunction() == true)
412  {
413  // ok, create new zip object
414  $zip = new \ZipArchive();
415 
416  // get sql backup filename
417  if (isset($sqlBackup) && (!empty($sqlBackup) && (is_string($sqlBackup))))
418  { // set this obj property
419  $this->sqlBackup = $sqlBackup;
420  }
421 
422  // generate zip filename
423  $filename = $this->sqlBackup.".zip";
424 
425  // open new zip archive
426  if ($zip->open($filename, \ZipArchive::CREATE) !== TRUE)
427  { // failed to create new zip archive
428  \YAWK\sys::setSyslog($db, 51, 2, "failed to create new zip archive $filename", 0, 0, 0, 0);
429  return false;
430  }
431 
432  // add .sql file to zip archive
433  $zip->addFile($this->sqlBackup,$this->backupSqlFile);
434 
435  // check if there is a backup.ini / config file
436  if (is_file($this->sqlPath.$this->configFilename))
437  { // add backup.ini config file to zip archive
438  $zip->addFile($this->sqlPath.$this->configFilename, $this->configFilename);
439  }
440  else
441  { // backup config ini file not found
442  \YAWK\sys::setSyslog($db, 51, 2, "failed to add $this->configFilename to archive $filename", 0, 0, 0, 0);
443  }
444  // echo "numfiles: " . $zip->numFiles . "\n";
445  // echo "status:" . $zip->status . "\n";
446  // ok, close zip file
447  $zip->close();
448 
449  // check if zip file exists
450  if (is_file($filename))
451  {
452  // zip file created
453  if ($this->removeAfterZip == "true")
454  { // remove files
455  if (unlink ($this->sqlPath.$this->backupSqlFile)
456  && (unlink ($this->sqlPath.$this->configFilename)))
457  {
458  return true;
459  }
460  else
461  { // unable to delete backup files after zipping
462  \YAWK\sys::setSyslog($db, 51, 1, "failed to delete backup files after adding .zip archive $filename", 0, 0, 0, 0);
463  return true;
464  }
465  }
466  return true;
467  }
468  else
469  { // zip file not created
470  \YAWK\sys::setSyslog($db, 51, 1, "failed to create .zip file: $filename", 0, 0, 0, 0);
471  return false;
472  }
473  }
474  else
475  { // ZipArchive class not available
476  \YAWK\sys::setSyslog($db, 51, 1, "failed create .zip archive - PHP ZIP class not available. Ask your web hosting provider about that", 0, 0, 0, 0);
477  return false;
478  }
479  }
480  else
481  { // zip not enabled due settings
482  return false;
483  }
$filename
Definition: actions.php:10
checkZipFunction()
Check if ZipArchive function exists.
Definition: backup.php:423

References $db, $filename, YAWK\BACKUP\DATABASE\mysqlBackup\$sqlBackup, YAWK\BACKUP\DATABASE\mysqlBackup\$zip, and YAWK\BACKUP\backup\checkZipFunction().

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\doSqlBackup().

◆ getDatabaseConfig()

YAWK\BACKUP\DATABASE\mysqlBackup::getDatabaseConfig ( )

Get current database config.

Get mysql configuration and set settings as private properties

Definition at line 177 of file backup-mysqlBackup.php.

179  {
180  // get database configuration
181  require ("../system/classes/dbconfig.php");
182  // set configuration vars for mysqldump-php
183  $this->host = $this->config['server'];
184  $this->user = $this->config['username'];
185  $this->pass = $this->config['password'];
186  $this->dbname = $this->config['dbname'];
187  $this->prefix = $this->config['prefix'];
188  $this->port = $this->config['port'];

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\includeMysqldumpClass().

◆ getHashValue()

YAWK\BACKUP\DATABASE\mysqlBackup::getHashValue (   $db)

get hash value from .sql backup file

Parameters
$db
Returns
bool|string

Definition at line 291 of file backup-mysqlBackup.php.

293  {
294  // check if sql backup file is accessable
295  if (is_file($this->sqlBackup))
296  { // generate hash value
297  return $this->hashValue = hash_file('md5', $this->sqlBackup);
298  }
299  else
300  { // sql backup file not found
301  // unable to generate hash value
302  \YAWK\sys::setSyslog($db, 52, 2, "failed to generate hash value - $this->sqlBackup not accessable", 0, 0, 0, 0);
303  return false;
304  }

References $db.

◆ includeMysqldumpClass()

YAWK\BACKUP\DATABASE\mysqlBackup::includeMysqldumpClass (   $db)

Include mysqldump-php and create new dump object.

Returns
bool true|false
Exceptions
Exceptioncreate new $this->mysqldump object Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com 1.0.0

Definition at line 199 of file backup-mysqlBackup.php.

201  {
202  // check if mysqldump class is there
203  if (is_file('../system/engines/mysqldump/Mysqldump.php'))
204  {
205  // ok, include class
206  require_once('../system/engines/mysqldump/Mysqldump.php');
207 
208  // check if database tables form is set
209  if (isset($_POST['database']) && (!empty($_POST['database'])))
210  {
211  // walk through database tables array
212  foreach ($_POST['database'] as $table)
213  {
214  // store table in array
215  $this->includeTablesArray[] = $table;
216  }
217 
218  // set tables to include
219  $this->dumpSettings = $this->includeTables($this->includeTablesArray);
220  }
221  else
222  { // set default settings (dump all)
223  $this->setDumpSettings();
224  }
225 
226  // load database config into this object
227  $this->getDatabaseConfig();
228 
229  // create new mysqldump object
230  $this->mysqldump = new \Ifsnop\Mysqldump\Mysqldump("mysql:host=$this->host;dbname=$this->dbname", $this->user, $this->pass, $this->dumpSettings);
231  return true;
232  }
233  else
234  { // unable to include class
235  \YAWK\sys::setSyslog($db, 52, 2, "unable to backup: failed to include mysqldump class", 0, 0, 0, 0);
236  return false;
237  }
setDumpSettings()
Set mysqldump settings.
includeTables($includeTables)
Include only this tables into backup.
getDatabaseConfig()
Get current database config.

References $db, YAWK\BACKUP\DATABASE\mysqlBackup\getDatabaseConfig(), YAWK\BACKUP\DATABASE\mysqlBackup\includeTables(), and YAWK\BACKUP\DATABASE\mysqlBackup\setDumpSettings().

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\startMysqlBackup().

◆ includeTables()

YAWK\BACKUP\DATABASE\mysqlBackup::includeTables (   $includeTables)

Include only this tables into backup.

Parameters
array$includeTablesarray
Returns
array $this->dumpSettings

awaits an array with all tables that should be included

Definition at line 148 of file backup-mysqlBackup.php.

150  { // check if include tables are set
151  if (isset($includeTables) && (is_array($includeTables) && (!empty($includeTables))))
152  {
153  // set includeTables array
154  $this->includeTablesArray = $includeTables;
155 
156  // walk through include tables array
157  foreach ($this->includeTablesArray AS $include => $table)
158  { // add include table to array
159  $this->dumpSettings['include-tables'][] = $table;
160  }
161  }
162 
163  // check if dump settings array is set and not empty
164  if (isset($this->dumpSettings['include-tables']) && (is_array($this->dumpSettings['include-tables']) && (!empty($this->dumpSettings['include-tables']))))
165  { // return dump settings array
166  return $this->dumpSettings;
167  }
168  else
169  { // no tables set for inclusion - return empty array
170  return $this->dumpSettings['include-tables'] = array();
171  }

References YAWK\BACKUP\DATABASE\mysqlBackup\$dumpSettings.

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\includeMysqldumpClass().

◆ initMysqlBackup()

YAWK\BACKUP\DATABASE\mysqlBackup::initMysqlBackup (   $db,
  $overwriteBackup,
  $zipBackup,
  $storeSqlTmp 
)

Initialize this database backup class.

Parameters
object$dbdatabase object
string$overwriteBackupif overwrite backup is allowed or not "true" | "false"
string$zipBackupif backup should be zipped or not "true" | "false"
string$storeSqlTmpif backup should be stored in tmp/database "true" | "false"
Returns
bool

Definition at line 69 of file backup-mysqlBackup.php.

71  {
72  // if overwrite backup is true
73  $this->overwriteBackup = $overwriteBackup;
74  // zip true|false
75  $this->zipBackup = $zipBackup;
76  // store .sql in tmp folder true|false
77  $this->storeSqlTmp = $storeSqlTmp;
78 
79  // check if .sql file should be stored in tmp folder
80  if (isset($this->storeSqlTmp) && ($this->storeSqlTmp == "true"))
81  { // if so, do not zip
82  $this->zipBackup = "false";
83  }
84 
85  // start database backup
86  if ($this->startMysqlBackup($db) === true)
87  { // mysql backup done
88  return true;
89  }
90  else
91  { // mysql backup failed
92  return false;
93  }
startMysqlBackup($db)
Start and manage mysql backup routine.

References $db, YAWK\BACKUP\backup\$overwriteBackup, YAWK\BACKUP\backup\$storeSqlTmp, YAWK\BACKUP\backup\$zipBackup, and YAWK\BACKUP\DATABASE\mysqlBackup\startMysqlBackup().

◆ setDumpSettings()

YAWK\BACKUP\DATABASE\mysqlBackup::setDumpSettings ( )

Set mysqldump settings.

Returns
array $this->dumpSettings

mysqldump settings eg. include or exclude tables from database

Definition at line 100 of file backup-mysqlBackup.php.

102  {
103  // generate dump settings array
104  $this->dumpSettings = array(
105  'include-tables'
106  => array(),
107  'exclude-tables'
108  => array());
109  return $this->dumpSettings;

References YAWK\BACKUP\DATABASE\mysqlBackup\$dumpSettings.

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\includeMysqldumpClass().

◆ sqlFileExists()

YAWK\BACKUP\DATABASE\mysqlBackup::sqlFileExists ( )

Check if .sql backup file exists.

return bool if $this->sqlBackup exists

Returns
bool true|false

Definition at line 244 of file backup-mysqlBackup.php.

246  {
247  // set path + filename (store as string in $this->sqlBackup)
248  $this->sqlBackup = $this->sqlPath.$this->backupSqlFile;// .sql backup file exists
249  // check if .sql backup file is already there
250  if (is_file($this->sqlBackup))
251  {
252  // build sqlBackup string
253  return true;
254  }
255  else
256  {
257  // .sql backup file does not exist
258  return false;
259  }

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\doSqlBackup(), and YAWK\BACKUP\DATABASE\mysqlBackup\startMysqlBackup().

◆ startMysqlBackup()

YAWK\BACKUP\DATABASE\mysqlBackup::startMysqlBackup (   $db)

Start and manage mysql backup routine.

First of all, mysqldump class will be included. Then, a check runs if a .sql backup file exists. if so, check if overwrite backup is allowed. If this is true, doSqlBackup method will be called. (This function does the real job).

return bool if zip archive exists

Returns
bool true|false

Definition at line 493 of file backup-mysqlBackup.php.

495  {
496  // include mysqldump class
497  $this->includeMysqldumpClass($db);
498 
499  // check if backup overwrite is allowed
500  if ($this->overwriteBackup == "false")
501  {
502  if (isset($_POST))
503  {
504  // check if new folder was entered by user
505  if (isset($_POST['newFolder']) && (!empty($_POST['newFolder'])))
506  {
507  // create new archive sub folder path
508  $this->archiveBackupSubFolder = $this->archiveBackupFolder.$_POST['newFolder']."/";
509 
510  // create new directory in archive
511  if (!is_dir($this->archiveBackupSubFolder))
512  {
513  if (mkdir($this->archiveBackupSubFolder))
514  { // all good, new archive subfolder created
515  // set syslog entry: dir created
516  \YAWK\sys::setSyslog($db, 49, 0, "archive directory created: $this->archiveBackupSubFolder", 0, 0, 0, 0);
517  }
518  else
519  { // failed to create new archive subfolder
520  // set syslog entry: failed
521  \YAWK\sys::setSyslog($db, 52, 0, "failed to create archive directory: $this->archiveBackupSubFolder", 0, 0, 0, 0);
522  }
523  }
524  }
525  // check if existing folder was selected by user
526  else if (isset($_POST['selectFolder']) && (!empty($_POST['selectFolder'])))
527  { // set archive sub foder path
528  $this->archiveBackupSubFolder = $this->archiveBackupFolder.$_POST['selectFolder']."/";
529  }
530 
531  // SET PATH WHERE .SQL FILE SHOULD BE STORED
532  $this->sqlPath = $this->archiveBackupSubFolder;
533  // set archive backup subfolder
534  $this->targetFolder = $this->archiveBackupSubFolder;
535  }
536  }
537 
538  // check if a backup exists
539  if ($this->sqlFileExists() === true)
540  {
541  // do database backup
542  if ($this->doSqlBackup($db) === true)
543  { // ok, backup done
544  \YAWK\sys::setSyslog($db, 50, 3, "database backup overwritten", 0, 0, 0, 0);
545  return true;
546  }
547  else
548  { // backup failed - unable to overwrite - check chmod settings!
549  \YAWK\sys::setSyslog($db, 52, 2, "failed to overwrite database backup", 0, 0, 0, 0);
550  return false;
551  }
552  }
553  else
554  { // .sql file does not exist - do database backup
555  if ($this->doSqlBackup($db) === true)
556  { // ok, backup done!
557  // \YAWK\sys::setSyslog($db, 50, 3, "created database backup", 0, 0, 0, 0);
558  return true;
559  }
560  else
561  { // backup failed!
562  \YAWK\sys::setSyslog($db, 52, 2, "failed to write database backup", 0, 0, 0, 0);
563  return false;
564  }
565  }
includeMysqldumpClass($db)
Include mysqldump-php and create new dump object.
doSqlBackup($db)
Start mysqldump and check if .sql file exists. Zip it afterwards if enabled.

References YAWK\BACKUP\backup\$archiveBackupSubFolder, $db, YAWK\BACKUP\DATABASE\mysqlBackup\doSqlBackup(), YAWK\BACKUP\DATABASE\mysqlBackup\includeMysqldumpClass(), and YAWK\BACKUP\DATABASE\mysqlBackup\sqlFileExists().

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\initMysqlBackup().

Member Data Documentation

◆ $backupMode

YAWK\BACKUP\DATABASE\mysqlBackup::$backupMode = 'include'
Parameters
stringbackup mode (include|exclude|all)

Definition at line 44 of file backup-mysqlBackup.php.

◆ $backupSqlFile

YAWK\BACKUP\DATABASE\mysqlBackup::$backupSqlFile = 'database-backup.sql'
Parameters
stringdefault filename of mysqldump .sql file

Definition at line 54 of file backup-mysqlBackup.php.

◆ $config

YAWK\BACKUP\DATABASE\mysqlBackup::$config
private
Parameters
arraymysql config array

Definition at line 30 of file backup-mysqlBackup.php.

◆ $dbname

YAWK\BACKUP\DATABASE\mysqlBackup::$dbname
private
Parameters
stringmysql database name

Definition at line 34 of file backup-mysqlBackup.php.

◆ $dumpSettings

YAWK\BACKUP\DATABASE\mysqlBackup::$dumpSettings = array()

◆ $excludeTablesArray

YAWK\BACKUP\DATABASE\mysqlBackup::$excludeTablesArray = array()
Parameters
arrayexclude tables

Definition at line 46 of file backup-mysqlBackup.php.

◆ $hashValue

YAWK\BACKUP\DATABASE\mysqlBackup::$hashValue = ''
Parameters
stringhash value of .sql file

Definition at line 58 of file backup-mysqlBackup.php.

◆ $host

YAWK\BACKUP\DATABASE\mysqlBackup::$host
private
Parameters
stringmysql server hostname

Definition at line 32 of file backup-mysqlBackup.php.

◆ $includeTablesArray

YAWK\BACKUP\DATABASE\mysqlBackup::$includeTablesArray = array()
Parameters
arrayinclude tables

Definition at line 48 of file backup-mysqlBackup.php.

◆ $mysqldump

YAWK\BACKUP\DATABASE\mysqlBackup::$mysqldump
Parameters
objectmysqldump object

Definition at line 26 of file backup-mysqlBackup.php.

◆ $pass

YAWK\BACKUP\DATABASE\mysqlBackup::$pass
private
Parameters
stringmysql pass

Definition at line 38 of file backup-mysqlBackup.php.

◆ $port

YAWK\BACKUP\DATABASE\mysqlBackup::$port
private
Parameters
stringmysql port

Definition at line 42 of file backup-mysqlBackup.php.

◆ $prefix

YAWK\BACKUP\DATABASE\mysqlBackup::$prefix
private
Parameters
stringmysql prefix

Definition at line 40 of file backup-mysqlBackup.php.

◆ $sqlBackup

YAWK\BACKUP\DATABASE\mysqlBackup::$sqlBackup = ''
Parameters
stringname of the backup .sql file

Definition at line 56 of file backup-mysqlBackup.php.

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\generateZipArchive().

◆ $sqlPath

YAWK\BACKUP\DATABASE\mysqlBackup::$sqlPath = '../system/backup/current/'
Parameters
stringpath, where the backup will be stored

Definition at line 52 of file backup-mysqlBackup.php.

◆ $user

YAWK\BACKUP\DATABASE\mysqlBackup::$user
private
Parameters
stringmysql user

Definition at line 36 of file backup-mysqlBackup.php.

◆ $zip

YAWK\BACKUP\DATABASE\mysqlBackup::$zip
Parameters
objectzip object

Definition at line 28 of file backup-mysqlBackup.php.

Referenced by YAWK\BACKUP\DATABASE\mysqlBackup\generateZipArchive().


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