public/wordpress/wp-content/plugins/backupbuddy/lib/xzipbuddy/zipbuddy.php
/**
		 *	file_exists()
		 *	
		 *	Tests whether a file (with path) exists in the given zip file
		 *	If leave_open is true then the zip object will be left open for faster checking for subsequent files within this zip
		 *	
		 *	@param		string	$zip_file		The zip file to check
		 *	@param		string	$locate_file	The file to test for
		 *	@param		bool	$leave_open		Optional: True if the zip file should be left open
		 *	@return		bool					True if the file is found in the zip otherwise false
		 *
		 */


Tests whether a file (with path) exists in the given zip file
If leave_open is true then the zip object will be left open for faster checking for subsequent files within this zip

@param          string  $zip_file               The zip file to check
@param          string  $locate_file    The file to test for
@param          bool    $leave_open             Optional: True if the zip file should be left open
@return         bool                                    True if the file is found in the zip otherwise false
Tests whether a file ( with path ) exists in the given zip file If leave_open is true then the zip object will be left open for faster checking for subsequent files within this zip @param string $zip_file The zip file to check @param string $locate_file The file to test for @param bool $leave_open Optional : True if the zip file should be left open @return bool True if the file is found in the zip otherwise false
public function file_exists( $zip_file, $locate_file, $leave_open = false ) {
			$zip_methods = array();
			$zip_methods = $this->_zip_methods;
			if ( empty( $zip_methods ) ) {
				$this->log( 'details', __('Failed to check file exists - no available methods.','it-l10n-backupbuddy' ) );
				return false;
			}
			foreach ( $zip_methods as $method_tag ) {
				if ( $this->_zip_methods_details[ $method_tag ][ 'attr' ][ 'is_checker' ] === true ) {
					$class_name = 'pluginbuddy_zbzip' . $method_tag;
					$zipper = new $class_name( $this );
					$zipper->set_logger( $this->_default_child_logger );
					$zipper->set_method_details( $this->_zip_methods_details[ $method_tag ] );
					$result = $zipper->file_exists( $zip_file, $locate_file, $leave_open );
					if ( !is_array( $result ) ) {
						unset( $zipper );
						return $result;
					} else {
						unset( $zipper );
					}
				}
			}
			$this->log( 'details', sprintf( __('Unable to check if file exists (looking for %1$s in %2$s): No compatible zip method found.','it-l10n-backupbuddy' ), $locate_file, $zip_file ) );
			return false;
		}
public function file_exists ( $ zip_file , $ locate_file , $ leave_open = false ) { $ zip_methods = array ( ) ; $ zip_methods = $ this -> _zip_methods ; if ( empty ( $ zip_methods ) ) { $ this -> log ( 'details' , __ ( 'Failed to check file exists - no available methods.' , 'it-l10n-backupbuddy' ) ) ; return false ; } foreach ( $ zip_methods as $ method_tag ) { if ( $ this -> _zip_methods_details [ $ method_tag ] [ 'attr' ] [ 'is_checker' ] === true ) { $ class_name = 'pluginbuddy_zbzip' . $ method_tag ; $ zipper = new $ class_name ( $ this ) ; $ zipper -> set_logger ( $ this -> _default_child_logger ) ; $ zipper -> set_method_details ( $ this -> _zip_methods_details [ $ method_tag ] ) ; $ result = $ zipper -> file_exists ( $ zip_file , $ locate_file , $ leave_open ) ; if ( ! is_array ( $ result ) ) { unset ( $ zipper ) ; return $ result ; } else { unset ( $ zipper ) ; } } } $ this -> log ( 'details' , sprintf ( __ ( 'Unable to check if file exists (looking for %1$s in %2$s): No compatible zip method found.' , 'it-l10n-backupbuddy' ) , $ locate_file , $ zip_file ) ) ; return false ; }
file_exists()
file_exists ()
// Better make sure we have some available methods // Hmm, we don't seem to have any available methods, oops, best go no further // Iterate over the methods - once we succeed just return directly otherwise drop through // First make sure we can check file existence with this method (ignore silently if not) // Note: has to be able to unzip as well but if that functionality wasn't available in // the method the is_checker attribute will have been set false // We need to tell the method what details belong to it // Now we are ready to try and test for the file existence // Will be true/false if file found/not-found otherwise error information array // Either we found the file or we didn't but we have a valid result // We have to return here because we cannot break out of foreach // The zipper encountered an error so we need to drop through and loop round to try another // We'll not process the result here, just drop through silently (the method will have logged it)			 // If we got this far then no method to check backup content was available or worked