function Add_EOF_Entry() { // Build EOF entry $fields = array(array('a3', 'EOF'), array('C', 0x0)); // Write the fields if (($ret = $this->indx_disk->Write(WPOnlineBackup_Functions::Pack_Fields($fields))) !== true) { return $ret; } return true; }
function Close() { // ASSERTION - The file is open and does not contain volatile data // Write the last block if we still have data if ($this->data_len != 0) { if (($ret = $this->Last_Write()) !== true) { return $ret; } } // Close the hash_ctx if ($this->hash_ctx !== false) { list($inc_crc) = array_values(unpack('N', hash_final($this->hash_ctx, true))); if ($this->crc !== false) { $this->crc = WPOnlineBackup_Functions::Combine_CRC32($this->crc, $inc_crc, $this->hash_len); } else { $this->crc = $inc_crc; } $this->hash_ctx = false; } $this->CleanUp_Cipher(); // Build the replacement fields and overwrite the header $fields = array(array('V', $this->totalsize), array('V', $this->crc)); if (($ret = $this->disk->Rewrite($this->header_pos + 16, WPOnlineBackup_Functions::Pack_Fields($fields))) !== true) { return $ret; } // Now closed, so set status to 0 $this->status = 0; return array('size' => $this->encsize); }
function Add_CDR_EOF() { $cdr_len = $this->cdr_ofs; $cdr_ofs = $this->ofs; // Prepare comment $comment = 'Backup file generated by Online Backup for WordPress ' . WPONLINEBACKUP_VERSION . PHP_EOL; $fields = array(array('V', 0x6054b50), array('v', 0x0), array('v', 0x0), array('v', $this->file_count), array('v', $this->file_count), array('V', $cdr_len), array('V', $cdr_ofs), array('v', strlen($comment))); // Write the fields if (($ret = $this->writer->Write(WPOnlineBackup_Functions::Pack_Fields($fields) . $comment)) !== true) { return $ret; } return true; }