Example #1
0
 function mysqlBackup(&$config, &$dbclass, &$vboptions)
 {
     /* Load Error Codes */
     parent::loadCodes();
     /* Set Default Status */
     $this->STATUS = $this->MESSAGES[NO_ERRORS];
     /* Reference Database Object */
     $this->MYSQL =& $dbclass;
     /* Forum Shutdown System */
     $this->SHUTDOWN =& $config['SHUTDOWN'];
     $this->MESSAGE =& $config['MESSAGE'];
     /* File Saving Information */
     $this->DATE = date($config['DATE']);
     $this->PREFIX =& $config['PREFIX'];
     $this->DUMP_PATH =& $config['DUMP_PATH'];
     /* Backup Method & Lock & Repair*/
     $this->LOCK =& $config['LOCK'];
     $this->REPAIR =& $config['REPAIR'];
     /* Backup Type & Tables & Combine */
     $this->TABLES = array();
     $this->TYPE =& $config['TYPE'];
     $this->TABS =& $config['TABLES'];
     $this->COMBINE =& $config['COMBINE'];
     /* Backup Optimizations */
     $this->INNODB =& $config['INNODB'];
     /* PHP Execution Function */
     $this->COMMAND =& $config['COMMAND'];
     /* Get Database Options */
     if ($this->SHUTDOWN) {
         /* Get Options */
         $this->OPTIONS =& $vboptions;
         /* Check if loaded OK */
         if (!is_array($this->OPTIONS) || empty($this->OPTIONS)) {
             $this->throwError(DB_OPTIONS);
         }
     }
     /* Get Tables List */
     $list = $this->MYSQL->query('SHOW tables');
     while ($table = $this->MYSQL->fetch_array($list, DBARRAY_NUM)) {
         if (in_array($table[0], $this->TABS)) {
             if ($this->TYPE == 1) {
                 $this->TABLES[] = $table[0];
             }
         } else {
             if ($this->TYPE == 2) {
                 $this->TABLES[] = $table[0];
             }
         }
     }
 }