public/wordpress/wp-content/plugins/backupbuddy/classes/backup.php
/*	backup_create_dat_file()
	 *	
	 *	Generates backupbuddy_dat.php within the temporary directory containing the
	 *	random serial in its name. This file contains a serialized array that has been
	 *	XOR encrypted for security.  The XOR key is backupbuddy_SERIAL where SERIAL
	 *	is the randomized set of characters in the ZIP filename. This file contains
	 *	various information about the source site.
	 *	
	 *	@param		string			$trigger			What triggered this backup. Valid values: scheduled, manual.
	 *	@return		boolean			true on success making dat file; else false
	 */


Generates backupbuddy_dat.php within the temporary directory containing the
random serial in its name. This file contains a serialized array that has been
XOR encrypted for security.  The XOR key is backupbuddy_SERIAL where SERIAL
is the randomized set of characters in the ZIP filename. This file contains
various information about the source site.

@param          string                  $trigger                        What triggered this backup. Valid values: scheduled, manual.
@return         boolean                 true on success making dat file; else false
Generates backupbuddy_dat . php within the temporary directory containing the random serial in its name . This file contains a serialized array that has been XOR encrypted for security . The XOR key is backupbuddy_SERIAL where SERIAL is the randomized set of characters in the ZIP filename . This file contains various information about the source site . @param string $trigger What triggered this backup . Valid values : scheduled manual . @return boolean true on success making dat file ; else false
function backup_create_dat_file( $trigger ) {
		$settings = array(
			'start_time'			=> $this->_backup['start_time'],
			'backup_type'			=> $this->_backup['type'],
			'profile'				=> $this->_backup['profile'],
			'serial'				=> $this->_backup['serial'],
			'breakout_tables'		=> $this->_backup['breakout_tables'],
			'table_sizes'			=> $this->_backup['table_sizes'],
			'force_single_db_file'	=> $this->_backup['force_single_db_file'],
			'deployment_direction'	=> $this->_backup['deployment_direction'],
			'trigger'				=> $this->_backup['trigger'],
			'skip_database_dump'	=> $this->_backup['profile']['skip_database_dump'],
			'db_excludes'			=> backupbuddy_core::get_mysqldump_additional( 'excludes', $this->_backup['profile'] ),
			'db_includes'			=> backupbuddy_core::get_mysqldump_additional( 'includes', $this->_backup['profile'] ),
			'custom_root'			=> $this->_backup['custom_root'],
		);
		$dat_file = $this->_backup['temp_directory'] . 'backupbuddy_dat.php';
		$dat_content = backupbuddy_core::render_dat_contents( $settings, $dat_file );
		if ( ! is_array( $dat_content ) ) {
			pb_backupbuddy::status( 'error', 'Error #34894834: Unable to render DAT file. Check permissions. Details: `' . $dat_content . '`. Fatal error.' );
			return false;
		}
		if ( true === $dat_content['wp-config_in_parent'] ) {
			if ( true === copy( dirname( ABSPATH ) . '/wp-config.php', $this->_backup['temp_directory'] . 'wp-config.php' ) ) {
				pb_backupbuddy::status( 'details', 'Copied wp-config.php from parent directory into working temp directory for backup.' );
			} else {
				pb_backupbuddy::status( 'error', 'Error #82394474: Failed to copy wp-config.php from parent directory into working temp directory for backup.' );
			}
		}
		pb_backupbuddy::status( 'details', __('Finished creating DAT (data) file.', 'it-l10n-backupbuddy' ) );
		return true;
	}
function backup_create_dat_file ( $ trigger ) { $ settings = array ( 'start_time' => $ this -> _backup [ 'start_time' ] , 'backup_type' => $ this -> _backup [ 'type' ] , 'profile' => $ this -> _backup [ 'profile' ] , 'serial' => $ this -> _backup [ 'serial' ] , 'breakout_tables' => $ this -> _backup [ 'breakout_tables' ] , 'table_sizes' => $ this -> _backup [ 'table_sizes' ] , 'force_single_db_file' => $ this -> _backup [ 'force_single_db_file' ] , 'deployment_direction' => $ this -> _backup [ 'deployment_direction' ] , 'trigger' => $ this -> _backup [ 'trigger' ] , 'skip_database_dump' => $ this -> _backup [ 'profile' ] [ 'skip_database_dump' ] , 'db_excludes' => backupbuddy_core :: get_mysqldump_additional ( 'excludes' , $ this -> _backup [ 'profile' ] ) , 'db_includes' => backupbuddy_core :: get_mysqldump_additional ( 'includes' , $ this -> _backup [ 'profile' ] ) , 'custom_root' => $ this -> _backup [ 'custom_root' ] , ) ; $ dat_file = $ this -> _backup [ 'temp_directory' ] . 'backupbuddy_dat.php' ; $ dat_content = backupbuddy_core :: render_dat_contents ( $ settings , $ dat_file ) ; if ( ! is_array ( $ dat_content ) ) { pb_backupbuddy :: status ( 'error' , 'Error #34894834: Unable to render DAT file. Check permissions. Details: `' . $ dat_content . '`. Fatal error.' ) ; return false ; } if ( true === $ dat_content [ 'wp-config_in_parent' ] ) { if ( true === copy ( dirname ( ABSPATH ) . '/wp-config.php' , $ this -> _backup [ 'temp_directory' ] . 'wp-config.php' ) ) { pb_backupbuddy :: status ( 'details' , 'Copied wp-config.php from parent directory into working temp directory for backup.' ) ; } else { pb_backupbuddy :: status ( 'error' , 'Error #82394474: Failed to copy wp-config.php from parent directory into working temp directory for backup.' ) ; } } pb_backupbuddy :: status ( 'details' , __ ( 'Finished creating DAT (data) file.' , 'it-l10n-backupbuddy' ) ) ; return true ; }
backup_create_dat_file()
backup_create_dat_file ()
// Handle wp-config.php file in a parent directory, copying to temp location.