File_Archive
[ class tree: File_Archive ] [ index: File_Archive ] [ all elements ]

Class: File_Archive_Reader_ChangeName

Source Location: /File_Archive-1.5.5/File/Archive/Reader/ChangeName.php

Class Overview

File_Archive_Reader
   |
   --File_Archive_Reader_Relay
      |
      --File_Archive_Reader_ChangeName

Base class for readers that need to modify the name of files


Author(s):

Copyright:

  • 1997-2005 The PHP Group

Methods


Child classes:

File_Archive_Reader_ChangeName_Callback
Discard the directory structure in a reader
File_Archive_Reader_ChangeName_AddDirectory
Add a directory to the public name of all the files of a reader
File_Archive_Reader_ChangeName_Directory
Change a directory name to another

Inherited Variables

Inherited Methods

Class: File_Archive_Reader_Relay

File_Archive_Reader_Relay::File_Archive_Reader_Relay()
File_Archive_Reader_Relay::close()
File_Archive_Reader_Relay::getData()
File_Archive_Reader_Relay::getDataFilename()
File_Archive_Reader_Relay::getFilename()
File_Archive_Reader_Relay::getMime()
File_Archive_Reader_Relay::getStat()
File_Archive_Reader_Relay::makeAppendWriter()
File_Archive_Reader_Relay::makeWriterRemoveBlocks()
File_Archive_Reader_Relay::makeWriterRemoveFiles()
File_Archive_Reader_Relay::next()
File_Archive_Reader_Relay::rewind()
File_Archive_Reader_Relay::skip()
File_Archive_Reader_Relay::tell()

Class: File_Archive_Reader

File_Archive_Reader::close()
Put back the reader in the state it was before the first call
File_Archive_Reader::extract()
Sends the whole reader to $writer and close the reader
File_Archive_Reader::extractFile()
Extract only one file (given by the URL)
File_Archive_Reader::getData()
Reads some data from the current file
File_Archive_Reader::getDataFilename()
If the current file of the archive is a physical file,
File_Archive_Reader::getFileList()
Returns the list of filenames from the current pos to the end of the source The source will be closed after having called this function This function goes through the whole archive (which may be slow).
File_Archive_Reader::getFilename()
Returns the name of the file currently read by the reader
File_Archive_Reader::getMime()
Returns the MIME associated with the current file
File_Archive_Reader::getStandardURL()
Returns the standard path
File_Archive_Reader::getStat()
Returns an array of statistics about the file (see the PHP stat function for more information)
File_Archive_Reader::makeAppendWriter()
Return a writer that allows appending files to the archive After having called makeAppendWriter, $this is closed and should not be used until the returned writer is closed.
File_Archive_Reader::makeWriterRemove()
Returns a writer that removes the current file
File_Archive_Reader::makeWriterRemoveBlocks()
Return a writer that has the same properties as the one returned by makeWriter, but after having removed a block of data from the current file. The writer will append data to the current file no data (other than the block) will be removed
File_Archive_Reader::makeWriterRemoveFiles()
Return a writer that has the same properties as the one returned by makeAppendWriter, but after having removed all the files that follow a given predicate.
File_Archive_Reader::next()
Move to the next file or folder in the reader
File_Archive_Reader::remove()
Removes the current file from the reader
File_Archive_Reader::rewind()
Move the current position back of a given amount of bytes.
File_Archive_Reader::select()
Move to the next file whose name is in directory $filename or is exactly $filename
File_Archive_Reader::sendData()
Sends the current file to the Writer $writer
File_Archive_Reader::skip()
Skip some data and returns how many bytes have been skipped
File_Archive_Reader::tell()
Returns the current offset in the current file

Class Details

[line 44]
Base class for readers that need to modify the name of files


[ Top ]


Method Detail

File_Archive_Reader_ChangeName (Constructor)   [line 51]

File_Archive_Reader_ChangeName File_Archive_Reader_ChangeName( File_Archive_Reader &$source)

Constructor

Parameters:

File_Archive_Reader   &$source   —  The archive reader to relay

[ Top ]

getFileList   [line 117]

array getFileList( )

Returns the list of filenames from the current pos to the end of the source

The source will be closed after having called this function This function goes through the whole archive (which may be slow). If you intend to work on the reader, doing it in one pass would be faster

  • Return: filenames from the current pos to the end of the source
  • See: File_Archive_Reader::getFileList()

Overrides File_Archive_Reader::getFileList() (Returns the list of filenames from the current pos to the end of the source The source will be closed after having called this function This function goes through the whole archive (which may be slow).)
[ Top ]

getFilename   [line 101]

string getFilename( )

Returns the name of the file currently read by the reader

Warning: undefined behaviour if no call to next have been done or if last call to next has returned false

  • Return: Name of the current file
  • See: File_Archive_Reader::getFilename()

Overrides File_Archive_Reader_Relay::getFilename() (parent method not documented)
[ Top ]

modifyName   [line 64]

string modifyName( string $name)

Modify the name
  • Return: New name as shown by this reader or false is the file or directory has to be skipped

Overridden in child classes as:

File_Archive_Reader_ChangeName_Callback::modifyName()
File_Archive_Reader_ChangeName_AddDirectory::modifyName()
Modify the name by adding baseName to it
File_Archive_Reader_ChangeName_Directory::modifyName()

Parameters:

string   $name   —  Name as in the inner reader

[ Top ]

select   [line 141]

array select( string $filename, [boolaen $close = true])

Returns the list of filenames from the current pos to the end of the source

The source will be closed after having called this function This function goes through the whole archive (which may be slow). If you intend to work on the reader, doing it in one pass would be faster

  • Return: filenames from the current pos to the end of the source
  • See: File_Archive_Reader::select()

Overrides File_Archive_Reader::select() (Move to the next file whose name is in directory $filename or is exactly $filename)

Parameters:

string   $filename   —  Filename to choose
boolaen   $close   —  Do we close the source after?

[ Top ]

unmodifyName   [line 87]

string unmodifyName( string $name)

Modify the name back to the inner reader naming style If implemented, unmodifyName(modifyName($name)) should be true

unmodifyName can be left unimplemented, this may only impact the efficiency of the select function (a full look up will be done when something more efficient with an index for example could be used on the inner reader of the original name is known).

unmodifyName may be provided some names that where not in the inner reader and that cannot possibly be the result of modifyName. In this case unmodifyName must return false.

  • Return: Name as in the inner reader, or false if there is no input such that modifyName would return $name or a file in a directory called $name

Overridden in child classes as:

File_Archive_Reader_ChangeName_AddDirectory::unmodifyName()
Remove baseName from the name
File_Archive_Reader_ChangeName_Directory::unmodifyName()

Parameters:

string   $name   —  Name as shown by this reader

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:48:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.