Property | Type | Description | |
---|---|---|---|
OpenedPath | string | ||
Options | StreamAccessOptions | ||
Wrapper |
Property | Type | Description | |
---|---|---|---|
_context | |||
currentAccess | FileAccess | ||
fgetssState | int | ||
isPersistent | bool | ||
isReadBuffered | bool | ||
readBuffers | Queue |
||
readChunkSize | int | ||
readFilteredCount | int | ||
readFilters | List |
||
readOffset | int | ||
readPosition | int | ||
readTimeout | double | ||
textReadFilter | IFilter | ||
textWriteFilter | IFilter | ||
writeBuffer | byte[] | ||
writeBufferSize | int | ||
writeFilteredCount | int | ||
writeOffset | int | ||
writePosition | int |
Method | Description | |
---|---|---|
AddFilter ( IFilter filter, FilterChainOptions where ) : void |
Adds a filter to one of the read or write filter chains.
|
|
CheckAccess ( string filename, CheckAccessMode mode, CheckAccessOptions options ) : bool |
Performs all checks on a path passed to a PHP function. This method performs a check similar to The filename may be one of the following: |
|
Flush ( ) : bool |
Write all the output buffer to the underlying stream and flush it.
|
|
GetNextDataLength ( ) : int |
Gets the number of bytes or characters in the first read-buffer or next chunk size.
|
|
GetValid ( |
Check that the resource handle contains a valid PhpStream resource and cast the handle to PhpStream.
|
|
GetValid ( |
||
Open ( |
||
Open ( |
||
Open ( |
Openes a PhpStream using the appropriate StreamWrapper.
|
|
PhpStream ( |
PhpStream is created by a StreamWrapper together with the encapsulated RawStream (the actual file opening is handled by the wrapper). This class newly implements the auto-remove behavior too (see StreamAccessOptions.Temporary). |
|
ReadBinaryContents ( int maxLength ) : byte[] | ||
ReadBytes ( int length ) : byte[] |
Reads binary data from the stream. First looks for data into the readBuffers. When length is not satisfied, new data from the underlying stream are processed.
|
|
ReadContents ( ) : |
||
ReadContents ( int maxLength ) : |
||
ReadContents ( int maxLength, int offset ) : |
||
ReadData ( int length, bool ending ) : |
Reads a block of data from the stream up to length characters or up to EOLN if length is negative. ReadData first looks for data into the readBuffers. While length is not satisfied, new data from the underlying stream are processed. The data is buffered as either string or PhpBytes but consistently. The type of the first buffer thus specifies the return type. |
|
ReadLine ( int length, string ending ) : string |
Reads one line (text ending with the ending delimiter) from the stream up to length characters long.
|
|
ReadMaximumBytes ( ) : byte[] |
Effecient access to the buffered and filtered stream consuming one whole buffer at a time.
|
|
ReadMaximumData ( ) : |
Most effecient access to the buffered stream consuming one whole buffer at a time. Performs no unnecessary conversions (although attached stream filters may do so). Use the readChunkSize member to affect the amount of data returned at a time. |
|
ReadMaximumString ( ) : string |
Effecient access to the buffered and filtered stream consuming one whole buffer at a time.
|
|
ReadString ( int length ) : string |
Reads text data from the stream. First looks for data into the readBuffers. When length is not satisfied, new data from the underlying stream are processed.
|
|
ReadStringContents ( int maxLength ) : string | ||
ResolvePath ( |
Merges the path with the current working directory to get a canonicalized absolute pathname representing the same file. This method is an analogy of |
|
Seek ( int offset, SeekOrigin whence ) : bool |
Sets the read/write pointer in the stream to a new position.
|
|
SetParameter ( StreamParameterOptions option, |
||
Stat ( ) : |
||
Tell ( ) : int |
Gets the current position in the stream. |
|
WriteBytes ( byte data ) : int |
Apppends the binary data to the output buffer passing through the output filter-chain. When the buffer is full or buffering is disabled, pass the data to the low-level stream.
|
|
WriteString ( string data ) : int |
Apppends the text data to the output buffer passing through the output filter-chain. When the buffer is full or buffering is disabled, pass the data to the low-level stream.
|
Method | Description | |
---|---|---|
DropReadBuffer ( ) : bool |
Remove the (entirely consumed) read buffer from the head of the read buffer queue.
|
|
FlushWriteBuffer ( ) : bool |
Writes all the output buffer to the underlying stream.
|
|
FreeManaged ( ) : void |
PhpResource.FreeManaged overridden to get rid of the contained context on Dispose.
|
|
FreeUnmanaged ( ) : void |
PhpResource.FreeUnmanaged overridden to remove a temporary file on Dispose.
|
|
RawFlush ( ) : bool | ||
RawLength ( ) : int |
Gets the length of the stream.
|
|
RawRead ( byte buffer, int offset, int count ) : int | ||
RawSeek ( int offset, SeekOrigin whence ) : bool | ||
RawTell ( ) : int | ||
RawWrite ( byte buffer, int offset, int count ) : int | ||
ReadBinaryBuffer ( int length ) : byte[] |
Joins the read buffers to get at least length bytes in a PhpBytes.
|
|
ReadFiltered ( int chunkSize ) : |
Fills the readBuffers with more data from the underlying stream passed through all the stream filters.
|
|
ReadTextBuffer ( int length ) : string |
Joins the read buffers to get at least length characters in a string. It is assumed that there already is length bytes in the buffers. Otherwise an InvalidOperationException is raised. |
|
WriteData ( |
Passes the data through output filter-chain to the output buffer. When the buffer is full or buffering is disabled, passes the data to the low-level stream.
|
Method | Description | |
---|---|---|
CheckIncludePath ( |
Check if the path lays inside of the directory tree specified by the
|
|
EnqueueReadBuffer ( |
Put a buffer at the end of the readBuffers.
|
|
FindEoln ( |
Finds the '\n' in a string or PhpBytes and returns its offset or
|
|
GetSchemeInternal ( string path, string &filename ) : string |
Checks if the given path is a filesystem path or an URL and returns the corresponding scheme.
|
|
Open ( |
Simple version of the stream opening function
|
|
ReadBufferScan ( int &nlpos ) : int | ||
SeekInternal ( int offset, int current, SeekOrigin whence ) : bool |
Perform the actual seek on the stream. Report errors.
|
|
SplitData ( |
Split a String or PhpBytes to "upto" bytes at left and the rest or
|
|
SplitData ( string s, int upto, string &left, string &right ) : void |
Split a string to "upto" bytes at left and the rest or
|
|
TryUnlink ( ) : void |
public AddFilter ( IFilter filter, FilterChainOptions where ) : void | ||
filter | IFilter | The filter. |
where | FilterChainOptions | The position in the chain. |
return | void |
public static CheckAccess ( string filename, CheckAccessMode mode, CheckAccessOptions options ) : bool | ||
filename | string | A resolved path. Must be an absolute path to a local file. |
mode | CheckAccessMode | One of the |
options | CheckAccessOptions | |
return | bool |
public static GetValid ( |
||
handle | A PhpResource passed to the PHP function. | |
return |
public static GetValid ( |
||
handle | ||
desiredAccess | FileAccess | |
return |
public static Open ( |
||
ctx | ||
path | string | |
mode | string | |
return |
public static Open ( |
||
ctx | ||
path | string | |
mode | string | |
options | StreamOpenOptions | |
return |
public static Open ( |
||
ctx | Current runtime context. | |
path | string | URI or filename of the resource to be opened. |
mode | string | A file-access mode as passed to the PHP function. |
options | StreamOpenOptions | A combination of |
context | A valid StreamContext. Must not be |
|
return |
public PhpStream ( |
||
ctx | Runtime context. | |
openingWrapper | The parent instance. | |
accessOptions | StreamAccessOptions | The additional options parsed from the |
openedPath | string | The absolute path to the opened resource. |
context | The stream context passed to fopen(). | |
return | Pchp.Core |
protected abstract RawRead ( byte buffer, int offset, int count ) : int | ||
buffer | byte | |
offset | int | |
count | int | |
return | int |
protected RawSeek ( int offset, SeekOrigin whence ) : bool | ||
offset | int | |
whence | SeekOrigin | |
return | bool |
protected abstract RawWrite ( byte buffer, int offset, int count ) : int | ||
buffer | byte | |
offset | int | |
count | int | |
return | int |
protected ReadBinaryBuffer ( int length ) : byte[] | ||
length | int | The desired maximum result length. |
return | byte[] |
public ReadBinaryContents ( int maxLength ) : byte[] | ||
maxLength | int | |
return | byte[] |
public ReadBytes ( int length ) : byte[] | ||
length | int | The number of bytes to return. |
return | byte[] |
public ReadContents ( int maxLength ) : |
||
maxLength | int | |
return |
public ReadContents ( int maxLength, int offset ) : |
||
maxLength | int | |
offset | int | |
return |
public ReadData ( int length, bool ending ) : |
||
length | int | The number of bytes to return, when set to |
ending | bool | If |
return |
protected ReadFiltered ( int chunkSize ) : |
||
chunkSize | int | Maximum number of bytes to be read from the stream. |
return |
public ReadLine ( int length, string ending ) : string | ||
length | int | Maximum length of the returned |
ending | string | Delimiter of the returned line or null to use the system default. |
return | string |
public ReadString ( int length ) : string | ||
length | int | The number of characters to return. |
return | string |
public ReadStringContents ( int maxLength ) : string | ||
maxLength | int | |
return | string |
protected ReadTextBuffer ( int length ) : string | ||
length | int | The desired maximum result length. |
return | string |
public static ResolvePath ( |
||
ctx | Current runtime context. | |
path | string | An absolute or relative path to a file. |
wrapper | The wrapper found for the specified file or |
|
mode | CheckAccessMode | The checking mode of the |
options | CheckAccessOptions | Additional options for the |
return | bool |
public Seek ( int offset, SeekOrigin whence ) : bool | ||
offset | int | The offset from the position denoted by |
whence | SeekOrigin | One of the |
return | bool |
public SetParameter ( StreamParameterOptions option, |
||
option | StreamParameterOptions | |
value | ||
return | bool |
protected WriteData ( |
||
data | The data to store (filters will handle the type themselves). | |
closing | bool | |
return | int |
public WriteString ( string data ) : int | ||
data | string | The |
return | int |
protected StreamContext,Pchp.Library.Streams _context | ||
return |