public/wordpress/wp-content/plugins/backupbuddy/_importbuddy/_importbuddy.php
/**
*	unpack_importbuddy()
*
*	Unpacks required files encoded in importbuddy.php into stand-alone files.
*
*	@return		null
*/
unpack_importbuddy()
Unpacks required files encoded in importbuddy.php into stand-alone files.
unpack_importbuddy () Unpacks required files encoded in importbuddy . php into stand - alone files .
function unpack_importbuddy( $ignore_not_writable = false ) {
	if ( ( ! is_writable( ABSPATH ) ) && ( false === $ignore_not_writable ) ) {
		echo 'Error #224834. This directory, `' . ABSPATH . '`, is not write enabled according to the server. Please verify proper write permissions to continue. If this persists, contact your web hosting provider and tell them that is_writable("' . ABSPATH . '") returns FALSE in PHP.';
		die();
	} else {
		$unpack_file = '';
		$handle = @fopen( __FILE__, 'r' );
		if ( $handle ) {
			while ( ( $buffer = fgets( $handle ) ) !== false ) {
				if ( substr( $buffer, 0, 11 ) == '###PACKDATA' ) {
					$packdata_commands = explode( ',', trim( $buffer ) );
					array_shift( $packdata_commands );
					if ( $packdata_commands[0] == 'BEGIN' ) {
					} elseif ( $packdata_commands[0] == 'FILE_START' ) {
						$unpack_file = $packdata_commands[2];
					} elseif ( $packdata_commands[0] == 'FILE_END' ) {
						$unpack_file = '';
					} elseif ( $packdata_commands[0] == 'END' ) {
						return;
					}
				} else {
					if ( $unpack_file != '' ) {
						if ( !is_dir( dirname( ABSPATH . $unpack_file ) ) ) {
							$mkdir_result = mkdir( dirname( ABSPATH . $unpack_file ), 0777, true ); 
							if ( $mkdir_result === false ) {
								echo 'Error #54455. Unable to mkdir `' . dirname( ABSPATH . $unpack_file ) . '`<br>';
							}
						}
						$fileput_result = file_put_contents( ABSPATH . $unpack_file, base64_decode( $buffer ) );
						if ( $fileput_result === false ) {
							echo 'Error #65656. Unable to put file contents to `' . ABSPATH . $unpack_file . '`.<br>';
						}
					}
				}
			}
			if ( !feof( $handle ) ) {
				echo "Error: unexpected fgets() fail.<br>";
			}
			fclose( $handle );
		} else {
			echo 'ERROR #54455: Unable to open `' . __FILE__ . '` file for reading in packaged data.<br>';
		}
	}
}
function unpack_importbuddy ( $ ignore_not_writable = false ) { if ( ( ! is_writable ( ABSPATH ) ) && ( false === $ ignore_not_writable ) ) { echo 'Error #224834. This directory, `' . ABSPATH . '`, is not write enabled according to the server. Please verify proper write permissions to continue. If this persists, contact your web hosting provider and tell them that is_writable("' . ABSPATH . '") returns FALSE in PHP.' ; die ( ) ; } else { $ unpack_file = '' ; $ handle = @ fopen ( __FILE__ , 'r' ) ; if ( $ handle ) { while ( ( $ buffer = fgets ( $ handle ) ) !== false ) { if ( substr ( $ buffer , 0 , 11 ) == '###PACKDATA' ) { $ packdata_commands = explode ( ',' , trim ( $ buffer ) ) ; array_shift ( $ packdata_commands ) ; if ( $ packdata_commands [ 0 ] == 'BEGIN' ) { } elseif ( $ packdata_commands [ 0 ] == 'FILE_START' ) { $ unpack_file = $ packdata_commands [ 2 ] ; } elseif ( $ packdata_commands [ 0 ] == 'FILE_END' ) { $ unpack_file = '' ; } elseif ( $ packdata_commands [ 0 ] == 'END' ) { return ; } } else { if ( $ unpack_file != '' ) { if ( ! is_dir ( dirname ( ABSPATH . $ unpack_file ) ) ) { $ mkdir_result = mkdir ( dirname ( ABSPATH . $ unpack_file ) , 0777 , true ) ; if ( $ mkdir_result === false ) { echo 'Error #54455. Unable to mkdir `' . dirname ( ABSPATH . $ unpack_file ) . '`<br>' ; } } $ fileput_result = file_put_contents ( ABSPATH . $ unpack_file , base64_decode ( $ buffer ) ) ; if ( $ fileput_result === false ) { echo 'Error #65656. Unable to put file contents to `' . ABSPATH . $ unpack_file . '`.<br>' ; } } } } if ( ! feof ( $ handle ) ) { echo " Error: unexpected fgets() fail.<br> " ; } fclose ( $ handle ) ; } else { echo 'ERROR #54455: Unable to open `' . __FILE__ . '` file for reading in packaged data.<br>' ; } } }
unpack_importbuddy()
Unpacks required files encoded in importbuddy.php into stand-alone files.
unpack_importbuddy () Unpacks required files encoded in importbuddy . php into stand - alone files .
// Start packed data. // second param makes recursive.