\JStream
Joomla! Stream Interface
The Joomla! stream interface is designed to handle files as streams
where as the legacy JFile static class treated files in a rather
atomic manner.
Synopsis
class JStream
extends JObject
{
- // members
- protected $filemode;
- protected $dirmode;
- protected $chunksize;
- protected $filename;
- protected $writeprefix;
- protected $readprefix;
- protected $processingmethod;
- protected $filters;
- protected $fh;
- protected $filesize;
- protected $context;
- protected $contextOptions;
- protected $openmode;
- // Inherited members from JObject
- protected $_errors;
- // methods
- public void __construct()
- public void __destruct()
- public boolean open()
- public boolean close()
- public boolean eof()
- public mixed filesize()
- public mixed gets()
- public mixed read()
- public boolean seek()
- public mixed tell()
- public boolean write()
- public boolean chmod()
- public array get_meta_data()
- public mixed _buildContext()
- public void setContextOptions()
- public void addContextEntry()
- public void deleteContextEntry()
- public mixed applyContextToStream()
- public mixed appendFilter()
- public mixed prependFilter()
- public boolean removeFilter()
- public mixed copy()
- public mixed move()
- public mixed delete()
- public mixed upload()
- public boolean writeFile()
- public string _getFilename()
- public File getFileHandle()
- // Inherited methods from JObject
- public void __construct()
- public string __toString()
- public mixed def()
- public mixed get()
- public array getProperties()
- public string getError()
- public array getErrors()
- public mixed set()
- public boolean setProperties()
- public void setError()
Hierarchy
Extends
Members
protected
- $_errors
—
array
An array of error messages or Exception objects. - $chunksize
—
integer
Default Chunk Size - $context
—
resource
Context to use when opening the connection - $contextOptions
—
array
Context options; used to rebuild the context - $dirmode
—
integer
Directory Mode - $fh
—
array
File Handle - $filemode
—
integer
File Mode - $filename
—
string
Filename - $filesize
—
integer
File size - $filters
—
array
Filters applied to the current stream - $openmode
—
string
The mode under which the file was opened - $processingmethod
—
string
Read Processing method - $readprefix
—
string
Prefix of the connection for reading - $writeprefix
—
string
Prefix of the connection for writing
Methods
public
- __construct() — Constructor
- __destruct() — Destructor
- _buildContext() — Stream contexts Builds the context from the array
- _getFilename() — Determine the appropriate 'filename' of a file
- addContextEntry() — Adds a particular options to the context
- appendFilter() — Stream filters Append a filter to the chain
- applyContextToStream() — Applies the current context to the stream
- chmod() — Chmod wrapper
- close() — Attempt to close a file handle
- copy() — Copy a file from src to dest
- delete() — Delete a file
- deleteContextEntry() — Deletes a particular setting from a context
- eof() — Work out if we're at the end of the file for a stream
- filesize() — Retrieve the file size of the path
- getFileHandle() — Return the internal file handle
- get_meta_data() — Get the stream metadata
- gets() — Get a line from the stream source.
- move() — Moves a file
- open() — Generic File Operations
- prependFilter() — Prepend a filter to the chain
- read() — Read a file
- removeFilter() — Remove a filter, either by resource (handed out from the append or prepend function) or via getting the filter list)
- seek() — Seek the file
- setContextOptions() — Updates the context to the array
- tell() — Returns the current position of the file read/write pointer.
- upload() — Upload a file
- write() — File write
- writeFile() — Writes a chunk of data to a file.
Inherited from JObject
public
- __toString() — Magic method to convert the object to a string gracefully.
- def() — Sets a default value if not alreay assigned
- get() — Returns a property of the object or the default value if the property is not set.
- getError() — Get the most recent error message.
- getErrors() — Return all errors, if any.
- getProperties() — Returns an associative array of object properties.
- set() — Modifies a property of the object, creating it if it does not already exist.
- setError() — Add an error message.
- setProperties() — Set the object properties based on a named array/hash.