Author: Derick Rethans Date: 2006-12-14 15:26:37 +0100 (Thu, 14 Dec 2006) New Revision: 4289
Log: - CS changes (automatic script) Modified: trunk/Archive/src/archive.php trunk/Archive/src/file/block_file.php trunk/Archive/src/file/character_file.php trunk/Archive/src/file/file.php trunk/Archive/src/tar/v7_tar.php trunk/Archive/src/zip/headers/zip_local_file.php trunk/Archive/src/zip/zip.php trunk/Archive/tests/archive_test.php trunk/Archive/tests/compressed_archives/bzip2_test.php trunk/Archive/tests/compressed_archives/zlib_test.php trunk/Archive/tests/file/block_file_test.php trunk/Archive/tests/tar/ustar_tar_test.php trunk/Archive/tests/tar/v7_tar_test.php trunk/Archive/tests/zip/zip_test.php Modified: trunk/Archive/src/archive.php =================================================================== --- trunk/Archive/src/archive.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/archive.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -422,7 +422,7 @@ */ public function extractCurrent( $target, $keepExisting = false ) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); if ( !$this->valid() ) { @@ -489,8 +489,8 @@ case ezcArchiveEntry::IS_SYMBOLIC_LINK: if ( $isWindows ) { - //FIXME.. need to be sure that target file - //already extracted before copying it to link destination. + // FIXME.. need to be sure that target file + // already extracted before copying it to link destination. $sourcePath = dirname( $fileName ).'/'.$entry->getLink(); $fileName = str_replace( '/', '\\', $fileName ); copy( $sourcePath, $fileName ); @@ -558,7 +558,7 @@ */ public function seek( $offset, $whence = SEEK_SET ) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); // Cannot trust the current position if the current position is invalid. if ( $whence == SEEK_CUR && $this->valid() == false ) @@ -689,7 +689,7 @@ */ public function getListing() { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); $result = array(); $this->rewind(); @@ -711,7 +711,7 @@ */ public function __toString() { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); $result = ""; $this->rewind(); @@ -743,7 +743,7 @@ */ public function extract( $target, $keepExisting = false ) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); $this->rewind(); if ( !$this->valid() ) Modified: trunk/Archive/src/file/block_file.php =================================================================== --- trunk/Archive/src/file/block_file.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/file/block_file.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -177,16 +177,16 @@ if ( $this->isValid ) { // XXX move the calc to readmode? - //$this->switchReadMode( ( $this->blockNumber + 1 ) * $this->blockSize ); + // $this->switchReadMode( ( $this->blockNumber + 1 ) * $this->blockSize ); // Read one block. $this->blockData = fread( $this->fp, $this->blockSize ); if ( strlen( $this->blockData ) < $this->blockSize ) { - if( $this->lastBlock != -1 ) + if ( $this->lastBlock != -1 ) { - if( $this->blockNumber != $this->lastBlock ) + if ( $this->blockNumber != $this->lastBlock ) { die ("Something weird happened with the blockNumber. Lastblock number registered at " . $this->lastBlock . " but changed into " . $this->blockNumber ); } @@ -255,17 +255,17 @@ throw new ezcBaseFilePermissionException( $this->fileName, ezcBaseFilePermissionException::WRITE, "The archive is opened in a read-only mode." ); } - if( !$this->isEmpty && $this->isValid) + if ( !$this->isEmpty && $this->isValid) { $needToTruncate = true; $currentBlock = $this->blockNumber; // Do we need to truncate the file? // Check if we already read the entire file. This way is quicker to check. - if( $this->lastBlock != -1 ) + if ( $this->lastBlock != -1 ) { // Last block is known. - if( $this->lastBlock == $this->blockNumber ) + if ( $this->lastBlock == $this->blockNumber ) { // We are at the last block. $needToTruncate = false; @@ -274,16 +274,16 @@ else { // The slower method. Check if we can read the next block. - if( !$this->next() ) + if ( !$this->next() ) { // We got a next block. $needToTruncate = false; } } - if( $needToTruncate ) + if ( $needToTruncate ) { - if( $this->fileAccess == self::READ_APPEND ) + if ( $this->fileAccess == self::READ_APPEND ) { // Sorry, don't know how to truncate this file (except copying everything). throw new ezcArchiveException( "Cannot truncate the file" ); @@ -291,7 +291,7 @@ echo ("\nNEED TO TRUNCATE\n"); - if( $this->blockNumber < $this->lastBlock ) + if ( $this->blockNumber < $this->lastBlock ) { echo ("blocknumber: " . $this->blockNumber ."\n"); echo ("Last block: " . $this->lastBlock ."\n" ); @@ -307,10 +307,10 @@ } else { - if( !$this->isEmpty && !$this->isValid ) + if ( !$this->isEmpty && !$this->isValid ) { echo ("WARNING, should not append to a non-empty, non-valid block. Assuming the end.\n"); - //throw new ezcArchiveException ("Not at a valid block position to append"); + // throw new ezcArchiveException ("Not at a valid block position to append"); } } } @@ -390,14 +390,14 @@ $this->switchWriteMode(); $localFile = @fopen( $fileName, "rb"); - if( !$localFile ) + if ( !$localFile ) { throw new ezcArchiveException( "Cannot open the file: <$fileName> for reading." ); } $addedBlocks = 0; $length = 0; - while( !feof( $localFile ) && ( $data = fread( $localFile, $this->blockSize ) ) !== false ) + while ( !feof( $localFile ) && ( $data = fread( $localFile, $this->blockSize ) ) !== false ) { $addedBlocks++; $length = $this->writeBytes( $data ); @@ -488,9 +488,9 @@ public function truncate( $blocks = 0 ) { // Empty files don't need to be truncated. - if( $this->isEmpty() ) return true; + if ( $this->isEmpty() ) return true; - if( $this->fileAccess !== self::READ_APPEND ) + if ( $this->fileAccess !== self::READ_APPEND ) { // We can read-write in the file. Easy. $pos = $blocks * $this->blockSize; @@ -511,24 +511,24 @@ return true; } - // + // // Truncate the whole file. - if( $blocks == 0 ) + if ( $blocks == 0 ) { die("Truncate whole file"); } // Truncate at the end? - if( !$this->isValid ) + if ( !$this->isValid ) { $this->rewind(); } // XXX check this, can be done via getLastBlockNumber() ? - while( $this->isValid && $blocks > $this->blockNumber ) $this->next(); + while ( $this->isValid && $blocks > $this->blockNumber ) $this->next(); - if( $this->isValid ) + if ( $this->isValid ) { die ("CANNOT TRUNCATE 1234RAY"); } @@ -542,7 +542,7 @@ // If we are not at a valid position or we are too far in the file then rewind. - if( !$this->isValid || $blocks < $this->blockNumber) $this->rewind(); + if ( !$this->isValid || $blocks < $this->blockNumber) $this->rewind(); // Read the next block. while ( $blocks < $this->blockNumber ) $this->next(); @@ -552,7 +552,7 @@ - if( $this->lastBlock == -1 ) + if ( $this->lastBlock == -1 ) { // Didn't read the entire file, yet. @@ -565,10 +565,10 @@ // Since we can only read or only write to the file, we have some limitations. - if( $this->readWriteSwitch >= 0 ) + if ( $this->readWriteSwitch >= 0 ) { - if( $blocks == 0 ) + if ( $blocks == 0 ) { $this->isEmpty = true; die ("TRUNCATING TO ZERO: FIX" ); @@ -581,9 +581,9 @@ } $this->next(); - while( $this->next() && $blocks > $this->blockNumber ); + while ( $this->next() && $blocks > $this->blockNumber ); - if( $blocks > $this->blockNumber ) + if ( $blocks > $this->blockNumber ) { return true; } @@ -593,9 +593,9 @@ /* // Maybe we just want to write to the next block. - if( $blocks == $this->blockNumber + 1 ) + if ( $blocks == $this->blockNumber + 1 ) { - if( $this->next() === false ) + if ( $this->next() === false ) { // Perfect, we are at the last block. @@ -646,16 +646,16 @@ */ public function seek( $blockOffset, $whence = SEEK_SET ) { - if( $this->fileAccess == self::WRITE_ONLY && $blockOffset == 0 && $whence == SEEK_END ) return true; + if ( $this->fileAccess == self::WRITE_ONLY && $blockOffset == 0 && $whence == SEEK_END ) return true; - if( ftell( $this->fp ) === false || $this->fileAccess == self::READ_APPEND) + if ( ftell( $this->fp ) === false || $this->fileAccess == self::READ_APPEND) { // Okay, cannot tell the current file position. // This happens with some compression streams. - if( !$this->isValid ) + if ( !$this->isValid ) { - if( $whence == SEEK_CUR ) + if ( $whence == SEEK_CUR ) { throw new ezcArchiveException("Cannot seek SEEK_CUR with an invalid block position"); } @@ -663,35 +663,35 @@ $this->rewind(); } - if( $whence == SEEK_END && $this->lastBlock == -1 ) + if ( $whence == SEEK_END && $this->lastBlock == -1 ) { - if( $blockOffset > 0 ) + if ( $blockOffset > 0 ) { die ("This requires us to read the file twice. Try not to do this"); } // Go to the end. - while( $this->next() ); + while ( $this->next() ); // We are a bit too far. Sneak back position. - //die( "SNEAK BACK"); - //SHOULD GO GREIT + // die( "SNEAK BACK"); + // SHOULD GO GREIT } - switch($whence ) + switch ($whence ) { case SEEK_CUR: $searchBlock = $this->blockNumber += $blockOffset; break; case SEEK_END: $searchBlock = $this->lastBlock += $blockOffset; break; case SEEK_SET: $searchBlock = $blockOffset; break; } - if( $searchBlock < $this->blockNumber ) + if ( $searchBlock < $this->blockNumber ) { $this->rewind(); } - while( $this->isValid && $this->blockNumber < $searchBlock ) $this->next(); + while ( $this->isValid && $this->blockNumber < $searchBlock ) $this->next(); return ( $this->blockNumber == $searchBlock ); } @@ -713,7 +713,7 @@ $this->positionSeek( $pos, $whence ); } - if( ftell( $this->fp ) === false ) + if ( ftell( $this->fp ) === false ) { throw new ezcArchiveException( "Cannot tell the current position, but this is after the position seek. " ); } Modified: trunk/Archive/src/file/character_file.php =================================================================== --- trunk/Archive/src/file/character_file.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/file/character_file.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -29,7 +29,7 @@ * * @var string */ - private $character; //FIXME. + private $character; // FIXME. /** * The current character position Modified: trunk/Archive/src/file/file.php =================================================================== --- trunk/Archive/src/file/file.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/file/file.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -107,11 +107,11 @@ protected function openFile( $fileName, $createIfNotExist ) { - if( $createIfNotExist && !self::fileExists( $fileName ) ) + if ( $createIfNotExist && !self::fileExists( $fileName ) ) { $this->isNew = true; $this->isEmpty = true; - if( !self::touch( $fileName ) ) + if ( !self::touch( $fileName ) ) { throw new ezcBaseFilePermissionException( self::getPureFileName( $fileName ), ezcBaseFilePermissionException::WRITE ); } @@ -136,7 +136,7 @@ // Check if we opened the file. if ( !$this->fp ) { - if( !self::fileExists( $fileName ) ) + if ( !self::fileExists( $fileName ) ) { throw new ezcBaseFileNotFoundException( $fileName ); } @@ -156,13 +156,13 @@ } // Why is it read only? - if( $this->fileAccess == self::READ_ONLY ) + if ( $this->fileAccess == self::READ_ONLY ) { - if( $this->fileMetaData["wrapper_type"] == "ZLIB" || $this->fileMetaData["wrapper_type"] == "BZip2" ) + if ( $this->fileMetaData["wrapper_type"] == "ZLIB" || $this->fileMetaData["wrapper_type"] == "BZip2" ) { // Append mode available? $b = @fopen( $fileName, "ab" ); - if( $b !== false ) + if ( $b !== false ) { // We have also a write-only mode. fclose( $b ); @@ -176,10 +176,10 @@ // Maybe we should write only to the archive. // Test this only, when the archive is new. - if( $this->isNew ) + if ( $this->isNew ) { $b = @fopen( $fileName, "wb" ); - if( $b !== false ) + if ( $b !== false ) { // XXX Clean up. $this->fp = $b; @@ -198,7 +198,7 @@ } // Check if the archive is empty. - if( fgetc( $this->fp ) === false ) + if ( fgetc( $this->fp ) === false ) { $this->isEmpty = true; } @@ -228,13 +228,13 @@ public function switchWriteMode() { // Switch only when we are in read (only) mode. - if( $this->fileAccess == self::READ_APPEND && $this->readAppendSwitch == self::SWITCH_READ ) + if ( $this->fileAccess == self::READ_APPEND && $this->readAppendSwitch == self::SWITCH_READ ) { fclose( $this->fp ); $this->fp = @fopen( $this->fileName, "ab" ); - if ($this->fp === false ) + if ( $this->fp === false ) { - throw new ezcBaseFilePermissionException( self::getPureFileName( $this->fileName ), ezcBaseFilePermissionException::WRITE, "Cannot switch to write mode"); + throw new ezcBaseFilePermissionException( self::getPureFileName( $this->fileName ), ezcBaseFilePermissionException::WRITE, "Cannot switch to write mode" ); } $this->readAppendSwitch = self::SWITCH_APPEND; } @@ -243,26 +243,26 @@ public function switchReadMode( $pos = 0) { // Switch only when we are in write (only) mode. - if( $this->fileAccess == self::READ_APPEND && $this->readAppendSwitch == self::SWITCH_APPEND ) + if ( $this->fileAccess == self::READ_APPEND && $this->readAppendSwitch == self::SWITCH_APPEND ) { fclose( $this->fp ); $this->fp = fopen( $this->fileName, "rb" ); - //echo ("Switch read mode should seek to the end of the file "); + // echo ("Switch read mode should seek to the end of the file "); - if ($this->fp === false ) + if ( $this->fp === false ) { - throw new ezcBaseFilePermissionException( self::getPureFileName( $this->fileName ), ezcBaseFilePermissionException::READ, "Cannot switch back to read mode"); + throw new ezcBaseFilePermissionException( self::getPureFileName( $this->fileName ), ezcBaseFilePermissionException::READ, "Cannot switch back to read mode" ); } $this->readAppendSwitch = self::SWITCH_READ; - //$this->positionSeek( $pos ); + // $this->positionSeek( $pos ); $this->positionSeek( 0, SEEK_END ); // XXX DOESN'T Make sense, Seek-end should be at the end! - //echo ("nonsense function called"); - while( fgetc( $this->fp ) !== false); + // echo ("nonsense function called"); + while ( fgetc( $this->fp ) !== false ); } } @@ -295,12 +295,12 @@ // TODO: Multistream goes wrong. if ( strncmp( $fileName, "compress.zlib://", 16 ) == 0 ) { - return substr( $fileName, 16); + return substr( $fileName, 16 ); } if ( strncmp( $fileName, "compress.bzip2://", 17 ) == 0 ) { - return substr( $fileName, 17); + return substr( $fileName, 17 ); } return $fileName; @@ -337,7 +337,7 @@ protected function positionSeek( $pos, $whence = SEEK_SET) { // Seek the end of the file in a write only file always succeeds. - if( $this->fileAccess == self::WRITE_ONLY && $pos == 0 && $whence == SEEK_END ) return true; + if ( $this->fileAccess == self::WRITE_ONLY && $pos == 0 && $whence == SEEK_END ) return true; if ( $this->fileMetaData["seekable"] ) { @@ -400,7 +400,7 @@ public function close() { - if( is_resource( $this->fp ) ) + if ( is_resource( $this->fp ) ) { fclose( $this->fp ); $this->fp = null; Modified: trunk/Archive/src/tar/v7_tar.php =================================================================== --- trunk/Archive/src/tar/v7_tar.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/tar/v7_tar.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -94,7 +94,7 @@ $this->hasNullBlocks = $this->file->isNew() ? false : true; $this->addedBlocks = 0; - if( $this->file->getFileAccess() !== ezcArchiveFile::WRITE_ONLY) $this->readCurrentFromArchive(); + if ( $this->file->getFileAccess() !== ezcArchiveFile::WRITE_ONLY) $this->readCurrentFromArchive(); } public function __destruct() @@ -224,9 +224,9 @@ // Documentation is inherited. public function truncate( $fileNumber = 0) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); - if ($this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite()) + if ( $this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite() ) { throw new ezcBaseFilePermissionException( $this->file->getFileName(), ezcBaseFilePermissionException::WRITE, "Archive is read-only" ); } @@ -254,10 +254,10 @@ return false; } - if( !$this->file->truncate ( $endBlockNumber + 1 ) ) + if ( !$this->file->truncate ( $endBlockNumber + 1 ) ) { - throw new ezcArchiveException( "The archive cannot be truncated to " . ($endBlockNumber + 1) . " block(s). ". - "This happens with write-only files or stream (e.g. compress.zlib) "); + throw new ezcArchiveException( "The archive cannot be truncated to " . ( $endBlockNumber + 1 ) . " block(s). ". + "This happens with write-only files or stream (e.g. compress.zlib) " ); } $this->entriesRead = $fileNumber; @@ -271,19 +271,19 @@ // Documentation is inherited. public function appendToCurrent( $files, $prefix ) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); - if ($this->file->getFileAccess() !== ezcArchiveFile::READ_WRITE ) + if ( $this->file->getFileAccess() !== ezcArchiveFile::READ_WRITE ) { throw new ezcArchiveException( "Cannot appendToCurrent when writing to a read-only, write-only stream (e.g. compress.zlib)." ); } - if ($this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite()) + if ( $this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite() ) { throw new ezcBaseFilePermissionException( $this->file->getFileName(), ezcBaseFilePermissionException::WRITE ); } - $entries = $this->getEntries( $files, $prefix); + $entries = $this->getEntries( $files, $prefix ); $originalFileNumber = $this->fileNumber; for( $i = 0; $i < sizeof( $files ); $i++) @@ -312,25 +312,25 @@ */ public function append( $files, $prefix) { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); - if ($this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite()) + if ( $this->file->getFileAccess() === ezcArchiveFile::READ_ONLY || !$this->algorithmCanWrite() ) { throw new ezcArchiveException( "Archive is read-only" ); } // Appending to an existing archive with a compressed stream does not work because we have to remove the NULL-blocks. - if( $this->hasNullBlocks && $this->file->getFileAccess() !== ezcArchiveFile::READ_WRITE ) + if ( $this->hasNullBlocks && $this->file->getFileAccess() !== ezcArchiveFile::READ_WRITE ) { throw new ezcArchiveException( "Cannot append to this archive" ); } // Existing files need to be read, because we don't know if it contains NULL-blocks at the end of the archive. - if( $this->file->getFileAccess() !== ezcArchiveFile::WRITE_ONLY ) + if ( $this->file->getFileAccess() !== ezcArchiveFile::WRITE_ONLY ) $this->seek( 0, SEEK_END ); // Do the same as in appendToCurrent(). But we know that it's possible. - $entries = $this->getEntries( $files, $prefix); + $entries = $this->getEntries( $files, $prefix ); $originalFileNumber = $this->fileNumber; for( $i = 0; $i < sizeof( $files ); $i++) @@ -346,7 +346,7 @@ public function close() { - if( $this->file !== null ) + if ( $this->file !== null ) { $this->writeEnd(); @@ -357,13 +357,13 @@ public function writeEnd() { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); - if( $this->file->isModified() ) + if ( $this->file->isModified() ) { - if( !$this->hasNullBlocks ) + if ( !$this->hasNullBlocks ) { - if( $this->addedBlocksNotReliable ) + if ( $this->addedBlocksNotReliable ) { $this->appendNullBlocks(); } @@ -375,7 +375,7 @@ // 19 - 1 // 20 - 0 // 21 - 19 - $nullBlocks = ($this->blockFactor - ($this->addedBlocks % $this->blockFactor ) ) % $this->blockFactor; + $nullBlocks = ( $this->blockFactor - ( $this->addedBlocks % $this->blockFactor ) ) % $this->blockFactor; $this->file->appendNullBlock( $nullBlocks ); } @@ -428,7 +428,7 @@ $this->addedBlocks += $this->file->appendFile( $entry->getPath() ); } - if(!( $this->file->isNew() && $this->file->getFileAccess() === ezcArchiveFile::WRITE_ONLY )) + if ( !( $this->file->isNew() && $this->file->getFileAccess() === ezcArchiveFile::WRITE_ONLY ) ) { $this->addedBlocksNotReliable = true; } @@ -451,14 +451,14 @@ protected function appendNullBlocks() { $last = 0; - if( $this->file->getLastBlockNumber() == -1 ) + if ( $this->file->getLastBlockNumber() == -1 ) { - if( !$this->file->valid() ) + if ( !$this->file->valid() ) { $this->file->rewind(); } - while( $this->file->valid() ) + while ( $this->file->valid() ) { $last = $this->file->key(); $this->file->next(); @@ -475,10 +475,10 @@ /* */ - //echo ("Last block: " . $this->file->getLastBlockNumber() ); + // echo ("Last block: " . $this->file->getLastBlockNumber() ); // Need a ftell in the seek. - //$this->file->seek( 0, SEEK_END ); + // $this->file->seek( 0, SEEK_END ); $blockNumber = $last; Modified: trunk/Archive/src/zip/headers/zip_local_file.php =================================================================== --- trunk/Archive/src/zip/headers/zip_local_file.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/zip/headers/zip_local_file.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -500,7 +500,7 @@ { // Fixme, for now only decompressed. $this->compressionMethod = $compressionMethod; // FIXME - $this->compressedSize = $compressedSize; //FIXME + $this->compressedSize = $compressedSize; // FIXME } @@ -535,7 +535,7 @@ */ public function setHeaderFromArchiveEntry( ezcArchiveEntry $entry ) { - $this->version = 10; //FIXME + $this->version = 10; // FIXME $this->bitFlag = 0; // FIXME $this->atime = $entry->getAccessTime(); Modified: trunk/Archive/src/zip/zip.php =================================================================== --- trunk/Archive/src/zip/zip.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/src/zip/zip.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -455,7 +455,7 @@ */ public function isWritable() { - if( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); + if ( $this->file === null ) throw new ezcArchiveException( "The archive is closed" ); return ( !$this->file->isReadOnly() && $this->algorithmCanWrite() ); } Modified: trunk/Archive/tests/archive_test.php =================================================================== --- trunk/Archive/tests/archive_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/archive_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -122,7 +122,7 @@ exec( "bzip2 $dir/mytar.tar" ); $archive = ezcArchive::open( "compress.bzip2://$dir/mytar.tar.bz2" ); - //echo ( $archive ); + // echo ( $archive ); $archive->extract( $dir ); $archive->rewind(); @@ -398,7 +398,7 @@ } catch ( ezcArchiveEntryPrefixException $e ) { - //$this->assertEquals( ezcArchiveException::INVALID_PREFIX, $e->getCode() ); + // $this->assertEquals( ezcArchiveException::INVALID_PREFIX, $e->getCode() ); } } Modified: trunk/Archive/tests/compressed_archives/bzip2_test.php =================================================================== --- trunk/Archive/tests/compressed_archives/bzip2_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/compressed_archives/bzip2_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -94,7 +94,7 @@ $archive->append( "$dir/a.txt", $dir); $this->fail( "Expected a 'cannot-append' exception"); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } @@ -144,7 +144,7 @@ $archive->append( "$dir/a.txt", $dir); $this->fail( "Expected a 'cannot-append' exception"); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } @@ -167,7 +167,7 @@ $archive->appendToCurrent( "$dir/a.txt", $dir); $this->fail( "Except an exception that the file couldn't be appended."); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } } @@ -190,7 +190,7 @@ $archive->append( "$dir/a.txt", $dir ); $this->fail( "Except an exception that the file couldn't be appended."); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } } Modified: trunk/Archive/tests/compressed_archives/zlib_test.php =================================================================== --- trunk/Archive/tests/compressed_archives/zlib_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/compressed_archives/zlib_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -60,7 +60,7 @@ $archive->append( "$dir/a.txt", $dir); $this->fail( "Expected a 'cannot-append' exception"); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } @@ -105,7 +105,7 @@ $archive->append( "$dir/a.txt", $dir); $this->fail( "Expected a 'cannot-append' exception"); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } @@ -123,7 +123,7 @@ $archive->appendToCurrent( "$dir/a.txt", $dir); $this->fail( "Except an exception that the file couldn't be appended."); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } } @@ -141,7 +141,7 @@ $archive->append( "$dir/a.txt", $dir ); $this->fail( "Except an exception that the file couldn't be appended."); } - catch( ezcArchiveException $e ) + catch ( ezcArchiveException $e ) { } } Modified: trunk/Archive/tests/file/block_file_test.php =================================================================== --- trunk/Archive/tests/file/block_file_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/file/block_file_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -47,7 +47,7 @@ public function testCompressedStream() { $dir = $this->createTempDir("ezcArchive_"); - //$file = $dir . "/blockfile"; + // $file = $dir . "/blockfile"; $file = "compress.zlib://" . $dir . "/blockfile"; // Create the file. @@ -80,7 +80,7 @@ $bf->append("ZZ"); $this->fail( "Expected an exception that the block could not be appended in the middle" ); } - catch( ezcArchiveException $e ) { } + catch ( ezcArchiveException $e ) { } $bf->next(); $bf->append("ZZ"); @@ -577,7 +577,7 @@ $tmpFile = $this->createTempFile("tar_ustar_2_textfiles.tar"); $blockFile = new ezcArchiveBlockFile( $tmpFile ); - $blockFile->next(); //Block number: 1. + $blockFile->next(); // Block number: 1. $this->assertEquals(1, $blockFile->key() ); $blockFile->seek( 0, SEEK_CUR ); // Stay at the same block @@ -608,7 +608,7 @@ // // $this->assertEquals( -1, $blockFile->getLastBlockNumber(), "Last blocknumber supposed to be unknown" ); // -// while( $blockFile->next() ); +// while ( $blockFile->next() ); // // $this->assertEquals( 19, $blockFile->getLastBlockNumber(), "Last blocknumber supposed to be 19. (0 .. 19)" ); // @@ -641,7 +641,7 @@ // // // /* -// $blockFile->next(); //Block number: 1. +// $blockFile->next(); // Block number: 1. // $this->assertEquals(1, $blockFile->key() ); // // $blockFile->seek( 0, SEEK_CUR ); // Stay at the same block Modified: trunk/Archive/tests/tar/ustar_tar_test.php =================================================================== --- trunk/Archive/tests/tar/ustar_tar_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/tar/ustar_tar_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -54,7 +54,7 @@ if ( $this->isWindows() ) { - $pathItemLen = 50; //long but not looong path. Windows max path = 255. + $pathItemLen = 50; // long but not looong path. Windows max path = 255. } else { Modified: trunk/Archive/tests/tar/v7_tar_test.php =================================================================== --- trunk/Archive/tests/tar/v7_tar_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/tar/v7_tar_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -415,8 +415,8 @@ public function testExtractOneSymbolicLink() { - //this test a bit different in Windows as symlinks - //simulated by copying + // this test a bit different in Windows as symlinks + // simulated by copying if ( $this->isWindows() ) { // The directory should be created automatically. @@ -424,11 +424,11 @@ // and there are both the same file. $targetDir = $this->getTempDir(); - //extract target + // extract target $this->complexArchive->seek( 4 ); $this->complexArchive->extractCurrent( $targetDir ); - //"extract" link i.e. copy target + // "extract" link i.e. copy target $this->complexArchive->seek( 7 ); $this->complexArchive->extractCurrent( $targetDir ); } @@ -825,7 +825,7 @@ // Append the files again. $archive->appendToCurrent( $dir . "/file1.txt", $dir ); - //$this->assertTrue( $this->archive->next() !== false ); + // $this->assertTrue( $this->archive->next() !== false ); $archive->appendToCurrent( $dir . "/file2.txt", $dir ); $archive->close(); @@ -869,7 +869,7 @@ public function testAppendToCurrentSymbolicLink() { if ( !$this->canWrite ) return; - if ( $this->isWindows() ) return; //there is no sense to test it in Windows as its the same as appending file. + if ( $this->isWindows() ) return; // there is no sense to test it in Windows as its the same as appending file. $dir = $this->getTempDir(); $this->complexArchive->seek(7); Modified: trunk/Archive/tests/zip/zip_test.php =================================================================== --- trunk/Archive/tests/zip/zip_test.php 2006-12-14 14:11:58 UTC (rev 4288) +++ trunk/Archive/tests/zip/zip_test.php 2006-12-14 14:26:37 UTC (rev 4289) @@ -45,7 +45,7 @@ if ( $this->isWindows() ) { - return; //avoid warning + return; // avoid warning } unlink( 'does_not_exist' ); @@ -193,7 +193,7 @@ { if ( $this->isWindows() ) { - return; //symlinks extracted as files in Windows, so there is no sence to call is_link() + return; // symlinks extracted as files in Windows, so there is no sence to call is_link() } $dir = $this->getTempDir(); @@ -340,7 +340,7 @@ } - //FIXME.. file is written, instead of a link. + // FIXME.. file is written, instead of a link. public function testExtractOneSymbolicLink() { // The directory should be created automatically. @@ -476,7 +476,7 @@ $archive = $this->td->getArchive( "2_textfiles" ); $file = $this->td->getFileName( "2_textfiles" ); - //copy( "$dir/$file", "$dir/done_with_infozip.zip" ); + // copy( "$dir/$file", "$dir/done_with_infozip.zip" ); $archive->extractCurrent( $dir ); $archive->truncate(); -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components