src/FS/File/Arc/Zip.php
public function addFile( $fileName )
	{
		if( !file_exists( $fileName ) )													// Make sure the file we are adding exists!
			throw new Exception( 'File "'.$fileName.'" is not existing' );
		if( $this->containsFile( $fileName ) )											// Make sure there are no other files in the archive that have this same fileName
			throw new Exception( 'File "'.$fileName.'" already existing in TAR' );

		$fileName	= str_replace( "\\", "/", $fileName );
		$fileName	= str_replace( "./", "", $fileName );
		$fileInfo	= stat( $fileName );												// Get file information
		$file		= new File_Reader( $fileName );

		$this->numFiles++;																// Add file to processed data
		$activeFile					= &$this->files[];
		$activeFile['name']			= $fileName;
		$activeFile['mode']			= $fileInfo['mode'];
		$activeFile['user_id']		= $fileInfo['uid'];
		$activeFile['group_id']		= $fileInfo['gid'];
		$activeFile['size']			= $fileInfo['size'];
		$activeFile['time']			= $fileInfo['mtime'];
#		$activeFile['checksum']		= $checksum;
		$activeFile['user_name']	= '';
		$activeFile['group_name']	= '';
		$activeFile['file']			= $file->readString();								// Read in the file's contents
		return TRUE;
	}
public function addFile( $fileName )
	{
		if( !file_exists( $fileName ) )													// Make sure the file we are adding exists!
			throw new Exception( 'File "'.$fileName.'" is not existing' );
		if( $this->containsFile( $fileName ) )											// Make sure there are no other files in the archive that have this same fileName
			throw new Exception( 'File "'.$fileName.'" already existing in TAR' );

		$fileName	= str_replace( "\\", "/", $fileName );
		$fileName	= str_replace( "./", "", $fileName );
		$fileInfo	= stat( $fileName );												// Get file information
		$file		= new File_Reader( $fileName );

		$this->numFiles++;																// Add file to processed data
		$activeFile					= &$this->files[];
		$activeFile['name']			= $fileName;
		$activeFile['mode']			= $fileInfo['mode'];
		$activeFile['user_id']		= $fileInfo['uid'];
		$activeFile['group_id']		= $fileInfo['gid'];
		$activeFile['size']			= $fileInfo['size'];
		$activeFile['time']			= $fileInfo['mtime'];
#		$activeFile['checksum']		= $checksum;
		$activeFile['user_name']	= '';
		$activeFile['group_name']	= '';
		$activeFile['file']			= $file->readString();								// Read in the file's contents
		return TRUE;
	}
public function addFile ( $ fileName ) { if ( ! file_exists ( $ fileName ) ) // Make sure the file we are adding exists! throw new Exception ( 'File "' . $ fileName . '" is not existing' ) ; if ( $ this -> containsFile ( $ fileName ) ) // Make sure there are no other files in the archive that have this same fileName throw new Exception ( 'File "' . $ fileName . '" already existing in TAR' ) ; $ fileName = str_replace ( "\\" , "/" , $ fileName ) ; $ fileName = str_replace ( "./" , "" , $ fileName ) ; $ fileInfo = stat ( $ fileName ) ; // Get file information $ file = new File_Reader ( $ fileName ) ; $ this -> numFiles ++ ; // Add file to processed data $ activeFile = & $ this -> files [ ] ; $ activeFile [ 'name' ] = $ fileName ; $ activeFile [ 'mode' ] = $ fileInfo [ 'mode' ] ; $ activeFile [ 'user_id' ] = $ fileInfo [ 'uid' ] ; $ activeFile [ 'group_id' ] = $ fileInfo [ 'gid' ] ; $ activeFile [ 'size' ] = $ fileInfo [ 'size' ] ; $ activeFile [ 'time' ] = $ fileInfo [ 'mtime' ] ; #		$activeFile['checksum']		= $checksum; $ activeFile [ 'user_name' ] = '' ; $ activeFile [ 'group_name' ] = '' ; $ activeFile [ 'file' ] = $ file -> readString ( ) ; // Read in the file's contents return TRUE ; }
Adds a File to the TAR Archive by its Path, depending on current working Directory.
@access		public
@param		stromg		$fileName			Path of File to add
@return		bool
Adds a File to the TAR Archive by its Path depending on current working Directory .